From f8c03cf178480914aa4570d0fcdf03a29133333d Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Fri, 19 Jul 2024 12:50:58 +1000 Subject: [PATCH 1/5] boot: zephyr: don't disable `MULTITHREADING` The documentation on the `MULTITHREADING` symbol states that ``` If you know for sure that your hardware will work, you can default it to n here. ``` Defaulting the entire Nordic user base to `n` here is a huge statement that all Nordic hardware will work without `MULTITHREADING`, which is somewhat undermined by all of the board overlays that have to turn it back on again in order to get basic features working (USB recovery, images on SPI or QSPI flash). Disable it again in the `nrf52_minimal_footprint.conf` sample, as that is obviously intended to showcase the minimal footprint possible. Leave it disabled for the `SOC_SERIES_NRF51X`, as the default boot sector partitions for that SoC are small enough to require it. Signed-off-by: Jordan Yates --- boot/zephyr/Kconfig | 2 +- boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf | 2 -- boot/zephyr/boards/actinius_icarus_nrf9160.conf | 2 -- boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf | 2 -- boot/zephyr/boards/actinius_icarus_som_nrf9160.conf | 2 -- boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf | 1 - boot/zephyr/boards/circuitdojo_feather_nrf9160.conf | 3 --- boot/zephyr/boards/conexio_stratus.conf | 3 --- boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf | 1 - boot/zephyr/boards/nrf52840dongle_nrf52840.conf | 3 --- boot/zephyr/boards/nrf52_minimal_footprint.conf | 3 +++ boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf | 1 - boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf | 3 --- boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf | 1 - 14 files changed, 4 insertions(+), 25 deletions(-) diff --git a/boot/zephyr/Kconfig b/boot/zephyr/Kconfig index effedfb4f..93ee918b8 100644 --- a/boot/zephyr/Kconfig +++ b/boot/zephyr/Kconfig @@ -748,8 +748,8 @@ comment "Zephyr configuration options" config MULTITHREADING default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING default y if BOOT_USB_DFU_GPIO || BOOT_USB_DFU_WAIT - default n if SOC_FAMILY_NORDIC_NRF default n if SOC_FAMILY_ESPRESSIF_ESP32 && MCUBOOT + default n if SOC_SERIES_NRF51X # Minimal flash available default y config LOG_PROCESS_THREAD diff --git a/boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf b/boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf index 2d4f00914..ae2fa1e42 100644 --- a/boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf +++ b/boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf @@ -6,5 +6,3 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y - -CONFIG_MULTITHREADING=y diff --git a/boot/zephyr/boards/actinius_icarus_nrf9160.conf b/boot/zephyr/boards/actinius_icarus_nrf9160.conf index 2d4f00914..ae2fa1e42 100644 --- a/boot/zephyr/boards/actinius_icarus_nrf9160.conf +++ b/boot/zephyr/boards/actinius_icarus_nrf9160.conf @@ -6,5 +6,3 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y - -CONFIG_MULTITHREADING=y diff --git a/boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf b/boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf index 2d4f00914..ae2fa1e42 100644 --- a/boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf +++ b/boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf @@ -6,5 +6,3 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y - -CONFIG_MULTITHREADING=y diff --git a/boot/zephyr/boards/actinius_icarus_som_nrf9160.conf b/boot/zephyr/boards/actinius_icarus_som_nrf9160.conf index 2d4f00914..ae2fa1e42 100644 --- a/boot/zephyr/boards/actinius_icarus_som_nrf9160.conf +++ b/boot/zephyr/boards/actinius_icarus_som_nrf9160.conf @@ -6,5 +6,3 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y - -CONFIG_MULTITHREADING=y diff --git a/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf b/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf index 00a8dfb46..657a98415 100644 --- a/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf +++ b/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf @@ -1,4 +1,3 @@ -CONFIG_MULTITHREADING=y # Enable QSPI (MX25R64) - Slot 1 in QSPI CONFIG_NORDIC_QSPI_NOR=y CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 diff --git a/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf b/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf index c23f92ca0..e95d11625 100644 --- a/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf +++ b/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf @@ -1,9 +1,6 @@ # Disable Zephyr console CONFIG_CONSOLE=n -# Multithreading -CONFIG_MULTITHREADING=y - # MCUBoot settings CONFIG_BOOT_MAX_IMG_SECTORS=256 diff --git a/boot/zephyr/boards/conexio_stratus.conf b/boot/zephyr/boards/conexio_stratus.conf index 79ba798e7..d25675381 100644 --- a/boot/zephyr/boards/conexio_stratus.conf +++ b/boot/zephyr/boards/conexio_stratus.conf @@ -3,9 +3,6 @@ CONFIG_CONSOLE=n CONFIG_CONSOLE_HANDLER=n CONFIG_UART_CONSOLE=n -# Multithreading -CONFIG_MULTITHREADING=y - # MCUBoot settings CONFIG_BOOT_MAX_IMG_SECTORS=256 diff --git a/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf b/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf index 9f984be4f..5f3b7808b 100644 --- a/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf +++ b/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf @@ -1,2 +1 @@ -CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 diff --git a/boot/zephyr/boards/nrf52840dongle_nrf52840.conf b/boot/zephyr/boards/nrf52840dongle_nrf52840.conf index d219f351d..abb13174b 100644 --- a/boot/zephyr/boards/nrf52840dongle_nrf52840.conf +++ b/boot/zephyr/boards/nrf52840dongle_nrf52840.conf @@ -15,9 +15,6 @@ CONFIG_GPIO=y CONFIG_MCUBOOT_SERIAL=y CONFIG_BOOT_SERIAL_CDC_ACM=y -# Required by USB -CONFIG_MULTITHREADING=y - # USB CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_REMOTE_WAKEUP=n diff --git a/boot/zephyr/boards/nrf52_minimal_footprint.conf b/boot/zephyr/boards/nrf52_minimal_footprint.conf index a290312be..08cb251d0 100644 --- a/boot/zephyr/boards/nrf52_minimal_footprint.conf +++ b/boot/zephyr/boards/nrf52_minimal_footprint.conf @@ -26,6 +26,9 @@ CONFIG_THREAD_STACK_INFO=n # CONFIG_TICKLESS_KERNEL is not set CONFIG_FLASH=y +# Multithreading +CONFIG_MULTITHREADING=n + CONFIG_CONSOLE=n CONFIG_DEBUG=n CONFIG_EARLY_CONSOLE=n diff --git a/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf b/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf index 00a8dfb46..657a98415 100644 --- a/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf +++ b/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf @@ -1,4 +1,3 @@ -CONFIG_MULTITHREADING=y # Enable QSPI (MX25R64) - Slot 1 in QSPI CONFIG_NORDIC_QSPI_NOR=y CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 diff --git a/boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf b/boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf index c23f92ca0..e95d11625 100644 --- a/boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf +++ b/boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf @@ -1,9 +1,6 @@ # Disable Zephyr console CONFIG_CONSOLE=n -# Multithreading -CONFIG_MULTITHREADING=y - # MCUBoot settings CONFIG_BOOT_MAX_IMG_SECTORS=256 diff --git a/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf b/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf index f2e42fd64..19925152d 100644 --- a/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf +++ b/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf @@ -1,3 +1,2 @@ CONFIG_NORDIC_QSPI_NOR=n CONFIG_SPI=n -CONFIG_MULTITHREADING=y From fb7ac6cb4ff62d9218c46e17ccd5dc8a3d82e125 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Fri, 19 Jul 2024 12:59:29 +1000 Subject: [PATCH 2/5] boot: zephyr: boards: remove `MULTITHREADING`casualties Remove configuration overrides that were only specified to compile with `MULTITHREADING=n`. Signed-off-by: Jordan Yates --- boot/zephyr/boards/nrf9161dk_nrf9161_0_7_0.conf | 1 - boot/zephyr/boards/thingy52_nrf52832.conf | 1 - boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf | 2 -- 3 files changed, 4 deletions(-) delete mode 100644 boot/zephyr/boards/nrf9161dk_nrf9161_0_7_0.conf delete mode 100644 boot/zephyr/boards/thingy52_nrf52832.conf delete mode 100644 boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf diff --git a/boot/zephyr/boards/nrf9161dk_nrf9161_0_7_0.conf b/boot/zephyr/boards/nrf9161dk_nrf9161_0_7_0.conf deleted file mode 100644 index c4ce81acc..000000000 --- a/boot/zephyr/boards/nrf9161dk_nrf9161_0_7_0.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_NOR=n diff --git a/boot/zephyr/boards/thingy52_nrf52832.conf b/boot/zephyr/boards/thingy52_nrf52832.conf deleted file mode 100644 index cf4c34c43..000000000 --- a/boot/zephyr/boards/thingy52_nrf52832.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_GPIO_SX1509B=n diff --git a/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf b/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf deleted file mode 100644 index 19925152d..000000000 --- a/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_NORDIC_QSPI_NOR=n -CONFIG_SPI=n From f3faa8eb860bf8c1485775967cda9a5ee3919ba3 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Fri, 19 Jul 2024 14:05:49 +1000 Subject: [PATCH 3/5] boot: zephyr: automatically configure `BOOT_MAX_IMG_SECTORS` Set valid defaults for `BOOT_MAX_IMG_SECTORS` based on the size of the primary image that MCUboot is expecting. Signed-off-by: Jordan Yates --- boot/zephyr/Kconfig | 6 +++++- boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf | 3 --- boot/zephyr/boards/actinius_icarus_nrf9160.conf | 3 --- boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf | 3 --- boot/zephyr/boards/actinius_icarus_som_nrf9160.conf | 3 --- boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf | 1 - boot/zephyr/boards/circuitdojo_feather_nrf9160.conf | 3 --- boot/zephyr/boards/conexio_stratus.conf | 3 --- boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf | 1 - boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 2 -- boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf | 1 - boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf | 3 --- 12 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf diff --git a/boot/zephyr/Kconfig b/boot/zephyr/Kconfig index 93ee918b8..397309f8a 100644 --- a/boot/zephyr/Kconfig +++ b/boot/zephyr/Kconfig @@ -382,12 +382,16 @@ config BOOT_ENCRYPTION_KEY_FILE config BOOT_MAX_IMG_SECTORS int "Maximum number of sectors per image slot" + default 512 if $(dt_nodelabel_reg_size_int,slot0_partition) > 1048576 + default 256 if $(dt_nodelabel_reg_size_int,slot0_partition) > 524288 default 128 help This option controls the maximum number of sectors that each of the two image areas can contain. Smaller values reduce MCUboot's memory usage; larger values allow it to support larger images. - If unsure, leave at the default value. + If unsure, leave at the default value. The required condition is + that (IMAGE_SIZE <= (BOOT_MAX_IMG_SECTORS * SECTOR_SIZE)). The + defaults are configured for a SECTOR_SIZE of 4096. config BOOT_SHARE_BACKEND_AVAILABLE bool diff --git a/boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf b/boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf index ae2fa1e42..11142f5a7 100644 --- a/boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf +++ b/boot/zephyr/boards/actinius_icarus_bee_nrf9160.conf @@ -1,8 +1,5 @@ # Disable Zephyr console CONFIG_CONSOLE=n -# MCUBoot settings -CONFIG_BOOT_MAX_IMG_SECTORS=256 - # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y diff --git a/boot/zephyr/boards/actinius_icarus_nrf9160.conf b/boot/zephyr/boards/actinius_icarus_nrf9160.conf index ae2fa1e42..11142f5a7 100644 --- a/boot/zephyr/boards/actinius_icarus_nrf9160.conf +++ b/boot/zephyr/boards/actinius_icarus_nrf9160.conf @@ -1,8 +1,5 @@ # Disable Zephyr console CONFIG_CONSOLE=n -# MCUBoot settings -CONFIG_BOOT_MAX_IMG_SECTORS=256 - # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y diff --git a/boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf b/boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf index ae2fa1e42..11142f5a7 100644 --- a/boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf +++ b/boot/zephyr/boards/actinius_icarus_som_dk_nrf9160.conf @@ -1,8 +1,5 @@ # Disable Zephyr console CONFIG_CONSOLE=n -# MCUBoot settings -CONFIG_BOOT_MAX_IMG_SECTORS=256 - # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y diff --git a/boot/zephyr/boards/actinius_icarus_som_nrf9160.conf b/boot/zephyr/boards/actinius_icarus_som_nrf9160.conf index ae2fa1e42..11142f5a7 100644 --- a/boot/zephyr/boards/actinius_icarus_som_nrf9160.conf +++ b/boot/zephyr/boards/actinius_icarus_som_nrf9160.conf @@ -1,8 +1,5 @@ # Disable Zephyr console CONFIG_CONSOLE=n -# MCUBoot settings -CONFIG_BOOT_MAX_IMG_SECTORS=256 - # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y diff --git a/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf b/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf index 657a98415..78ad3c1b1 100644 --- a/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf +++ b/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf @@ -2,4 +2,3 @@ CONFIG_NORDIC_QSPI_NOR=y CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=4 -CONFIG_BOOT_MAX_IMG_SECTORS=256 diff --git a/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf b/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf index e95d11625..f3ee4eeff 100644 --- a/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf +++ b/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf @@ -1,9 +1,6 @@ # Disable Zephyr console CONFIG_CONSOLE=n -# MCUBoot settings -CONFIG_BOOT_MAX_IMG_SECTORS=256 - # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y CONFIG_BOOT_SERIAL_DETECT_DELAY=450 diff --git a/boot/zephyr/boards/conexio_stratus.conf b/boot/zephyr/boards/conexio_stratus.conf index d25675381..a02d710a2 100644 --- a/boot/zephyr/boards/conexio_stratus.conf +++ b/boot/zephyr/boards/conexio_stratus.conf @@ -3,9 +3,6 @@ CONFIG_CONSOLE=n CONFIG_CONSOLE_HANDLER=n CONFIG_UART_CONSOLE=n -# MCUBoot settings -CONFIG_BOOT_MAX_IMG_SECTORS=256 - # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y CONFIG_BOOT_SERIAL_DETECT_DELAY=450 diff --git a/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf b/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf deleted file mode 100644 index 5f3b7808b..000000000 --- a/boot/zephyr/boards/nrf52840dk_qspi_secondary_boot.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BOOT_MAX_IMG_SECTORS=256 diff --git a/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 33e7e6124..5bc3bfabd 100644 --- a/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 # -CONFIG_BOOT_MAX_IMG_SECTORS=256 - # Ensure that the qspi driver is disabled by default CONFIG_NORDIC_QSPI_NOR=n diff --git a/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf b/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf index 657a98415..78ad3c1b1 100644 --- a/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf +++ b/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf @@ -2,4 +2,3 @@ CONFIG_NORDIC_QSPI_NOR=y CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=4 -CONFIG_BOOT_MAX_IMG_SECTORS=256 diff --git a/boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf b/boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf index e95d11625..f3ee4eeff 100644 --- a/boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf +++ b/boot/zephyr/boards/sparkfun_thing_plus_nrf9160.conf @@ -1,9 +1,6 @@ # Disable Zephyr console CONFIG_CONSOLE=n -# MCUBoot settings -CONFIG_BOOT_MAX_IMG_SECTORS=256 - # MCUboot serial recovery CONFIG_MCUBOOT_SERIAL=y CONFIG_BOOT_SERIAL_DETECT_DELAY=450 From b1d5fe2efe073049677cdbf46e01ca30652513d0 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Fri, 19 Jul 2024 14:11:36 +1000 Subject: [PATCH 4/5] boot: zephyr: valid NRF QSPI defaults `NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE` needs to be set to 4096 for every board that uses QSPI for external images, so set the default in a single location. Signed-off-by: Jordan Yates --- boot/zephyr/Kconfig | 9 +++++++++ boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf | 2 -- boot/zephyr/boards/nrf52840dk_qspi_nor.conf | 4 +--- boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf | 2 -- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/boot/zephyr/Kconfig b/boot/zephyr/Kconfig index 397309f8a..bf79cd002 100644 --- a/boot/zephyr/Kconfig +++ b/boot/zephyr/Kconfig @@ -786,4 +786,13 @@ config MCUBOOT_VERIFY_IMG_ADDRESS also be useful when BOOT_DIRECT_XIP is enabled, to ensure that the image linked at the correct address is loaded. +# When used with MCUboot, the external flash page size must match +# the internal SoC flash page size, which is 4096 for Nordic MCUs. +configdefault NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE + default 4096 +# Use a slightly larger default value for stack writes that is unlikely +# to lead to any stack overflows. +configdefault NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE + default 32 + source "Kconfig.zephyr" diff --git a/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf b/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf index 78ad3c1b1..6486ddc1f 100644 --- a/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf +++ b/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf @@ -1,4 +1,2 @@ # Enable QSPI (MX25R64) - Slot 1 in QSPI CONFIG_NORDIC_QSPI_NOR=y -CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 -CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=4 diff --git a/boot/zephyr/boards/nrf52840dk_qspi_nor.conf b/boot/zephyr/boards/nrf52840dk_qspi_nor.conf index 3205eafd6..2fe51d6a8 100644 --- a/boot/zephyr/boards/nrf52840dk_qspi_nor.conf +++ b/boot/zephyr/boards/nrf52840dk_qspi_nor.conf @@ -1,3 +1 @@ -CONFIG_NORDIC_QSPI_NOR=y -CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 -CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 +CONFIG_NORDIC_QSPI_NOR=y \ No newline at end of file diff --git a/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf b/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf index 78ad3c1b1..6486ddc1f 100644 --- a/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf +++ b/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf @@ -1,4 +1,2 @@ # Enable QSPI (MX25R64) - Slot 1 in QSPI CONFIG_NORDIC_QSPI_NOR=y -CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 -CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=4 From dad039da8c82abeaf062b12d26264177eb1aafee Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Fri, 19 Jul 2024 14:20:10 +1000 Subject: [PATCH 5/5] boot: zephyr: remove explicit `NORDIC_QSPI_NOR` control Remove explicit control over `NORDIC_QSPI_NOR` from board overlays (including some boards that didn't have QPI flash anyway). The new behaviour is that if the QSPI flash node exists in devicetree, it will be compiled into the bootloader. Options for disabling this include: * Setting the devicetree node to `status="disabled"` for MCUboot * Adding a default in the board definition ``` configdefault NORDIC_QSPI_NOR default n if MCUBOOT ``` Explicitly disabling the symbol in the MCUboot repository makes it very painful for users of the board to setup an alternate flash partition scheme (secondary on QSPI flash), as it requires maintaining a fork of MCUboot or board specific overrides at compile-time. Signed-off-by: Jordan Yates --- boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf | 2 -- boot/zephyr/boards/nrf52840dk_nrf52840.conf | 2 -- boot/zephyr/boards/nrf52840dk_qspi_nor.conf | 1 - boot/zephyr/boards/nrf52840dongle_nrf52840.conf | 2 -- boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 3 --- boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf | 2 -- boot/zephyr/sample.yaml | 1 - 7 files changed, 13 deletions(-) delete mode 100644 boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf delete mode 100644 boot/zephyr/boards/nrf52840dk_nrf52840.conf delete mode 100644 boot/zephyr/boards/nrf52840dk_qspi_nor.conf delete mode 100644 boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf diff --git a/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf b/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf deleted file mode 100644 index 6486ddc1f..000000000 --- a/boot/zephyr/boards/bl5340_dvk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Enable QSPI (MX25R64) - Slot 1 in QSPI -CONFIG_NORDIC_QSPI_NOR=y diff --git a/boot/zephyr/boards/nrf52840dk_nrf52840.conf b/boot/zephyr/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index 3bd75a29d..000000000 --- a/boot/zephyr/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Ensure that the qspi driver is disabled by default -CONFIG_NORDIC_QSPI_NOR=n diff --git a/boot/zephyr/boards/nrf52840dk_qspi_nor.conf b/boot/zephyr/boards/nrf52840dk_qspi_nor.conf deleted file mode 100644 index 2fe51d6a8..000000000 --- a/boot/zephyr/boards/nrf52840dk_qspi_nor.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NORDIC_QSPI_NOR=y \ No newline at end of file diff --git a/boot/zephyr/boards/nrf52840dongle_nrf52840.conf b/boot/zephyr/boards/nrf52840dongle_nrf52840.conf index abb13174b..ec14f13bb 100644 --- a/boot/zephyr/boards/nrf52840dongle_nrf52840.conf +++ b/boot/zephyr/boards/nrf52840dongle_nrf52840.conf @@ -19,5 +19,3 @@ CONFIG_BOOT_SERIAL_CDC_ACM=y CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_REMOTE_WAKEUP=n CONFIG_USB_DEVICE_PRODUCT="MCUBOOT" - -CONFIG_NORDIC_QSPI_NOR=n diff --git a/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 5bc3bfabd..15d13bdbf 100644 --- a/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -2,7 +2,4 @@ # # SPDX-License-Identifier: Apache-2.0 # -# Ensure that the qspi driver is disabled by default -CONFIG_NORDIC_QSPI_NOR=n - CONFIG_BOOT_WATCHDOG_FEED=n diff --git a/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf b/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf deleted file mode 100644 index 6486ddc1f..000000000 --- a/boot/zephyr/boards/pinnacle_100_dvk_nrf52840.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Enable QSPI (MX25R64) - Slot 1 in QSPI -CONFIG_NORDIC_QSPI_NOR=y diff --git a/boot/zephyr/sample.yaml b/boot/zephyr/sample.yaml index 9ab330781..88a69ccf4 100644 --- a/boot/zephyr/sample.yaml +++ b/boot/zephyr/sample.yaml @@ -38,7 +38,6 @@ tests: tags: bootloader_mcuboot sample.bootloader.mcuboot.qspi_nor_slot: extra_args: DTC_OVERLAY_FILE="./boards/nrf52840dk_qspi_nor_secondary.overlay;app.overlay" - OVERLAY_CONFIG="./boards/nrf52840dk_qspi_nor.conf;./boards/nrf52840dk_qspi_secondary_boot.conf" platform_allow: nrf52840dk/nrf52840 integration_platforms: - nrf52840dk/nrf52840