|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
examples/ek_ra8d2/hil_needs_revalidation/cpu1_pingpong_ipc/src/trustzone_init.c More...
#include "trustzone_init.h"#include <stdint.h>#include "ra8_attributes.h"#include "ra8_dual_core.h"#include "ra8_err.h"#include "ra8_log.h"#include "ra8_tz_secure_boot.h"Go to the source code of this file.
Enumerations | |
| enum | cpu1_pingpong_ipc_tz_const_t : uint32_t { k_ipcsar_value = 0x000F0303UL , k_ipcpar_value = 0x000F0303UL , k_ns_vector_table_addr = 0x02080000UL } |
| Constants for the cpu1_pingpong_ipc secure boot. More... | |
Functions | |
| void | ra8_trustzone_init (void) |
| Programme + enable the SAU per the partition. | |
Variables | |
| uint32_t | g_ra8_ls_cpu1_mram_start |
| uint32_t | g_ra8_ls_cpu1_stack_top |
| volatile uint32_t | g_cpu1_pingpong_ipc_ipcsar_post = 0U |
| HIL post-secure-boot IPCSAR read-back diagnostic. | |
| volatile uint8_t | g_cpu1_pingpong_ipc_tz_step = 0U |
| Mirror of ra8_tz_secure_boot_get_step for SWD readback. | |
| volatile uint32_t | g_cpu1_pingpong_ipc_cpu1_release_err = 0xFFFFFFFFU |
| S-side CPU1 release return code captured pre-BLXNS. | |
examples/ek_ra8d2/hil_needs_revalidation/cpu1_pingpong_ipc/src/trustzone_init.c
Per-app secure-boot wiring for cpu1_pingpong_ipc
Thin wrapper around libs/ra8_tz_secure_boot/ – the per-app file exists because the auto-discovery glue scans for trustzone_init.c in each example directory. The actual SAU + CPSCU + BLXNS sequence lives in ra8_tz_secure_boot_run so other apps can share it.
When RA8_TRUSTZONE_ENABLE is not defined the function is a no-op so the single-world build is unaffected. When it is defined the secure-boot:
Bench validation is NOT performed by this commit – a human operator with scripts/hil/recover.sh warm is the only safe path to flash the resulting image (see project_sau_sgstubs_brick).
Definition in file trustzone_init.c.
| enum cpu1_pingpong_ipc_tz_const_t : uint32_t |
Constants for the cpu1_pingpong_ipc secure boot.
| Enumerator | |
|---|---|
| k_ipcsar_value | IPC security. |
| k_ipcpar_value | IPC privilege. |
| k_ns_vector_table_addr | NS vectors. |
Definition at line 64 of 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 g_cpu1_pingpong_ipc_ipcsar_post, g_cpu1_pingpong_ipc_tz_step, k_ipcpar_value, k_ipcsar_value, k_ns_vector_table_addr, k_ra8_ok, ra8_log_error_val, ra8_tz_secure_boot_get_step(), ra8_tz_secure_boot_jump_ns(), ra8_tz_secure_boot_sau_init(), and ra8_tz_secure_boot_security_init().
| volatile uint32_t g_cpu1_pingpong_ipc_cpu1_release_err = 0xFFFFFFFFU |
S-side CPU1 release return code captured pre-BLXNS.
ra8_cpu1_release writes CPU1INITVTOR / CPU1WAITCR / CPU1ACTCSR which are all in the CPU control register block (0x4000F000). Those registers are Secure-only on this chip so the release must happen before BLXNS hands the CPU to the NS image. Bench reads this counter to confirm CPU1 was successfully released even when the NS ping-pong loop later misbehaves.
Definition at line 114 of file trustzone_init.c.
| volatile uint32_t g_cpu1_pingpong_ipc_ipcsar_post = 0U |
HIL post-secure-boot IPCSAR read-back diagnostic.
Bench scripts read this through SWD: it must hold 0x00050000 after the secure boot has finished. The variable is updated from within ra8_trustzone_init immediately after the IPCSAR write so a J-Link memprobe can pinpoint whether the write landed even if the BLXNS later fails.
Definition at line 84 of file trustzone_init.c.
Referenced by ra8_trustzone_init().
| volatile uint8_t g_cpu1_pingpong_ipc_tz_step = 0U |
Mirror of ra8_tz_secure_boot_get_step for SWD readback.
One-shot snapshot taken inside ra8_trustzone_init for bench diagnostics. Mirrors the secure-boot library step enum (ra8_tz_secure_boot_step_t).
Definition at line 97 of file trustzone_init.c.
Referenced by ra8_trustzone_init().
|
extern |
Referenced by main().
|
extern |