diff --git a/boot/zephyr/boards/b_u585i_iot02a.conf b/boot/zephyr/boards/b_u585i_iot02a.conf new file mode 100644 index 0000000000..7a89dffe67 --- /dev/null +++ b/boot/zephyr/boards/b_u585i_iot02a.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y diff --git a/boot/zephyr/boards/nucleo_h7s3l8.conf b/boot/zephyr/boards/nucleo_h7s3l8.conf new file mode 100644 index 0000000000..93013ed9a1 --- /dev/null +++ b/boot/zephyr/boards/nucleo_h7s3l8.conf @@ -0,0 +1,4 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y +CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n +CONFIG_BOOT_MAX_IMG_SECTORS=4096 diff --git a/boot/zephyr/boards/stm32f746g_disco.conf b/boot/zephyr/boards/stm32f746g_disco.conf new file mode 100644 index 0000000000..7a89dffe67 --- /dev/null +++ b/boot/zephyr/boards/stm32f746g_disco.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y diff --git a/boot/zephyr/boards/stm32h573i_dk.conf b/boot/zephyr/boards/stm32h573i_dk.conf new file mode 100644 index 0000000000..93013ed9a1 --- /dev/null +++ b/boot/zephyr/boards/stm32h573i_dk.conf @@ -0,0 +1,4 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y +CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n +CONFIG_BOOT_MAX_IMG_SECTORS=4096 diff --git a/boot/zephyr/boards/stm32h735g_disco.conf b/boot/zephyr/boards/stm32h735g_disco.conf new file mode 100644 index 0000000000..7a89dffe67 --- /dev/null +++ b/boot/zephyr/boards/stm32h735g_disco.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y diff --git a/boot/zephyr/boards/stm32h747i_disco_m7.conf b/boot/zephyr/boards/stm32h747i_disco_m7.conf new file mode 100644 index 0000000000..7a89dffe67 --- /dev/null +++ b/boot/zephyr/boards/stm32h747i_disco_m7.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y diff --git a/boot/zephyr/boards/stm32h750b_dk.conf b/boot/zephyr/boards/stm32h750b_dk.conf new file mode 100644 index 0000000000..7a89dffe67 --- /dev/null +++ b/boot/zephyr/boards/stm32h750b_dk.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y diff --git a/boot/zephyr/boards/stm32h7b3i_dk.conf b/boot/zephyr/boards/stm32h7b3i_dk.conf new file mode 100644 index 0000000000..7a89dffe67 --- /dev/null +++ b/boot/zephyr/boards/stm32h7b3i_dk.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y diff --git a/boot/zephyr/boards/stm32h7s78_dk.conf b/boot/zephyr/boards/stm32h7s78_dk.conf new file mode 100644 index 0000000000..93013ed9a1 --- /dev/null +++ b/boot/zephyr/boards/stm32h7s78_dk.conf @@ -0,0 +1,4 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y +CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n +CONFIG_BOOT_MAX_IMG_SECTORS=4096 diff --git a/boot/zephyr/boards/stm32l496g_disco.conf b/boot/zephyr/boards/stm32l496g_disco.conf new file mode 100644 index 0000000000..7a89dffe67 --- /dev/null +++ b/boot/zephyr/boards/stm32l496g_disco.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_DIRECT_XIP=y +CONFIG_STM32_MEMMAP=y diff --git a/boot/zephyr/flash_map_extended.c b/boot/zephyr/flash_map_extended.c index 4a29750f75..3922b4f99e 100644 --- a/boot/zephyr/flash_map_extended.c +++ b/boot/zephyr/flash_map_extended.c @@ -20,7 +20,23 @@ BOOT_LOG_MODULE_DECLARE(mcuboot); -#if (!defined(CONFIG_XTENSA) && DT_HAS_CHOSEN(zephyr_flash_controller)) +#if defined(CONFIG_STM32_MEMMAP) +/* MEMORY MAPPED for XiP on external NOR flash takes the sspi-nor or ospi-nor or qspi-nor device */ +#define FLASH_DEVICE_ID SPI_FLASH_0_ID +#if DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_xspi_nor), okay) +#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_xspi_nor) +#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_xspi),1) +#elif DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_ospi_nor), okay) +#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_ospi_nor) +#define FLASH_DEVICE_BASE DT_REG_ADDR(DT_INST(0, st_stm32_ospi_nor)) +#elif DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_qspi_nor), okay) +#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_qspi_nor) +#define FLASH_DEVICE_BASE DT_REG_ADDR(DT_INST(0, st_stm32_qspi_nor)) +#else +#error "FLASH_DEVICE_NODE could not be determined" +#endif + +#elif (!defined(CONFIG_XTENSA) && DT_HAS_CHOSEN(zephyr_flash_controller)) #define FLASH_DEVICE_ID SOC_FLASH_0_ID #define FLASH_DEVICE_BASE CONFIG_FLASH_BASE_ADDRESS #define FLASH_DEVICE_NODE DT_CHOSEN(zephyr_flash_controller)