Skip to content

Commit e50466c

Browse files
committed
Merge branch 'master' into lpc55s69
2 parents 6c48415 + 2277dfa commit e50466c

28 files changed

Lines changed: 898 additions & 78 deletions

.github/workflows/trustzone-emulator-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
trustzone-emulator-tests:
99
runs-on: ubuntu-latest
1010
container:
11-
image: ghcr.io/danielinux/m33mu-ci:1.3
11+
image: ghcr.io/danielinux/m33mu-ci:1.5
1212
steps:
1313
- uses: actions/checkout@v4
1414

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ endif
202202

203203
# Environment variables for sign tool
204204
SIGN_ENV=IMAGE_HEADER_SIZE=$(IMAGE_HEADER_SIZE) \
205+
WOLFBOOT_PARTITION_SIZE=$(WOLFBOOT_PARTITION_SIZE) \
205206
WOLFBOOT_SECTOR_SIZE=$(WOLFBOOT_SECTOR_SIZE) \
207+
NVM_FLASH_WRITEONCE=$(NVM_FLASH_WRITEONCE) \
206208
ML_DSA_LEVEL=$(ML_DSA_LEVEL) \
207209
IMAGE_SIGNATURE_SIZE=$(IMAGE_SIGNATURE_SIZE) \
208210
LMS_LEVELS=$(LMS_LEVELS) \
@@ -604,6 +606,7 @@ include/target.h: $(TARGET_H_TEMPLATE) FORCE
604606
sed -e "s/@WOLFBOOT_DTS_UPDATE_ADDRESS@/$(WOLFBOOT_DTS_UPDATE_ADDRESS)/g" | \
605607
sed -e "s/@WOLFBOOT_LOAD_ADDRESS@/$(WOLFBOOT_LOAD_ADDRESS)/g" | \
606608
sed -e "s/@WOLFBOOT_LOAD_DTS_ADDRESS@/$(WOLFBOOT_LOAD_DTS_ADDRESS)/g" | \
609+
sed -e "s/@WOLFBOOT_RAMBOOT_MAX_SIZE@/$(WOLFBOOT_RAMBOOT_MAX_SIZE)/g" | \
607610
sed -e "s/@WOLFBOOT_PARTITION_SELF_HEADER_ADDRESS@/$(WOLFBOOT_PARTITION_SELF_HEADER_ADDRESS)/g" \
608611
> $@
609612

arch.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,6 @@ ifeq ($(ARCH), AURIX_TC3)
13981398
# TC3xx specific
13991399
ifeq ($(TARGET), aurix_tc3xx)
14001400
USE_GCC?=1
1401-
ARCH_FLASH_OFFSET=0x00000000
14021401

14031402
CFLAGS += -I$(TC3_DIR) -Ihal
14041403

@@ -1444,6 +1443,7 @@ ifeq ($(ARCH), AURIX_TC3)
14441443
endif
14451444

14461445
ifeq ($(AURIX_TC3_HSM),1)
1446+
ARCH_FLASH_OFFSET=0x80028000
14471447
# HSM compiler flags, build options, source code, etc
14481448
ifeq ($(USE_GCC),1)
14491449
# Just arm-none-eabi-gcc for now
@@ -1512,6 +1512,7 @@ ifeq ($(ARCH), AURIX_TC3)
15121512

15131513
else
15141514
# Tricore compiler settings
1515+
ARCH_FLASH_OFFSET=0x800A0000
15151516
ifeq ($(USE_GCC),1)
15161517
HT_ROOT?=/opt/hightec/gnutri_v4.9.4.1-11fcedf-lin64
15171518
CROSS_COMPILE?=$(HT_ROOT)/bin/tricore-

config/examples/polarfire_mpfs250.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ WOLFBOOT_LOAD_ADDRESS?=0x8E000000
6262
# Partition layout for PolarFire SoC MPFS250T
6363
# Using update_disk loader we just need to specify the partition number or A/B
6464
WOLFBOOT_NO_PARTITIONS=1
65+
WOLFBOOT_RAMBOOT_MAX_SIZE=0x80000000
6566
CFLAGS_EXTRA+=-DBOOT_PART_A=1
6667
CFLAGS_EXTRA+=-DBOOT_PART_B=2
6768
# Speed up disk partition read (512KB chunks - max DMA size)

config/examples/raspi3-encrypted.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ PKA?=0
1010
WOLFTPM?=0
1111

1212
WOLFBOOT_NO_PARTITIONS=1
13+
WOLFBOOT_RAMBOOT_MAX_SIZE=0x20000000
1314
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x140000
1415
WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x1140000
1516
WOLFBOOT_PARTITION_SWAP_ADDRESS=0xFFFFFFFF

config/examples/raspi3.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ NO_XIP?=1
1313
NO_QNX?=1
1414
WOLFBOOT_SECTOR_SIZE=0x400
1515
WOLFBOOT_NO_PARTITIONS=1
16+
WOLFBOOT_RAMBOOT_MAX_SIZE=0x20000000
1617
WOLFBOOT_LOAD_ADDRESS?=0x3080000
1718
WOLFBOOT_LOAD_DTS_ADDRESS?=0x400000

config/examples/versal_vmk180_sdcard.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ CROSS_COMPILE=aarch64-none-elf-
6666
# These are 0-based indices into the parsed partition array:
6767
# part[0]=boot, part[1]=OFP_A, part[2]=OFP_B, part[3]=rootfs
6868
WOLFBOOT_NO_PARTITIONS=1
69+
WOLFBOOT_RAMBOOT_MAX_SIZE=0x80000000
6970
CFLAGS_EXTRA+=-DBOOT_PART_A=1
7071
CFLAGS_EXTRA+=-DBOOT_PART_B=2
7172

config/examples/vorago_va416x0.config

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ DUALBANK_SWAP?=0
3333
PKA?=0
3434
ENCRYPT=0
3535
WOLFTPM?=0
36-
OPTIMIZATION_LEVEL=1
36+
OPTIMIZATION_LEVEL=s
3737

3838
# Optionally allow downgrade to older valid version in update partition
3939
ALLOW_DOWNGRADE?=0
@@ -45,11 +45,11 @@ NO_ARM_ASM?=0
4545
# Optional: Use smaller SHA512
4646
#CFLAGS_EXTRA+=-DUSE_SLOW_SHA512
4747

48-
# 38KB boot, 108KB partitions, 2KB swap
48+
# Optimized: 46KB wolfboot, 104KB partitions, 2KB swap
4949
WOLFBOOT_SECTOR_SIZE?=0x800
50-
WOLFBOOT_PARTITION_SIZE?=0x1B000
51-
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x9800
52-
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x24800
50+
WOLFBOOT_PARTITION_SIZE?=0x1A000
51+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0xB800
52+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x25800
5353
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x3F800
5454

5555
# ML-DSA 5: 36KB boot, 96KB partitions, 12KB swap
@@ -81,3 +81,9 @@ WOLFBOOT_RESTORE_CLOCK?=1
8181
# Optional debugging
8282
#CFLAGS_EXTRA+=-DDEBUG_EXT_FLASH
8383
#CFLAGS_EXTRA+=-DTEST_EXT_FLASH
84+
85+
# Optional: Enable wolfCrypt test and benchmark in test-app
86+
# Uncomment to enable
87+
# Note: Requires ~80-160KB additional flash and ~10-20KB RAM
88+
#WOLFCRYPT_TEST?=1
89+
#WOLFCRYPT_BENCHMARK?=1

hal/aurix_tc3xx.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,13 @@ void do_boot(const uint32_t* app_offset)
348348
}
349349
#endif
350350

351-
void arch_reboot(void)
351+
RAMFUNCTION void arch_reboot(void)
352352
{
353+
#ifdef WOLFBOOT_AURIX_TC3XX_HSM
354+
tc3arm_HsmBridgeSysReset();
355+
#else
353356
tc3_Scu_TriggerSwReset(1, WOLFBOOT_AURIX_RESET_REASON);
357+
#endif
354358
}
355359

356360
/* Programs unaligned input data to flash, assuming the underlying memory is
@@ -612,15 +616,15 @@ int RAMFUNCTION hal_flash_erase(uint32_t address, int len)
612616
/* If the IAP interface of the flash memory of the target requires it, this
613617
* function is called before every write and erase operations to unlock write
614618
* access to the flash. On some targets, this function may be empty. */
615-
void hal_flash_unlock(void) {}
619+
RAMFUNCTION void hal_flash_unlock(void) {}
616620

617621
/* If the IAP interface of the flash memory requires locking/unlocking, this
618622
* function restores the flash write protection by excluding write accesses.
619623
* This function is called by the bootloader at the end of every write and erase
620624
* operations. */
621-
void hal_flash_lock(void) {}
625+
RAMFUNCTION void hal_flash_lock(void) {}
622626

623-
int ext_flash_write(uintptr_t address, const uint8_t* data, int len)
627+
RAMFUNCTION int ext_flash_write(uintptr_t address, const uint8_t* data, int len)
624628
{
625629
return hal_flash_write(address, data, len);
626630
}
@@ -685,17 +689,17 @@ int RAMFUNCTION ext_flash_read(uintptr_t address, uint8_t* data, int len)
685689
return 0;
686690
}
687691

688-
int ext_flash_erase(uintptr_t address, int len)
692+
RAMFUNCTION int ext_flash_erase(uintptr_t address, int len)
689693
{
690694
return hal_flash_erase(address, len);
691695
}
692696

693-
void ext_flash_lock(void)
697+
RAMFUNCTION void ext_flash_lock(void)
694698
{
695699
hal_flash_lock();
696700
}
697701

698-
void ext_flash_unlock(void)
702+
RAMFUNCTION void ext_flash_unlock(void)
699703
{
700704
hal_flash_unlock();
701705
}

include/target.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
/* Load address in RAM for staged OS (update_ram only) */
117117
#define WOLFBOOT_LOAD_ADDRESS @WOLFBOOT_LOAD_ADDRESS@
118118
#endif
119+
120+
/* Optional RAM-boot image size cap for targets without partitions */
121+
#define WOLFBOOT_RAMBOOT_MAX_SIZE @WOLFBOOT_RAMBOOT_MAX_SIZE@
119122
#define WOLFBOOT_LOAD_DTS_ADDRESS @WOLFBOOT_LOAD_DTS_ADDRESS@
120123

121124

0 commit comments

Comments
 (0)