42#ifdef RA8_ENABLE_ROOT_OF_TRUST
47#ifdef RA8_ENABLE_ROOT_OF_TRUST
83RA8_INTERNAL static bool internal_launch_authorized(uintptr_t src, uint32_t img_len)
106#ifdef RA8_ENABLE_ROOT_OF_TRUST
109 if (!internal_launch_authorized(src, img_len)) {
114#ifndef RA8_OFF_TARGET
115 const volatile uint32_t* s = (
const volatile uint32_t*)src;
117 const uint32_t words = img_len / (uint32_t)
sizeof(uint32_t);
119 __asm__
volatile(
"cpsid i" :::
"memory");
122 for (uint32_t i = 0U; i < words; ++i) {
125 __asm__
volatile(
"dsb 0xF" :::
"memory");
127 const uint32_t initial_sp = d[0];
128 const uint32_t reset_entry = d[1];
133 __asm__
volatile(
"dsb 0xF\n isb 0xF\n" :::
"memory");
134 __asm__
volatile(
"msr msp, %0\n"
137 :
"r"(initial_sp),
"r"(reset_entry)
139 __builtin_unreachable();
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Controller-agnostic USB-DFU MRAM bootloader core for the RA8D2.
bool ra8_dfu_run_target_valid(uint32_t entry, uint32_t img_len)
Decide whether a validated slot's image may be copied-to-run.
@ k_ra8_dfu_run_base
SRAM copy-to-run / payload link base.
DFU anti-rollback (downgrade protection) policy + storage seam.
const ra8_rot_antirollback_store_t * ra8_rot_antirollback_default_store(void)
Return the non-faking default store (reports "not provisioned").
ra8_err_t ra8_rot_antirollback_verify(const ra8_rot_antirollback_store_t *store, uint32_t image_version)
Read the stored minimum, apply the policy, and commit on accept.
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).
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Root-of-trust signed-image verifier (SHA-256 + ECDSA-P256, default-deny).
ra8_err_t ra8_rot_verify_image(const uint8_t *body, uint32_t body_len, const ra8_rot_trailer_t *trailer)
Authenticate a signed image: SHA-256 + ECDSA-P256, default-deny.
const ra8_rot_trailer_t * ra8_rot_trailer_after(const void *image_base, uint32_t body_len)
Locate the trailer that immediately follows a signed image body.
Cortex-M85 System Control Block: VTOR relocation + fault-status decode.
void ra8_scb_set_vtor(uintptr_t base)
Relocate the vector table by writing SCB->VTOR.
Authenticity trailer appended after a signed image body.
uint32_t img_version
Monotonic anti-rollback image ver.