Browse Source

TF Image: modify uboot env variable to support booting from tf card

Signed-off-by: sw.multimedia <sw.multimedia@starfivetech.com>
Signed-off-by: Curry Zhang <curry.zhang@starfivetech.com>
sw.multimedia 2 years ago
parent
commit
8831f26e94

+ 1 - 0
configs/starfive_jh7100_starlight_smode_defconfig

@@ -202,6 +202,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200  debug rootwait  earlycon=sbi stmmaceth=chain_mode:1"
 # CONFIG_BOOTARGS_SUBST is not set
 # CONFIG_USE_BOOTCOMMAND is not set
+# CONFIG_BOOTCOMMAND="run mmcsetup; run fdtsetup; run fatenv; echo 'running boot2...'; run boot2"
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run mmcbootenv"
 CONFIG_DEFAULT_FDT_FILE=""

+ 4 - 0
include/configs/starfive-jh7100.h

@@ -66,6 +66,10 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	STARLIGHT_FEDORA_BOOTENV \
+	"mmcsetup=mmc part\0" \
+	"fdtsetup=fdt addr ${fdtcontroladdr}\0" \
+	"fatenv=setenv fileaddr a0000000; fatload mmc 0:1 ${fileaddr} u74_uEnv.txt;" \
+	"env import -t ${fileaddr} ${filesize}\0" \
 	"loadaddr=0xa0000000\0" \
 	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
 	"ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \