Skip to content

Commit

Permalink
Update configurations for all the ST TZ targets
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinux committed May 2, 2024
1 parent 9e2b8aa commit b4f59b9
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 25 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test-configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,24 @@ jobs:
arch: arm
config-file: ./config/examples/stm32g0.config

stm32h5_test:
uses: ./.github/workflows/test-build.yml
with:
arch: arm
config-file: ./config/examples/stm32h5.config

stm32h5_dualbank_test:
uses: ./.github/workflows/test-build.yml
with:
arch: arm
config-file: ./config/examples/stm32h5-dualbank.config

stm32h5_wolfcrypt_tz:
uses: ./.github/workflows/test-build.yml
with:
arch: arm
config-file: ./config/examples/stm32h5-wolfcrypt-tz.config

stm32h7_test:
uses: ./.github/workflows/test-build.yml
with:
Expand Down Expand Up @@ -261,6 +273,12 @@ jobs:
arch: arm
config-file: ./config/examples/stm32l5.config

stm32l5_wolfcrypt_tz:
uses: ./.github/workflows/test-build.yml
with:
arch: arm
config-file: ./config/examples/stm32l5-wolfcrypt-tz.config

stm32u5_nonsecure_dualbank_test:
uses: ./.github/workflows/test-build.yml
with:
Expand All @@ -273,6 +291,12 @@ jobs:
arch: arm
config-file: ./config/examples/stm32u5.config

stm32u5_wolfcrypt_tz:
uses: ./.github/workflows/test-build.yml
with:
arch: arm
config-file: ./config/examples/stm32u5-wolfcrypt-tz.config

stm32wb_delta_enc_ext_test:
uses: ./.github/workflows/test-build.yml
with:
Expand Down
1 change: 1 addition & 0 deletions arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ ifeq ($(ARCH),ARM)
WOLFBOOT_ORIGIN=0x0C000000
else
WOLFBOOT_ORIGIN=0x08000000
LSCRIPT_IN=hal/$(TARGET)-ns.ld
endif
SPI_TARGET=stm32
endif
Expand Down
29 changes: 29 additions & 0 deletions config/examples/stm32h5-wolfcrypt-tz.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ARCH?=ARM
TZEN?=1
TARGET?=stm32h5
SIGN?=ECC256
HASH?=SHA256
DEBUG?=0
VTOR?=1
CORTEX_M0?=0
CORTEX_M33?=1
NO_ASM?=0
NO_MPU=1
EXT_FLASH?=0
SPI_FLASH?=0
ALLOW_DOWNGRADE?=0
NVM_FLASH_WRITEONCE?=1
WOLFBOOT_VERSION?=1
V?=0
SPMATH?=1
RAM_CODE?=0
DUALBANK_SWAP?=0
WOLFBOOT_PARTITION_SIZE?=0x1F800
WOLFBOOT_SECTOR_SIZE?=0x800
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08040000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x805F800
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x0807F000
FLAGS_HOME=0
DISABLE_BACKUP=0
WOLFCRYPT_TZ=1
WOLFCRYPT_TZ_PKCS11=1
19 changes: 10 additions & 9 deletions config/examples/stm32l5.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARCH?=ARM
TZEN?=1
TZEN?=0
TARGET?=stm32l5
SIGN?=ECC256
HASH?=SHA256
Expand All @@ -17,11 +17,12 @@ WOLFBOOT_VERSION?=1
V?=0
SPMATH?=1
RAM_CODE?=0
DUALBANK_SWAP?=0
WOLFBOOT_PARTITION_SIZE?=0x1F800
WOLFBOOT_SECTOR_SIZE?=0x800
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08040000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x805F800
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x0807F000
FLAGS_HOME=0
DISABLE_BACKUP=0
DUALBANK_SWAP?=1
WOLFBOOT_PARTITION_SIZE?=0x30000
WOLFBOOT_SECTOR_SIZE?=0x2000
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08010000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08110000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xFFFFFFFF

# Use a larger image header size to enforce alignment requirements for the interrupt vector table
IMAGE_HEADER_SIZE?=1024
5 changes: 1 addition & 4 deletions config/examples/stm32u5-nonsecure-dualbank.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TZEN?=0
TARGET?=stm32u5
SIGN?=ECC256
HASH?=SHA256
DEBUG?=1
DEBUG?=0
VTOR?=1
CORTEX_M0?=0
CORTEX_M33?=1
Expand All @@ -23,6 +23,3 @@ WOLFBOOT_SECTOR_SIZE?=0x2000
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08010000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08110000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xFFFFFFFF

# Use a larger image header size to enforce alignment requirements for the interrupt vector table
IMAGE_HEADER_SIZE?=1024
29 changes: 29 additions & 0 deletions config/examples/stm32u5-wolfcrypt-tz.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ARCH?=ARM
TZEN?=1
TARGET?=stm32u5
SIGN?=ECC256
HASH?=SHA256
DEBUG?=0
VTOR?=1
CORTEX_M0?=0
CORTEX_M33?=1
NO_ASM?=0
NO_MPU=1
EXT_FLASH?=0
SPI_FLASH?=0
ALLOW_DOWNGRADE?=0
NVM_FLASH_WRITEONCE?=1
WOLFBOOT_VERSION?=1
V?=0
SPMATH?=1
RAM_CODE?=0
DUALBANK_SWAP?=0
WOLFBOOT_PARTITION_SIZE?=0x1F800
WOLFBOOT_SECTOR_SIZE?=0x800
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08040000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x805F800
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x0807F000
FLAGS_HOME=0
DISABLE_BACKUP=0
WOLFCRYPT_TZ=1
WOLFCRYPT_TZ_PKCS11=1
14 changes: 6 additions & 8 deletions config/examples/stm32u5.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARCH?=ARM
TZEN?=1
TZEN?=0
TARGET?=stm32u5
SIGN?=ECC256
HASH?=SHA256
Expand All @@ -17,14 +17,12 @@ WOLFBOOT_VERSION?=1
V?=0
SPMATH?=1
RAM_CODE?=0
DUALBANK_SWAP?=0
WOLFBOOT_PARTITION_SIZE?=0x20000
DUALBANK_SWAP?=1
WOLFBOOT_PARTITION_SIZE?=0x30000
WOLFBOOT_SECTOR_SIZE?=0x2000
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08100000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x817F000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x81FE000
FLAGS_HOME=0
DISABLE_BACKUP=0
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08010000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08110000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xFFFFFFFF

# Use a larger image header size to enforce alignment requirements for the interrupt vector table
IMAGE_HEADER_SIZE?=1024
50 changes: 50 additions & 0 deletions hal/stm32u5-ns.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = @BOOTLOADER_PARTITION_SIZE@
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000 /* mapping TCM only */
}

SECTIONS
{
.text :
{
_start_text = .;
KEEP(*(.isr_vector))
*(.text*)
*(.rodata*)
. = ALIGN(4);
_end_text = .;
} > FLASH

.edidx :
{
. = ALIGN(4);
*(.ARM.exidx*)
} > FLASH

_stored_data = .;
.data : AT (_stored_data)
{
_start_data = .;
KEEP(*(.data*))
. = ALIGN(4);
KEEP(*(.ramcode))
. = ALIGN(4);
_end_data = .;
} > RAM

.bss (NOLOAD) :
{
_start_bss = .;
__bss_start__ = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
_end_bss = .;
__bss_end__ = .;
_end = .;
} > RAM
. = ALIGN(4);
}

END_STACK = ORIGIN(RAM) + LENGTH(RAM);
20 changes: 16 additions & 4 deletions hal/stm32u5.ld
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
MEMORY
{
FLASH (rx) : ORIGIN = @WOLFBOOT_ORIGIN@, LENGTH = @BOOTLOADER_PARTITION_SIZE@
RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 0x00017FFF
FLASH_NSC(rx): ORIGIN = @WOLFBOOT_ORIGIN@ + 0x20000, LENGTH = 0x20000
FLASH (rx) : ORIGIN = @WOLFBOOT_ORIGIN@, LENGTH = @BOOTLOADER_PARTITION_SIZE@ - 0x20000
RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 0x00012000
RAM_HEAP (rw): ORIGIN = 0x30012000, LENGTH = 0xc000 /* 49152 B Heap for wolfcrypt/PKCS11 */
RAM_KV (rw): ORIGIN = 0x3001e000, LENGTH = 0x2000
FLASH_KEYVAULT(rw): ORIGIN = @WOLFBOOT_ORIGIN@ + 0x20000, LENGTH = 0x18000
FLASH_NSC(rx): ORIGIN = @WOLFBOOT_ORIGIN@ + 0x38000, LENGTH = 0x8000
}

SECTIONS
Expand All @@ -25,6 +28,7 @@ SECTIONS

.gnu.sgstubs :
{
. += 0x400;
. = ALIGN(4);
*(.gnu.sgstubs*) /* Secure Gateway stubs */
. = ALIGN(4);
Expand Down Expand Up @@ -53,7 +57,15 @@ SECTIONS
_end = .;
} > RAM
. = ALIGN(8);

}

END_STACK = ORIGIN(RAM) + LENGTH(RAM);

_keyvault_origin = ORIGIN(RAM_KV);
_keyvault_size = LENGTH(RAM_KV);

_flash_keyvault = ORIGIN(FLASH_KEYVAULT);
_flash_keyvault_size = LENGTH(FLASH_KEYVAULT);

_start_heap = ORIGIN(RAM_HEAP);
_heap_size = LENGTH(RAM_HEAP);

0 comments on commit b4f59b9

Please sign in to comment.