LS1012ARDB boot from eMMC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1012ARDB boot from eMMC

Jump to solution
1,178 Views
miftahul_huda
Contributor III

Hi all,

I want to know how to boot openwrt from eMMC in LS1012ARDB board. I use openwrt repository from https://source.codeaurora.org/external/qoriq/qoriq-components/openwrt (branch layerscape-20.09). From this build root, I only able to create firmware that will be flashed to QSPI, or loaded to ram (ramdisk) for booting.

I use board MYZR-LS1012A-EK200. It has eMMC installed and divided to 2 partition, boot partition (fat32) and root filesystem partition (ext4). It is installed with yocto that booted from eMMC using loadable .dtb file and linux kernel in boot partition. I can use this board's .dtb file for device tree binary source to boot openwrt ramdisk image that I built from repository that I mentioned earlier. 

From the board's boot sequence to boot from eMMC, it will create bootargs to point rootfs in second partition of eMMC, then load files from boot partition, the Image file as linux kernel, then load .dtb file as device tree binary source, next boot the linux kernel using "booti <kernel_addr> - <dtb_addr>".

I tried to get linux openwrt kernel Image file from the build root inside build_dir folder (build_dir/target-aarch64_generic_glibc/linux-layerscape_armv8_64b/), then put it into the board's boot partition, also I formated the board's root file system partition and filled it with files and directory that extracted from openwrt image root folder. I thought it will success like the board will boot the openwrt kernel Image, then use board's second partition as root file system, but the booting process failed when to mounted root fs.

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

 

I also tried to invoke the boot sequence manually, and the result is still same.

Can you guys give me direction how to make the openwrt that able to be booted from eMMC in this board?

Is openwrt firmware for ls1012ardb (built from build root) only able to be booted from qspi (for persistance) and ramdisk like I mentioned above? since there is no option to built image firmware that can be booted from eMMC or sdcard in build root.

If the openwrt for ls1012ardb can be booted from eMMC, what is wrong with my kernel Image that unnable to mount the root fs?

Best regards,

Huda

0 Kudos
1 Solution
1,120 Views
miftahul_huda
Contributor III

Hi @yipingwang, thank you for your reply.

apparently there is difference in how openwrt naming block device for emmc. From your comment I changed rootdelay=5 to rootwait (the kernel will wait forever until rootfs available) just to make sure the emmc driver is loaded by kernel at boot.

...
[ 0.513126] mmc1: new HS200 MMC card at address 0001
[ 0.517967] mmcblk1: mmc1:0001 Q2J54A 3.64 GiB
[ 0.518340] mmcblk1boot0: mmc1:0001 Q2J54A partition 1 2.00 MiB
[ 0.518708] mmcblk1boot1: mmc1:0001 Q2J54A partition 2 2.00 MiB
[ 0.518922] mmcblk1rpmb: mmc1:0001 Q2J54A partition 3 512 KiB, chardev (245:0)
[ 0.524161] mmcblk1: p1 p2
...

As you can see, the emmc driver is loaded and the emmc is listed, but openwrt give the emmc storage name as mmcblk1 instead of mmcblk0 like the default firmware does (since there are 2 mmc on the board, which one is emmc as mmc1 and the other is sdcard as mmc0 a scdcard reader that no card inserted on it). 

From there I realized that I was assigning wrong paramater for root partition. Then I changed the root partition in the bootargs from /dev/mmcblk0p2 to /dev/mmcblk1p2. Now the board is able to boot.

Thanks.

View solution in original post

0 Kudos
2 Replies
1,151 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please define bootargs as the following.

=> setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:2 0xa0000000 /boot/Image;ext2load mmc 0:2 0xb0000000 /boot/fsl-ls1043a-rdb-sdk.dtb;booti 0xa0000000 - 0xb0000000'

For images deploying in SD card, you could refer to this thread.

https://community.nxp.com/t5/Layerscape/How-to-create-a-bootable-SD-for-the-LS1043ARDB/m-p/1297151#M...

0 Kudos
1,121 Views
miftahul_huda
Contributor III

Hi @yipingwang, thank you for your reply.

apparently there is difference in how openwrt naming block device for emmc. From your comment I changed rootdelay=5 to rootwait (the kernel will wait forever until rootfs available) just to make sure the emmc driver is loaded by kernel at boot.

...
[ 0.513126] mmc1: new HS200 MMC card at address 0001
[ 0.517967] mmcblk1: mmc1:0001 Q2J54A 3.64 GiB
[ 0.518340] mmcblk1boot0: mmc1:0001 Q2J54A partition 1 2.00 MiB
[ 0.518708] mmcblk1boot1: mmc1:0001 Q2J54A partition 2 2.00 MiB
[ 0.518922] mmcblk1rpmb: mmc1:0001 Q2J54A partition 3 512 KiB, chardev (245:0)
[ 0.524161] mmcblk1: p1 p2
...

As you can see, the emmc driver is loaded and the emmc is listed, but openwrt give the emmc storage name as mmcblk1 instead of mmcblk0 like the default firmware does (since there are 2 mmc on the board, which one is emmc as mmc1 and the other is sdcard as mmc0 a scdcard reader that no card inserted on it). 

From there I realized that I was assigning wrong paramater for root partition. Then I changed the root partition in the bootargs from /dev/mmcblk0p2 to /dev/mmcblk1p2. Now the board is able to boot.

Thanks.

0 Kudos