Infineon: Add cyw20829 platform, shared slot feature, json memory map, psoc6 xip
Based in 1.8.0 release of MCUBoot library
This commit adds CYW20829 Infineon platform support with following capabilities:
1. Overwrite and swap upgrade mode support
2. Multi-image with up to 4 images
3. Hardware security counter is supported for CYW20829 platform
Add XIP support for PSOC6 platform - place BOOT slot in external memory and execute it in place using SMIF in XIP mode
and some new features for Infineon devices.
1. Shared upgrade slot feature - use one shared area for upgrade slots of multiple images
2. Memory map defined using JSON file - define memory regions for bootloader and user app in conventional way using JSON file
diff --git a/boot/zephyr/boards/flash_sim_driver.conf b/boot/zephyr/boards/flash_sim_driver.conf
new file mode 100644
index 0000000..7e5e58e
--- /dev/null
+++ b/boot/zephyr/boards/flash_sim_driver.conf
@@ -0,0 +1,2 @@
+CONFIG_FLASH_SIMULATOR=y
+CONFIG_FLASH_SIMULATOR_UNALIGNED_READ=y
diff --git a/boot/zephyr/boards/mimxrt1020_evk.conf b/boot/zephyr/boards/mimxrt1020_evk.conf
new file mode 100644
index 0000000..37ed5f8
--- /dev/null
+++ b/boot/zephyr/boards/mimxrt1020_evk.conf
@@ -0,0 +1,4 @@
+# Copyright 2021 NXP
+# SPDX-License-Identifier: Apache-2.0
+
+CONFIG_BOOT_MAX_IMG_SECTORS=1024
diff --git a/boot/zephyr/boards/mimxrt1050_evk_qspi.conf b/boot/zephyr/boards/mimxrt1050_evk_qspi.conf
new file mode 100644
index 0000000..37ed5f8
--- /dev/null
+++ b/boot/zephyr/boards/mimxrt1050_evk_qspi.conf
@@ -0,0 +1,4 @@
+# Copyright 2021 NXP
+# SPDX-License-Identifier: Apache-2.0
+
+CONFIG_BOOT_MAX_IMG_SECTORS=1024
diff --git a/boot/zephyr/boards/mimxrt1060_evk.conf b/boot/zephyr/boards/mimxrt1060_evk.conf
new file mode 100644
index 0000000..37ed5f8
--- /dev/null
+++ b/boot/zephyr/boards/mimxrt1060_evk.conf
@@ -0,0 +1,4 @@
+# Copyright 2021 NXP
+# SPDX-License-Identifier: Apache-2.0
+
+CONFIG_BOOT_MAX_IMG_SECTORS=1024
diff --git a/boot/zephyr/boards/mimxrt1064_evk.conf b/boot/zephyr/boards/mimxrt1064_evk.conf
new file mode 100644
index 0000000..1c50bc9
--- /dev/null
+++ b/boot/zephyr/boards/mimxrt1064_evk.conf
@@ -0,0 +1,4 @@
+# Copyright 2021 NXP
+# SPDX-License-Identifier: Apache-2.0
+
+CONFIG_BOOT_MAX_IMG_SECTORS=512
diff --git a/boot/zephyr/boards/nrf52840_big.overlay b/boot/zephyr/boards/nrf52840_big.overlay
index 094a7a4..778a1ed 100644
--- a/boot/zephyr/boards/nrf52840_big.overlay
+++ b/boot/zephyr/boards/nrf52840_big.overlay
@@ -28,3 +28,10 @@
};
};
};
+
+&zephyr_udc0 {
+ cdc_acm_uart0 {
+ compatible = "zephyr,cdc-acm-uart";
+ label = "CDC_ACM_0";
+ };
+};
diff --git a/boot/zephyr/boards/nrf52840dk_hooks_sample_overlay.conf b/boot/zephyr/boards/nrf52840dk_hooks_sample_overlay.conf
new file mode 100644
index 0000000..5c13cd2
--- /dev/null
+++ b/boot/zephyr/boards/nrf52840dk_hooks_sample_overlay.conf
@@ -0,0 +1,7 @@
+CONFIG_UPDATEABLE_IMAGE_NUMBER=2
+
+CONFIG_FLASH_SIMULATOR=y
+CONFIG_FLASH_SIMULATOR_UNALIGNED_READ=y
+
+CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y
+CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE="hooks_sample.c"
diff --git a/boot/zephyr/boards/nrf52840dk_ram.overlay b/boot/zephyr/boards/nrf52840dk_ram.overlay
new file mode 100644
index 0000000..a1f9f38
--- /dev/null
+++ b/boot/zephyr/boards/nrf52840dk_ram.overlay
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2021 Nordic Semiconductor ASA
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/delete-node/ &slot1_partition;
+/delete-node/ &slot0_partition;
+/delete-node/ &boot_partition;
+
+&flash0 {
+ partitions {
+ boot_partition: partition@0 {
+ label = "mcuboot";
+ reg = <0x000000000 0x00010000>;
+ };
+ slot0_partition: partition@10000 {
+ label = "image-0";
+ reg = <0x000010000 0x00000A000>;
+ };
+ };
+};
+
+/ {
+ soc {
+ flash_controller2: flash-controller@2 {
+ compatible = "zephyr,sim-flash";
+ reg = <0x00000000 DT_SIZE_K(40)>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ erase-value = <0xff>;
+
+ label = "flash_ctrl";
+
+ flash_sim0: flash_sim@0 {
+ status = "okay";
+ compatible = "soc-nv-flash";
+ label = "simulated_flash";
+ erase-block-size = <4096>;
+ write-block-size = <1>;
+ reg = <0x00000000 DT_SIZE_K(40)>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ slot1_partition: partition@0 {
+ label = "image-1";
+ reg = <0x00000000 0x00000A000>;
+ };
+ };
+ };
+ };
+ };
+};
diff --git a/boot/zephyr/boards/nrf52840dk_ram_multi.overlay b/boot/zephyr/boards/nrf52840dk_ram_multi.overlay
new file mode 100644
index 0000000..7befec9
--- /dev/null
+++ b/boot/zephyr/boards/nrf52840dk_ram_multi.overlay
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2021 Nordic Semiconductor ASA
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/delete-node/ &slot1_partition;
+/delete-node/ &slot0_partition;
+/delete-node/ &boot_partition;
+
+&flash0 {
+ partitions {
+ boot_partition: partition@0 {
+ label = "mcuboot";
+ reg = <0x000000000 0x00010000>;
+ };
+ slot0_partition: partition@10000 {
+ label = "image-0";
+ reg = <0x000010000 0x00000A000>;
+ };
+ slot1_partition: partition@1A000 {
+ label = "image-1";
+ reg = <0x00001A000 0x00000A000>;
+ };
+ slot3_partition: partition@24000 {
+ label = "image-3";
+ reg = <0x000024000 0x00000A000>;
+ };
+ };
+};
+
+/ {
+ soc {
+ flash_controller2: flash-controller@2 {
+ compatible = "zephyr,sim-flash";
+ reg = <0x00000000 DT_SIZE_K(40)>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ erase-value = <0xff>;
+
+ label = "flash_ctrl";
+
+ flash_sim0: flash_sim@0 {
+ status = "okay";
+ compatible = "soc-nv-flash";
+ label = "simulated_flash";
+ erase-block-size = <4096>;
+ write-block-size = <1>;
+ reg = <0x00000000 DT_SIZE_K(40)>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ slot2_partition: partition@0 {
+ label = "image-2";
+ reg = <0x00000000 0x00000A000>;
+ };
+ };
+ };
+ };
+ };
+};
diff --git a/boot/zephyr/boards/nrf52840dongle_nrf52840.conf b/boot/zephyr/boards/nrf52840dongle_nrf52840.conf
index ba333d9..f4fbb39 100644
--- a/boot/zephyr/boards/nrf52840dongle_nrf52840.conf
+++ b/boot/zephyr/boards/nrf52840dongle_nrf52840.conf
@@ -24,9 +24,7 @@
CONFIG_MULTITHREADING=y
# USB
-CONFIG_USB=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="MCUBOOT"
-CONFIG_USB_CDC_ACM=y
CONFIG_USB_COMPOSITE_DEVICE=n
CONFIG_USB_MASS_STORAGE=n
diff --git a/boot/zephyr/boards/nrf52_minimal_footprint.conf b/boot/zephyr/boards/nrf52_minimal_footprint.conf
index afe8c9b..81c0845 100644
--- a/boot/zephyr/boards/nrf52_minimal_footprint.conf
+++ b/boot/zephyr/boards/nrf52_minimal_footprint.conf
@@ -44,7 +44,7 @@
CONFIG_SERIAL=n
# Power management
-CONFIG_SYS_POWER_MANAGEMENT=n
+CONFIG_PM=n
# Interrupts
CONFIG_DYNAMIC_INTERRUPTS=n
diff --git a/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf b/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf
new file mode 100644
index 0000000..754bf7b
--- /dev/null
+++ b/boot/zephyr/boards/thingy53_nrf5340_cpuapp.conf
@@ -0,0 +1,81 @@
+CONFIG_SIZE_OPTIMIZATIONS=y
+
+CONFIG_SYSTEM_CLOCK_DISABLE=y
+CONFIG_SYSTEM_CLOCK_NO_WAIT=y
+CONFIG_PM=n
+
+CONFIG_MAIN_STACK_SIZE=10240
+CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"
+
+CONFIG_BOOT_MAX_IMG_SECTORS=2048
+CONFIG_BOOT_SIGNATURE_TYPE_RSA=y
+
+# Flash
+CONFIG_FLASH=y
+CONFIG_BOOT_ERASE_PROGRESSIVELY=y
+CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y
+CONFIG_FPROTECT=y
+
+# Serial
+CONFIG_SERIAL=y
+CONFIG_UART_LINE_CTRL=y
+
+# MCUBoot serial
+CONFIG_GPIO=y
+CONFIG_MCUBOOT_SERIAL=y
+CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y
+CONFIG_BOOT_SERIAL_CDC_ACM=y
+CONFIG_BOOT_SERIAL_DETECT_PORT="GPIO_1"
+CONFIG_BOOT_SERIAL_DETECT_PIN=13
+
+# Required by QSPI
+CONFIG_NORDIC_QSPI_NOR=y
+CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
+CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
+
+CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y
+CONFIG_PM_EXTERNAL_FLASH=y
+CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64"
+CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
+CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000
+
+# Required by USB and QSPI
+CONFIG_MULTITHREADING=y
+
+# USB
+CONFIG_USB=y
+CONFIG_USB_DEVICE_MANUFACTURER="Nordic Semiconductor ASA"
+CONFIG_USB_DEVICE_PRODUCT="Bootloader Thingy:53"
+CONFIG_USB_DEVICE_VID=0x1915
+CONFIG_USB_DEVICE_PID=0x5300
+CONFIG_USB_CDC_ACM=y
+
+# Decrease memory footprint
+CONFIG_CBPRINTF_NANO=y
+CONFIG_TIMESLICING=n
+CONFIG_BOOT_BANNER=n
+CONFIG_CONSOLE=n
+CONFIG_CONSOLE_HANDLER=n
+CONFIG_UART_CONSOLE=n
+CONFIG_USE_SEGGER_RTT=n
+CONFIG_LOG=n
+CONFIG_ERRNO=n
+CONFIG_PRINTK=n
+CONFIG_RESET_ON_FATAL_ERROR=n
+CONFIG_SPI=n
+CONFIG_I2C=n
+CONFIG_UART_NRFX=n
+
+# The following configurations are required to support simultaneous multi image update
+CONFIG_PCD_APP=y
+CONFIG_UPDATEABLE_IMAGE_NUMBER=2
+CONFIG_BOOT_UPGRADE_ONLY=y
+# The network core cannot access external flash directly. The flash simulator must be used to
+# provide a memory region that is used to forward the new firmware to the network core.
+CONFIG_FLASH_SIMULATOR=y
+CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
+CONFIG_FLASH_SIMULATOR_STATS=n
+
+# Enable custom command to erase settings partition.
+CONFIG_ENABLE_MGMT_PERUSER=y
+CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y