Qspi (firmware) → emmc(rft & boot partition) boot

From ESS-WIKI
Revision as of 10:59, 16 September 2021 by William6.chen (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Commands

#at 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_emmc_boot --privileged -v $(pwd):/home/adv/flexbuild_lsdk2012:rw fbubuntu:18.04 /bin/bash

# -----below command are in docker container----------
cd /home/adv/flexbuild_lsdk2012

#source environment variable
source setup.env

#先build一次拉code
flex-builder -i mkfw -m ls1046ardb -b qspi

# clean 
flex-builder clean

# 修改rcw_1800_qspiboot.rcw內容(才認得到eMMC)
cd /home/adv/flexbuild_lsdk2012/packages/firmware/rcw/ls1046ardb/RR_FFSSPPPH_1133_5559
vim rcw_1800_qspiboot.rcw
IIC2_EXT=0
EVDD_VSEL=0

# 重新build firmware image
flex-builder -i mkfw -m ls1046ardb -b qspi
ls -hl build/images/

# generate Ubuntu-base arm64 LSDK
flex-builder -i mkrfs -r ubuntu:lite -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
cd build/images/
cp firmware_ls1046ardb_uboot_qspiboot.img /tftpboot/
cp rootfs_lsdk2012_ubuntu_lite_arm64_202109080922.tgz /tftpboot/
cp bootpartition_LS_arm64_lts_5.4_202109080224.tgz /tftpboot/


#at ls1046ardb Device COM
#firmware_ls1046ardb_uboot_qspiboot.img 燒入qspi bank1

=> 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

#uboot check emmc
=> mmcinfo
=> mmc list

#reboot from qspi bank4 and boot to tiny rfs
=> run qspi_bootcmd
RTENOTITLE
# download bootpartition and rfs to mytftp folder
cd /media/
mkdir mytftp
cd mytftp

ifconfig fm1-mac9 up
udhcpc -i fm1-mac9
ping 172.22.31.153


tftp -g -r bootpartition_LS_arm64_lts_5.4_202109080224.tgz 172.22.31.153
tftp -g -r rootfs_lsdk2012_ubuntu_lite_arm64_202109080922.tgz 172.22.31.153


# format emmc
flex-installer -i pf -d /dev/mmcblk0
sync


# -------------------install bootpartition and lite rfs----------------------
#lite 可以成功

#without ota flag partition 
flex-installer -i install -b bootpartition_LS_arm64_lts_5.4_202109080224.tgz -r rootfs_lsdk2012_ubuntu_lite_arm64_202109080922.tgz -d /dev/mmcblk0
sync

# with ota flag partition
# lite RFS -p 5P=50M:1G:50M:100M:-1 --rootpart=6 -b 
#After installing successfully, run "setenv devpart_root 6;boot" in U-Boot to boot distro from the specific partition)
flex-installer -i install -p 5P=50M:1G:50M:100M:-1 -b bootpartition_LS_arm64_lts_5.4_202109080224.tgz -r rootfs_lsdk2012_ubuntu_lite_arm64_202109080922.tgz -d /dev/mmcblk0 --rootpart=6


#reboot and boot to qspi bank4
cpld reset altbank

#in U-Boot to boot distro from the specific partition
setenv devpart_root 6;boot

lite result

RTENOTITLE

RTENOTITLE