ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_flash_irq.c
Go to the documentation of this file.
1
29
30#include <stdint.h>
31
32#include "ra8_attributes.h"
33#include "ra8_check.h"
34#include "ra8_err.h"
35#include "ra8_flash.h"
36#include "ra8_flash_internal.h"
37#include "ra8_flash_regs.h"
38#include "ra8_log.h"
39
40/* =============================================================================
41 * Public API: IRQ enables + dispatcher
42 * =============================================================================
43 */
44
65RA8_INTERNAL static void internal_irq_rmw8(uint16_t off, uint8_t bit, bool enable)
66{
67 uint8_t v = *ra8_mram_reg8(off);
68 if (enable) {
69 v = (uint8_t)(v | bit);
70 } else {
71 v = (uint8_t)(v & (uint8_t)~bit);
72 }
73 *ra8_mram_reg8(off) = v;
74}
75
97RA8_INTERNAL static void internal_apply_ecc_irq(uint16_t off, bool is_ted, bool enable)
98{
100 if (is_ted) {
102 }
103 internal_irq_rmw8(off, bit, enable);
104}
105
125RA8_INTERNAL static void internal_apply_extra_err_irq(bool err_kind, bool enable)
126{
127 uint8_t bit = k_ra8_mpaeint_mask_cmdlkie;
128 if (err_kind) {
130 }
132}
133
135{
136 if (src >= k_ra8_flash_irq_count) {
138 }
139 switch (src) {
143 break;
147 break;
149 /* HUM Ch 59 "MRCPAEINT : Code MRAM Program Access Error IRQ Enable" p 3579 */
150 uint8_t v = 0U;
151 if (enable) {
153 }
155 break;
156 }
160 break;
162 /* HUM Ch 59 "MRDYIE : Extra MRAM Ready Interrupt Enable" p 3564 */
163 uint8_t v = 0U;
164 if (enable) {
166 }
168 break;
169 }
170 /* Unreachable: the src >= k_ra8_flash_irq_count guard at line 135 rejects
171 * every value that could reach this arm, including k_ra8_flash_irq_count
172 * itself. */
173 /* fallthrough -- unreachable, validated above. */
174 case k_ra8_flash_irq_count: /* GCOVR_EXCL_LINE -- validated enum, default unreachable */
175 default: /* GCOVR_EXCL_LINE -- validated enum, default unreachable */
176 return k_ra8_err_invalid_arg; /* GCOVR_EXCL_LINE -- validated enum, default unreachable */
177 }
178 return k_ra8_ok;
179}
180
182{
183 g_flash_rt.cb = cb;
184 g_flash_rt.user_ctx = user_ctx;
185 return k_ra8_ok;
186}
187
206RA8_INTERNAL static void
207internal_deliver(ra8_flash_irq_src_t src, uint32_t fault_addr, uint32_t status_word)
208{
209 if (g_flash_rt.cb == nullptr) {
210 return;
211 }
212 const ra8_flash_isr_event_t ev = {
213 .src = src,
214 .fault_addr = fault_addr,
215 .status_word = status_word,
216 .user_ctx = g_flash_rt.user_ctx,
217 };
218 g_flash_rt.cb(&ev);
219}
220
249RA8_INTERNAL static uint32_t internal_dispatch_ecc(uint16_t status_off,
250 uint16_t ted_addr_off,
251 uint16_t dec_addr_off,
252 ra8_flash_irq_src_t ted_src,
253 ra8_flash_irq_src_t dec_src)
254{
255 uint32_t delivered = 0U;
256 const uint8_t status = *ra8_mram_reg8(status_off);
257 if ((status & k_ra8_mrcraes_mask_tederrc) != 0U) {
258 const uint32_t fa = *ra8_mram_reg32(ted_addr_off);
259 internal_deliver(ted_src, fa, (uint32_t)status);
260 delivered++;
261 }
262 if ((status & k_ra8_mrcraes_mask_decerrc) != 0U) {
263 const uint32_t fa = *ra8_mram_reg32(dec_addr_off);
264 internal_deliver(dec_src, fa, (uint32_t)status);
265 delivered++;
266 }
267 if (status != 0U) {
268 *ra8_mram_reg8(status_off) = 0U;
269 }
270 return delivered;
271}
272
274{
275 uint32_t delivered = 0U;
276
287
288 /* HUM Ch 59 "MRCPS : Code MRAM Program Status Register" p 3577 */
289 const uint8_t mrcps = *ra8_mram_reg8(k_ra8_mram_off_mrcps);
290 if ((mrcps & k_ra8_mrcps_mask_errors) != 0U) {
291 /* HUM Ch 59 "MRCPEA : Code MRAM Program Error Address" p 3579 */
292 const uint32_t fa = *ra8_mram_reg32(k_ra8_mram_off_mrcpea);
293 internal_deliver(k_ra8_flash_irq_program_err, fa, (uint32_t)mrcps);
294 /* W1C the program error bits. */
296#ifdef RA8_OFF_TARGET
297 /* The host-test fake is dumb memory: emulate the W1C clear so the
298 * post-dispatch state matches real HW. */
300#endif
301 delivered++;
302 }
303
304 /* HUM Ch 59 "MASTAT : Extra MRAM Access Status Register" p 3562 */
305 const uint8_t mastat = *ra8_mram_reg8(k_ra8_mram_off_mastat);
306 if ((mastat & k_ra8_mastat_mask_mreae) != 0U) {
307 internal_deliver(k_ra8_flash_irq_extra_err, 0U, (uint32_t)mastat);
308 delivered++;
309 }
310 if ((mastat & k_ra8_mastat_mask_cmdlk) != 0U) {
311 internal_deliver(k_ra8_flash_irq_extra_cmdlk, 0U, (uint32_t)mastat);
312 delivered++;
313 }
314
315 /* HUM Ch 59 "MSTATR : Extra MRAM Status Register" p 3568 */
316 const uint32_t mstatr = *ra8_mram_reg32(k_ra8_mram_off_mstatr);
317 if ((mstatr & k_ra8_mstatr_mask_mrdy) != 0U) {
319 delivered++;
320 }
321 return delivered;
322}
323
324/* =============================================================================
325 * Public API: FSP r_mram parity surface
326 * =============================================================================
327 */
328
330{
331 /* FSP r_mram.c L253 R_MRAM_Open delegates to mram_init; we delegate to the
332 * existing ra8_flash_init so there is one canonical bring-up path. */
333 return ra8_flash_init(cfg);
334}
335
337{
338 /* FSP r_mram.c L646 R_MRAM_Close just clears the opened flag; we delegate
339 * to ra8_flash_deinit which also returns the controller to read mode. */
340 return ra8_flash_deinit();
341}
342
343ra8_err_t ra8_flash_set_window(uintptr_t low, uintptr_t high)
344{
345 if (low == 0U && high == 0U) {
346 g_flash_rt.win_low = 0U;
347 g_flash_rt.win_high = 0U;
348 return k_ra8_ok;
349 }
350 if (low >= high) {
352 }
353 g_flash_rt.win_low = low;
354 g_flash_rt.win_high = high;
355 return k_ra8_ok;
356}
357
382RA8_INTERNAL static ra8_err_t internal_validate_range(uintptr_t address, uint64_t total_len)
383{
384 if ((address & (k_ra8_mram_block_size_bytes - 1U)) != 0U) {
386 }
387 const uint64_t end_excl = (uint64_t)address + total_len;
388 if (address < k_ra8_flash_code_start) {
390 }
391 if (end_excl > (uint64_t)k_ra8_flash_code_start + (uint64_t)k_ra8_flash_code_size) {
393 }
394 if (!priv_ra8_flash_internal_window_allows(address, (uint32_t)total_len)) {
396 }
397 return k_ra8_ok;
398}
399
400ra8_err_t ra8_flash_erase(uintptr_t address, uint32_t num_blocks)
401{
402 RA8_VALIDATE_INIT(g_flash_rt.initialized, g_flash_tag, "flash_erase before init");
403 if (num_blocks == 0U) {
405 }
406 const uint64_t total_bytes = (uint64_t)num_blocks * (uint64_t)k_ra8_mram_block_size_bytes;
407 const ra8_err_t v_err = internal_validate_range(address, total_bytes);
408 RA8_RETURN_ON_ERROR(v_err, g_flash_tag, "flash_erase: validate");
409 /* internal_validate_range above rejects any address outside
410 * [k_ra8_flash_code_start, +k_ra8_flash_code_size), which is the default
411 * (non-secure) 0x02000000 code-MRAM view -- HUM Ch 59.1 "Address Map" p 3543.
412 * The secure alias therefore cannot reach here, so MRCPC0 is provably the
413 * right controller. A caller that needs the secure half calls
414 * ra8_flash_erase_block / ra8_flash_write_block directly with world_s. */
416 /* FSP r_mram.c L917 mram_erase_blocks loops one programming-size block at
417 * a time; we mirror that one-block-per-iteration cadence. NASA Rule 2:
418 * loop bound is the caller-supplied num_blocks, validated above. */
419 uintptr_t cur = address;
420 for (uint32_t i = 0U; i < num_blocks; ++i) {
421 const ra8_err_t err = ra8_flash_erase_block((uint32_t)cur, world);
422 if (err != k_ra8_ok) {
423 return err;
424 }
426 }
427 return k_ra8_ok;
428}
429
430ra8_err_t ra8_flash_write(uintptr_t address, const uint8_t* src, uint32_t len)
431{
432 RA8_CHECK_NULL_PTR(src, g_flash_tag, "src must not be nullptr");
433 RA8_VALIDATE_INIT(g_flash_rt.initialized, g_flash_tag, "flash_write before init");
434 if (len == 0U || (len % k_ra8_mram_write_size_bytes) != 0U) {
436 }
437 const ra8_err_t v_err = internal_validate_range(address, (uint64_t)len);
438 RA8_RETURN_ON_ERROR(v_err, g_flash_tag, "flash_write: validate");
439 /* Same reasoning as ra8_flash_erase: the validated range lies inside the
440 * default non-secure code-MRAM view, so MRCPC0 is provably correct. */
442 /* FSP r_mram.c L861 mram_write_data chunks the request into 32-byte
443 * page programs; our wrapper re-uses ra8_flash_write_block for each
444 * page. NASA Rule 2: loop bound is len/page (validated above). */
445 const uint32_t pages = len / k_ra8_mram_write_size_bytes;
446 for (uint32_t i = 0U; i < pages; ++i) {
447 const uint32_t offset = i * k_ra8_mram_write_size_bytes;
448 const uintptr_t page_addr = address + offset;
449 const ra8_err_t err =
450 ra8_flash_write_block((uint32_t)page_addr, src + offset, k_ra8_mram_write_size_bytes, world);
451 if (err != k_ra8_ok) {
452 return err;
453 }
454 }
455 return k_ra8_ok;
456}
457
461typedef enum : uint8_t {
464
465ra8_err_t ra8_flash_blank_check(uintptr_t address, uint32_t len, bool* out_blank)
466{
467 RA8_CHECK_NULL_PTR(out_blank, g_flash_tag, "out_blank must not be nullptr");
468 if (len == 0U) {
470 }
471 /* Accept either MRAM window. FSP r_mram.c L395 R_MRAM_BlankCheck returns
472 * UNSUPPORTED on RA8D2 because the silicon has no BlankCheck command;
473 * we implement the check as a direct read since 0xFF is the documented
474 * erased state (HUM Ch 59.4.2 p 3548). */
475 const uint64_t end_excl = (uint64_t)address + (uint64_t)len;
476 const bool in_code =
477 (address >= k_ra8_flash_code_start) &&
478 (end_excl <= (uint64_t)k_ra8_flash_code_start + (uint64_t)k_ra8_flash_code_size);
479 const bool in_extra =
480 (address >= k_ra8_flash_extra_start) &&
481 (end_excl <= (uint64_t)k_ra8_flash_extra_start + (uint64_t)k_ra8_flash_extra_size);
482 /* HUM Ch 7 "Option-Setting Memory" p 278 also benefits from a blank-check
483 * (callers may want to verify a freshly-erased OFS slot before re-write). */
484 const bool in_ofs =
485 (address >= k_ra8_flash_ofs_start) &&
486 (end_excl <= (uint64_t)k_ra8_flash_ofs_start + (uint64_t)k_ra8_flash_ofs_size);
487 if (!in_code && !in_extra && !in_ofs) {
489 }
490
491 const volatile uint8_t* p = (const volatile uint8_t*)address;
492 bool is_blank = true;
493 /* NASA Rule 2: bounded loop on caller-validated len. */
494 for (uint32_t i = 0U; i < len; ++i) {
495 if (p[i] != k_ra8_flash_blank_byte) {
496 is_blank = false;
497 break;
498 }
499 }
500 *out_blank = is_blank;
501 return k_ra8_ok;
502}
503
505{
506 RA8_CHECK_NULL_PTR(out, g_flash_tag, "out must not be nullptr");
507
508 /* HUM Ch 59 "MRCPS : Code MRAM Program Status Register" p 3577 */
509 const uint8_t mrcps = *ra8_mram_reg8(k_ra8_mram_off_mrcps);
510 /* HUM Ch 59 "MASTAT : Extra MRAM Access Status Register" p 3562 */
511 const uint8_t mastat = *ra8_mram_reg8(k_ra8_mram_off_mastat);
512 /* HUM Ch 59 "MENTRYR : Extra MRAM Program-Mode Entry" p 3571 */
513 const uint16_t mentryr = *ra8_mram_reg16(k_ra8_mram_off_mentryr);
514 /* HUM Ch 59 "MSTATR : Extra MRAM Status Register" p 3568 */
515 const uint32_t mstatr = *ra8_mram_reg32(k_ra8_mram_off_mstatr);
516 /* HUM Ch 59 "MRCBPROT0 : Code MRAM Block Protection (NS)" p 3576 */
517 const uint16_t mrcbprot0 = *ra8_mram_reg16(k_ra8_mram_off_mrcbprot0);
518 /* HUM Ch 59 "MRCBPROT1 : Code MRAM Block Protection (S)" p 3577 */
519 const uint16_t mrcbprot1 = *ra8_mram_reg16(k_ra8_mram_off_mrcbprot1);
520
521 const bool busy =
522 ((mrcps & k_ra8_mrcps_mask_prgbsyc) != 0U) || ((mentryr & k_ra8_mentryr_mask_pe_mode) != 0U);
523 out->programming_busy = busy;
524 out->erase_busy = busy; /* MRAM has no separate erase. */
525 out->illegal_command =
526 ((mastat & k_ra8_mastat_mask_cmdlk) != 0U) || ((mstatr & k_ra8_mstatr_mask_ilgcomerr) != 0U);
527 out->voltage_error = ((mstatr & k_ra8_mstatr_mask_oterr) != 0U);
528 /* MRCBPROTx low bit = 1 means programming is permitted; bit clear
529 * (the keyed lock pattern with bit 0 == 0) means the block is
530 * write-protected. HUM Ch 59 p 3604..3605. */
531 out->sector_protected = ((mrcbprot0 & 0x0001U) == 0U) || ((mrcbprot1 & 0x0001U) == 0U);
532 out->program_error = ((mrcps & k_ra8_mrcps_mask_prgerrc) != 0U);
533 out->ecc_error = ((mrcps & k_ra8_mrcps_mask_eccerrc) != 0U);
534 return k_ra8_ok;
535}
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_RETURN_ON_ERROR(err, tag, message)
Early return on error, propagating the code upward.
Definition ra8_check.h:184
#define RA8_VALIDATE_INIT(initialized, tag, message)
Precondition: module must be initialized.
Definition ra8_check.h:334
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Definition ra8_check.h:243
Error Code Definitions for ra8-firmware.
@ k_ra8_err_out_of_range
Sensor or peripheral output out of valid range.
Definition ra8_err.h:337
@ k_ra8_err_invalid_arg
Invalid function argument.
Definition ra8_err.h:152
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Definition ra8_err.h:119
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_flash_runtime_t g_flash_rt
Single shared ra8_flash runtime-state instance.
Definition ra8_flash.c:67
bool priv_ra8_flash_internal_window_allows(uintptr_t addr, uint32_t len)
Test whether [addr, addr+len) lies inside the configured soft window.
Definition ra8_flash.c:588
const char * g_flash_tag
Shared log tag string for the ra8_flash module.
Definition ra8_flash.c:50
Code MRAM + Extra MRAM + Option-Setting driver – DANGEROUS, brick-capable.
ra8_err_t ra8_flash_init(const ra8_flash_cfg_t *cfg)
Initialise the MRAM controller for safe read access.
Definition ra8_flash.c:386
ra8_err_t ra8_flash_write_block(uint32_t mram_addr, const uint8_t *src, uint32_t len, ra8_flash_world_t world)
Program 1..32 contiguous bytes into one MRAM page.
Definition ra8_flash.c:709
ra8_err_t ra8_flash_erase_block(uint32_t mram_addr, ra8_flash_world_t world)
Erase (= program to all 0xFF) one 32-byte MRAM block.
Definition ra8_flash.c:734
ra8_err_t ra8_flash_deinit(void)
Deinitialise: lock all program gates and re-enable prefetch.
Definition ra8_flash.c:446
Test-access surface for ra8_flash internal helpers (MC/DC).
ra8_err_t ra8_flash_status(ra8_flash_status_t *out)
Decode the controller status into a flat ra8_flash_status_t.
static void internal_apply_ecc_irq(uint16_t off, bool is_ted, bool enable)
Apply enable/disable to an MRCRAEINT-style ECC IRQ.
ra8_err_t ra8_flash_set_window(uintptr_t low, uintptr_t high)
Configure the soft access window enforced by write/erase.
static void internal_apply_extra_err_irq(bool err_kind, bool enable)
Apply enable/disable to an MPAEINT bit.
ra8_err_t ra8_flash_set_irq_enable(ra8_flash_irq_src_t src, bool enable)
Enable or disable MRAM-controller IRQs by source.
ra8_err_t ra8_flash_open(const ra8_flash_cfg_t *cfg)
FSP-parity bring-up: equivalent to ra8_flash_init.
uint32_t ra8_flash_dispatch_isr(void)
Run the MRAM IRQ dispatcher (call from the BSP vector).
ra8_err_t ra8_flash_callback_set(ra8_flash_callback_t cb, void *user_ctx)
Register the unified IRQ callback.
ra8_flash_blank_const_t
Erase-pattern constants used by ra8_flash_blank_check.
@ k_ra8_flash_blank_byte
Erased state byte value (HUM Ch 59 p 3548).
ra8_err_t ra8_flash_write(uintptr_t address, const uint8_t *src, uint32_t len)
Program len bytes into code-MRAM starting at address.
static void internal_deliver(ra8_flash_irq_src_t src, uint32_t fault_addr, uint32_t status_word)
Deliver one IRQ event to the registered callback.
static uint32_t internal_dispatch_ecc(uint16_t status_off, uint16_t ted_addr_off, uint16_t dec_addr_off, ra8_flash_irq_src_t ted_src, ra8_flash_irq_src_t dec_src)
Dispatch ECC TED/DEC events for one of the two MRAM regions.
ra8_err_t ra8_flash_erase(uintptr_t address, uint32_t num_blocks)
Erase num_blocks consecutive 32-byte MRAM blocks.
static ra8_err_t internal_validate_range(uintptr_t address, uint64_t total_len)
Validate a multi-block erase / multi-page write range.
ra8_err_t ra8_flash_blank_check(uintptr_t address, uint32_t len, bool *out_blank)
Check whether a region holds the erase pattern (all 0xFF).
static void internal_irq_rmw8(uint16_t off, uint8_t bit, bool enable)
Read-modify-write a single bit in an 8-bit register.
ra8_err_t ra8_flash_close(void)
FSP-parity tear-down: equivalent to ra8_flash_deinit.
Flash / MRAM controller register layout for the Renesas RA8D2.
static volatile uint8_t * ra8_mram_reg8(uint16_t off)
Pointer to a byte-wide MRMS register at offset off.
@ k_ra8_mrcraes_mask_decerrc
2-bit DEC error.
@ k_ra8_mrcraes_mask_tederrc
1-bit TED error.
@ k_ra8_mrcpaeint_mask_mrcaeie
Code program-error IRQ enable.
@ k_ra8_mastat_mask_cmdlk
Command lock latched.
@ k_ra8_mastat_mask_mreae
Extra MRAM access error.
@ k_ra8_flash_code_size
1 MiB of code MRAM.
@ k_ra8_flash_extra_start
First legal Program target (FSBL setting).
@ k_ra8_flash_extra_size
Covers through 0x02E179F0 (last, reserved).
@ k_ra8_flash_code_start
Start of code MRAM region.
@ k_ra8_flash_ofs_start
Start of OFS config_set window.
@ k_ra8_flash_ofs_size
4 KiB OFS block.
static volatile uint16_t * ra8_mram_reg16(uint16_t off)
Pointer to a halfword-wide MRMS register at offset off.
@ k_ra8_mstatr_mask_mrdy
MRE ready.
@ k_ra8_mstatr_mask_oterr
Other error.
@ k_ra8_mstatr_mask_ilgcomerr
Illegal command error.
@ k_ra8_mpaeint_mask_cmdlkie
Command-lock IRQ enable.
@ k_ra8_mpaeint_mask_mreaeie
Access-error IRQ enable.
@ k_ra8_mrdyie_mask_mrdyie
MRDY IRQ enable.
@ k_ra8_mentryr_mask_pe_mode
MENTRY status bit.
static volatile uint32_t * ra8_mram_reg32(uint16_t off)
Pointer to a word-wide MRMS register at offset off.
@ k_ra8_mram_block_size_bytes
One programmable block.
@ k_ra8_mram_write_size_bytes
Minimum programmable unit.
@ k_ra8_mram_off_mentryr
RA8 MRAM off mentryr.
@ k_ra8_mram_off_mrcrtea
RA8 MRAM off mrcrtea.
@ k_ra8_mram_off_mrcps
RA8 MRAM off mrcps.
@ k_ra8_mram_off_mrertea
RA8 MRAM off mrertea.
@ k_ra8_mram_off_mrdyie
RA8 MRAM off mrdyie.
@ k_ra8_mram_off_mrcbprot1
RA8 MRAM off mrcbprot1.
@ k_ra8_mram_off_mpaeint
RA8 MRAM off mpaeint.
@ k_ra8_mram_off_mrcpea
RA8 MRAM off mrcpea.
@ k_ra8_mram_off_mrcraes
RA8 MRAM off mrcraes.
@ k_ra8_mram_off_mrcraeint
RA8 MRAM off mrcraeint.
@ k_ra8_mram_off_mrerdea
RA8 MRAM off mrerdea.
@ k_ra8_mram_off_mreraint
RA8 MRAM off mreraint.
@ k_ra8_mram_off_mrcpaeint
RA8 MRAM off mrcpaeint.
@ k_ra8_mram_off_mrcbprot0
RA8 MRAM off mrcbprot0.
@ k_ra8_mram_off_mastat
RA8 MRAM off mastat.
@ k_ra8_mram_off_mstatr
RA8 MRAM off mstatr.
@ k_ra8_mram_off_mreraes
RA8 MRAM off mreraes.
@ k_ra8_mram_off_mrcrdea
RA8 MRAM off mrcrdea.
@ k_ra8_mrcps_mask_errors
W1C: PRGERRC + ECCERRC.
@ k_ra8_mrcps_mask_prgbsyc
Code MRAM program busy.
@ k_ra8_mrcps_mask_prgerrc
Programming error.
@ k_ra8_mrcps_mask_eccerrc
ECC error.
@ k_ra8_mrcraeint_mask_intenbtc
TED error IRQ enable.
@ k_ra8_mrcraeint_mask_intenbdc
DEC error IRQ enable.
ra8_flash_irq_src_t
Source identifier for unified flash IRQ dispatcher.
@ k_ra8_flash_irq_extra_ready
Extra MRAM ready.
@ k_ra8_flash_irq_code_ecc_ted
Code MRAM 1-bit ECC TED.
@ k_ra8_flash_irq_extra_cmdlk
Extra MRAM command-lock.
@ k_ra8_flash_irq_extra_ecc_dec
Extra MRAM 2-bit ECC DEC.
@ k_ra8_flash_irq_extra_err
Extra MRAM access error.
@ k_ra8_flash_irq_program_err
Code MRAM program/erase error.
@ k_ra8_flash_irq_extra_ecc_ted
Extra MRAM 1-bit ECC TED.
@ k_ra8_flash_irq_count
Sentinel: number of sources.
@ k_ra8_flash_irq_code_ecc_dec
Code MRAM 2-bit ECC DEC.
ra8_flash_world_t
Which secure-attribution gate to open for a write.
@ k_ra8_flash_world_ns
Open MRCPC0 (non-secure half).
void(* ra8_flash_callback_t)(const ra8_flash_isr_event_t *ev)
Callback signature for the unified flash IRQ dispatcher.
Lightweight Logging Interface for ra8-firmware.
Initialisation descriptor for ra8_flash_init.
One IRQ event delivered to ra8_flash_callback_t.
Decoded status snapshot, FSP-parity surface.
bool program_error
MRCPS.PRGERRC.
bool sector_protected
MRCBPROT0/1 lock observed.
bool ecc_error
MRCPS.ECCERRC.
bool illegal_command
MASTAT.CMDLK or MSTATR.ILGCOMERR.
bool programming_busy
MRCPS.PRGBSYC or MENTRYR.MENTRY set.
bool erase_busy
Same as programming_busy on MRAM.
bool voltage_error
MSTATR.OTERR (other / supply error).