ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_flash_types.h File Reference

Code MRAM driver – shared types (enums, structs, callback typedef). More...

#include <stdint.h>
#include "ra8_err.h"
#include "ra8_flash_regs.h"
Include dependency graph for ra8_flash_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_flash_cfg_t
 Initialisation descriptor for ra8_flash_init. More...
struct  ra8_flash_status_ext_t
 Extended status snapshot (MRCPS + MSTATR + MASTAT + MREZS). More...
struct  ra8_flash_status_t
 Decoded status snapshot, FSP-parity surface. More...
struct  ra8_flash_isr_event_t
 One IRQ event delivered to ra8_flash_callback_t. More...

Typedefs

typedef void(* ra8_flash_callback_t) (const ra8_flash_isr_event_t *ev)
 Callback signature for the unified flash IRQ dispatcher.

Enumerations

enum  ra8_flash_world_t : uint8_t {
  k_ra8_flash_world_ns = 0U ,
  k_ra8_flash_world_s = 1U
}
 Which secure-attribution gate to open for a write. More...
enum  ra8_flash_irq_src_t : uint8_t {
  k_ra8_flash_irq_code_ecc_ted = 0U ,
  k_ra8_flash_irq_code_ecc_dec = 1U ,
  k_ra8_flash_irq_extra_ecc_ted = 2U ,
  k_ra8_flash_irq_extra_ecc_dec = 3U ,
  k_ra8_flash_irq_program_err = 4U ,
  k_ra8_flash_irq_extra_err = 5U ,
  k_ra8_flash_irq_extra_cmdlk = 6U ,
  k_ra8_flash_irq_extra_ready = 7U ,
  k_ra8_flash_irq_count = 8U
}
 Source identifier for unified flash IRQ dispatcher. More...
enum  ra8_flash_startup_t : uint8_t {
  k_ra8_flash_startup_default = 0U ,
  k_ra8_flash_startup_alternate = 1U ,
  k_ra8_flash_startup_btflg = 2U
}
 Boot-area selection for ra8_flash_set_startup_area. More...
enum  ra8_flash_arc_id_t : uint8_t {
  k_ra8_flash_arc_sec = 0U ,
  k_ra8_flash_arc_oembl = 1U ,
  k_ra8_flash_arc_nsec_0 = 2U ,
  k_ra8_flash_arc_nsec_1 = 3U ,
  k_ra8_flash_arc_nsec_2 = 4U ,
  k_ra8_flash_arc_nsec_3 = 5U ,
  k_ra8_flash_arc_count = 6U
}
 Anti-rollback counter identifier. More...

Detailed Description

Code MRAM driver – shared types (enums, structs, callback typedef).

Tag
[Ring 3 / HAL] {World: S}

Type definitions for the RA8D2 MRAM controller driver. This sub-header is split out of ra8_flash.h (the thin umbrella) and holds every typed enum, configuration / status struct, IRQ-event struct, and the unified IRQ callback typedef the driver exposes. It is included by the function-prototype sub-headers (ra8_flash_core.h and ra8_flash_fsp.h) and, transitively, by the ra8_flash.h umbrella that consumers continue to include unchanged.

Since
0.1.0

Definition in file ra8_flash_types.h.

Typedef Documentation

◆ ra8_flash_callback_t

typedef void(* ra8_flash_callback_t) (const ra8_flash_isr_event_t *ev)

Callback signature for the unified flash IRQ dispatcher.

Parameters
[in]evEvent descriptor (source, fault address, status).
Precondition
Caller registered this callback via ra8_flash_callback_set.
Postcondition
Callback returns; dispatcher continues with the next pending source (if any) or returns to the caller of ra8_flash_dispatch_isr.
Note
Runs in IRQ context: keep it short, do not block.

Definition at line 168 of file ra8_flash_types.h.

Enumeration Type Documentation

◆ ra8_flash_arc_id_t

enum ra8_flash_arc_id_t : uint8_t

Anti-rollback counter identifier.

Enumerator
k_ra8_flash_arc_sec 

Secure ARC.

k_ra8_flash_arc_oembl 

OEM bootloader ARC.

k_ra8_flash_arc_nsec_0 

Non-secure ARC #0.

k_ra8_flash_arc_nsec_1 

Non-secure ARC #1.

k_ra8_flash_arc_nsec_2 

Non-secure ARC #2.

k_ra8_flash_arc_nsec_3 

Non-secure ARC #3.

k_ra8_flash_arc_count 

Sentinel.

Definition at line 74 of file ra8_flash_types.h.

◆ ra8_flash_irq_src_t

enum ra8_flash_irq_src_t : uint8_t

Source identifier for unified flash IRQ dispatcher.

Enumerator
k_ra8_flash_irq_code_ecc_ted 

Code MRAM 1-bit ECC TED.

k_ra8_flash_irq_code_ecc_dec 

Code MRAM 2-bit ECC DEC.

k_ra8_flash_irq_extra_ecc_ted 

Extra MRAM 1-bit ECC TED.

k_ra8_flash_irq_extra_ecc_dec 

Extra MRAM 2-bit ECC DEC.

k_ra8_flash_irq_program_err 

Code MRAM program/erase error.

k_ra8_flash_irq_extra_err 

Extra MRAM access error.

k_ra8_flash_irq_extra_cmdlk 

Extra MRAM command-lock.

k_ra8_flash_irq_extra_ready 

Extra MRAM ready.

k_ra8_flash_irq_count 

Sentinel: number of sources.

Definition at line 48 of file ra8_flash_types.h.

◆ ra8_flash_startup_t

enum ra8_flash_startup_t : uint8_t

Boot-area selection for ra8_flash_set_startup_area.

Enumerator
k_ra8_flash_startup_default 

Default startup area (BTFLG=1).

k_ra8_flash_startup_alternate 

Alternate startup area (BTFLG=0).

k_ra8_flash_startup_btflg 

Validation sentinel.

Definition at line 64 of file ra8_flash_types.h.

◆ ra8_flash_world_t

enum ra8_flash_world_t : uint8_t

Which secure-attribution gate to open for a write.

MRCPC0 controls writes to the non-secure MRAM half; MRCPC1 controls the secure half. Cite HUM Ch 59 p 3601..3603 (MRCPC0/MRCPC1 register descriptions in chapter range 3542..3625).

Enumerator
k_ra8_flash_world_ns 

Open MRCPC0 (non-secure half).

k_ra8_flash_world_s 

Open MRCPC1 (secure half).

Definition at line 39 of file ra8_flash_types.h.