Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

How to porting u-boot to my own board?

Altera_Forum
Honored Contributor II
2,103 Views

Hello, everyone 

 

I want to use u-boot on my board. I have two questions. 

 

1. Before I use u-boot on my board, I just try to compile u-boot first. So, I follow the readme file. 

I use  

make PK1C20_config 

make all 

But there have errors. 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

In file included from /usr/include/sys/unistd.h:9, 

                from /usr/include/unistd.h:6, 

                from img2srec.c:61: 

/usr/include/sys/types.h:106: conflicting types for `int8_t&#39; 

/usr/include/stdint.h:38: previous declaration of `int8_t&#39; 

/usr/include/sys/types.h:108: warning: redefinition of `int16_t&#39; 

/usr/include/stdint.h:39: warning: `int16_t&#39; previously declared here 

/usr/include/sys/types.h:110: warning: redefinition of `int32_t&#39; 

/usr/include/stdint.h:40: warning: `int32_t&#39; previously declared here 

/usr/include/sys/types.h:112: warning: redefinition of `int64_t&#39; 

/usr/include/stdint.h:45: warning: `int64_t&#39; previously declared here 

make[1]: *** Error 1 

make[1]: Leaving directory `/cygdrive/d/My_Project/MtxCyclone_uBoot/BootLoader/u-boot-1.1.3/tools 

make: *** [tools] Error 2[/b] 

--- Quote End ---  

 

 

I search the forum and find the answer given by smcnutt. 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

This looks like the sources directly from sourceforge.net ... this tree assumes you 

have an appropriately configured native gcc and shell environment -- which 

doesn&#39;t come with the nios2 toolchain 8-P The easiest thing to do is get the source 

tree from http://www.pysent.com/download (http://www.pysent.com/download) -- this tree has certain "nips & tucks" 

made to build cleanly with the default nios2 toolchain (under cygwin) -- and it&#39;s 

more up-to-date than the sourceforge tree (WRT Nios-II, the sourceforge tree 

has been lagging by several months).[/b] 

--- Quote End ---  

 

 

But I can not access the web link. Can give me the right link or the files? 

 

2. If I want use u-boot on my MtxCyclone Board, how can I do?  

Just what should I do according to the PK1C20.h? 

Can give me more information or detailed steps than readme file? 

 

Thank you very much, 

LiangYi
0 Kudos
36 Replies
Altera_Forum
Honored Contributor II
287 Views

Hi LiangYi, 

 

> Have you ever seen this problem? 

 

No, sorry ... I&#39;m not familiar with that error. 

 

I rarely use the IDE ... if there is a setting so you can see how the flash programmer is 

invoked by the IDE (and parameters) perhaps that will resolve your 

issue. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi Scott, 

 

Sorry for so many questions. Because I have never used u-boot(cygwin or linux) before, so I have many questions. Now, I am being in confused about u-boot. 

 

I want to re-new my mind now in order to make u-boot work on my board. 

> First, I want to ask you the relation between u-boot, flash, sdram and epcs4.  

> Furthermore, where are various kinds of files(uImage, .bin, .sof, .flash, .srec and so on) run or properly 

stored in for u-boot? Is u-boot stored in flash or EPCS? 

> Finally, what procedure should I follow and test step by step in order to achieve u-boot, boot uClinux on 

my board? 

 

Thank you, 

LiangYi
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi LiangYi, 

 

> > First, I want to ask you the relation between u-boot, flash, sdram and epcs4.  

 

u-boot is an application (a boot monitor) that can be stored in flash or an epcs device. 

When the cpu is reset, u-boot is copied to sdram by: itself (if it is stored at the reset address); 

or the epcs controller boot code. 

 

> > Furthermore, where are various kinds of files(uImage, .bin, .sof, .flash, .srec and so on) run 

> or properly stored in for u-boot? 

 

uimage or an "img" file is most commonly used to store a kernel binary (but it can be used 

to store data, ram disk images, scripts, etc.). The kernel image can be compressed. It can be stored 

anywhere you want. In flash, in ram (downloaded by u-boot via serial port, TFTP or NFS), in an epcs 

device (if the device is large enough). An image file is nothing more than a small header prepended 

to your original file. The header contains information about the binary data that follows and includes 

a 32-bit CRC for the data, and a 32-bit CRC for the header itself. 

 

u-boot.bin is simply the u-boot .text, .data, .rodata, etc. u-boot.srec is an S-record file for 

u-boot ... it&#39;s just a convenience for use with EPROM programmers, etc. The flash file is used by 

nios2-flash-programmer (it just happens to in S-record format). 

 

> Is u-boot stored in flash or EPCS? 

 

Either ... that&#39;s up to you. 

 

> > Finally, what procedure should I follow and test step by step in order to achieve u-boot, 

> boot uClinux on my board? 

 

Create an image file for uClinux, load it onto your board, then execute the u-boot "bootm" 

command (this is all in the u-boot README). 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Congratulations to Scott, you are nios god plus 

 

Hi,  

I have received the staff from Scott about U-boot on NiosII. Thank you, Scott. I am going to test it on my custom board, on which there are EP1C6, 16MB flash, 16MB SDRAM, Ethernet. "both of us can share our success."
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi Scott, 

 

 

I retry run u-boot in epcs4 and it successed.  

Reset Address: epcs_controller, base address=0x00400000. 

Exception Address: sdram, 8M, base address=0x01000000. 

Am29DL323GB Flash: 4M, base address:=0x00000000. 

Here is the information in hyper-terminal 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

U-Boot 1.1.3 (Sep 26 2005 - 22:44:56) 

 

CPU   : Nios-II 

SYSID : 8a712a61, Mon Sep 26 12:41:05 2005 

BOARD : Microtronix Cyclone 1C20 Kit 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode 

WARNING: flash_make_cmd: unsuppported LittleEndian mode# # Unknown FLASH on Bank 0 - Size = 0x00000000 = 0 MB 

*** Warning - bad CRC, using default environment 

 

==>[/b] 

--- Quote End ---  

 

So, I have some question to ask you. 

1. WARNING: flash_make_cmd: unsuppported LittleEndian mode 

# # Unknown FLASH on Bank 0 - Size = 0x00000000 = 0 MB 

I do not know what is the reason and how to correct. I use cfi_flash.c you send to me. 

 

2. I do it as you replied to DW. But I still have questions. 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

1. Create the u-boot flash file with elf2flash and these parameters: 

$ elf2flash --epcs --base=0x0 --end=0x7fffffff --flash=U15 --input=u-boot --output=u-boot.flash --boot=boot_loader_epcs.srec[/b] 

--- Quote End ---  

 

Here, --base is epcs base or cfi flash base. If it is cfi flash, why --end=0x7fffffff. 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

2. Download u-boot to the epcs device. 

$ nios2-flash-programmer --epcs --input=u-boot.flash --sof=<path to pgm sof> 

3. Create the configuration flash file. 

$ sof2flash --epcs --input=<path to your system sof> --offset=0x0 --output=config.flash 

4. Download the configuration flash file to the epcs device. 

$ nios2-flash-programmer --epcs --input=config.flash --sof=<path to pgm sof> --relocate[/b] 

--- Quote End ---  

 

Here, what address the u-boot.flash download to? 

I have read nios-flash-programmer-guide. In Booting From EPCS Serial Configuration Devices part, it says The flash programmer first checks the size of the FPGA configuration data, then appends the software content to the end of it in the EPCS device. Is flash-programmer can know to distribute the address space of configuration data and u-boot.flash intelligently? 

--relocate: relocate code following a sof <epcs mode only>. Are all data address in epcs distributed by --relocate parameter, and --relocate is only used in programming fpga config data to epcs? 

 

The data in epcs are in the sequence below, 

.sof ----- 0x0 

boot_loader_srec(or store in on-chip rom), 

u-boot 

When run, u-boot is relocated by boot_loader_srec to run in sdram text_base. 

Right? 

 

Thank you, 

LiangYi
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi LiangYi, 

 

> Am29DL323GB Flash: 4M, base address:=0x00000000. 

 

Is your base address correct? The base address for your flash was 0x0020_0000 in the last 

email you sent. 

 

> *** Warning - bad CRC, using default environment 

 

-#define CFG_ENV_ADDR (CFG_RESET_ADDR + CFG_MONITOR_LEN)  

+#define CFG_ENV_ADDR CFG_FLASH_BASE /* Or whatever you like */  

 

Since the reset address has changed to the epcs controller, the vanilla CFG_ENV_ADDR is not 

valid -- the default configs for the altera boards assume the reset address is in flash ... and 

assume the environment is stored in the sector following the u-boot binary. 

 

> Here, --base is epcs base or cfi flash base. If it is cfi flash, why --end=0x7fffffff. 

 

It&#39;s just a simple way to grab everything from the elf file since the Nios II memory space is 

only 2GB [0000_0000 - 7fff_ffff]. The flash file for an epcs is handled a bit different -- it 

contains a sequence of length-address-data records that must be copied to the appropriate 

address in the Nios II memory space. These records are actually programmed into the 

epcs. For a parallel (CFI) flash device, only the data is programmed into the device (if it falls 

within the device&#39;s address range). 

 

> Is flash-programmer can know to allot the address space to configuration data and 

> u-boot.flash intelligently? 

 

Yes, otherwise you would overwrite your FPGA configuration data. 

 

> The data in epcs are in the sequence, .sof, boot_loader_srec(or store in on-chip rom), u-boot, 

> then u-boot is relocated by boot_loader_srec to run in sdram text_base. 

> Right? 

 

Yes (the onchip rom is part of the sof). You can examine all of this using the u-boot epcs commands: 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

==> help epcs 

epcs 

epcs erase start [end] 

    - erase sector start or sectors start through end. 

epcs info 

    - display EPCS device information. 

epcs protect on | off 

    - turn device protection on or off. 

epcs read addr offset count 

    - read count bytes from offset to addr. 

epcs write addr offset count 

    - write count bytes to offset from addr. 

epcs verify addr offset count 

    - verify count bytes at offset from addr. 

 

==> epcs info 

EPCS4 : 512 kbytes (8 sectors x 64 kbytes, 256 bytes/page)                                                           

status: 0x00 (WIP:0, WEL:0, PROT:off)                                   

config: 0x02d453 (185427) bytes                             

  0: 000000 data @ 0x000010 

  1: 010000 data @ 0x010000 

  2: 020000 data @ 0x020000 

  3: 030000 data @ 0x030000 

  4: 040000 data @ 0x040000 

  5: 050000 erased 

  6: 060000 erased 

  7: 070000 erased 

 

==> epcs read 400 2d453  10 

epcs: read 00000400 <- 02d453 (0x10 bytes) 

==> md.b 400 10 

00000400: c2 2d 80 00 00 00 bf 00 28 10 00 80 2c 00 02 80    .-......(...,...[/b] 

--- Quote End ---  

 

 

If you bit reverse the first two words you get: 0001_b443 00fc_0000 

which is in fact, the length and address of the .text section for my particular board. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi Scott, 

 

When programming epcs device as above, is --relocate parameter only used in the last one nios2-flash-programmer command? Whatever contents which is programmed in epcs last. 

 

LiangYi
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi Scott, 

 

>>> 

I see a text in PK1C20.h. 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

/*------------------------------------------------------------------------ 

* EPCS Device -- wne CFG_NIOS_EPCSBASE is defined code/commands for 

* epcs device access is enabled. The base address is the epcs 

* _register_ base address, NOT THE ADDRESS OF THE MEMORY BLOCK. 

* The register base is currently at offset 0x600 from the memory base. 

*----------------------------------------------------------------------*/# define CFG_NIOS_EPCSBASE 0x02100200 /* EPCS register base */[/b] 

--- Quote End ---  

 

 

I look the epcs controller data sheet, its registers map is 

0x000 

. Boot ROM Memory 

0x0FF 

0x100 Read Data 

0x101 Write Data 

0x102 Status 

0x103 Control 

0x104 Reserved 

0x105 Slave Enable 

0x106 End of Packet 

 

Why the text says <div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

"The register base is currently at offset 0x600 from the memory base."[/b] 

--- Quote End ---  

 

I try to set offset=0x110,# define CFG_NIOS_EPCSBASE 0x00400110(my epcs base=0x00400000). 

When run ==>epcs info, it display 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

==> epcs info 

epcs: device not found. 

==>[/b] 

--- Quote End ---  

 

Why, I have avoided the epcs registers address! I retry offset=0x200, it runs OK. 

 

Another,  

0x000 

. Boot ROM Memory 

0x0FF 

Does here store the boot_loader_epcs.srec? And the boot_loader_epcs.srec runs in FPGA on-chip-rom? 

I do not know it clearly, and altera&#39;s document do not describe this. 

 

>>> 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

> Am29DL323GB Flash: 4M, base address:=0x00000000. 

 

Is your base address correct? The base address for your flash was 0x0020_0000 in the last 

email you sent.[/b] 

--- Quote End ---  

 

Yes, my flash base is 0x0. 

 

>>> 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

> *** Warning - bad CRC, using default environment 

 

-#define CFG_ENV_ADDR (CFG_RESET_ADDR + CFG_MONITOR_LEN)  

+#define CFG_ENV_ADDR CFG_FLASH_BASE /* Or whatever you like */[/b] 

--- Quote End ---  

 

 

I change as you say, but have no effect on u-boot boot-up message. 

 

>>> 

I think the sequence of u-boot running in epcs4 is: 

First, the FPGA is configured with config data in epcs. 

Then, boot_loader_epcs.srec stored in epcs runs in FPGA on-chip rom and copy u-boot to the u-boot TEXT_BASE(elf link address). 

Finally, u-boot runs in TEXT_BASE, initial hardware and generate the environment(heap, global data, stack). 

Right? 

 

Thank you, 

LiangYi
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi LiangYi, 

 

> When programming epcs device as above, is --relocate parameter only used in the last 

> one nios2-flash-programmer command? 

 

The documentation for the --relocate option is vague. The user guide does not even mention it, 

and the --help option only states:<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

The --relocate option is used with EPCS serial configuration devices. If data has already been programmed into the EPCS device, it will be relocated at a higher address to make room for the new data being programmed.[/b] 

--- Quote End ---  

 

However, my observations and some script hacking indicate that only non-configuration data is actually 

relocated. Since the application (u-boot) data is programmed immediately after the configuration data, 

it needs to be relocated when you write new FPGA configuration data (sof) to the the epcs device (to 

account for changes in the size of the sof data). 

 

Basically, I use the --relocate parameter only when programming a new sof to the epcs -- and I have 

never had a problem -- the existing u-boot data in the epcs is always where it needs to be :-) 

 

> Why the text says 

> QUOTE 

> "The register base is currently at offset 0x600 from the memory base." 

 

An "epcs controller" is simply ASMI + on chip memory + boot code. The on chip memory that contains 

the boot code comes first (lower addresses) and the ASMI registers follow. The last I checked, the 

size of the epcs on chip memory is 512 bytes (0x200) ... so the offset of the ASMI registers should 

be 0x200. Perhaps this bug just got lucky with some address bus aliasing ;-) 

 

> I try to set offset=0x110,# define CFG_NIOS_EPCSBASE 0x00400110(my epcs base=0x00400000). 

 

If you&#39;re using Nios II 5.0, don&#39;t do that. An offset of 0x200 should be correct -- try it ;-) 

 

> When run ==>epcs info, it display 

> QUOTE 

> ==> epcs info 

> epcs: device not found. 

 

Correct -- it did not find the device because the offset is not correct. 

 

> I retry offset=0x200, it runs OK. 

 

Yep ... as above. 

 

> I change as you say, but have no effect on u-boot boot-up message. 

 

Until you can successfully write your environment to flash you will get the warning message. 

Also, I tried the cfi_flash.c that I sent you on two different boards (EP1C20 and PCI-5441) and 

it works ok for me. However, both boards use 8-bit devices and do not implement data cache. 

If you have a data cache, I don&#39;t think cfi_flash.c will work -- it&#39;s currently not coded to use 

the ld/st io instructions. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi Scott, 

 

Now I am well-known about u-boot start-up from epcs device. 

<1> FPGA is configured with config data in epcs first. 

<2> Then, boot_loader_epcs.srec stored in epcs runs in FPGA on-chip rom and copy u-boot to the u-boot 

TEXT_BASE(elf link address). 

<3> Finally, u-boot runs in TEXT_BASE(here is in sdram 0x017C_0000, the last 256KB. My sdram is 8M, base=0x0100_0000), generate the environment(heap, global data, stack) and initial hardware for use. 

 

Right? 

 

My timer, epcs, led, uart and sysid are initialized ok, now. 

Next, I &#39;ll try to make my flash work. 

 

LiangYi
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi Scott, 

 

I search the files related with flash in u-boot directory and find some 

 

> ..\u-boot\common\cmd_flash.c 

> ..\u-boot\common\env_dataflash.c 

> ..\u-boot\common\env_flash.c 

> ..\u-boot\common\flash.c 

 

> ..\u-boot\drivers\cfi_flash.c 

 

> ..\u-boot\include\flash.h 

> ..\u-boot\include\dataflash.h 

 

> ..\u-boot\board\altera\common\flash.c 

> ..\u-boot\board\altera\dk1c20\flash.c 

> ..\u-boot\board\altera\common\AMDLV065D.c 

> ..\u-boot\board\psyent\common\AMDLV065D.c 

 

> .. and the cfi_flash.c you send to me 

 

I have found that all *.c files are based on flash.h, what the relationship between these files? 

 

I know the function below, they are flash driver for u-boot. 

> ..\u-boot\board\altera\common\flash.c 

> ..\u-boot\board\altera\dk1c20\flash.c 

> ..\u-boot\board\altera\common\AMDLV065D.c 

> ..\u-boot\board\psyent\common\AMDLV065D.c 

But, the files below play what function. Do they have relation with u-boot flash driver? 

> ..\u-boot\common\cmd_flash.c 

> ..\u-boot\common\env_dataflash.c 

> ..\u-boot\common\env_flash.c 

> ..\u-boot\common\flash.c 

> ..\u-boot\drivers\cfi_flash.c 

 

Thanks, 

LiangYi
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi LiangYi, 

 

> But, the files below play what function. Do they have relation with u-boot flash driver? 

 

> ..\u-boot\common\cmd_flash.c 

This implements all of the flash commands (e.g.: erase, protect, etc.) 

 

> ..\u-boot\common\env_dataflash.c 

Used for storing non-volatile environment. 

 

> ..\u-boot\common\env_flash.c 

Used for storing non-volatile environment. 

 

> ..\u-boot\common\flash.c 

Implements some higher-level flash routines. 

 

> ..\u-boot\drivers\cfi_flash.c 

Low-level CFI flash driver implementation. This can be used rather than implementing your own flash 

driver in your board-specific source tree. Many boards have their own "flash.c" file that is customized 

for the specific flash device on the board. 

 

But don&#39;t take my word ... the best way to understand how things work is to read through the code 

yourself ;-) Start with the following: 

common/cmd_flash.c -- start with do_flerase(). 

common/cmd_mem.c -- start with do_mem_cp(). 

 

It should all become clear. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi Scott, 

 

> Until you can successfully write your environment to flash you will get the warning message. 

Also, I tried the cfi_flash.c that I sent you on two different boards (EP1C20 and PCI-5441) and 

it works ok for me. However, both boards use 8-bit devices and do not implement data cache. 

If you have a data cache, I don&#39;t think cfi_flash.c will work -- it&#39;s currently not coded to use 

the ld/st io instructions. 

 

Thank for your remind. I use nios/f core before, so when I change to nios/s core. My flash seems to work. 

 

I download uImage(kernel) to my flash(offset=0x0) and run 

==>bootm 0, my kernel is booted. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

==> bootm 0 

# # Booting image at 00000000 ... 

?nbsp; Image Name:?nbsp; Mtx uClinux 1.4 

?nbsp; Image Type:?nbsp; Nios-II Linux Kernel Image (gzip compressed) 

?nbsp; Data Size:??753694 Bytes = 736 kB 

?nbsp; Load Address: 01000000 

?nbsp; Entry Point:?01000000 

?nbsp; Verifying Checksum ... OK 

?nbsp; Uncompressing Kernel Image ... OK 

Linux version 2.6.11-uc0 (LiangYi@liangyi) (gcc version 3.4.1 (Altera Nios II 5.0 b73))# 1 Fri Sep 30 00:36:27 2005 

 

 

uClinux/Nios II 

Altera Nios II support ?2004 Microtronix Datacom Ltd. 

 

setup_arch: No persistant network settings signature at 003F0000 

Built 1 zonelists 

Kernel command line: root=/dev/mtdblock0 ro 

PID hash table entries: 64 (order: 6, 1024 bytes) 

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) 

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) 

Memory available: 6352k/8192k RAM, 0k/0k ROM (1426k kernel code, 295k data) 

Mount-cache hash table entries: 512 (order: 0, 4096 bytes) 

NET: Registered protocol family 16 

NIOS serial driver version 0.0 

ttyS0 (irq = 2) is a builtin NIOS UART 

Serial: JTAG UART driver $Revision: 1.4 $ 

ttyJ0 at MMIO 0x80800800 (irq = 1) is a jtag_uart 

io scheduler noop registered 

io scheduler anticipatory registered 

io scheduler deadline registered 

io scheduler cfq registered 

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize 

eth0: Open Ethernet Core Version 1.0 

?oeth_probe: 65536 Khz Nios: 16 RX, 16 TX buffs 

???????NO Custom HW ALIGN. 

???????CONFIG_NIOS2_HW_MULX??defined. 

???????CONFIG_NIOS2_HW_MUL_OFF NOT defined. 

Microtronix map: Found 1 x16 devices at 0x0 in 16-bit bank 

Amd/Fujitsu Extended Query Table at 0x0040 

number of CFI chips: 1 

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 

cmdlinepart partition parsing not available 

RedBoot partition parsing not available 

Using Microtronix development partition definition 

Creating 2 MTD partitions on "Microtronix map": 

0x00200000-0x00800000 : "romfs" 

mtd: partition "romfs" extends beyond the end of device "Microtronix map" -- size truncated to 0x200000 

0x00000000-0x00200000 : "loader/kernel" 

NET: Registered protocol family 2 

IP: routing cache hash table of 512 buckets, 4Kbytes 

TCP established hash table entries: 512 (order: 0, 4096 bytes) 

TCP bind hash table entries: 512 (order: -1, 2048 bytes) 

TCP: Hash tables configured (established 512 bind 512) 

NET: Registered protocol family 1 

NET: Registered protocol family 17 

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,0)[/b] 

--- Quote End ---  

 

I can not load filesystem. I first build filesystem project in Nios IDE, then I gzip the romfs.bin > romfs.bin.gz. 

I download romfs.bin.gz to flash at offset=0x200000.  

Right? How you do it? 

I have run Mtx uClinux ok in my board under Nios IDE(Directly upload .bin to board). 

 

Misfortune, the board I use is borrowed from other people. I have to return it today. 

 

Thank you all the same. 

LiangYi
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

Hi LiangYi, 

 

>so when I change to nios/s core. My flash seems to work. 

 

Good -- from a u-boot point-of-view, we&#39;re done ;-) 

 

> I can not load filesystem. 

 

Ok ... but this is not a u-boot issue. You should probably start a new topic so people who are not interested in u-boot will contribute. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

To LiangYi, 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

Creating 2 MTD partitions on "Microtronix map": 

0x00200000-0x00800000 : "romfs" 

mtd: partition "romfs" extends beyond the end of device "Microtronix map" -- size truncated to 0x200000 

0x00000000-0x00200000 : "loader/kernel"[/b] 

--- Quote End ---  

 

 

Your mtd partition definition has a little error. 

 

Seconed, Could you not zip "romfs.bin" first, just upload to flash with original "romfs.bin"? 

 

However, I&#39;d like to know/discuss how to implement the zipped "romfs.bin" to reduce flash capicity.
0 Kudos
Altera_Forum
Honored Contributor II
287 Views

> I&#39;d like to know/discuss how to implement the zipped "romfs.bin" to reduce flash 

> capicity. 

 

As long as you&#39;re using an read-only file system, you might want to consider 

cramfs ... it works quite well ... and it is supported by u-boot. But please see: 

 

http://www.niosforum.com/forum/index.php?s...=2383&hl=cramfs (http://www.niosforum.com/forum/index.php?showtopic=2383&hl=cramfs

 

Regards, 

--Scott
0 Kudos
Reply