45typedef enum : uint32_t {
63typedef enum : uint32_t {
198typedef enum : uint64_t {
223typedef enum : uint64_t {
238typedef enum : uint32_t {
374 const uint64_t span = fam->
stride * (uint64_t)fam->
count;
375 if ((addr >= fam->
base) && (addr < (fam->
base + span))) {
376 *out_idx = (uint32_t)((addr - fam->
base) / fam->
stride);
402 return (
s_mstpcr[reg] & ((uint32_t)1U << bit)) != 0U;
423 for (
unsigned i = 0U; i < size; i++) {
424 const uint64_t b = off + (uint64_t)i;
439 for (
unsigned i = 0U; i < size; i++) {
440 const uint64_t b = off + (uint64_t)i;
456 if (fam ==
nullptr) {
466 if (fam !=
nullptr) {
Module-private module-stop (MSTP) gate state shared with the core.
@ k_board_mstp_win_span
MSTPCRA..E = 5 x uint32 = 20 B.
static const uint16_t s_k_ids_dac[]
DAC_B0..DAC_B1 (0x40233000, 0x100 stride) – MSTPCRD20..19, HUM 11.2.9.
static const uint16_t s_k_ids_xspi[]
XSPI0 / OSPI0 (0x40268000) – MSTPCRB16, HUM 11.2.7.
mstp_reset_t
Per-register reset values: all peripheral bits stopped (HUM 11.2.6).
@ k_mstp_reset_a
MSTPCRA: SRAM0-3 (bits 0-3) running.
@ k_mstp_reset_rest
MSTPCRB..E: all peripherals stopped.
static const uint16_t s_k_ids_i3c[]
I3C0 (0x4035F000) – MSTPCRB4, HUM 11.2.7.
static const uint16_t s_k_ids_agt[]
AGT0..AGT1 (0x40221000, 0x100 stride) – MSTPCRD5..4, HUM 11.2.9.
static const uint16_t s_k_ids_crc[]
CRC (0x40310000) – MSTPCRC1, HUM 11.2.8.
void priv_board_mstp_note_gated_access(uint64_t addr, bool is_write)
Record that an MMIO access to a module-stopped peripheral was dropped.
static const char * s_last_gated
Label of last gated access.
static const uint16_t s_k_ids_sdhi[]
SDHI0 (0x40252000) – MSTPCRC12, HUM 11.2.8.
static const uint16_t s_k_ids_ulpt[]
ULPT0..ULPT1 (0x40220000, 0x100 stride) – MSTPCRE9..8, HUM 11.2.10.
mstp_family_base_t
Peripheral-family register-window bases (RA8D2 peripheral memory map).
@ k_mstp_base_drw
DRW / D-AVE 2D.
@ k_mstp_base_riic
IIC0 (RIIC family base).
@ k_mstp_base_sci
SCI0 (SCI family base).
@ k_mstp_base_poeg
POEG group A (POEG base).
@ k_mstp_base_canfd1
CANFD1.
@ k_mstp_base_ulpt
ULPT0 (ULPT family base).
@ k_mstp_base_agt
AGT0 (AGT family base).
@ k_mstp_base_ssie
SSIE0 (SSIE family base).
@ k_mstp_base_spi
SPI0 (SPI_B family base).
@ k_mstp_base_gpt
GPT0 (GPT family base).
@ k_mstp_base_dac
DAC_B0 (DAC family base).
@ k_mstp_base_canfd0
CANFD0.
static const uint16_t s_k_ids_cac[]
CAC (0x40202400) – MSTPCRC0, HUM 11.2.8.
static const mstp_family_t * internal_mstp_family_for_addr(uint64_t addr, uint32_t *out_idx)
Resolve addr to the family + instance index that owns it.
uint32_t priv_board_mstp_read_reg(uint64_t off, unsigned size)
Read the tracked MSTPCRA..MSTPCRE shadow (the read-back path).
mstp_dim_t
Shadow-array dimensions + bit-field packing constants.
@ k_mstp_byte_mask
Low-byte mask.
@ k_mstp_reg_count
MSTPCRA..MSTPCRE.
@ k_mstp_bytes_per_reg
32-bit registers.
@ k_mstp_id_reg_shift
ra8_mstp_t: reg in bits 15:8.
@ k_mstp_id_bit_mask
ra8_mstp_t: bit in bits 7:0.
@ k_mstp_byte_bits
Bits per byte.
static const uint16_t s_k_ids_gpt[]
GPT0..GPT13 (0x40322000, 0x100 stride) – MSTPCRE31..18, GPT4..9 share MSTPE27, HUM 11....
uint32_t priv_board_mstp_gated_write_count(void)
Number of writes dropped because their peripheral was module-stopped.
uint32_t priv_board_mstp_gated_read_count(void)
Number of reads zeroed because their peripheral was module-stopped.
const char * priv_board_mstp_last_gated_name(void)
Label of the peripheral whose access was most recently gated off.
void priv_board_mstp_reset(void)
Restore MSTPCRA..MSTPCRE to their all-stopped reset values.
static uint32_t s_gated_reads
Reads zeroed (peripheral off).
static const uint16_t s_k_ids_ssie[]
SSIE0..SSIE1 (0x4025D000, 0x100 stride) – MSTPCRC8..7, HUM 11.2.8.
mstp_family_span_t
Per-family instance stride / single-instance window span (bytes).
@ k_mstp_span_adc
ADC_B register window.
@ k_mstp_span_doc
DOC register window.
@ k_mstp_span_sdhi
SDHI0 register window.
@ k_mstp_span_i3c
I3C window (through BCST).
@ k_mstp_chan_stride
Channel stride (also CEU window).
@ k_mstp_span_pdm
PDM common + channel banks.
@ k_mstp_span_cac
CAC register window.
@ k_mstp_span_canfd
CANFD channel window.
@ k_mstp_span_drw
DRW register window.
@ k_mstp_span_crc
CRC register window.
@ k_mstp_span_xspi
XSPI0 register window.
static const uint16_t s_k_ids_sci[]
SCI0..SCI9 (0x40358000, 0x100 stride) – MSTPCRB31..22, HUM 11.2.7.
bool priv_board_mstp_addr_stopped(uint64_t addr)
Report whether the peripheral instance owning addr is module-stopped.
static uint32_t s_gated_writes
Writes dropped (periph off).
void priv_board_mstp_apply_write(uint64_t off, unsigned size, uint32_t value)
Apply a firmware write to the MSTPCRA..MSTPCRE shadow.
static const uint16_t s_k_ids_spi[]
SPI0..SPI1 (0x4035C000, 0x100 stride) – MSTPCRB19..18, HUM 11.2.7.
static const uint16_t s_k_ids_canfd1[]
CANFD1 (0x40382000) – MSTPCRC26, HUM 11.2.8.
static const uint16_t s_k_ids_adc[]
ADC_B (0x40338000) – MSTPCRD21, HUM 11.2.9.
static const mstp_family_t s_k_families[]
The gate table: every module-stop-gated modelled peripheral instance.
static const uint16_t s_k_ids_pdm[]
PDM-IF (0x40256000) – MSTPCRC24, HUM 11.2.8.
static const uint16_t s_k_ids_doc[]
DOC (0x40311000) – MSTPCRC13, HUM 11.2.8.
static const uint16_t s_k_ids_poeg[]
POEG group A..D (0x40212000, 0x100 stride) – MSTPCRD14..11, HUM 11.2.9.
static bool internal_mstp_bit_set(uint16_t id)
True iff the module-stop bit id (packed ra8_mstp_t) reads set.
static const uint16_t s_k_ids_canfd0[]
CANFD0 (0x40380000) – MSTPCRC27, HUM 11.2.8.
static const uint16_t s_k_ids_riic[]
IIC0..IIC2 / RIIC (0x4025E000, 0x100 stride) – MSTPCRB9..7, HUM 11.2.7.
static const uint16_t s_k_ids_ceu[]
CEU (0x40348000) – MSTPCRC16, HUM 11.2.8.
mstp_family_count_t
Instance counts per family (channels with a module-stop bit).
@ k_mstp_count_14
GPT (fourteen channels).
@ k_mstp_count_1
Single-instance peripheral.
@ k_mstp_count_4
POEG (four groups).
@ k_mstp_count_3
RIIC (three channels).
@ k_mstp_count_10
SCI (ten channels).
@ k_mstp_count_2
SPI/AGT/ULPT/DAC/SSIE (two).
static uint32_t s_mstpcr[k_mstp_reg_count]
MSTPCRA..E live values.
static const uint16_t s_k_ids_drw[]
DRW / D-AVE 2D (0x40444000) – MSTPCRC6, HUM 11.2.8.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Module Stop Control (MSTP) register layout for the Renesas RA8D2.
@ k_ra8_mstp_sci2
MSTPB29 SCI2.
@ k_ra8_mstp_sci4
MSTPB27 SCI4.
@ k_ra8_mstp_agt0
MSTPD5 AGT0.
@ k_ra8_mstp_gpt2
MSTPE29 GPT2.
@ k_ra8_mstp_sci7
MSTPB24 SCI7.
@ k_ra8_mstp_ulpt1
MSTPE8 ULPT1.
@ k_ra8_mstp_agt1
MSTPD4 AGT1.
@ k_ra8_mstp_ssie1
MSTPC7 SSIE1.
@ k_ra8_mstp_crc
MSTPC1 CRC.
@ k_ra8_mstp_pdmif
MSTPC24 PDM-IF.
@ k_ra8_mstp_gpt11
MSTPE20 GPT11.
@ k_ra8_mstp_iic2
MSTPB7 IIC2.
@ k_ra8_mstp_sci9
MSTPB22 SCI9.
@ k_ra8_mstp_sci0
MSTPB31 SCI0.
@ k_ra8_mstp_gpt3
MSTPE28 GPT3.
@ k_ra8_mstp_ospi0
MSTPB16 OSPI0+DOTF0.
@ k_ra8_mstp_iic0
MSTPB9 IIC0.
@ k_ra8_mstp_sci5
MSTPB26 SCI5.
@ k_ra8_mstp_adc16h
MSTPD21 ADC16H.
@ k_ra8_mstp_iic1
MSTPB8 IIC1.
@ k_ra8_mstp_gpt10
MSTPE21 GPT10.
@ k_ra8_mstp_ulpt0
MSTPE9 ULPT0.
@ k_ra8_mstp_cac
MSTPC0 CAC.
@ k_ra8_mstp_drw
MSTPC6 2D Drawing.
@ k_ra8_mstp_ssie0
MSTPC8 SSIE0.
@ k_ra8_mstp_spi0
MSTPB19 SPI0.
@ k_ra8_mstp_sci1
MSTPB30 SCI1.
@ k_ra8_mstp_ceu
MSTPC16 CEU.
@ k_ra8_mstp_sdhi0
MSTPC12 SDHI0.
@ k_ra8_mstp_sci6
MSTPB25 SCI6.
@ k_ra8_mstp_poeg_c
MSTPD12 POEG group C.
@ k_ra8_mstp_dac12_0
MSTPD20 DAC12 ch 0.
@ k_ra8_mstp_canfd1
MSTPC26 CANFD1.
@ k_ra8_mstp_gpt4_9
MSTPE27 GPT4..GPT9.
@ k_ra8_mstp_gpt1
MSTPE30 GPT1.
@ k_ra8_mstp_poeg_a
MSTPD14 POEG group A.
@ k_ra8_mstp_poeg_d
MSTPD11 POEG group D.
@ k_ra8_mstp_gpt13
MSTPE18 GPT13.
@ k_ra8_mstp_dac12_1
MSTPD19 DAC12 ch 1.
@ k_ra8_mstp_canfd0
MSTPC27 CANFD0.
@ k_ra8_mstp_spi1
MSTPB18 SPI1.
@ k_ra8_mstp_gpt0
MSTPE31 GPT0.
@ k_ra8_mstp_doc
MSTPC13 DOC.
@ k_ra8_mstp_i3c
MSTPB4 I3C.
@ k_ra8_mstp_sci8
MSTPB23 SCI8.
@ k_ra8_mstp_gpt12
MSTPE19 GPT12.
@ k_ra8_mstp_poeg_b
MSTPD13 POEG group B.
@ k_ra8_mstp_sci3
MSTPB28 SCI3.
One strided family of peripheral instances sharing a mapping shape.
uint32_t count
Number of gated instances in the family.
uint64_t base
Window base of instance 0.
uint64_t stride
Bytes between consecutive instances.
const uint16_t * ids
[count] packed ra8_mstp_t per instance.
const char * name
Short label for the dropped-access report.