|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Cortex-M85 TrustZone-M Security Attribution Unit (SAU) bring-up. More...
#include "trustzone_init.h"#include <stdint.h>#include "ra8_boot_intrinsics.h"Go to the source code of this file.
Functions | |
| void | ra8_trustzone_init (void) |
| Programme + enable the SAU per the partition. | |
Cortex-M85 TrustZone-M Security Attribution Unit (SAU) bring-up.
scaffold for the secure / non-secure address-space split. Programs the SAU with four canonical regions and enables it. Called from SystemInit after the cache + MPU are up but before any non-secure code can run.
The function is gated behind the RA8_TRUSTZONE_ENABLE build symbol so the single-world build (the ..8 default) does not pay any code-size cost. When the symbol is undefined, ra8_trustzone_init is an empty inline.
The RA8D2 IDAU defines bit 28 of the address as the security attribute by default (S = bit 28 clear, NS = bit 28 set). The SAU overlays additional rules. The partition is:
| Region | Range | Attribute |
|---|---|---|
| 0 | 0x02080000..0x020FFFFF | NS (upper MRAM) |
| 1 | 0x22100000..0x221FFFFF | NS (upper SRAM) |
| 2 | 0x6A000000..0x6BFFFFFF | NS (upper SDRAM) |
| 3 | 0x10000000..0x100FFFFF | NSC veneer alias |
These addresses are illustrative – the actual partition lands once the linker script grows the matching memory regions and the veneer section is wired up.
Definition in file trustzone_init.c.
| void ra8_trustzone_init | ( | void | ) |
Programme + enable the SAU per the partition.
No-op TrustZone init for the secure-only USB experiment.
Programme the SAU + SRAM NS boundary and copy the NS image (no BLXNS).
Called from SystemInit after the cache + MPU are up but before any application code runs. When the firmware is built without RA8_TRUSTZONE_ENABLE defined this function is a no-op so the single-world build is unaffected.
Definition at line 166 of file trustzone_init.c.
References internal_sau_set_region(), ra8_boot_dsb(), ra8_boot_isb(), ra8_boot_read32(), and ra8_boot_write32().