]> Git Repo - u-boot.git/commitdiff
ARM: stm32: Add update_sf script to install U-Boot into SF on DHSOM
authorMarek Vasut <[email protected]>
Sat, 13 Nov 2021 02:25:13 +0000 (03:25 +0100)
committerPatrice Chotard <[email protected]>
Tue, 30 Nov 2021 15:41:21 +0000 (16:41 +0100)
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. The
script erases the entire SPI NOR, including U-Boot environment,
to make sure the installation is clean. To retain environment
from current running U-Boot, run 'saveenv' after running the
'update_sf' script.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Reviewed-by: Patrice Chotard <[email protected]>
Reviewed-by: Patrick Delaunay <[email protected]>
include/configs/stm32mp15_dh_dhsom.h

index bac9e8388a7e6f5be4f2120d0bbaa63a46ced0b1..b68e153f10b4653217071594c03eca8f42acf766 100644 (file)
@@ -9,7 +9,17 @@
 #define __CONFIG_STM32MP15_DH_DHSOM_H__
 
 #define STM32MP_BOARD_EXTRA_ENV \
-       "usb_pgood_delay=1000\0"
+       "usb_pgood_delay=1000\0" \
+       "update_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} && "                     \
+               "load mmc 0:4 ${loadaddr} /boot/u-boot.itb && "         \
+               "sf probe && sf erase 0 0x200000 && "                   \
+               "sf update ${loadaddr1} 0 ${filesize1} && "             \
+               "sf update ${loadaddr1} 0x40000 ${filesize1} && "       \
+               "sf update ${loadaddr} 0x80000 ${filesize} && "         \
+               "env set filesize1 && env set loadaddr1\0"
 
 #include <configs/stm32mp15_common.h>
 
This page took 0.036201 seconds and 4 git commands to generate.