board/same70-xplained: MCUboot related improvements

- simplify LDSCRIPT file name selection
- rename CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT to
  CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT
- fix usage of SAME70XPLAINED_PROGMEM_OTA_PARTITION
  config option

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2021-11-29 11:50:38 +02:00 committed by Xiang Xiao
parent c3307fce6b
commit d4a5003376
6 changed files with 22 additions and 28 deletions

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)
{