[U-Boot] u-boot didn't mount ramdisk ...

Hi All,
I am using u-boot 1.2.0 and tried to boot kernel with one ramdisk, but it seems the u-boot doesn't load my ramdisk image at all. Please view the below log message for detailed informations.
=> tftpboot a0800000 uRamdisk => iminfo a0800000 ## Checking Image at a0800000 ... Image Name: Test Ramdisk Image Created: 2008-12-17 11:43:47 UTC Image Type: MIPS Linux RAMDisk Image (gzip compressed) Data Size: 3824687 Bytes = 3.6 MB Load Address: 82010000 Entry Point: 82010000 Verifying Checksum ... OK => bootm bfc60000 a0800000 ## Booting image at bfc60000 ... Image Name: MIPS OpenWrt Linux-2.6.21.7 Created: 2008-12-16 19:55:08 UTC Image Type: MIPS Linux Kernel Image (gzip compressed) Data Size: 1172251 Bytes = 1.1 MB Load Address: 80010000 Entry Point: 80262000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK ## Loading Ramdisk Image at a0800000 ... Image Name: Test Ramdisk Image Created: 2008-12-17 11:21:06 UTC Image Type: MIPS Linux RAMDisk Image (gzip compressed) Data Size: 3824687 Bytes = 3.6 MB Load Address: 82010000 Entry Point: 82010000 Verifying Checksum ... OK /* COMMENT ADDED BY MIKE, boot loader hasn't loaded RAMDISK since no "Loading Ramdisk to..." output...... */
Starting kernel ...
LINUX started... ... No filesystem could mount root, tried: cramfs squashfs romfs Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
Are there any special requirement of the ramdisk format for u-boot? I used mips mkimage command as below and both of the ramdisk.gz in ext2 or cramfs format are all failed. mkimage -O linux -A mips -T ramdisk -C gzip -n 'Test Ramdisk Image' -d ramdisk.gz uRamdisk
Could somebody give me any suggestions?
Thanks, Mike

Dear "mike xu",
In message 7103aeea0812170706p3e1fa7cby7093a87d4d01eb6f@mail.gmail.com you wrote:
I am using u-boot 1.2.0 and tried to boot kernel with one ramdisk, but it seems the u-boot doesn't load my ramdisk image at all. Please view
This is correct. U-Boot does not load the RAMdisk image - why should it? If the image is stored in NOR flash memory, the kernel can read it there as well, so copying it to RAM before starting Linux would be just a waste of boot time.
U-Boot just passes tha ramdisk address to the Linux kernel - assuming your ports of U-Boot and Linux for your MIPS board support this correctly.
Are there any special requirement of the ramdisk format for u-boot? I used mips mkimage command as below and both of the ramdisk.gz in ext2 or cramfs format are all failed. mkimage -O linux -A mips -T ramdisk -C gzip -n 'Test Ramdisk Image' -d ramdisk.gz uRamdisk
This is OK. Maybe you are using a kernel version that cannot use a ramdisk image from flash (i. e. it finds it only in RAM, like the vanilla ARM kernel does, too).
Patche sto fix that (for ARM) have been posted several timers before, search the archives if needed.
Best regards,
Wolfgang Denk

Hi Wolfgang,
Thank you for your quick response. Actually I need to get one image which composed by the kernel ramdisk image. I'd like to use the ramdisk as root file system. The combined imageg is made by `mkimage -T multi...` command... And I found that the image can not startup successfully (kernel is ok but cannot mount the rootfs). Then I tried to bootup the kernel and ramdisk separately as I describe in the previous email.
Do you have any suggestion on how to bootup a multiple type image via u-boot?
Best regards & Thanks again, Mike
On Wed, Dec 17, 2008 at 11:35 PM, Wolfgang Denk wd@denx.de wrote:
Dear "mike xu",
In message 7103aeea0812170706p3e1fa7cby7093a87d4d01eb6f@mail.gmail.com you wrote:
I am using u-boot 1.2.0 and tried to boot kernel with one ramdisk, but it seems the u-boot doesn't load my ramdisk image at all. Please view
This is correct. U-Boot does not load the RAMdisk image - why should it? If the image is stored in NOR flash memory, the kernel can read it there as well, so copying it to RAM before starting Linux would be just a waste of boot time.
U-Boot just passes tha ramdisk address to the Linux kernel - assuming your ports of U-Boot and Linux for your MIPS board support this correctly.
Are there any special requirement of the ramdisk format for u-boot? I used mips mkimage command as below and both of the ramdisk.gz in ext2 or cramfs format are all failed. mkimage -O linux -A mips -T ramdisk -C gzip -n 'Test Ramdisk Image' -d ramdisk.gz uRamdisk
This is OK. Maybe you are using a kernel version that cannot use a ramdisk image from flash (i. e. it finds it only in RAM, like the vanilla ARM kernel does, too).
Patche sto fix that (for ARM) have been posted several timers before, search the archives if needed.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "Data is a lot like humans: It is born. Matures. Gets married to other data, divorced. Gets old. One thing that it doesn't do is die. It has to be killed." - Arthur Miller

Hi Wolfgang,
You are correct, U-Boot does not load the RAMdisk image since the image is already stored in NOR flash memory. Sorry for my carelessness... Below is the kernel start log, Could you please take a look into it and give my any suggestions? I have the below kernel options enabled, and tried ramdisk in ext2 or cramfs format, CONFIG_RAMFS=y CONFIG_CRAMFS=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_INITRD=y CONFIG_EXT2_FS=y
=> setenv bootargs console=ttyS0,115200 root=/dev/ram0 ro mem=100M => bootm a0800000 a0a00000 ## Booting image at a0800000 ... Image Name: MIPS OpenWrt Linux-2.6.21.7 Created: 2008-12-18 12:32:02 UTC Image Type: MIPS Linux Kernel Image (gzip compressed) Data Size: 1191161 Bytes = 1.1 MB Load Address: 80010000 Entry Point: 8026c000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK ## Loading Ramdisk Image at a0a00000 ... Image Name: Test Ramdisk Image Created: 2008-12-18 16:14:42 UTC Image Type: MIPS Linux RAMDisk Image (gzip compressed) Data Size: 4335780 Bytes = 4.1 MB Load Address: 82010000 Entry Point: 82010000 Verifying Checksum ... OK Starting kernel ...
LINUX started... bl234x_cpu_clock_rate: CPU Clock 383 MHZ OCP 2 perclock 4 bl234x_cpu_clock_rate: CPU Clock 383 MHZ bus clock 47 MHz Get board type: BL2348 evaluation board (Jasmine) CPU clock 383MHz SYSTEM clock 47MHz Linux version 2.6.21.719-g3c500d65-dirty (mikexu@localhost.localdomain) (gcc version 4.1.2) #29 Thu Dec 18 20:31:13 CST 2008 CPU revision is: 0001937cK=|hE ~PugBj(~| |xR~!Linux version 2.6.21.719-g3c500d65-dirty (mikexu@localhost.localdomain) (gcc version 4.1.2) #29 Thu Dec 18 20:31:13 CST 2008 CPU revision is: 0001937c BL2348 Evaluation board (Jasmine) setup Determined physical RAM map: memory: 08000000 @ 00000000 (usable) User-defined physical RAM map: memory: 06400000 @ 00000000 (usable) Initrd not found or empty - disabling initrd Built 1 zonelists. Total pages: 25400 Kernel command line: console=ttyS0,115200 root=/dev/ram0 ro mem=100M Primary instruction cache 16kB, physically tagged, 4-way, linesize 32 bytes. Primary data cache 16kB, 4-way, linesize 32 bytes. Synthesized TLB refill handler (20 instructions). Synthesized TLB load handler fastpath (32 instructions). Synthesized TLB store handler fastpath (32 instructions). Synthesized TLB modify handler fastpath (31 instructions). Cache parity protection disabled PID hash table entries: 512 (order: 9, 2048 bytes) Using 191.667 MHz high precision timer. Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 98516k/102400k available (1897k kernel code, 3740k reserved, 514k data, 152k init, 0k highmem) Mount-cache hash table entries: 512 NET: Registered protocol family 16
BLPCI driver initialized : vendor_id=0x5555 device_id=0x1556 version=0x380 type=0x2 revision_id=0x0 class_id=0x400000 registering PCI controller with io_map_base unset Generic PHY: Registered new driver Time: MIPS clocksource has been installed. 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 squashfs: version 3.0 (2006/03/15) Phillip Lougher Registering mini_fo version $Id$ JFFS2 version 2.2. (C) 2001-2006 Red Hat, Inc. io scheduler noop registered (default) Generic RTC Driver v1.07 Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled ttyS0: autoconf (0x0000, 0xaff01000): )J=#eAu2** U$x.Y.ZX6250: ttyS0 at MMIO 0xaff01000 (irq = 116) is a 16550A RAMDISK driver initialized: 16 RAM disks of 12000K size 4096 blocksize loop: loaded (max 8 devices) BL2348 load microcode ver. 6 Runner driver ver. 9 Created eth0 PHY 2 on MAC 0 : link state = 1Gb Full physmap platform flash device: 01000000 at bf000000 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 edBoot partition parsing not available IPv4 over IPv4 tunneling driver TCP cubic registered NET: Registered protocol family 1 NET: Registered protocol family 17 No filesystem could mount root, tried: ext2 cramfs squashfs romfs Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
Thanks & best regards, Mike
On Wed, Dec 17, 2008 at 11:35 PM, Wolfgang Denk wd@denx.de wrote:
Dear "mike xu",
In message 7103aeea0812170706p3e1fa7cby7093a87d4d01eb6f@mail.gmail.com you wrote:
I am using u-boot 1.2.0 and tried to boot kernel with one ramdisk, but it seems the u-boot doesn't load my ramdisk image at all. Please view
This is correct. U-Boot does not load the RAMdisk image - why should it? If the image is stored in NOR flash memory, the kernel can read it there as well, so copying it to RAM before starting Linux would be just a waste of boot time.
U-Boot just passes tha ramdisk address to the Linux kernel - assuming your ports of U-Boot and Linux for your MIPS board support this correctly.
Are there any special requirement of the ramdisk format for u-boot? I used mips mkimage command as below and both of the ramdisk.gz in ext2 or cramfs format are all failed. mkimage -O linux -A mips -T ramdisk -C gzip -n 'Test Ramdisk Image' -d ramdisk.gz uRamdisk
This is OK. Maybe you are using a kernel version that cannot use a ramdisk image from flash (i. e. it finds it only in RAM, like the vanilla ARM kernel does, too).
Patche sto fix that (for ARM) have been posted several timers before, search the archives if needed.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "Data is a lot like humans: It is born. Matures. Gets married to other data, divorced. Gets old. One thing that it doesn't do is die. It has to be killed." - Arthur Miller

Dear Mike,
In message 7103aeea0812180831y258494c4obe34e934f87450f5@mail.gmail.com you wrote:
You are correct, U-Boot does not load the RAMdisk image since the image is already stored in NOR flash memory. Sorry for my carelessness... Below is the kernel start log, Could you please take a look into it and give my any suggestions?
That's difficult for me, given the fact that I don't know how your kernel was modified and/or configured.
=> setenv bootargs console=ttyS0,115200 root=/dev/ram0 ro mem=100M
You might have to pass an address for the inital ramdisk as part of the bootargs; I don't know how your kernel passes such parameters between boot loader and kernel. And even then your kernel might expect that the ramdisk image is in RAM, not in flash. As mentioned before, patches have been posted here several times. Search the list archive, please.
Best regards,
Wolfgang Denk

Hi Wolfgang,
Thank you for your reply & read inline below please.
Best regards, Mike
On Fri, Dec 19, 2008 at 5:50 AM, Wolfgang Denk wd@denx.de wrote:
Dear Mike,
In message 7103aeea0812180831y258494c4obe34e934f87450f5@mail.gmail.com you wrote:
You are correct, U-Boot does not load the RAMdisk image since the image is already stored in NOR flash memory. Sorry for my carelessness... Below is the kernel start log, Could you please take a look into it and give my any suggestions?
That's difficult for me, given the fact that I don't know how your kernel was modified and/or configured.
I am using standard kernel of version 2.6.21.7. And only few changes to adapt the hardware board.
=> setenv bootargs console=ttyS0,115200 root=/dev/ram0 ro mem=100M
You might have to pass an address for the inital ramdisk as part of the bootargs; I don't know how your kernel passes such parameters between boot loader and kernel. And even then your kernel might expect that the ramdisk image is in RAM, not in flash. As mentioned before, patches have been posted here several times. Search the list archive, please.
I tried to pass initrd=0xa0a00000,16M into the kernel command line, but kernel still reports "Initrd not found or empty"... btw: 0xa0a00000 is a memory address. my flash space is from BF000000 to BFFE0000 which is a 64MB NOR flash. Actually, I just want the kernel to use the ramdisk in memory as its rootfs.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "The more data I punch in this card, the lighter it becomes, and the lower the mailing cost." - Stan Kelly-Bootle, "The Devil's DP Dictionary"

Dear Mike,
In message 7103aeea0812190138v74d94aa0nb8789f01e3ccda27@mail.gmail.com you wrote:
I tried to pass initrd=0xa0a00000,16M into the kernel command line, but kernel still reports "Initrd not found or empty"... btw: 0xa0a00000 is a memory address. my flash space is from BF000000 to BFFE0000 which is a 64MB NOR flash.
Hm... why do you think the kernel could find a ramdisk image at address 0xa0a00000 when the correct address is 0xBF000000 or above instead?
Did you manually copy the ramdisk image to 0xa0a00000 ?
Best regards,
Wolfgang Denk

Hi Wolfgang,
So quick response :). Yes, I download it into memory manually by `tftpboot a0a00000 ramdiskfile`
Thanks, Mike
On Fri, Dec 19, 2008 at 5:48 PM, Wolfgang Denk wd@denx.de wrote:
Dear Mike,
In message 7103aeea0812190138v74d94aa0nb8789f01e3ccda27@mail.gmail.com you wrote:
I tried to pass initrd=0xa0a00000,16M into the kernel command line, but kernel still reports "Initrd not found or empty"... btw: 0xa0a00000 is a memory address. my flash space is from BF000000 to BFFE0000 which is a 64MB NOR flash.
Hm... why do you think the kernel could find a ramdisk image at address 0xa0a00000 when the correct address is 0xBF000000 or above instead?
Did you manually copy the ramdisk image to 0xa0a00000 ?
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de No man knows what true happiness is until he gets married. By then, of course, its too late.

Dear Mike,
A: Full quoting.
Q: And what is the second most annoying thing on usenet and in e-mail?
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Please STOP top-posting / full quoting. Read http://www.netmeister.org/news/learn2quote.html
In message 7103aeea0812190158u7e08cb33j4fd33c8d75320b5b@mail.gmail.com you wrote:
So quick response :). Yes, I download it into memory manually by `tftpboot a0a00000 ramdiskfile`
Then your ramdiskfile is probably not a ramdisk file recognized by your kernel. Can you mount it locally using the loopback device in Linux?
Best regards,
Wolfgang Denk

On Fri, Dec 19, 2008 at 7:18 PM, Wolfgang Denk wd@denx.de wrote:
Dear Mike,
A: Full quoting.
Q: And what is the second most annoying thing on usenet and in e-mail?
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Please STOP top-posting / full quoting. Read http://www.netmeister.org/news/learn2quote.html
In message 7103aeea0812190158u7e08cb33j4fd33c8d75320b5b@mail.gmail.com you wrote:
So quick response :). Yes, I download it into memory manually by `tftpboot a0a00000 ramdiskfile`
Then your ramdiskfile is probably not a ramdisk file recognized by your kernel. Can you mount it locally using the loopback device in Linux?
Mike: It could be mounted via loopback device. Below is the steps I made the ramdisk image: dd if=/dev/zero of=initrd.bin bs=4k count=4096 sudo /sbin/mke2fs -F -v -m0 initrd.bin sudo mount -o loop initrd.bin /mnt/initrd sudo cp -av $(ROMFSDIR)/* /mnt/initrd sudo umount /mnt/initrd gzip -f9 initrd.bin ../openWRT-BL2338_DEV/build_dir/host/mkimage/mkimage -O linux -A mips -T ramdisk -C gzip -n 'Test Ramdisk Image' -d initrd.bin.gz uRamdisk
Thanks.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de I will also, for an appropriate fee, certify that your keyboard is object-oriented, and that the bits on your hard disk are template- compatible. - Jeffrey S. Haemer in 411akr$3ga@cygnus.com
participants (2)
-
mike xu
-
Wolfgang Denk