[U-Boot-Users] ramdisk problem (once again?)

Hi
I am experiencing problems using a ramdisk with Das u-boot, and although I have been reading the previous questions and answers in the mailing list I cannot solve the question.
The problem: I can start a Linux kernel and its filesystem from flash (linux image made using mkimage, and filesystem in cramfs format). However, if I try to boot them from flash (this time both images have been constructed using mkimage), the kernel starts, but a "No filesystem could mount root, tried: cramfs romfs" appears.
Upload of kernel: tftp 0x260000 linux.uboot Upload of fs: tftp 0x3a0000 root.uboot
Environment: => printenv bootcmd=run bootflash bootdelay=3 baudrate=115200 eth1addr=00:02:b3:02:02:02 kernel_addr=50060000 ramdisk_addr=501A0000 bootflash=bootm $(kernel_addr) stdin=serial stdout=serial stderr=serial ethact=i82559#0 ethaddr=00:11:22:33:44:55 tftpdstp=10069 bootargs=console=ttyS0,115200 root=/dev/ram0 rw irqpoll mtdparts=physmap-flash.0:256k(boot),128k(conf),1280k(linux),-(root) mem=128MB filesize=f4040 fileaddr=3A0000 netmask=255.255.0.0 ipaddr=128.127.165.133 serverip=128.127.50.94
As you can see, I do not use initrd param because I suppose it is directly passed to the kernel.
Whole log: ### Configuring the network setenv ethaddr 00:11:22:33:44:55 => setenv ipaddr 128.127.165.133 => setenv serverip 128.127.50.94 => setenv netmask 255.255.0.0 => setenv tftpdstp 10069 => setenv bootargs console=ttyS0,115200 root=/dev/ram0 rw irqpoll mtdparts=physmap-flash.0:256k(boot),128k(conf),1280k(linux),-(root) mem=128MB => ### Uploading kernel tftp 0x260000 linux.uboot Using i82559#0 device TFTP from server 128.127.50.94; our IP address is 128.127.165.133 Filename 'linux.uboot'. Transferred 0 KB of 1111 KB (0 %)60000 Transferred 185 KB of 1111 KB (16 %)############################# #################################################################
#################################################################ERROR: Timeout waiting for ack (errno: 11 n: -1) ERROR: Ack(s) lost. Resending: 1950 ERROR: Ack(s) lost. Resending complete.
Transferred 1111 KB of 1111 KB (100 %)############# # done Bytes transferred = 1138480 (115f30 hex) => ### Uploading file system tftp 0x3a0000 root.uboot Using i82559#0 device TFTP from server 128.127.50.94; our IP address is 128.127.165.133 Filename 'root.uboot'. Load address: 0x3a0000 Loading: ################################################################# Transferred 465 KB of 976 KB (47 %)###################################### Transferred 976 KB of 976 KB (100 %)######################################
# done Bytes transferred = 999488 (f4040 hex) => ### Boot from ram bootm 0x260000 0x3a0000 ## Booting image at 00260000 ... Image Name: linux-2.6.22.15 Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 1138416 Bytes = 1.1 MB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK ## Loading Ramdisk Image at 003a0000 ... Image Name: root Image Type: ARM Linux RAMDisk Image (uncompressed) Data Size: 999424 Bytes = 976 kB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK
Starting kernel ...
Linux version 2.6.22.15-uSysCom (mac@mac2) (gcc version 4.1.2) #10 PREEMPT Mon Feb 11 20:15:32 CET 2008 CPU: XScale-IXP46x Family [69054202] revision 2 (ARMv5TE), cr=000039ff Machine: Intel IXDP465 Development Platform Memory policy: ECC disabled, Data cache writeback CPU0: D VIVT undefined 5 cache CPU0: I cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets CPU0: D cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets Built 1 zonelists. Total pages: 32512 Kernel command line: console=ttyS0,115200 root=/dev/ram0 rw irqpoll mtdparts=physmap-flash.0:256k(boot),128k(conf),1280k(linux),-(root) mem=128MB Misrouted IRQ fixup and polling support enabled This may significantly impact system performance PID hash table entries: 512 (order: 9, 2048 bytes) Console: colour dummy device 80x30 Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 128MB = 128MB total Memory: 127232KB available (2204K code, 226K data, 104K init) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok NET: Registered protocol family 16 IXP4xx: Using 32MiB expansion bus window size usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb Time: OSTS clocksource has been installed. Switched to high resolution mode on CPU 0 NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 4096 (order: 3, 32768 bytes) TCP bind hash table entries: 4096 (order: 2, 16384 bytes) TCP: Hash tables configured (established 4096 bind 4096) TCP reno registered NetWinder Floating Point Emulator V0.97 (double precision) io scheduler noop registered io scheduler deadline registered (default) Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0xc8000000 (irq = 15) is a XScale serial8250.0: ttyS1 at MMIO 0xc8001000 (irq = 13) is a XScale RAMDISK driver initialized: 4 RAM disks of 8192K size 1024 blocksize loop: module loaded tun: Universal TUN/TAP device driver, 1.6 tun: (C) 1999-2004 Max Krasnyansky maxk@qualcomm.com physmap platform flash device: 02000000 at 50000000 physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank Intel/Sharp Extended Query Table at 0x0031 Using buffer write method cfi_cmdset_0001: Erase suspend on write enabled 4 cmdlinepart partitions found on MTD device physmap-flash.0 Creating 4 MTD partitions on "physmap-flash.0": 0x00000000-0x00040000 : "boot" 0x00040000-0x00060000 : "conf" 0x00060000-0x001a0000 : "linux" 0x001a0000-0x02000000 : "root" i2c /dev entries driver Driver for 1-wire Dallas network protocol. device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com nf_conntrack version 0.5.0 (1024 buckets, 8192 max) IPv4 over IPv4 tunneling driver GRE over IPv4 tunneling driver ip_tables: (C) 2000-2006 Netfilter Core Team TCP cubic registered Initializing XFRM netlink socket NET: Registered protocol family 1 NET: Registered protocol family 17 NET: Registered protocol family 15 Bridge firewalling registered NET: Registered protocol family 33 802.1Q VLAN Support v1.8 Ben Greear greearb@candelatech.com All bugs added by David S. Miller davem@redhat.com SCTP: Hash tables configured (established 4096 bind 8192) XScale DSP coprocessor detected. List of all partitions: 1f00 256 mtdblock0 (driver?) 1f01 128 mtdblock1 (driver?) 1f02 1280 mtdblock2 (driver?) 1f03 31104 mtdblock3 (driver?) No filesystem could mount root, tried: cramfs romfs Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
I am not quite sure about the -a and -e parameters for the mkimage (I have tried different ones for the ramdisk... the kernel seems to be correct with 0x8000).
The RAM of my system begins on 0x0 and then is moved into 0x200000.
Any clues?
Thanks
Miguel Ángel This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored.
Internet communications cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Therefore, we do not accept responsibility for any errors or omissions that are present in this message, or any attachment, that have arisen as a result of e-mail transmission. If verification is required, please request a hard-copy version. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

In message 47B15940.8030901@gmail.com you wrote:
The problem: I can start a Linux kernel and its filesystem from flash (linux image made using mkimage, and filesystem in cramfs format). However, if I try to boot them from flash (this time both images have been constructed using mkimage), the kernel starts, but a "No filesystem could mount root, tried: cramfs romfs" appears.
...
As you can see, I do not use initrd param because I suppose it is directly passed to the kernel.
The kernel.org tree does not recognize a ramdisk image in flash. Patches have been posted here since 2.4.17 times, but never made it upstream. See the archives ...
Best regards,
Wolfgang Denk

Wolfgang Denk wrote: Hi,
In message 47B15940.8030901@gmail.com you wrote:
The problem: I can start a Linux kernel and its filesystem from flash (linux image made using mkimage, and filesystem in cramfs format). However, if I try to boot them from flash (this time both images have been constructed using mkimage), the kernel starts, but a "No filesystem could mount root, tried: cramfs romfs" appears.
...
As you can see, I do not use initrd param because I suppose it is directly passed to the kernel.
The kernel.org tree does not recognize a ramdisk image in flash. Patches have been posted here since 2.4.17 times, but never made it upstream. See the archives ...
If you want to use it, put in ram before... Regards Michael

In message 47B2202A.7000807@gandalf.sssup.it you wrote:
The kernel.org tree does not recognize a ramdisk image in flash. Patches have been posted here since 2.4.17 times, but never made it upstream. See the archives ...
If you want to use it, put in ram before... Regards Michael
yesm that's the status quo - but it's plain stupid. Why add another memory copy of megabytes of data, when the kernel will just read the data, uncompres it and write it to some (other) RAM location? The flash is mapped anyway (normally), so it just has to check if it's a RAM or flash address to decide if it should free that area or not. That's a tiny patch, actually.
It's on the same line with the ARM kernel always bringing with it it's own decompressor code - why do we have to copy this with each and every image when we already have a working copy of that code in U-Boot?
Well, let the PTB for ARM answer this...
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
In message 47B2202A.7000807@gandalf.sssup.it you wrote:
The kernel.org tree does not recognize a ramdisk image in flash. Patches have been posted here since 2.4.17 times, but never made it upstream. See the archives ...
If you want to use it, put in ram before... Regards Michael
yesm that's the status quo - but it's plain stupid. Why add another
I just answer to the question.
memory copy of megabytes of data, when the kernel will just read the data, uncompres it and write it to some (other) RAM location? The flash is mapped anyway (normally), so it just has to check if it's a RAM or flash address to decide if it should free that area or not. That's a tiny patch, actually.
Regards Michael

Oooopps!
I mismatch my question... I said "if i try to boot from flash" when I wanted to say "if I try to boot from ram".
So... The question is: I cannot boot my ramdisk from ram (kernel is also in ram)... The rest of the mail was correct.
Thanks for your answers.
Miguel Ángel
Wolfgang Denk escribió:
In message 47B15940.8030901@gmail.com you wrote:
The problem: I can start a Linux kernel and its filesystem from flash (linux image made using mkimage, and filesystem in cramfs format). However, if I try to boot them from flash (this time both images have been constructed using mkimage), the kernel starts, but a "No filesystem could mount root, tried: cramfs romfs" appears.
...
As you can see, I do not use initrd param because I suppose it is directly passed to the kernel.
The kernel.org tree does not recognize a ramdisk image in flash. Patches have been posted here since 2.4.17 times, but never made it upstream. See the archives ...
Best regards,
Wolfgang Denk
This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored.
Internet communications cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Therefore, we do not accept responsibility for any errors or omissions that are present in this message, or any attachment, that have arisen as a result of e-mail transmission. If verification is required, please request a hard-copy version. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

Upload of kernel: tftp 0x260000 linux.uboot Upload of fs: tftp 0x3a0000 root.uboot
Environment: => printenv bootcmd=run bootflash bootdelay=3 baudrate=115200 eth1addr=00:02:b3:02:02:02 kernel_addr=50060000 ramdisk_addr=501A0000 bootflash=bootm $(kernel_addr) stdin=serial stdout=serial stderr=serial ethact=i82559#0 ethaddr=00:11:22:33:44:55 tftpdstp=10069 bootargs=console=ttyS0,115200 root=/dev/ram0 rw irqpoll mtdparts=physmap-flash.0:256k(boot),128k(conf),1280k(linux),-(root) mem=128MB filesize=f4040 fileaddr=3A0000 netmask=255.255.0.0 ipaddr=128.127.165.133 serverip=128.127.50.94
Hi Miguel Angel,
In your case everything seems to be correct.....
but bootflash=bootm $(kernel_addr) should be bootflash=bootm 0x260000 0x3a0000 i.e.,bootflash=bootm $(kernel_addr) $(rams) for ramdisk booting. u can test with bootargs=/dev/ram itself.
Let me know output of it....
best regards, Nethra

Hi.
I solved it.
First of all I would like to thank Nethra. The solution was not the one in his mail (the bootflash parameter is the one I use when loading from flash which worked...), but an answer is always welcome.
The question was that in my config file, I have defined CONFIG_CMDLINE_TAG, but not CONFIG_INITRD_TAG which was required to make it work properly.
Thanks to you all
Miguel Ángel
P.S. If anyone needs more detailed info, please tell me.
Nethra escribió:
Upload of kernel: tftp 0x260000 linux.uboot Upload of fs: tftp 0x3a0000 root.uboot
Environment: => printenv bootcmd=run bootflash bootdelay=3 baudrate=115200 eth1addr=00:02:b3:02:02:02 kernel_addr=50060000 ramdisk_addr=501A0000 bootflash=bootm $(kernel_addr) stdin=serial stdout=serial stderr=serial ethact=i82559#0 ethaddr=00:11:22:33:44:55 tftpdstp=10069 bootargs=console=ttyS0,115200 root=/dev/ram0 rw irqpoll mtdparts=physmap-flash.0:256k(boot),128k(conf),1280k(linux),-(root) mem=128MB filesize=f4040 fileaddr=3A0000 netmask=255.255.0.0 ipaddr=128.127.165.133 serverip=128.127.50.94
Hi Miguel Angel,
In your case everything seems to be correct.....
but bootflash=bootm $(kernel_addr) should be bootflash=bootm 0x260000 0x3a0000 i.e.,bootflash=bootm $(kernel_addr) $(rams) for ramdisk booting. u can test with bootargs=/dev/ram itself.
Let me know output of it....
best regards, Nethra
This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored.
Internet communications cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Therefore, we do not accept responsibility for any errors or omissions that are present in this message, or any attachment, that have arisen as a result of e-mail transmission. If verification is required, please request a hard-copy version. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

Hi, I'm using the taishan board. and have adding some test cmd on top of it and here's what i see when i compile.
make distclean && make clean && make taishan_config && make
UNDEF_SYM=`/opt/montavista/pro/devkit/ppc/440/bin/ppc_440-objdump -x lib_generic/libgeneric.a board/amcc/taishan/libtaishan.a cpu/ppc4xx/libppc4xx.a lib_ppc/libppc.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a |sed -n -e 's/.*(__u_boot_cmd_.*)/-u\1/p'|sort|uniq`;\ cd /export/home/kxb/perforce/taishan-bootldr/common/devel/micro/ppc440/bootloader/u-boot-1.2.0/main/devel/src && /opt/montavista/pro/devkit/ppc/440/bin/ppc_440-ld -Bstatic -T /export/home/kxb/perforce/taishan-bootldr/common/devel/micro/ppc440/bootloader/u-boot-1.2.0/main/devel/src/board/amcc/taishan/u-boot.lds -Ttext 0xFFFC0000 -n $UNDEF_SYM cpu/ppc4xx/start.o cpu/ppc4xx/resetvec.o \ --start-group lib_generic/libgeneric.a board/amcc/taishan/libtaishan.a cpu/ppc4xx/libppc4xx.a lib_ppc/libppc.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a --end-group -L /opt/montavista/pro/devkit/ppc/440/bin/../lib/gcc-lib/powerpc-hardhat-linux/3.3.1 -lgcc \ -Map u-boot.map -o u-boot /opt/montavista/pro/devkit/ppc/440/bin/ppc_440-ld: u-boot: Not enough room for program headers (allocated 2, need 3) /opt/montavista/pro/devkit/ppc/440/bin/ppc_440-ld: final link failed: Bad value
I'm using uboot 1.2.0. And looked around to see what this error meant looks like it has to somethign with SIZEOF_HEADERS in the u-boot.lds. I'm out of ideas here so any inputs would help.
thanks
Kunal
_________________________________________________________________ Shed those extra pounds with MSN and The Biggest Loser! http://biggestloser.msn.com/

In message BLU137-W41517BC1A3DE3F1971469A8E1C0@phx.gbl you wrote:
I'm using the taishan board. and have adding some test cmd on top of it and here's what i see when i compile.
...
I'm using uboot 1.2.0. And looked around to see what this error meant looks like it has to somethign with SIZEOF_HEADERS in the u-boot.lds.
As a first step you should update your code and use 1.3.2-rc1.
Best regards,
Wolfgang Denk
participants (5)
-
k b
-
michael
-
Miguel Angel Alvarez
-
Nethra
-
Wolfgang Denk