I'm working on imx6s sabre sdp and trying to boot with ramdisk root file system, but it's not working.
With i.mx51, ramdisk root file system boot was successful with almost same configuarion.
Could somebody tell me what I missed?
Here is what have i done.
1. kernel config.
at kernel menuconfig, i've selected following configuration
General setup > initial ram filesystem and ram disk support
--> CONFIG_BLK_DEV_INITRD=y, CONFIG_RD_GZIP=y
Device drivers > block devices > ram block device support
--> CONFIG_BLK_DEV_RAM=y, CONFIG_BLK_DEV_RAM_COUNT=16, CONFIG_BLK_DEV_RAM_SIZE=4096
2. ramdisk creation
I made ramdisk image with rootfs created by ltib
dd if=/dev/zero of=ramdisk bs=1k count=131072 ==> 128MB ramdisk
mkfs.ext2 ramdisk
mount -t ext2 -o loop ramdisk /mnt/rootfs
cp -a ./ltib/rootfs/* /mnt/rootfs
umount dir_ramdisk
gzip ramdisk ==> which create ramdisk.gz
3. ramdisk deployment
I placed u-boot, uImage, ramdisk.gz on SD slot 3 SD card,
0~1M : u-boot area
1M~5M : kernel area
5M~55M : ramdisk.gz area
with the following commend on linux host computer. (sdcard is recognized as /dev/sdc in my linux host)
dd if=u-boot of=/dev/sdc bs=512 seek=2 skip=2 conv=fsync
dd if=uImage of=/dev/sdc bs=512 seek=2048 conv=fsync
dd if=ramdisk.gz of=/dev/sdc bs=512 seek=10240 conv=fsync
4. kernel cmdline configuration at u-boot command
the following is what I entered at u-boot command line.
set bootargs console=ttymxc0,115200 nosmp video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666 ldb=sin1 ip=10.175.93.16 initrd=0x10c00000,50M root=/dev/ram0 ramdisk_size=131072
mmc dev 2
mmc read 0x10800000 0x800 0x2000 ==> read 4Mbyte from 1M offset. kernel
mmc read 0x10c00000 0x2800 0x19000 ==> read 50Mbyte from 5M offset, ramdisk.gz
bootm
and then, kernel booting halted with the following message
mmcblk1: mmc2:b02c SD04G 3.69 GiB
mmcblk1: p1
PHY: 1:01 - Link is Up - 100/Full
IP-Config: Guessing netmask 255.0.0.0
IP-Config: Complete:
device=eth0, addr=10.175.93.16, mask=255.0.0.0, gw=255.255.255.255,
host=10.175.93.16, domain=, nis-domain=(none),
bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
RAMDISK: Couldn't find valid RAM disk image starting at 0.
List of all partitions:
1f00 1024 mtdblock0 (driver?)
1f01 3072 mtdblock1 (driver?)
b300 7757824 mmcblk0 driver: mmcblk
b310 2048 mmcblk0boot1 (driver?)
b308 2048 mmcblk0boot0 (driver?)
b318 3872256 mmcblk1 driver: mmcblk
b319 3814912 mmcblk1p1 00000000-0000-0000-0000-000000000000
No filesystem could mount root, tried: ext3 ext2 ext4 cramfs vfat msdos
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
[<8004a834>] (unwind_backtrace+0x0/0xf8) from [<8050c514>] (panic+0x74/0x18c)
[<8050c514>] (panic+0x74/0x18c) from [<80008dac>] (mount_block_root+0x1e0/0x224)
[<80008dac>] (mount_block_root+0x1e0/0x224) from [<80008fc4>] (mount_root+0xe8/0x108)
[<80008fc4>] (mount_root+0xe8/0x108) from [<80009148>] (prepare_namespace+0x164/0x1bc)
[<80009148>] (prepare_namespace+0x164/0x1bc) from [<80008a04>] (kernel_init+0x108/0x13c)
[<80008a04>] (kernel_init+0x108/0x13c) from [<80044aa4>] (kernel_thread_exit+0x0/0x8)
there is a related issue on this thread
https://community.freescale.com/message/362688#362688
it may be worth trying the same first approach: placing the ramdisk on RAM and calling bootm with two parameters (kernel_address ramdisk_address)
I tried the first approach from the link https://community.freescale.com/message/362688#362688
But it's not working in my case.
To make ramdisk image which can be recognized by u-boot, I used following command
mkimage -n 'Ramdisk' -A arm -O linux -T ramdisk -C gzip -a 0x10c00000 -e 0x10c00000 -d ramdisk.gz ramdisk.gz.uboot
And I removed initrd=0x10c00000,50M parameter from u-boot bootargs.
But it shows the same result.
Is there any recommanded option when using mkimage?
I checked rootfs.ext2.gz.uboot which was created by ltib, but it show 0x0 form load address and entry point.
mkimage -l rootfs.ext2.gz.uboot
Image Name: uboot ext2 ramdisk rootfs
Created: Tue Jan 7 13:37:21 2014
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 6394243 Bytes = 6244.38 kB = 6.10 MB
Load Address: 0x00000000
Entry Point: 0x00000000
I think it doesn't make sense.
Try to add 'keepinitrd' to kernel boot parameter on u-boot, please.
Basically Linux is finding initramfs for root file system as default on init process of Linux if you check CONFIG_BLK_DEV_INITRD on kernel menuconfig and initramfs differs to RAM disk.
So the init process frees the allocated RAM region for root file system if rootfs which is loaded to DRAM is not initramfs.
But The parameter 'keepinitrd' prevents to free RAM region as RAM filesystem on executing the init process even if the loaded RAMfs isn't initramfs.
I expect that 'keepinitrd' can resolve your error. Please try it.
- Alex Yang
The manufacting tool has a XML file indicating the way to flash a particular board/profile, can you look at this file (or flash a demo image using it) to see how it handles? you can at least see the kernel command line with the correct address value.
Leo
Thank you for your answer.
But calling bootm with two parameter will be working with ramdisk image processed by mkimage - u-boot tool.
Normally created ramdisk image - built on loop device and then gzipped - will not be recognized by u-boot.
I wonder why my approach is not working.
I checked every steps I have done several times, but I cannot find any mistake.
On the other CPU platform including i.mx51, I could successfully boot the system with ramdisk root file system by using same approach.
Is there any difference on imx6s linux kernel?
shouldn't ramdisk image be loaded at 0x10c00000?
In addition, there is new u-boot environment variable.
rd_loadaddr=(0x10800000+0x300000)
does it mean ramdisk load address?
if it means ramdisk load address, it should be 0x10800000+0x400000, because kernel size is 3.7MB.
How can I use this environment variable?