ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_tz_secure_boot.h
Go to the documentation of this file.
1
47
48#pragma once
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
54#include <stdint.h>
55
56#include "ra8_attributes.h"
57#include "ra8_err.h"
58
90
110
122typedef enum : uint32_t {
125
141
163typedef struct {
164 uint32_t magic;
165 uint32_t body_len;
167
205[[nodiscard]] uint32_t ra8_tz_ns_signed_body_len(const uint32_t* ns_vector_table);
206
233[[nodiscard]] ra8_err_t ra8_tz_secure_boot_sau_init(void);
234
268[[nodiscard]] ra8_err_t ra8_tz_secure_boot_security_init(uint32_t ipcsar_value,
269 uint32_t ipcpar_value);
270
324[[nodiscard]] ra8_err_t ra8_tz_secure_boot_jump_ns(const uint32_t* ns_vector_table);
325
355[[nodiscard]] ra8_err_t ra8_tz_secure_boot_run(uint32_t ipcsar_value,
356 uint32_t ipcpar_value,
357 const uint32_t* ns_vector_table);
358
377
401
423
424#ifdef __cplusplus
425}
426#endif
Annotation-attribute framework macros for ra8-firmware.
#define RA8_TEST_HELPER
Mark a symbol as externally-linked but only callable from tests.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_tz_secure_boot_step_t ra8_tz_secure_boot_get_step(void)
Read the boot progress counter (debug / test).
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.
ra8_err_t ra8_tz_secure_boot_sau_init(void)
Programme the SAU regions documented in ra8_tz_sau_region_t.
uint32_t ra8_tz_secure_boot_host_blxns_target(void)
Read the captured BLXNS target (host / test).
void ra8_tz_secure_boot_host_reset(void)
Reset the host-side state for unit-test fixtures.
ra8_tz_ns_rot_header_offset_t
Byte offset of the ra8_ns_rot_header_t from the NS image base.
@ k_ra8_tz_ns_rot_header_offset
Offset after the 16-slot NS vectors.
ra8_tz_ns_rot_header_magic_t
Magic marker of the Non-Secure signed-image RoT header.
@ k_ra8_tz_ns_rot_header_magic
ASCII "NSR1" (little-endian).
ra8_tz_sau_region_t
Canonical SAU region indices for the RA8D2 secure-boot layout.
@ k_ra8_tz_sau_region_ns_periph
Non-Secure peripheral window.
@ k_ra8_tz_sau_region_code_nsc
NSC alias for code-flash veneers.
@ k_ra8_tz_sau_region_sram_nsc
NSC alias for SRAM veneers.
@ k_ra8_tz_sau_region_count
Number of programmed regions.
@ k_ra8_tz_sau_region_ns_mram
Non-Secure upper MRAM (NS image).
@ k_ra8_tz_sau_region_ns_sram
Non-Secure upper SRAM (NS data).
uint32_t ra8_tz_ns_signed_body_len(const uint32_t *ns_vector_table)
Read the NS image's self-describing signed-body length.
ra8_err_t ra8_tz_secure_boot_security_init(uint32_t ipcsar_value, uint32_t ipcpar_value)
Unlock PRCR_S.PRC4 and write IPCSAR + IPCPAR.
ra8_err_t ra8_tz_secure_boot_run(uint32_t ipcsar_value, uint32_t ipcpar_value, const uint32_t *ns_vector_table)
Run the full secure-boot sequence and (on target) BLXNS.
ra8_tz_secure_boot_step_t
Progress markers stamped into g_ra8_tz_secure_boot_step.
@ k_ra8_tz_secure_boot_step_sau_done
SAU regions programmed.
@ k_ra8_tz_secure_boot_step_ipcsar_written
IPCSAR write landed.
@ k_ra8_tz_secure_boot_step_prcr_unlocked
PRCR_S.PRC4 set.
@ k_ra8_tz_secure_boot_step_blxns_armed
MSP_NS / VTOR set up.
@ k_ra8_tz_secure_boot_step_branched
BLXNS executed (host).
@ k_ra8_tz_secure_boot_step_prcr_relocked
PRCR_S.PRC4 cleared.
@ k_ra8_tz_secure_boot_step_idle
Pre-run sentinel.
Self-describing RoT header the NS linker embeds in the NS image.
uint32_t body_len
Signed body length in bytes (trailer at base+len).
uint32_t magic
k_ra8_tz_ns_rot_header_magic ("NSR1").