[U-Boot] [PATCH 3/4] armv7: ls1021atwr: Add sd_bootcmd for distro fallback in case of sdboot

Shengzhou Liu Shengzhou.Liu at nxp.com
Wed Aug 30 10:26:08 UTC 2017


Signed-off-by: Shengzhou Liu <Shengzhou.Liu at nxp.com>
---
 include/configs/ls1021atwr.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 0e5b004868..45fb94a889 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -384,6 +384,8 @@
 	"ramdisk_addr_r=0xa0000000\0"	\
 	"load_addr=0xa0000000\0"	\
 	"kernel_size=0x2800000\0"	\
+	"kernel_addr_sd=0x8000\0"	\
+	"kernel_size_sd=0x14000\0"	\
 	BOOTENV				\
 	"boot_scripts=ls1021atwr_boot.scr\0"	\
 	"boot_script_hdr=hdr_ls1021atwr_bs.out\0"	\
@@ -473,13 +475,20 @@
 		"$kernel_addr $kernel_size && bootm $load_addr#$board\0"	\
 	"nor_bootcmd=echo Trying load from nor..;"	\
 		"cp.b $kernel_addr $load_addr "		\
-		"$kernel_size && bootm $load_addr#$board\0"
+		"$kernel_size && bootm $load_addr#$board\0" \
+	"sd_bootcmd=echo Trying load from SD ..;"       \
+		"mmcinfo; mmc read $load_addr "		\
+		"$kernel_addr_sd $kernel_size_sd; "	\
+		"bootm $load_addr#$board\0"
 #endif
 
 #undef CONFIG_BOOTCOMMAND
 #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; env exists secureboot"	\
 			   "&& esbc_halt; run qspi_bootcmd;"
+#elif defined(CONFIG_SD_BOOT)
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; env exists secureboot"  \
+			   "&& esbc_halt; run sd_bootcmd;"
 #else
 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; env exists secureboot"	\
 			   "&& esbc_halt; run nor_bootcmd;"
-- 
2.14.1



More information about the U-Boot mailing list