summaryrefslogtreecommitdiff
path: root/include/configs/stm32mp1.h
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2018-03-20 10:54:54 +0100
committerTom Rini <trini@konsulko.com>2018-04-06 20:45:28 -0400
commit11dfd1a331e915b17f3dd25c4ca98382d400719e (patch)
tree7184ceb7682e49405c1a00dda1d1eb1f646c20ab /include/configs/stm32mp1.h
parent08772f6e79af7b5e7ce4a7f230b7d6f69352a8ec (diff)
stm32mp1: select boot device and partition
Bootrom loads SPL from SDCARD or eMMC according BootPin selection. Then SPL loads U-Boot on the same mmc device with the following predefined GPT partitioning: on SDCARD: gpt partitioning 1: SPL 2: SPL#2 3: U-Boot 4: bootable partition on eMMC: The 2 boot partitions are used for SPL (2 copy) boot1: SPL boot2: SPL#2 The user partition use gpt partitioning 1: U-Boot 2: bootable partition This patch select the correct SPL partition (3 for SDCARD on mmc0 and 1 for eMMC on mmc1) according the BootRom information saved in TAMP register and based on configuration flasg: - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION => for BOOT_DEVICE_MMC1 or mmc 0 in U-Boot - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2 (new) => for BOOT_DEVICE_MMC2 or mmc 1 in U-Boot And the correct boot_targets is selected according the environment variables boot_device and boot_instance, with preboot command, to search the bootable partition with kernel on this device (generic distro support). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'include/configs/stm32mp1.h')
-rw-r--r--include/configs/stm32mp1.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h
index 6281dd5387..815910128e 100644
--- a/include/configs/stm32mp1.h
+++ b/include/configs/stm32mp1.h
@@ -82,6 +82,12 @@
#include <config_distro_bootcmd.h>
+#define STM32MP_PREBOOT \
+ "echo \"Boot over ${boot_device}${boot_instance}!\"; " \
+ "if test \"${boot_device}\" = \"mmc\"; then " \
+ "env set boot_targets \"mmc${boot_instance}\"; "\
+ "fi;"
+
#define CONFIG_EXTRA_ENV_SETTINGS \
"scriptaddr=0xC0000000\0" \
"pxefile_addr_r=0xC0000000\0" \
@@ -90,6 +96,7 @@
"ramdisk_addr_r=0xC4100000\0" \
"fdt_high=0xffffffff\0" \
"initrd_high=0xffffffff\0" \
+ "preboot=" STM32MP_PREBOOT "\0" \
BOOTENV
#endif /* ifndef CONFIG_SPL_BUILD */