59#include "mbedtls/memory_buffer_alloc.h"
66#include "trustzone_init.h"
69typedef enum : uint32_t {
80typedef enum : uint32_t {
90typedef enum : uint8_t {
102typedef enum : uint32_t {
112typedef enum : uint32_t {
206 __asm__
volatile(
"wfi");
264 if (msg ==
nullptr) {
294 const uint32_t shift =
298 ? (uint8_t)(
'0' + nib)
303 if (buf[first] != (uint8_t)
'0') {
void main(void)
Secure fallback main entry point.
@ k_sbns_ns_run_base
NS image VMA (SRAM2 NS alias).
static void sbns_console_print_hex32(uint32_t value)
Print a uint32 as hexadecimal on the console, no leading zeros.
volatile uint32_t g_sbns_step
Secure boot progress breadcrumb (sbns_step_t).
static bool s_sbns_console_up
True once the Secure J-Link OB VCOM console is initialised.
static void sbns_park(void)
Park the Secure core in WFI forever.
sbns_hex_t
Nibble-decode constants for the denial-code hexadecimal print.
@ k_sbns_hex_dec_max
Highest nibble emitted as an ASCII '0'-'9'.
@ k_sbns_hex_bits
Bits per hex nibble.
@ k_sbns_hex_nibbles
Hex nibbles in a uint32 (32 / 4).
@ k_sbns_hex_alpha_base
First nibble emitted as ASCII 'a'.
volatile uint32_t g_sbns_denied
Set to 1 when the root-of-trust gate DENIED the NS image (tampered).
static void sbns_console_bringup(void)
Bring up the Secure J-Link OB VCOM console (best-effort).
sbns_uart_t
Secure-side J-Link OB VCOM (SCI8) console parameters.
@ k_sbns_uart_baud
SCI8 J-Link OB VCOM console line rate (bps).
static const uint8_t k_sbns_msg_verify_enter[]
UART breadcrumb: about to verify + BLXNS into the NS image.
volatile uint32_t g_sbns_jump_err
The ra8_err_t ra8_tz_secure_boot_jump_ns returned on a denial.
sbns_hex_mask_t
Bit mask isolating one hexadecimal nibble from a shifted word.
@ k_sbns_hex_nibble_mask
Low-nibble mask for a uint32 shift result.
static void sbns_console_say_reject(ra8_err_t err)
Print the sbns: NS REJECTED err=0x... verdict line for a denial.
sbns_step_t
Boot-progress breadcrumbs latched into g_sbns_step.
@ k_sbns_step_denied
jump_ns returned -> NS image denied.
@ k_sbns_step_idle
Pre-main sentinel.
@ k_sbns_step_crypto
Heap + PSA facade initialised.
@ k_sbns_step_armed
About to call jump_ns (verify+BLXNS).
@ k_sbns_step_psa_fail
PSA init failed (crypto unavailable).
sbns_const_t
Static-heap sizing for tf-psa-crypto's mbedtls_calloc (no libc heap).
@ k_sbns_heap_bytes
64 KiB static heap for the ECDSA verify.
static const uint8_t k_sbns_msg_reject[]
UART verdict prefix: RoT denied the NS image (followed by the hex code).
static void sbns_console_say(const uint8_t *msg, uint32_t len)
Emit a byte run on the Secure console (no-op until it is up).
static uint8_t s_sbns_heap[k_sbns_heap_bytes]
Static heap tf-psa-crypto's mbedtls_calloc draws from.
static const uint8_t k_sbns_msg_crlf[]
UART line terminator appended after the denial error code.
static const uint8_t k_sbns_msg_crypto_ready[]
UART breadcrumb: crypto/PSA facade is up (printed pre-verify).
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
Boot entry points shared between a vector table and its startup code.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_exists
Item already exists – cannot create again.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
Application-level PSA Crypto facade over tf-psa-crypto.
ra8_err_t ra8_psa_crypto_init(void)
One-shot facade initialisation.
FSP-style TrustZone secure-boot for the Cortex-M85 (CPU0).
ra8_err_t ra8_tz_secure_boot_jump_ns(const uint32_t *ns_vector_table)
Switch to NS state and jump to the NS image's reset vector.