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:
parent
c3307fce6b
commit
d4a5003376
@ -99,14 +99,14 @@ config SAME70XPLAINED_PROGMEM_OTA_PARTITION
|
|||||||
select MTD_PROGMEM
|
select MTD_PROGMEM
|
||||||
select MTD_PROGMEM_ERASESTATE
|
select MTD_PROGMEM_ERASESTATE
|
||||||
|
|
||||||
menuconfig SAME70XPLAINED_APP_FORMAT_MCUBOOT
|
menuconfig SAME70XPLAINED_FORMAT_MCUBOOT
|
||||||
bool "MCUboot-bootable format"
|
bool "MCUboot-bootable format"
|
||||||
default n
|
default n
|
||||||
select SAME70XPLAINED_PROGMEM_OTA_PARTITION
|
select SAME70XPLAINED_PROGMEM_OTA_PARTITION
|
||||||
---help---
|
---help---
|
||||||
The MCUboot support of loading the firmware images.
|
The MCUboot support of loading the firmware images.
|
||||||
|
|
||||||
if SAME70XPLAINED_APP_FORMAT_MCUBOOT
|
if SAME70XPLAINED_FORMAT_MCUBOOT
|
||||||
|
|
||||||
config SAME70XPLAINED_MCUBOOT_BOOTLOADER
|
config SAME70XPLAINED_MCUBOOT_BOOTLOADER
|
||||||
bool "MCUboot bootloader application"
|
bool "MCUboot bootloader application"
|
||||||
@ -149,6 +149,6 @@ config SAME70XPLAINED_OTA_SCRATCH_SIZE
|
|||||||
hex "MCUboot scratch partition size (in bytes)"
|
hex "MCUboot scratch partition size (in bytes)"
|
||||||
default "0x20000"
|
default "0x20000"
|
||||||
|
|
||||||
endif # SAME70XPLAINED_APP_FORMAT_MCUBOOT
|
endif # SAME70XPLAINED_FORMAT_MCUBOOT
|
||||||
|
|
||||||
endif # ARCH_BOARD_SAME70_XPLAINED
|
endif # ARCH_BOARD_SAME70_XPLAINED
|
||||||
|
@ -1716,7 +1716,7 @@ Configuration sub-directories
|
|||||||
CONFIG_MCUBOOT_BOOTLOADER=y
|
CONFIG_MCUBOOT_BOOTLOADER=y
|
||||||
CONFIG_MCUBOOT_ENABLE_LOGGING=y
|
CONFIG_MCUBOOT_ENABLE_LOGGING=y
|
||||||
|
|
||||||
CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT=y
|
CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT=y
|
||||||
CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER=y
|
CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER=y
|
||||||
CONFIG_USER_ENTRYPOINT="mcuboot_loader_main"
|
CONFIG_USER_ENTRYPOINT="mcuboot_loader_main"
|
||||||
|
|
||||||
@ -1737,5 +1737,5 @@ Configuration sub-directories
|
|||||||
CONFIG_BOOT_MCUBOOT=y
|
CONFIG_BOOT_MCUBOOT=y
|
||||||
CONFIG_MCUBOOT_SLOT_CONFIRM_EXAMPLE=y
|
CONFIG_MCUBOOT_SLOT_CONFIRM_EXAMPLE=y
|
||||||
|
|
||||||
CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT=y
|
CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT=y
|
||||||
CONFIG_USER_ENTRYPOINT="mcuboot_confirm_main"
|
CONFIG_USER_ENTRYPOINT="mcuboot_confirm_main"
|
||||||
|
@ -55,7 +55,7 @@ CONFIG_RAM_SIZE=393216
|
|||||||
CONFIG_RAM_START=0x20400000
|
CONFIG_RAM_START=0x20400000
|
||||||
CONFIG_RAW_BINARY=y
|
CONFIG_RAW_BINARY=y
|
||||||
CONFIG_RR_INTERVAL=200
|
CONFIG_RR_INTERVAL=200
|
||||||
CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT=y
|
CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT=y
|
||||||
CONFIG_SAMV7_GPIOA_IRQ=y
|
CONFIG_SAMV7_GPIOA_IRQ=y
|
||||||
CONFIG_SAMV7_GPIOC_IRQ=y
|
CONFIG_SAMV7_GPIOC_IRQ=y
|
||||||
CONFIG_SAMV7_GPIO_IRQ=y
|
CONFIG_SAMV7_GPIO_IRQ=y
|
||||||
|
@ -56,7 +56,7 @@ CONFIG_RAM_SIZE=393216
|
|||||||
CONFIG_RAM_START=0x20400000
|
CONFIG_RAM_START=0x20400000
|
||||||
CONFIG_RAW_BINARY=y
|
CONFIG_RAW_BINARY=y
|
||||||
CONFIG_RR_INTERVAL=200
|
CONFIG_RR_INTERVAL=200
|
||||||
CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT=y
|
CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT=y
|
||||||
CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER=y
|
CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER=y
|
||||||
CONFIG_SAMV7_GPIOA_IRQ=y
|
CONFIG_SAMV7_GPIOA_IRQ=y
|
||||||
CONFIG_SAMV7_GPIOC_IRQ=y
|
CONFIG_SAMV7_GPIOC_IRQ=y
|
||||||
|
@ -22,26 +22,20 @@ include $(TOPDIR)/.config
|
|||||||
include $(TOPDIR)/tools/Config.mk
|
include $(TOPDIR)/tools/Config.mk
|
||||||
include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs
|
include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs
|
||||||
|
|
||||||
ifeq ($(CONFIG_SAME70XPLAINED_APP_FORMAT_MCUBOOT),y)
|
ifeq ($(CONFIG_ARMV7M_DTCM),y)
|
||||||
ifeq ($(CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER),y)
|
LDSCRIPT_PREFIX = flash-dtcm
|
||||||
ifeq ($(CONFIG_ARMV7M_DTCM),y)
|
|
||||||
LDSCRIPT = flash-dtcm-mcuboot-loader.ld
|
|
||||||
else
|
|
||||||
LDSCRIPT = flash-sram-mcuboot-loader.ld
|
|
||||||
endif
|
|
||||||
else
|
else
|
||||||
ifeq ($(CONFIG_ARMV7M_DTCM),y)
|
LDSCRIPT_PREFIX = flash-sram
|
||||||
LDSCRIPT = flash-dtcm-mcuboot-app.ld
|
|
||||||
else
|
|
||||||
LDSCRIPT = flash-sram-mcuboot-app.ld
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
else
|
|
||||||
ifeq ($(CONFIG_ARMV7M_DTCM),y)
|
ifeq ($(CONFIG_SAME70XPLAINED_FORMAT_MCUBOOT),y)
|
||||||
LDSCRIPT = flash-dtcm.ld
|
ifeq ($(CONFIG_SAME70XPLAINED_MCUBOOT_BOOTLOADER),y)
|
||||||
|
LDSCRIPT = $(LDSCRIPT_PREFIX)-mcuboot-loader.ld
|
||||||
else
|
else
|
||||||
LDSCRIPT = flash-sram.ld
|
LDSCRIPT = $(LDSCRIPT_PREFIX)-mcuboot-app.ld
|
||||||
endif
|
endif
|
||||||
|
else
|
||||||
|
LDSCRIPT = $(LDSCRIPT_PREFIX).ld
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
* Private Types
|
* Private Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(SAME70XPLAINED_PROGMEM_OTA_PARTITION)
|
#if defined(CONFIG_SAME70XPLAINED_PROGMEM_OTA_PARTITION)
|
||||||
|
|
||||||
struct ota_partition_s
|
struct ota_partition_s
|
||||||
{
|
{
|
||||||
@ -69,7 +69,7 @@ struct ota_partition_s
|
|||||||
* Private Function Prototypes
|
* 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,
|
static struct mtd_dev_s *sam_progmem_alloc_mtdpart(uint32_t mtd_offset,
|
||||||
uint32_t mtd_size);
|
uint32_t mtd_size);
|
||||||
static int init_ota_partitions(void);
|
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;
|
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[] =
|
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
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(SAME70XPLAINED_PROGMEM_OTA_PARTITION)
|
#if defined(CONFIG_SAME70XPLAINED_PROGMEM_OTA_PARTITION)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: sam_progmem_alloc_mtdpart
|
* Name: sam_progmem_alloc_mtdpart
|
||||||
@ -225,7 +225,7 @@ int sam_progmem_init(void)
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SAME70XPLAINED_PROGMEM_OTA_PARTITION)
|
#if defined(CONFIG_SAME70XPLAINED_PROGMEM_OTA_PARTITION)
|
||||||
ret = init_ota_partitions();
|
ret = init_ota_partitions();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user