Skip to contentSkip to conversation

ARM: imx6: dh-imx6: Use sf update instead of sf erase and write

PATCH In review Marek Vasut 3 participants 3 messages Sep 28, 2022 – Oct 21, 2022 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx6: dh-imx6: Use sf update instead of sf erase and write

With sf update fixed to support unaligned start offset, use plain sf update to update the bootloader in SPI NOR. This also helps avoid the case where not enough SPI NOR has been erased and the bootloader has been written to unerased area, and thus corrupted.

---
Cc: Fabio Estevam <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Stefano Babic <[email protected]>

---
 include/configs/dh_imx6.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/configs/dh_imx6.h +1 -2
index 0f7e1c5c451..2040deb2b87 100644
@@ -60,8 +60,7 @@
 	"fdtfile=imx6q-dhcom-pdk2.dtb\0"\
 	"update_sf=" /* Erase SPI NOR and install U-Boot from SD */	\
 		"load mmc 0:1 ${loadaddr} /boot/u-boot-with-spl.imx && "\
-		"sf probe && sf erase 0x0 0x100000 && "			\
-		"sf write ${loadaddr} 0x400 ${filesize}\0"		\
+		"sf probe && sf update ${loadaddr} 0x400 ${filesize}\0"	\
 	BOOTENV
 
 #define BOOT_TARGET_DEVICES(func) \
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Marek Vasut

With sf update fixed to support unaligned start offset, use plain sf update to update the bootloader in SPI NOR. This also helps avoid the case where not enough SPI NOR has been erased and the bootloader has been written to unerased area, and thus corrupted.

---
Cc: Fabio Estevam <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Stefano Babic <[email protected]>

---
  include/configs/dh_imx6.h | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
include/configs/dh_imx6.h +0 -0
index 0f7e1c5c451..2040deb2b87 100644

include/configs/dh_imx6.h line 66

Quoted 9 lines
include/configs/dh_imx6.h +1 -2
@@ -60,8 +60,7 @@
  	"fdtfile=imx6q-dhcom-pdk2.dtb\0"\
  	"update_sf=" /* Erase SPI NOR and install U-Boot from SD */	\
  		"load mmc 0:1 ${loadaddr} /boot/u-boot-with-spl.imx && "\
-		"sf probe && sf erase 0x0 0x100000 && "			\
-		"sf write ${loadaddr} 0x400 ${filesize}\0"		\
+		"sf probe && sf update ${loadaddr} 0x400 ${filesize}\0"	\
  	BOOTENV
 
  #define BOOT_TARGET_DEVICES(func) \
#2 lore raw

PATCH 1/1 ARM: imx6: dh-imx6: Use sf update instead of sf erase and write

In reply to Marek Vasut
Quoted 6 lines

With sf update fixed to support unaligned start offset, use plain sf update to update the bootloader in SPI NOR. This also helps avoid the case where not enough SPI NOR has been erased and the bootloader has been written to unerased area, and thus corrupted.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================