aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2021-11-13 03:25:13 +0100
committerPatrice Chotard <patrice.chotard@foss.st.com>2021-12-13 14:33:53 +0100
commit44beea28456fc17b6b5137f0104b625d8741a5c6 (patch)
treed2216bfb80a7f04fbe402ad6c49cd166a52b6181 /include
parente8e66801bd512eb1e4c14efca34b7b254ad26110 (diff)
downloadu-boot-44beea28456fc17b6b5137f0104b625d8741a5c6.zip
u-boot-44beea28456fc17b6b5137f0104b625d8741a5c6.tar.gz
u-boot-44beea28456fc17b6b5137f0104b625d8741a5c6.tar.bz2
ARM: stm32: Add update_sf script to install U-Boot into SF on DHSOM
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 <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Diffstat (limited to 'include')
-rw-r--r--include/configs/stm32mp15_dh_dhsom.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/configs/stm32mp15_dh_dhsom.h b/include/configs/stm32mp15_dh_dhsom.h
index bac9e83..b68e153 100644
--- a/include/configs/stm32mp15_dh_dhsom.h
+++ b/include/configs/stm32mp15_dh_dhsom.h
@@ -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>