Skip to contentSkip to conversation

arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

PATCH New Shengzhou Liu 3 participants 10 messages Aug 30, 2017 – Nov 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

---
 include/configs/ls1043a_common.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
include/configs/ls1043a_common.h +10 -1
index f064d5c24a..976c031574 100644
@@ -281,6 +281,8 @@
 	"fdt_addr_r=0x90000000\0"		\
 	"load_addr=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
+	"kernel_addr_sd=0x8000\0"		\
+	"kernel_size_sd=0x14000\0"		\
 	"console=ttyS0,115200\0"		\
 	"mtdparts=" MTDPARTS_DEFAULT "\0"	\
 	BOOTENV					\
@@ -318,12 +320,19 @@
 		"$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"
 
 #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;"
Signature · 1 line
2.14.1
#1 lore raw

PATCH 2/4 arm64: ls1046ardb: Add sd_bootcmd for distro fallback in case of sdboot

---
 include/configs/ls1046a_common.h | 8 +++++++-
 include/configs/ls1046ardb.h     | 6 ++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
include/configs/ls1046a_common.h +7 -1
index e5159d8f1a..953f3ae70e 100644
@@ -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 " \
include/configs/ls1046ardb.h +6 -0
index b9f27bbe51..9aa84feb1f 100644
@@ -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)," \
Signature · 1 line
2.14.1
#2 lore raw

PATCH 3/4 armv7: ls1021atwr: Add sd_bootcmd for distro fallback in case of sdboot

In reply to Shengzhou Liu
---
 include/configs/ls1021atwr.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
include/configs/ls1021atwr.h +10 -1
index 0e5b004868..45fb94a889 100644
@@ -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;"
Signature · 1 line
2.14.1
#3 lore raw

PATCH 4/4 arm64: ls2080ardb: Add sd_bootcmd for distro fallback in case of sdboot

In reply to Shengzhou Liu
---
 include/configs/ls2080ardb.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
include/configs/ls2080ardb.h +17 -0
index b309d79586..9458fda173 100644
@@ -361,6 +361,12 @@ unsigned long get_board_sys_clk(void);
 	"esbc_validate 0x20700000 && "		\
 	"esbc_validate 0x20740000;"		\
 	"fsl_mc start mc 0x20a00000 0x20e00000 \0"
+#elif defined(CONFIG_SD_BOOT)
+#define MC_INIT_CMD                             \
+	"mcinitcmd=mmcinfo;mmc read 0x80000000 0x5000 0x800;" \
+        "mmc read 0x80100000 0x7000 0x800;"	\
+        "fsl_mc start mc 0x80000000 0x80100000\0" \
+        "mcmemsize=0x70000000\0"
 #else
 #define MC_INIT_CMD				\
 	"mcinitcmd=env exists secureboot && "	\
@@ -391,7 +397,13 @@ unsigned long get_board_sys_clk(void);
 	"fdt_addr_r=0x90000000\0"		\
 	"load_addr=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
+	"kernel_addr_sd=0x8000\0"		\
+	"kernel_size_sd=0x14000\0"		\
 	"console=ttyAMA0,38400n8\0"		\
+	"sd_bootcmd=echo Trying load from SD ..;" \
+	"mmcinfo; mmc read $load_addr "		\
+	"$kernel_addr_sd $kernel_size_sd; "	\
+	"bootm $load_addr#$board\0"		\
 	MC_INIT_CMD				\
 	BOOTENV					\
 	"boot_scripts=ls2088ardb_boot.scr\0"	\
@@ -446,6 +458,11 @@ unsigned long get_board_sys_clk(void);
 			"fsl_mc lazyapply dpl 0x20d00000; "		\
 			"run distro_bootcmd;run qspi_bootcmd; "		\
 			"env exists secureboot && esbc_halt; "
+#elif defined(CONFIG_SD_BOOT)						\
+			"env exists mcinitcmd && run mcinitcmd "	\
+			"&& mmcinfo && mmc read 0x88000000 0x6800 0x800 " \
+			"&& fsl_mc apply dpl 0x88000000;"		\
+			"run distro_bootcmd;run sd_bootcmd"
 #else
 /* Try to boot an on-NOR kernel first, then do normal distro boot */
 #define CONFIG_BOOTCOMMAND						\
Signature · 1 line
2.14.1
#4 lore raw

PATCH 1/4 arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

In reply to Shengzhou Liu
Quoted 19 lines · Shengzhou Liu
---
  include/configs/ls1043a_common.h | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
include/configs/ls1043a_common.h +2 -0
index f064d5c24a..976c031574 100644
@@ -281,6 +281,8 @@
  	"fdt_addr_r=0x90000000\0"		\
  	"load_addr=0xa0000000\0"		\
  	"kernel_size=0x2800000\0"		\
+	"kernel_addr_sd=0x8000\0"		\
+	"kernel_size_sd=0x14000\0"		\
  	"console=ttyS0,115200\0"		\
  	"mtdparts=" MTDPARTS_DEFAULT "\0"	\
  	BOOTENV					\

include/configs/ls1043a_common.h line 328

Quoted 10 lines
include/configs/ls1043a_common.h +5 -1
@@ -318,12 +320,19 @@
  		"$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"
 

Shouldn't you be using "&&" instead of ";" between commands?

York

#5 lore raw

PATCH 1/4 arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

Quoted 24 lines · York Sun
Quoted 23 lines · Shengzhou Liu
---
  include/configs/ls1043a_common.h | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
include/configs/ls1043a_common.h +2 -1
index f064d5c24a..976c031574 100644
@@ -281,6 +281,8 @@
  	"fdt_addr_r=0x90000000\0"		\
  	"load_addr=0xa0000000\0"		\
  	"kernel_size=0x2800000\0"		\
+	"kernel_addr_sd=0x8000\0"		\
+	"kernel_size_sd=0x14000\0"		\
  	"console=ttyS0,115200\0"		\
  	"mtdparts=" MTDPARTS_DEFAULT "\0"	\
  	BOOTENV					\
@@ -318,12 +320,19 @@
  		"$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"
Quoted 9 lines

include/configs/ls1043a_common.h line 328

Quoted 6 lines
include/configs/ls1043a_common.h +5 -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"
 

Shouldn't you be using "&&" instead of ";" between commands?

Shengzhou,

Are you going to update the patches?

York

#6 lore raw

PATCH 1/4 arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

Quoted 35 lines · York Sun
Quoted 24 lines · York Sun
Quoted 23 lines · Shengzhou Liu
---
  include/configs/ls1043a_common.h | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
include/configs/ls1043a_common.h +2 -1
index f064d5c24a..976c031574 100644
@@ -281,6 +281,8 @@
  	"fdt_addr_r=0x90000000\0"		\
  	"load_addr=0xa0000000\0"		\
  	"kernel_size=0x2800000\0"		\
+	"kernel_addr_sd=0x8000\0"		\
+	"kernel_size_sd=0x14000\0"		\
  	"console=ttyS0,115200\0"		\
  	"mtdparts=" MTDPARTS_DEFAULT "\0"	\
  	BOOTENV					\
@@ -318,12 +320,19 @@
  		"$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"
Quoted 9 lines

include/configs/ls1043a_common.h line 328

Quoted 6 lines
include/configs/ls1043a_common.h +5 -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"
 

Shouldn't you be using "&&" instead of ";" between commands?

Quoted 3 lines

Shengzhou,

Are you going to update the patches?

Mingkai,

Do you need this change for LS1043ARDB? Please respond to my comment if so. Otherwise, I will drop this set.

York

#7 lore raw

PATCH 1/4 arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

Quoted 50 lines

-----Original Message-----
From: York Sun
Sent: Tuesday, October 31, 2017 2:45 AM
To: Mingkai Hu <[email protected]>
Cc: Shengzhou Liu <[email protected]>; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH 1/4] arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

Quoted 7 lines · York Sun
Quoted 6 lines · York Sun
Quoted 5 lines · Shengzhou Liu
---
  include/configs/ls1043a_common.h | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
include/configs/ls1043a_common.h +0 -0
index f064d5c24a..976c031574 100644
@@ -281,6 +281,8 @@
  	"fdt_addr_r=0x90000000\0"		\
  	"load_addr=0xa0000000\0"		\
Quoted 8 lines

include/configs/ls1043a_common.h line 320

Quoted 8 lines
include/configs/ls1043a_common.h +2 -0
  	"kernel_size=0x2800000\0"		\
+	"kernel_addr_sd=0x8000\0"		\
+	"kernel_size_sd=0x14000\0"		\
  	"console=ttyS0,115200\0"		\
  	"mtdparts=" MTDPARTS_DEFAULT "\0"	\
  	BOOTENV					\
@@ -318,12 +320,19 @@
  		"$kernel_addr $kernel_size && bootm

$load_addr#$board\0" \

Quoted 15 lines
Quoted 12 lines

include/configs/ls1043a_common.h line 328

Quoted 9 lines
include/configs/ls1043a_common.h +5 -1
  	"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"
 

Shouldn't you be using "&&" instead of ";" between commands?

Shengzhou,

Quoted 8 lines
Quoted 1 line

Are you going to update the patches?

Mingkai,

Do you need this change for LS1043ARDB? Please respond to my comment if so. Otherwise, I will drop this set.

York

Hi York,

This will be needed in order to keep consistent with our LSDK.

Thanks,
Mingkai

#8 lore raw

PATCH 1/4 arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

Quoted 67 lines

-----Original Message-----
From: Mingkai Hu
Sent: Wednesday, November 01, 2017 7:14 PM
To: York Sun <[email protected]>
Cc: Shengzhou Liu <[email protected]>; u-boot at lists.denx.de
Subject: RE: [U-Boot] [PATCH 1/4] arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

Quoted 46 lines

-----Original Message-----
From: York Sun
Sent: Tuesday, October 31, 2017 2:45 AM
To: Mingkai Hu <[email protected]>
Cc: Shengzhou Liu <[email protected]>; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH 1/4] arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

Quoted 7 lines · York Sun
Quoted 6 lines · York Sun
Quoted 5 lines · Shengzhou Liu
---
  include/configs/ls1043a_common.h | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
include/configs/ls1043a_common.h +0 -0
index f064d5c24a..976c031574 100644
@@ -281,6 +281,8 @@
  	"fdt_addr_r=0x90000000\0"		\
  	"load_addr=0xa0000000\0"		\
Quoted 8 lines

include/configs/ls1043a_common.h line 320

Quoted 8 lines
include/configs/ls1043a_common.h +2 -0
  	"kernel_size=0x2800000\0"		\
+	"kernel_addr_sd=0x8000\0"		\
+	"kernel_size_sd=0x14000\0"		\
  	"console=ttyS0,115200\0"		\
  	"mtdparts=" MTDPARTS_DEFAULT "\0"	\
  	BOOTENV					\
@@ -318,12 +320,19 @@
  		"$kernel_addr $kernel_size && bootm

$load_addr#$board\0" \

Quoted 13 lines
Quoted 12 lines

include/configs/ls1043a_common.h line 328

Quoted 9 lines
include/configs/ls1043a_common.h +5 -1
  	"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"
 

Shouldn't you be using "&&" instead of ";" between commands?

Quoted 7 lines
Quoted 3 lines

Shengzhou,

Are you going to update the patches?

Mingkai,

Do you need this change for LS1043ARDB? Please respond to my

comment

Quoted 2 lines

if so. Otherwise, I will drop this set.

Quoted 8 lines
Quoted 1 line

York

Hi York,

This will be needed in order to keep consistent with our LSDK.

Thanks,
Mingkai

York,
please drop this version, I will update it and send next new version to add distro secureboot together.

Thanks,
Shengzhou

#9 lore raw

PATCH 1/4 arm64: ls1043ardb: Add sd_bootcmd for distro fallback in case of sdboot

Quoted 4 lines · Shengzhou Liu

York,
please drop this version, I will update it and send next new version to add distro secureboot together.

Shengzhou,

Do not mark the patch as "superseded" if you haven't sent a new version. You can mark it as "Not Applicable" instead.

Thanks.

York