Skip to contentSkip to conversation

ARM: imx6: dh-imx6: Add update_sf script to install U-Boot into SF

PATCH In review Marek Vasut 3 participants 3 messages Nov 28, 2021 – Jan 15, 2022 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx6: dh-imx6: Add update_sf script to install U-Boot into SF

Add script to read U-Boot from SD card and write it to matching locations in the SPI NOR, thus making the SPI NOR bootable.

Cc Christoph Niedermaier <[email protected]>
Cc Stefano Babic <[email protected]>
---
 include/configs/dh_imx6.h | 4 ++++
 1 file changed, 4 insertions(+)
include/configs/dh_imx6.h +4 -0
index ee56eb691ad..8183e7debd4 100644
@@ -82,6 +82,10 @@
 	"ramdisk_addr_r=0x18000000\0"	\
 	"scriptaddr=0x14000000\0"	\
 	"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 0xa0000 && "			\
+		"sf write ${loadaddr} 0x400 ${filesize}\0"		\
 	BOOTENV
 
 #define CONFIG_BOOTCOMMAND		"run distro_bootcmd"
Signature · 1 line
2.33.0
Acked-by Peng Fan on v1 1/1
#1 lore raw
Quoted 6 lines · Marek Vasut

Add script to read U-Boot from SD card and write it to matching locations in the SPI NOR, thus making the SPI NOR bootable.

Cc Christoph Niedermaier <[email protected]>
Cc Stefano Babic <[email protected]>
Quoted 20 lines
---
  include/configs/dh_imx6.h | 4 ++++
  1 file changed, 4 insertions(+)
include/configs/dh_imx6.h +4 -0
index ee56eb691ad..8183e7debd4 100644
@@ -82,6 +82,10 @@
  	"ramdisk_addr_r=0x18000000\0"	\
  	"scriptaddr=0x14000000\0"	\
  	"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 0xa0000 && "			\
+		"sf write ${loadaddr} 0x400 ${filesize}\0"		\
  	BOOTENV
 
  #define CONFIG_BOOTCOMMAND		"run distro_bootcmd"