75typedef enum : uint32_t {
90typedef enum : uint8_t {
102typedef enum : uint8_t {
113typedef enum : uint8_t {
121 "cacheable self-test buffer must be at least 4 KiB");
215 __asm
volatile(
"wfi");
283 const uint8_t expected =
351 if (sckdivcr == 0U) {
448 if (line ==
nullptr) {
478 ra8_log_info(
"CACHE_MPU",
"==== cache_mpu_hil: M85 L1 cache + MPU self-test ====");
481 ra8_log_info(
"CACHE_MPU",
"setup FAILED (CGC / console) -- halting");
490 ra8_log_info(
"CACHE_MPU",
"cache+mpu PASS (cacheable RW + MRAM const + Device MMIO)");
494 ra8_log_info(
"CACHE_MPU",
"cacheable-SRAM step FAILED");
void main(void)
Secure fallback main entry point.
static void cache_mpu_wfi_forever(void)
Park the Cortex-M85 forever in a WFI idle loop.
cache_mpu_mram_t
Geometry of the read-only MRAM const table summed in MPU region 0.
@ k_cache_mpu_mram_words
Number of 32-bit words in the const table.
static bool cache_mpu_test_device_mmio(void)
Step 3 – prove Device-nGnRE peripheral MMIO is accessible (region 3).
cache_mpu_config_t
Compile-time scalar parameters for the cache + MPU self-test.
@ k_cache_mpu_sckdivcr_exp
SCKDIVCR readback after ra8_cgc_init().
@ k_cache_mpu_buf_min
Self-test buffer floor (4 KiB minimum).
@ k_cache_mpu_baud
VCOM console line rate (8N1).
@ k_cache_mpu_mram_sum_exp
Expected sum of the MRAM const table.
@ k_cache_mpu_buf_bytes
Cacheable self-test buffer size (>= 4 KiB).
static const uint8_t k_cache_mpu_fail_sram[]
Failure banner: the cacheable-SRAM (region 1) readback mismatched.
static cache_mpu_result_t cache_mpu_run_selftest(void)
Run all three self-test steps in order, naming the first failure.
static bool cache_mpu_setup(void)
Bring up the clock tree and the VCOM console for the banner.
static void cache_mpu_emit(const uint8_t *line, size_t len)
Emit one banner line over the VCOM console and flush it.
cache_mpu_pattern_t
Affine byte-pattern coefficients: buf[i] = i * MUL + ADD.
@ k_cache_mpu_pat_add
Pattern addend.
@ k_cache_mpu_pat_mul
Pattern multiplier.
static bool cache_mpu_test_cacheable_rw(void)
Step 1 – prove cacheable RW works in M85-private SRAM (region 1).
cache_mpu_result_t
Verdict of the self-test, naming which step failed (if any).
@ k_cache_mpu_result_pass
All three steps passed.
@ k_cache_mpu_result_fail_mram
RO-MRAM-const (region 0) step failed.
@ k_cache_mpu_result_fail_mmio
Device-MMIO (region 3) step failed.
@ k_cache_mpu_result_fail_sram
Cacheable-RW (region 1) step failed.
static const uint8_t k_cache_mpu_fail_mmio[]
Failure banner: the Device-nGnRE MMIO (region 3) readback mismatched.
static const uint32_t k_cache_mpu_mram_table[k_cache_mpu_mram_words]
Read-only word table placed in MRAM .rodata (MPU region 0).
static const uint8_t k_cache_mpu_fail_setup[]
Failure banner: clock / console bring-up failed before the self-test.
static uint32_t cache_mpu_mram_const_sum(void)
Sum the read-only MRAM const table (executes from MRAM, region 0).
static uint8_t s_cache_mpu_buf[k_cache_mpu_buf_bytes]
4 KiB cacheable scratch buffer in M85-private SRAM (MPU region 1).
static bool cache_mpu_test_mram_const(void)
Step 2 – prove RO MRAM const + MRAM code execution (region 0).
static const uint8_t k_cache_mpu_fail_mram[]
Failure banner: the RO-MRAM-const (region 0) sum mismatched.
static const uint8_t k_cache_mpu_pass_banner[]
Deterministic one-shot HIL success banner (uart_scrape gate).
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.
ra8_err_t ra8_board_uart_console_flush(void)
Block until every byte queued on the J-Link OB VCOM console has finished clocking out on the wire.
Boot entry points shared between a vector table and its startup code.
Cortex-M85 L1 cache maintenance, enable/disable, and I-cache invalidate.
ra8_err_t ra8_cache_dcache_clean_invalidate_by_addr(const void *addr, uint32_t size)
Clean and invalidate the D-cache lines covering a byte range.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Lightweight Logging Interface for ra8-firmware.
void ra8_log_init(void)
Initialise the logging backend.
#define ra8_log_info(tag, message)
RA8 log info.
System Control (SYSC) register layout for the Renesas RA8D2.
static volatile uint32_t * ra8_sys_sckdivcr(void)
Get pointer to the 32-bit SCKDIVCR register.