mirror of https://github.com/ARMmbed/mbed-os.git
[M2351] Support TrustZone and bootloader for IAR
parent
8f2c717c4c
commit
767e74b1db
|
|
@ -1,33 +1,70 @@
|
||||||
|
include partition_M2351_sub
|
||||||
|
|
||||||
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
||||||
/*-Editor annotation file-*/
|
/*-Editor annotation file-*/
|
||||||
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
|
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
|
||||||
|
|
||||||
if (isdefinedsymbol(__DOMAIN_NS)) {
|
if (isdefinedsymbol(__DOMAIN_NS)) {
|
||||||
/*-Specials-*/
|
|
||||||
define symbol __ICFEDIT_intvec_start__ = 0x10040000;
|
if (! isdefinedsymbol(MBED_APP_START)) {
|
||||||
/*-Memory Regions-*/
|
define symbol MBED_APP_START = 0x10000000 + NU_TZ_SECURE_FLASH_SIZE;
|
||||||
define symbol __ICFEDIT_region_ROM_start__ = 0x10040000;
|
}
|
||||||
define symbol __ICFEDIT_region_ROM_end__ = 0x10080000 - 1;
|
|
||||||
define symbol __ICFEDIT_region_IRAM_start__ = 0x30006000;
|
if (! isdefinedsymbol(MBED_APP_SIZE)) {
|
||||||
define symbol __ICFEDIT_region_IRAM_end__ = 0x30018000 - 1;
|
define symbol MBED_APP_SIZE = 0x80000 - NU_TZ_SECURE_FLASH_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*-Specials-*/
|
||||||
|
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
|
||||||
|
/*-Memory Regions-*/
|
||||||
|
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
|
||||||
|
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
|
||||||
|
define symbol __ICFEDIT_region_IRAM_start__ = 0x30000000 + NU_TZ_SECURE_SRAM_SIZE;
|
||||||
|
define symbol __ICFEDIT_region_IRAM_end__ = 0x30018000 - 1;
|
||||||
|
|
||||||
|
/*-Sizes-*/
|
||||||
|
define symbol __ICFEDIT_size_cstack__ = 0x800;
|
||||||
|
define symbol __ICFEDIT_size_heap__ = 0x4000;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/*-Specials-*/
|
|
||||||
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
|
if (! isdefinedsymbol(MBED_APP_START)) {
|
||||||
/*-Memory Regions-*/
|
define symbol MBED_APP_START = 0;
|
||||||
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
|
}
|
||||||
define symbol __ICFEDIT_region_ROM_end__ = 0x0003F000 - 1;
|
|
||||||
define symbol __ICFEDIT_region_NSCROM_start__ = 0x0003F000;
|
if (! isdefinedsymbol(MBED_APP_SIZE)) {
|
||||||
define symbol __ICFEDIT_region_NSCROM_end__ = 0x00040000 - 1;
|
define symbol MBED_APP_SIZE = NU_TZ_SECURE_FLASH_SIZE;
|
||||||
define symbol __ICFEDIT_region_IRAM_start__ = 0x20000000;
|
}
|
||||||
define symbol __ICFEDIT_region_IRAM_end__ = 0x20006000 - 1;
|
|
||||||
}
|
/* Requirements for NSC location
|
||||||
/*-Sizes-*/
|
*
|
||||||
define symbol __ICFEDIT_size_cstack__ = 0x800;
|
* 1. By IDAU, 0~0x4000 is secure. NSC can only locate in 0x4000~0x10000000.
|
||||||
if (isdefinedsymbol(__DOMAIN_NS)) {
|
* 2. Greentea flash IAP uses last 4 sectors for its test. Avoid this range.
|
||||||
define symbol __ICFEDIT_size_heap__ = 0x4000;
|
* 3. Greentea NVSTORE uses last 2 sectors or 4KB x 2 for its test. Avoid this range.
|
||||||
} else {
|
*/
|
||||||
define symbol __ICFEDIT_size_heap__ = 0x1000;
|
define exported symbol NU_TZ_NSC_REGION_BASE = MBED_APP_START + MBED_APP_SIZE - 0x2000 - NU_TZ_NSC_REGION_SIZE;
|
||||||
|
|
||||||
|
/*-Specials-*/
|
||||||
|
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
|
||||||
|
/*-Memory Regions-*/
|
||||||
|
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
|
||||||
|
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
|
||||||
|
define symbol __ICFEDIT_region_NSCROM_start__ = NU_TZ_NSC_REGION_BASE;
|
||||||
|
define symbol __ICFEDIT_region_NSCROM_end__ = NU_TZ_NSC_REGION_BASE + NU_TZ_NSC_REGION_SIZE - 1;
|
||||||
|
define symbol __ICFEDIT_region_IRAM_start__ = 0x20000000;
|
||||||
|
define symbol __ICFEDIT_region_IRAM_end__ = 0x20000000 + NU_TZ_SECURE_SRAM_SIZE - 1;
|
||||||
|
|
||||||
|
export symbol __NU_TZ_SECURE_FLASH_SIZE__ = NU_TZ_SECURE_FLASH_SIZE;
|
||||||
|
export symbol __NU_TZ_SECURE_SRAM_SIZE__ = NU_TZ_SECURE_SRAM_SIZE;
|
||||||
|
export symbol __NU_TZ_NSC_REGION_BASE__ = NU_TZ_NSC_REGION_BASE;
|
||||||
|
export symbol __NU_TZ_NSC_REGION_SIZE__ = NU_TZ_NSC_REGION_SIZE;
|
||||||
|
|
||||||
|
/*-Sizes-*/
|
||||||
|
define symbol __ICFEDIT_size_cstack__ = 0x800;
|
||||||
|
define symbol __ICFEDIT_size_heap__ = 0x1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**** End of ICF editor section. ###ICF###*/
|
/**** End of ICF editor section. ###ICF###*/
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -47,10 +84,10 @@ do not initialize { section .noinit };
|
||||||
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
||||||
|
|
||||||
place in ROM_region { readonly };
|
place in ROM_region { readonly };
|
||||||
if (!isdefinedsymbol(__DOMAIN_NS)) {
|
if (! isdefinedsymbol(__DOMAIN_NS)) {
|
||||||
place at address mem:__ICFEDIT_region_NSCROM_start__ { readonly section Veneer$$CMSE };
|
place at address mem:__ICFEDIT_region_NSCROM_start__ { readonly section Veneer$$CMSE };
|
||||||
}
|
}
|
||||||
place at start of IRAM_region { block CSTACK };
|
place at start of IRAM_region { block CSTACK };
|
||||||
place in IRAM_region { block IRAMVEC };
|
place in IRAM_region { block IRAMVEC };
|
||||||
place in IRAM_region { readwrite };
|
place in IRAM_region { readwrite };
|
||||||
place in IRAM_region { block HEAP };
|
place in IRAM_region { block HEAP };
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
/* Secure flash size: 256 KB */
|
||||||
|
define exported symbol NU_TZ_SECURE_FLASH_SIZE = 0x40000
|
||||||
|
|
||||||
|
/* Secure SRAM size: 24 KB */
|
||||||
|
define exported symbol NU_TZ_SECURE_SRAM_SIZE = 0x6000
|
||||||
|
|
||||||
|
/* NSC region size: 4 KB */
|
||||||
|
define exported symbol NU_TZ_NSC_REGION_SIZE = 0x1000
|
||||||
|
|
||||||
|
|
@ -21,7 +21,15 @@ extern int Image$$NSC_ROM$$Base;
|
||||||
|
|
||||||
#elif defined(__ICCARM__)
|
#elif defined(__ICCARM__)
|
||||||
|
|
||||||
#error ("TODO: Support IAR")
|
extern int __NU_TZ_SECURE_FLASH_SIZE__;
|
||||||
|
extern int __NU_TZ_SECURE_SRAM_SIZE__;
|
||||||
|
extern int __NU_TZ_NSC_REGION_BASE__;
|
||||||
|
extern int __NU_TZ_NSC_REGION_SIZE__;
|
||||||
|
|
||||||
|
#define NU_TZ_SECURE_FLASH_SIZE ((uint32_t) &__NU_TZ_SECURE_FLASH_SIZE__)
|
||||||
|
#define NU_TZ_SECURE_SRAM_SIZE ((uint32_t) &__NU_TZ_SECURE_SRAM_SIZE__)
|
||||||
|
#define NU_TZ_NSC_REGION_BASE ((uint32_t) &__NU_TZ_NSC_REGION_BASE__)
|
||||||
|
#define NU_TZ_NSC_REGION_SIZE ((uint32_t) &__NU_TZ_NSC_REGION_SIZE__)
|
||||||
|
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue