38#include "mbedtls/memory_buffer_alloc.h"
50typedef enum : uint32_t {
56typedef enum : uint8_t {
64static const uint8_t
k_sb_msg_enforcing[] =
"secure-boot: ENFORCING OK -- launching authentic\r\n";
66 "secure-boot: LAUNCH FAILED (authentic rejected -- bug)\r\n";
74static void sb_write(
const uint8_t* msg,
size_t len)
82 __asm__
volatile(
"wfi");
88 uint32_t cpuclk0_hz = 0U;
void main(void)
Secure fallback main entry point.
static uint8_t s_sb_heap[k_sb_heap_bytes]
Static heap tf-psa's mbedtls_calloc draws from (no libc heap on target).
static const uint8_t k_sb_msg_launchfail[]
static void sb_setup_or_halt(void)
static const uint8_t k_sb_msg_enforcing[]
static void sb_write(const uint8_t *msg, size_t len)
@ k_sb_heap_bytes
64 KiB static heap for tf-psa mbedtls_calloc.
static uint8_t s_sb_tampered[sizeof(g_sb_signed_payload)]
Mutable copy of the signed image used to build the tampered case.
static const uint8_t k_sb_msg_start[]
static const uint8_t k_sb_msg_psa_fail[]
static const uint8_t k_sb_msg_no_reject[]
sb_bit_t
Byte flipped in the tampered copy (first body octet).
@ k_sb_tamper_bit
Sb tamper bit.
static bool sb_tampered_rejected(void)
Confirm a one-bit body corruption is rejected by the launch gate.
static const uint8_t k_sb_msg_rejected[]
static void sb_panic_halt(void)
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
ra8_err_t ra8_board_led_init(ra8_board_led_id_t led)
Configure led as a digital output, initial level low (off).
@ k_ra8_board_led2
LED2, GREEN, P303 (jumper E26).
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
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.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Controller-agnostic USB-DFU MRAM bootloader core for the RA8D2.
@ k_ra8_dfu_run_base
SRAM copy-to-run / payload link base.
void ra8_dfu_launch(uintptr_t src, uint32_t img_len, uint32_t entry)
Copy an image to the SRAM run base and branch to it (copy-to-run).
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Application-level PSA Crypto facade over tf-psa-crypto.
ra8_err_t ra8_psa_crypto_init(void)
One-shot facade initialisation.
SysTick-based tick counter, delay and timestamp helpers.
ra8_err_t ra8_time_init(uint32_t cpu_hz)
Initialise SysTick for a 1 kHz tick interrupt.
GENERATED: copy-to-run payload signed by scripts/secrets/rot_sign.py – do not edit.
static const uint8_t g_sb_signed_payload[148]
Signed copy-to-run image: 32-byte body + 116-byte RoT trailer.
@ k_sb_payload_body_len
Sb payload body length.