Skip to contentSkip to conversation

ARM: stm32: Rename update_sf to dh_update_sd_to_sf on STM32MP15xx DHCOR

PATCH In review Marek Vasut 2 participants 6 messages Oct 2, 2023 – Oct 4, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: stm32: Rename update_sf to dh_update_sd_to_sf on STM32MP15xx DHCOR

Align the script name with DH i.MX8MP DHCOM script name. Add backward compatibility script to avoid breaking user scripts.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/configs/stm32mp15_dh_dhsom.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/configs/stm32mp15_dh_dhsom.h +4 -2
index 91921690624..c7ebf5cd180 100644
@@ -20,7 +20,7 @@
 
 #define STM32MP_BOARD_EXTRA_ENV \
 	"usb_pgood_delay=1000\0" \
-	"update_sf=" /* Erase SPI NOR and install U-Boot from SD */	\
+	"dh_update_sd_to_sf=" /* Erase SPI NOR and install U-Boot from SD */ \
 		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
 		"load mmc 0:4 ${loadaddr1} /boot/u-boot-spl.stm32 && "	\
 		"env set filesize1 ${filesize} && "			\
@@ -29,7 +29,9 @@
 		"sf update ${loadaddr1} 0 ${filesize1} && "		\
 		"sf update ${loadaddr1} 0x40000 ${filesize1} && "	\
 		"sf update ${loadaddr} 0x80000 ${filesize} && "		\
-		"env set filesize1 && env set loadaddr1\0"
+		"env set filesize1 && env set loadaddr1\0"		\
+	"update_sf=run dh_update_sd_to_sf\0"
+
 
 #include <configs/stm32mp15_common.h>
 
Signature · 1 line
2.40.1
#1 lore raw

PATCH 2/2 ARM: stm32: Add dh_update_sd_to_emmc to STM32MP15xx DHCOR

Add script which installs U-Boot binaries from SD card to eMMC and makes the eMMC bootable.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/configs/stm32mp15_dh_dhsom.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/configs/stm32mp15_dh_dhsom.h +19 -0
index c7ebf5cd180..8ff882264f4 100644
@@ -20,6 +20,25 @@
 
 #define STM32MP_BOARD_EXTRA_ENV \
 	"usb_pgood_delay=1000\0" \
+	"dh_update_sd_to_emmc=" /* Install U-Boot from SD to eMMC */	\
+		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
+		"load mmc 0:4 ${loadaddr1} boot/u-boot-spl.stm32 && "	\
+		"setexpr sblkcnt ${filesize} + 0x1ff && "		\
+		"setexpr sblkcnt ${sblkcnt} / 0x200 && "		\
+		"load mmc 0:4 ${loadaddr} boot/u-boot.itb && "		\
+		"setexpr ublkcnt ${filesize} + 0x1ff && "		\
+		"setexpr ublkcnt ${ublkcnt} / 0x200 && "		\
+		"mmc partconf 1 1 1 1 && mmc dev 1 1 && "		\
+		"mmc write ${loadaddr1} 0 ${sblkcnt} && "		\
+		"mmc dev 1 2 && "					\
+		"mmc write ${loadaddr1} 0 ${sblkcnt} && "		\
+		"mmc dev 1 && "						\
+		"gpt write mmc 1 'name=ssbl,size=2MiB' && "		\
+		"mmc write ${loadaddr} 0x22 ${ublkcnt} && "		\
+		"mmc partconf 1 1 1 0 && "				\
+		"setenv loadaddr1 && "					\
+		"setenv sblkcnt && "					\
+		"setenv ublkcnt\0"					\
 	"dh_update_sd_to_sf=" /* Erase SPI NOR and install U-Boot from SD */ \
 		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
 		"load mmc 0:4 ${loadaddr1} /boot/u-boot-spl.stm32 && "	\
Signature · 1 line
2.40.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ARM: stm32: Add dh_update_sd_to_emmc to STM32MP15xx DHCOR

Quoted 34 lines · Marek Vasut

Add script which installs U-Boot binaries from SD card to eMMC and makes the eMMC bootable.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/configs/stm32mp15_dh_dhsom.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/configs/stm32mp15_dh_dhsom.h +12 -0
index c7ebf5cd180..8ff882264f4 100644
@@ -20,6 +20,25 @@
 
 #define STM32MP_BOARD_EXTRA_ENV \
 	"usb_pgood_delay=1000\0" \
+	"dh_update_sd_to_emmc=" /* Install U-Boot from SD to eMMC */	\
+		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
+		"load mmc 0:4 ${loadaddr1} boot/u-boot-spl.stm32 && "	\
+		"setexpr sblkcnt ${filesize} + 0x1ff && "		\
+		"setexpr sblkcnt ${sblkcnt} / 0x200 && "		\
+		"load mmc 0:4 ${loadaddr} boot/u-boot.itb && "		\
+		"setexpr ublkcnt ${filesize} + 0x1ff && "		\
+		"setexpr ublkcnt ${ublkcnt} / 0x200 && "		\
+		"mmc partconf 1 1 1 1 && mmc dev 1 1 && "		\
+		"mmc write ${loadaddr1} 0 ${sblkcnt} && "		\
+		"mmc dev 1 2 && "					\
+		"mmc write ${loadaddr1} 0 ${sblkcnt} && "		\

include/configs/stm32mp15_dh_dhsom.h line 44

Quoted 10 lines
include/configs/stm32mp15_dh_dhsom.h +7 -0
+		"mmc dev 1 && "						\
+		"gpt write mmc 1 'name=ssbl,size=2MiB' && "		\
+		"mmc write ${loadaddr} 0x22 ${ublkcnt} && "		\
+		"mmc partconf 1 1 1 0 && "				\
+		"setenv loadaddr1 && "					\
+		"setenv sblkcnt && "					\
+		"setenv ublkcnt\0"					\
 	"dh_update_sd_to_sf=" /* Erase SPI NOR and install U-Boot from SD */ \
 		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
 		"load mmc 0:4 ${loadaddr1} /boot/u-boot-spl.stm32 && "	\

Hi Marek

Thanks
Patrice

#3 lore raw

Re: [PATCH 2/2] ARM: stm32: Add dh_update_sd_to_emmc to STM32MP15xx DHCOR

Quoted 49 lines · Patrice CHOTARD
Quoted 34 lines · Marek Vasut

Add script which installs U-Boot binaries from SD card to eMMC and makes the eMMC bootable.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/configs/stm32mp15_dh_dhsom.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/configs/stm32mp15_dh_dhsom.h +12 -0
index c7ebf5cd180..8ff882264f4 100644
@@ -20,6 +20,25 @@
 
 #define STM32MP_BOARD_EXTRA_ENV \
 	"usb_pgood_delay=1000\0" \
+	"dh_update_sd_to_emmc=" /* Install U-Boot from SD to eMMC */	\
+		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
+		"load mmc 0:4 ${loadaddr1} boot/u-boot-spl.stm32 && "	\
+		"setexpr sblkcnt ${filesize} + 0x1ff && "		\
+		"setexpr sblkcnt ${sblkcnt} / 0x200 && "		\
+		"load mmc 0:4 ${loadaddr} boot/u-boot.itb && "		\
+		"setexpr ublkcnt ${filesize} + 0x1ff && "		\
+		"setexpr ublkcnt ${ublkcnt} / 0x200 && "		\
+		"mmc partconf 1 1 1 1 && mmc dev 1 1 && "		\
+		"mmc write ${loadaddr1} 0 ${sblkcnt} && "		\
+		"mmc dev 1 2 && "					\
+		"mmc write ${loadaddr1} 0 ${sblkcnt} && "		\

include/configs/stm32mp15_dh_dhsom.h line 44

Quoted 10 lines
include/configs/stm32mp15_dh_dhsom.h +7 -0
+		"mmc dev 1 && "						\
+		"gpt write mmc 1 'name=ssbl,size=2MiB' && "		\
+		"mmc write ${loadaddr} 0x22 ${ublkcnt} && "		\
+		"mmc partconf 1 1 1 0 && "				\
+		"setenv loadaddr1 && "					\
+		"setenv sblkcnt && "					\
+		"setenv ublkcnt\0"					\
 	"dh_update_sd_to_sf=" /* Erase SPI NOR and install U-Boot from SD */ \
 		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
 		"load mmc 0:4 ${loadaddr1} /boot/u-boot-spl.stm32 && "	\

Hi Marek

Quoted 4 lines

Thanks
Patrice

Apply on stm32/next

Thanks
Patrice

Reviewed-by on v1 1/2
#4 lore raw
In reply to Marek Vasut
Quoted 28 lines · Marek Vasut

Align the script name with DH i.MX8MP DHCOM script name. Add backward compatibility script to avoid breaking user scripts.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/configs/stm32mp15_dh_dhsom.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/configs/stm32mp15_dh_dhsom.h +1 -1
index 91921690624..c7ebf5cd180 100644
@@ -20,7 +20,7 @@
 
 #define STM32MP_BOARD_EXTRA_ENV \
 	"usb_pgood_delay=1000\0" \
-	"update_sf=" /* Erase SPI NOR and install U-Boot from SD */	\
+	"dh_update_sd_to_sf=" /* Erase SPI NOR and install U-Boot from SD */ \
 		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
 		"load mmc 0:4 ${loadaddr1} /boot/u-boot-spl.stm32 && "	\
 		"env set filesize1 ${filesize} && "			\

include/configs/stm32mp15_dh_dhsom.h line 37

Quoted 10 lines
include/configs/stm32mp15_dh_dhsom.h +3 -1
@@ -29,7 +29,9 @@
 		"sf update ${loadaddr1} 0 ${filesize1} && "		\
 		"sf update ${loadaddr1} 0x40000 ${filesize1} && "	\
 		"sf update ${loadaddr} 0x80000 ${filesize} && "		\
-		"env set filesize1 && env set loadaddr1\0"
+		"env set filesize1 && env set loadaddr1\0"		\
+	"update_sf=run dh_update_sd_to_sf\0"
+
 
 #include <configs/stm32mp15_common.h>
 

Hi Marek

Thanks
Patrice

#5 lore raw
Quoted 44 lines · Patrice CHOTARD
Quoted 28 lines · Marek Vasut

Align the script name with DH i.MX8MP DHCOM script name. Add backward compatibility script to avoid breaking user scripts.

---
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 include/configs/stm32mp15_dh_dhsom.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/configs/stm32mp15_dh_dhsom.h +1 -1
index 91921690624..c7ebf5cd180 100644
@@ -20,7 +20,7 @@
 
 #define STM32MP_BOARD_EXTRA_ENV \
 	"usb_pgood_delay=1000\0" \
-	"update_sf=" /* Erase SPI NOR and install U-Boot from SD */	\
+	"dh_update_sd_to_sf=" /* Erase SPI NOR and install U-Boot from SD */ \
 		"setexpr loadaddr1 ${loadaddr} + 0x1000000 && "		\
 		"load mmc 0:4 ${loadaddr1} /boot/u-boot-spl.stm32 && "	\
 		"env set filesize1 ${filesize} && "			\

include/configs/stm32mp15_dh_dhsom.h line 37

Quoted 10 lines
include/configs/stm32mp15_dh_dhsom.h +3 -1
@@ -29,7 +29,9 @@
 		"sf update ${loadaddr1} 0 ${filesize1} && "		\
 		"sf update ${loadaddr1} 0x40000 ${filesize1} && "	\
 		"sf update ${loadaddr} 0x80000 ${filesize} && "		\
-		"env set filesize1 && env set loadaddr1\0"
+		"env set filesize1 && env set loadaddr1\0"		\
+	"update_sf=run dh_update_sd_to_sf\0"
+
 
 #include <configs/stm32mp15_common.h>
 

Hi Marek

Quoted 4 lines

Thanks
Patrice

Apply on stm32/next

Thanks
Patrice