Skip to content

Commit b3db3a3

Browse files
asmellbydkalowsk
authored andcommitted
soc: silabs: s2: Only configure SMU and SAU once on boot
If a bootloader is used, it will configure the SMU and SAU. The application cannot also configure it, since it can't know what alias (S vs NS) to access the CMU through. Only connect the interrupt to the application's vector table if a bootloader is present. Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
1 parent d7c0244 commit b3db3a3

File tree

1 file changed

+4
-0
lines changed
  • soc/silabs/silabs_s2

1 file changed

+4
-0
lines changed

soc/silabs/silabs_s2/soc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ void soc_prep_hook(void)
8181
* all bus transactions from the CPU have non-secure attribution.
8282
* This makes the secure-only app behave more like a non-secure app, allowing the use of
8383
* libraries that only expect to use non-secure peripherals, such as the radio subsystem.
84+
* If MCUboot is used, assume that the bootloader has configured the SMU and SAU
85+
* appropriately, and only connect the IRQ for SMU faults.
8486
*/
8587
#if defined(CONFIG_ARM_SECURE_FIRMWARE) && !defined(CONFIG_ARM_FIRMWARE_HAS_SECURE_ENTRY_FUNCS)
88+
#if !defined(CONFIG_BOOTLOADER_MCUBOOT)
8689
#if defined(CMU_CLKEN1_SMU)
8790
CMU_S->CLKEN1_SET = CMU_CLKEN1_SMU;
8891
#endif
@@ -100,6 +103,7 @@ void soc_prep_hook(void)
100103
NVIC_ClearPendingIRQ(SMU_SECURE_IRQn);
101104
SMU->IF_CLR = SMU_IF_PPUSEC | SMU_IF_BMPUSEC;
102105
SMU->IEN = SMU_IEN_PPUSEC | SMU_IEN_BMPUSEC;
106+
#endif
103107

104108
IRQ_DIRECT_CONNECT(SMU_SECURE_IRQn, 0, smu_fault, 0);
105109
irq_enable(SMU_SECURE_IRQn);

0 commit comments

Comments
 (0)