Qspi (firmware)→ sd (rfs and bootpartition) boot
From ESS-WIKI
#Linux host
#download flex-installer
wget https://www.nxp.com/lgfiles/sdk/lsdk2012/flex-installer && chmod +x flex-installer && sudo mv flex-installer /usr/bin
flex-installer -h
#download flex-builder
tar xvzf flexbuild_lsdk2012.tgz
cd flexbuild_lsdk2012/
source setup.env
flex-builder -h
#create docker container
docker run -it --name qspi_sdboot --privileged -v $(pwd):/home/adv/flexbuild_lsdk2012:rw fbubuntu:18.04 /bin/bash
cd home/adv/flexbuild_lsdk2012
source setup.env
# build firmware for qspi bank4
flex-builder -i mkfw -m ls1046ardb -b qspi
ls -hl build/images/
# generate Ubuntu-base arm64 LSDK
flex-builder -i mkrfs -a arm64
ls -hl build/images/
# kernel image , dtb, distro boot script, flex_linux_<arch>.itb, small ramdiskrfs,etc.
# Flex-builder automatically builds the dependent images if the are not present.
flex-builder -i mkbootpartition -a arm64
ls -hl build/images/
# exit docker container
exit
# copy images to tftpfolder
cd build/images/
cp firmware_ls1046ardb_uboot_qspiboot.img /tftpboot/
cp rootfs_lsdk2012_ubuntu_main_arm64.tgz /tftpboot/
cp bootpartition_LS_arm64_lts_5.4_202109060454.tgz /tftpboot/
#at ls1046ardb Device COM
#firmware_ls1046ardb_uboot_qspiboot.img 燒入qspi bank4
=> cpld reset
=> setenv serverip 172.22.31.153
=> dhcp
=> ping 172.22.31.153
=> tftp $load_addr firmware_ls1046ardb_uboot_qspiboot.img
=> sf probe 0:1
=> sf erase 0 +$filesize && sf write $load_addr 0 $filesize
=> cpld reset altbank
#boot from qspi bank4 and check sd
=> mmcinfo
=> mmc list
# qspi bank4 boot to tiny rfs
run qspi_bootcmd
# format sd
flex-installer -i pf -d /dev/mmcblk0
sync
# download bootpartition and rfs to mytftp folder
cd /media/
mkdir mytftp
cd mytftp
# set ethernet config
ifconfig fm1-mac9 up
udhcpc -i fm1-mac9
ping 172.22.31.153
# download files from tftp server
tftp -g -r bootpartition_LS_arm64_lts_5.4_202109060454.tgz 172.22.31.153
tftp -g -r rootfs_lsdk2012_ubuntu_main_arm64.tgz 172.22.31.153
# install bootpartition and rfs
flex-installer -i install -b bootpartition_LS_arm64_lts_5.4_202109060454.tgz -r rootfs_lsdk2012_ubuntu_main_arm64.tgz -d /dev/mmcblk0
#power off and switch to qspi bank4
#power on