How to jump from QSPI firmware image to emmc boot partition or root fs for LS1088ARDB_PB Platform

cancel
Showing results for 
Search instead for 
Did you mean: 

How to jump from QSPI firmware image to emmc boot partition or root fs for LS1088ARDB_PB Platform

Jump to solution
307 Views
gsuresh_12
Contributor II

I am using LS1088ARDB_PB platform for my prototype development. I can able to boot from both QSPIs and from SD Card also by setting the switches on the board.

I would like to change Tiny Linux distro from QSPI boot and want to bring up ubuntu 20.04 through QSPI. As I aware that QSPI memory space is very less to accommodate firmware image, boot partition image and rootfs image. So I would like to keep firmware image into the QSPI, and boot partition image and rootfs image into the emmc. I could able to partition the emmc (/dev/mmcblk0) and able to keep the both images (boot partition image and rootfs image) in the emmc memory.

Now my issue here is if I keep the boot switches to QSPI boot mode from one of the QSPI-nor flashes, it is again Tiny Linux distro only coming up.

Please suggest how can I guide to jump after executing firmware image from QSPI flash then remaining boot partition and rootfs execution from emmc memory to run my ubuntu image?

Note: we don't want to use SD Card at all because we don't have any more SD Card Slot on our proto board.   

Thanks & Regards

Suresh

0 Kudos
1 Solution
227 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please try the following commands.

$ flex-installer -i pf -p 2P=1536M:-1 -d /dev/mmcblk0


$ flex-installer -b boot_LS_arm64_lts_5.10.tgz -r rootfs_lsdk2108_ubuntu_lite_arm64.tgz -d /dev/mmcblk0 --bootpart=1 --rootpart=2


After installing successfully, run "setenv devpart_boot 1;setenv devpart_root 2;boot" in U-Boot to boot distro from the specific partition.

View solution in original post

0 Kudos
6 Replies
294 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following procedure to deploy emmc card.

$ wget https://www.nxp.com/lgfiles/sdk/lsdk2108/boot_LS_arm64_lts_5.10.tgz

$ wget https://www.nxp.com/lgfiles/sdk/lsdk2108/rootfs_lsdk2108_ubuntu_main_arm64.tgz

On your host PC, please execute the following command.

$ flex-installer -b boot_LS_arm64_lts_5.10.tgz -r rootfs_lsdk2108_ubuntu_main_arm64.tgz -d /dev/sdx

Please note /dev/sdx is MMC card device name on your host PC.

Then plug in eMMC card to your target board, configure the target boot from QSPI flash, then the system will boot Linux Kernel and rootfs from eMMC card.

Please refer to the following bootargs from QSPI boot.

=> pri bootcmd
bootcmd=sf read 0x80001000 0xd00000 0x100000;env exists mcinitcmd && env exists secureboot && sf read 0x806C0000 0x6C0000 0x100000 && esbc_validate 0x806C0000;env exists mcinitcmd && fsl_mc lazyapply dpl 0x80001000;run distro_bootcmd;run qspi_bootcmd;env exists secureboot && esbc_halt;
=> pri distro_bootcmd
distro_bootcmd=scsi_need_init=; setenv nvme_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
=> pri boot_targets
boot_targets=mmc0 usb0 scsi0 dhcp

So if you deploy images to emmc card correctly, bootcmd_mmc0 will be run first, If all mmc, usb and SATA are empty,  qspi_bootcmd will be executed.

 

 

0 Kudos
283 Views
gsuresh_12
Contributor II

Thanks for your reply,

Yes your procedure is working perfectly, if I use SD card. But this procedure is not working when I am using on board emmc chip.

while loading binaries into the on board emmc chip I am using below command

 $ flex-installer -i pf -b boot_LS_arm64_lts_5.10.tgz -r rootfs_lsdk2108_ubuntu_main_arm64.tgz -d /dev/mmcblk0

Thanks & Regards

Suresh

0 Kudos
256 Views
yipingwang
NXP TechSupport
NXP TechSupport

The on chip emmc chip is only 3.6G, it is too small to store ubuntu main rootfs, you could try ubuntu lite rootfs.

You could create two partition, the first is for bootpartition, the second is for rootfs.

$ flex-installer -i pf -p 2P=1G:-1 -d /dev/mmcblk0
$ flex-installer -b boot_LS_arm64_lts_5.10.tgz -r rootfs_lsdk2108_ubuntu_lite_arm64.tgz -d /dev/mmcblk0 --bootpart=1 --rootpart=2
After installing successfully, run "setenv devpart_boot 1;setenv devpart_root 2;boot" in U-Boot to boot distro from the specific partition)

0 Kudos
236 Views
gsuresh_12
Contributor II

HI yipingwang,

I have followed your instructions, here is the first command for partition and it was partitioned properly.   

root@TinyLinux:/mnt/flexbuild_lsdk2108/tools# flex-installer -i pf -p 2P=1G:-1 -d /dev/mmcblk0
/dev/mmcblk0: 3 GB
Partitioning /dev/mmcblk0 ...
[ 834.306267] mmcblk0:
Formatting partitions ...
/dev/mmcblk0p1 contains a ext4 file system labelled 'misc'
last mounted on Fri Mar 9 12:45:11 2018
/dev/mmcblk0p2 contains a ext4 file system labelled 'boot'
last mounted on Fri Mar 9 12:45:11 2018
[ 847.114317] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[ 847.177671] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
Model: MMC P1XXXX (sd/mmc)
Disk /dev/mmcblk0: 3867MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 71.3MB 1145MB 1074MB ext4 primary
2 1146MB 3867MB 2721MB ext4 primary

partition and format /dev/mmcblk0 [Done]
root@TinyLinux:/mnt/flexbuild_lsdk2108/tools# fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 3.6 GiB, 3867148288 bytes, 7553024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F30CDFBE-23DF-4430-AC8F-E1AF09E68534

Device Start End Sectors Size Type
/dev/mmcblk0p1 139264 2236415 2097152 1G Linux filesystem
/dev/mmcblk0p2 2238464 7552990 5314527 2.5G Linux filesystem

Here is your second command execution and it is showing No space left.

root@TinyLinux:/mnt/flexbuild_lsdk2108/tools# flex-installer -b boot_LS_arm64_lts_5.10.tgz -r rootfs_lsdk2108_ubuntu_lite_arm64.tgz -d /dev/mmcblk0 --bootpart=1 --rootpart=2
Installing boot_LS_arm64_lts_5.10.tgz to /dev/mmcblk0p1 ...
tar: write error: No space left on device
root@TinyLinux:/mnt/flexbuild_lsdk2108/tools#

 

Please help us to resolve this issue

Regards

Suresh

 

0 Kudos
228 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please try the following commands.

$ flex-installer -i pf -p 2P=1536M:-1 -d /dev/mmcblk0


$ flex-installer -b boot_LS_arm64_lts_5.10.tgz -r rootfs_lsdk2108_ubuntu_lite_arm64.tgz -d /dev/mmcblk0 --bootpart=1 --rootpart=2


After installing successfully, run "setenv devpart_boot 1;setenv devpart_root 2;boot" in U-Boot to boot distro from the specific partition.

0 Kudos
215 Views
gsuresh_12
Contributor II

Thank you yipingwang,

These instructions are working perfectly.

$ flex-installer -i pf -p 2P=1536M:-1 -d /dev/mmcblk0

$ flex-installer -b boot_LS_arm64_lts_5.10.tgz -r rootfs_lsdk2108_ubuntu_lite_arm64.tgz -d /dev/mmcblk0 --bootpart=1 --rootpart=2

After installing successfully, run "setenv devpart_boot 1;setenv devpart_root 2;saveenv;boot" in U-Boot to boot distro from the specific partition.

Thanks & Regards

Suresh

0 Kudos