[U-Boot] [PATCH 2/4] arm64: ls1046ardb: Add sd_bootcmd for distro fallback in case of sdboot

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


Signed-off-by: Shengzhou Liu <Shengzhou.Liu at nxp.com>
---
 include/configs/ls1046a_common.h | 8 +++++++-
 include/configs/ls1046ardb.h     | 6 ++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
index e5159d8f1a..953f3ae70e 100644
--- a/include/configs/ls1046a_common.h
+++ b/include/configs/ls1046a_common.h
@@ -229,6 +229,8 @@
 	"kernel_start=0x1000000\0"		\
 	"kernel_load=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
+	"kernel_addr_sd=0x8000\0"		\
+	"kernel_size_sd=0x14000\0"		\
 	"console=ttyS0,115200\0"                \
 		MTDPARTS_DEFAULT "\0"		\
 	BOOTENV					\
@@ -264,7 +266,11 @@
 		"bootm $load_addr#ls1046ardb\0"	 \
 	"qspi_bootcmd=echo Trying load from qspi..;"      \
 		"sf probe && sf read $load_addr "         \
-		"$kernel_start $kernel_size && bootm $load_addr#$board\0"
+		"$kernel_start $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"
 
 
 #define CONFIG_BOOTARGS			"console=ttyS0,115200 root=/dev/ram0 " \
diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h
index b9f27bbe51..9aa84feb1f 100644
--- a/include/configs/ls1046ardb.h
+++ b/include/configs/ls1046ardb.h
@@ -237,8 +237,14 @@
 
 #ifndef SPL_NO_MISC
 #undef CONFIG_BOOTCOMMAND
+#if defined(CONFIG_QSPI_BOOT)
 #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;"
+#endif
+
 #define MTDPARTS_DEFAULT "mtdparts=1550000.quadspi:1m(rcw)," \
 			"15m(u-boot),48m(kernel.itb);" \
 			"7e800000.flash:16m(nand_uboot)," \
-- 
2.14.1



More information about the U-Boot mailing list