diff --git a/boards/arm/samv7/same70-xplained/Kconfig b/boards/arm/samv7/same70-xplained/Kconfig index 740e844573b..78a74bb988d 100644 --- a/boards/arm/samv7/same70-xplained/Kconfig +++ b/boards/arm/samv7/same70-xplained/Kconfig @@ -99,14 +99,14 @@ config SAME70XPLAINED_PROGMEM_OTA_PARTITION select MTD_PROGMEM select MTD_PROGMEM_ERASESTATE -menuconfig SAME70XPLAINED_APP_FORMAT_MCUBOOT +menuconfig SAME70XPLAINED_FORMAT_MCUBOOT bool "MCUboot-bootable format" default n select SAME70XPLAINED_PROGMEM_OTA_PARTITION ---help--- The MCUboot support of loading the firmware images. -if SAME70XPLAINED_APP_FORMAT_MCUBOOT +if SAME70XPLAINED_FORMAT_MCUBOOT config SAME70XPLAINED_MCUBOOT_BOOTLOADER bool "MCUboot bootloader application" @@ -149,6 +149,6 @@ config SAME70XPLAINED_OTA_SCRATCH_SIZE hex "MCUboot scratch partition size (in bytes)" default "0x20000" -endif # SAME70XPLAINED_APP_FORMAT_MCUBOOT +endif # SAME70XPLAINED_FORMAT_MCUBOOT endif # ARCH_BOARD_SAME70_XPLAINED diff --git a/boards/arm/samv7/same70-xplained/README.txt b/boards/arm/samv7/same70-xplained/README.txt index add9d3ca557..3c7ab655f64 100644 --- a/boards/arm/samv7/same70-xplained/README.txt +++ b/boards/arm/samv7/same70-xplained/README.txt @@ -1716,7 +1716,7 @@ Configuration sub-directories CONFIG_MCUBOOT_BOOTLOADER=y CONFIG_MCUBOOT_ENABLE_LOGGING=y - CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT=y + CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT=y CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER=y CONFIG_USER_ENTRYPOINT="mcuboot_loader_main" @@ -1737,5 +1737,5 @@ Configuration sub-directories CONFIG_BOOT_MCUBOOT=y CONFIG_MCUBOOT_SLOT_CONFIRM_EXAMPLE=y - CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT=y + CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT=y CONFIG_USER_ENTRYPOINT="mcuboot_confirm_main" diff --git a/boards/arm/samv7/same70-xplained/configs/mcuboot-confirm/defconfig b/boards/arm/samv7/same70-xplained/configs/mcuboot-confirm/defconfig index a8314ae25df..ff3ac8f37d2 100644 --- a/boards/arm/samv7/same70-xplained/configs/mcuboot-confirm/defconfig +++ b/boards/arm/samv7/same70-xplained/configs/mcuboot-confirm/defconfig @@ -55,7 +55,7 @@ CONFIG_RAM_SIZE=393216 CONFIG_RAM_START=0x20400000 CONFIG_RAW_BINARY=y CONFIG_RR_INTERVAL=200 -CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT=y +CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT=y CONFIG_SAMV7_GPIOA_IRQ=y CONFIG_SAMV7_GPIOC_IRQ=y CONFIG_SAMV7_GPIO_IRQ=y diff --git a/boards/arm/samv7/same70-xplained/configs/mcuboot-loader/defconfig b/boards/arm/samv7/same70-xplained/configs/mcuboot-loader/defconfig index 369b25d1450..1c332f65e42 100644 --- a/boards/arm/samv7/same70-xplained/configs/mcuboot-loader/defconfig +++ b/boards/arm/samv7/same70-xplained/configs/mcuboot-loader/defconfig @@ -56,7 +56,7 @@ CONFIG_RAM_SIZE=393216 CONFIG_RAM_START=0x20400000 CONFIG_RAW_BINARY=y CONFIG_RR_INTERVAL=200 -CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT=y +CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT=y CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER=y CONFIG_SAMV7_GPIOA_IRQ=y CONFIG_SAMV7_GPIOC_IRQ=y diff --git a/boards/arm/samv7/same70-xplained/scripts/Make.defs b/boards/arm/samv7/same70-xplained/scripts/Make.defs index 0d508f49550..7957c995f90 100644 --- a/boards/arm/samv7/same70-xplained/scripts/Make.defs +++ b/boards/arm/samv7/same70-xplained/scripts/Make.defs @@ -22,26 +22,20 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs -ifeq ($(CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT),y) -ifeq ($(CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER),y) - ifeq ($(CONFIG_ARMV7M_DTCM),y) - LDSCRIPT = flash-dtcm-mcuboot-loader.ld - else - LDSCRIPT = flash-sram-mcuboot-loader.ld - endif +ifeq ($(CONFIG_ARMV7M_DTCM),y) +LDSCRIPT_PREFIX = flash-dtcm else - ifeq ($(CONFIG_ARMV7M_DTCM),y) - LDSCRIPT = flash-dtcm-mcuboot-app.ld - else - LDSCRIPT = flash-sram-mcuboot-app.ld - endif +LDSCRIPT_PREFIX = flash-sram endif -else - ifeq ($(CONFIG_ARMV7M_DTCM),y) - LDSCRIPT = flash-dtcm.ld + +ifeq ($(CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT),y) + ifeq ($(CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER),y) + LDSCRIPT = $(LDSCRIPT_PREFIX)-mcuboot-loader.ld else - LDSCRIPT = flash-sram.ld + LDSCRIPT = $(LDSCRIPT_PREFIX)-mcuboot-app.ld endif +else + LDSCRIPT = $(LDSCRIPT_PREFIX).ld endif ifeq ($(CONFIG_CYGWIN_WINTOOL),y) diff --git a/boards/arm/samv7/same70-xplained/src/sam_progmem.c b/boards/arm/samv7/same70-xplained/src/sam_progmem.c index 3232c2f02dd..5dfe73e6f7a 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_progmem.c +++ b/boards/arm/samv7/same70-xplained/src/sam_progmem.c @@ -54,7 +54,7 @@ * Private Types ****************************************************************************/ -#if defined(SAME70XPLAINED_PROGMEM_OTA_PARTITION) +#if defined(CONFIG_SAME70XPLAINED_PROGMEM_OTA_PARTITION) struct ota_partition_s { @@ -69,7 +69,7 @@ struct ota_partition_s * Private Function Prototypes ****************************************************************************/ -#if defined(SAME70XPLAINED_PROGMEM_OTA_PARTITION) +#if defined(CONFIG_SAME70XPLAINED_PROGMEM_OTA_PARTITION) static struct mtd_dev_s *sam_progmem_alloc_mtdpart(uint32_t mtd_offset, uint32_t mtd_size); static int init_ota_partitions(void); @@ -81,7 +81,7 @@ static int init_ota_partitions(void); static FAR struct mtd_dev_s *g_samv7_progmem_mtd; -#if defined(SAME70XPLAINED_PROGMEM_OTA_PARTITION) +#if defined(CONFIG_SAME70XPLAINED_PROGMEM_OTA_PARTITION) static const struct ota_partition_s g_ota_partition_table[] = { { @@ -106,7 +106,7 @@ static const struct ota_partition_s g_ota_partition_table[] = * Private Functions ****************************************************************************/ -#if defined(SAME70XPLAINED_PROGMEM_OTA_PARTITION) +#if defined(CONFIG_SAME70XPLAINED_PROGMEM_OTA_PARTITION) /**************************************************************************** * Name: sam_progmem_alloc_mtdpart @@ -225,7 +225,7 @@ int sam_progmem_init(void) return -EFAULT; } -#if defined(SAME70XPLAINED_PROGMEM_OTA_PARTITION) +#if defined(CONFIG_SAME70XPLAINED_PROGMEM_OTA_PARTITION) ret = init_ota_partitions(); if (ret < 0) {