|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
CANFD ECC (CNECC) register layout for the RA8D2. More...
Go to the source code of this file.
Data Structures | |
| struct | r_cnecc_regs_t |
| Per-instance CNECC register window (size = 0x14 bytes). More... | |
Functions | |
| static volatile r_cnecc_regs_t * | ra8_cnecc (uint8_t instance) |
| Get pointer to CNECC instance instance. | |
CANFD ECC (CNECC) register layout for the RA8D2.
The RA8D2 ships two CANFD message-buffer SRAM (MBRAM) ECC blocks (ECCMB0 and ECCMB1). Each instance is a small 0x14-byte window that detects single-bit ECC errors (correctable) and dual-bit ECC errors (uncorrectable) on the 32-bit CANFD message buffer SRAM that sits behind the corresponding CANFD channel (CAN0 for ECCMB0, CAN1 for ECCMB1).
Per-instance registers (HUM Ch 42.2 p 2868-2873):
| Offset | Name | Width | Purpose |
|---|---|---|---|
| 0x00 | EC710CTL | 32 | Enable / status / IRQ / clear |
| 0x04 | EC710TMC | 16 | Test-mode control (decoder fault inject) |
| 0x06 | (reserved) | 16 | |
| 0x08 | (reserved) | 32 | |
| 0x0C | EC710TED | 32 | Test substitute data (fault inject src) |
| 0x10 | EC710EAD0 | 32 | Captured faulting RAM offset |
Layout cross-checked against FSP R_ECCMB0_Type in R7KA8D2KF_core0.h (size = 20 bytes, base 0x4036F200 for instance 0, 0x4036F300 for instance 1, NS aliases at 0x5036F200 / 0x5036F300).
The single shared interrupt vector for both instances is CANn_MRAM_ERI (HUM 42.4 p 2875).
Definition in file ra8_cnecc_regs.h.
| enum ra8_cnecc_addr_t : uintptr_t |
Memory-mapped base addresses for the two CNECC instances.
Secure aliases (0x4036F200 family). The non-secure aliases (0x5036F200 family) are not mirrored here – security-attribute routing is the job of the SAR layer, not the per-driver register header. HUM Ch 42.2.1 "Base address" line, p 2868.
| Enumerator | |
|---|---|
| k_ra8_cnecc0_base_addr | ECCMB0 (CAN0 MRAM). |
| k_ra8_cnecc1_base_addr | ECCMB1 (CAN1 MRAM). |
Definition at line 57 of file ra8_cnecc_regs.h.
| enum ra8_cnecc_ctl_bit_t : uint8_t |
EC710CTL bit positions.
Verified against HUM Ch 42.2.1 "EC710CTL" p 2868 and FSP R_ECCMB0_EC710CTL_*_Pos defines in R7KA8D2KF_core0.h.
Definition at line 80 of file ra8_cnecc_regs.h.
| enum ra8_cnecc_ctl_mask_t : uint32_t |
EC710CTL bit masks (32-bit register).
Cross-checked against FSP R_ECCMB0_EC710CTL_*_Msk defines. HUM Ch 42.2.1 p 2870 EMCA[1:0] = 01b is the write-unlock pattern for ECERVF.
Definition at line 106 of file ra8_cnecc_regs.h.
| enum ra8_cnecc_ead_mask_t : uint32_t |
EC710EAD0 field mask (10-bit RAM offset).
HUM Ch 42.2.4 p 2872: ECEAD[9:0] holds the captured RAM word offset; bits [31:10] are reserved and read as 0.
| Enumerator | |
|---|---|
| k_ra8_cnecc_mask_ecead | ECEAD[9:0]. |
| k_ra8_cnecc_mask_ead_reserved | Bits [31:10] always 0. |
Definition at line 171 of file ra8_cnecc_regs.h.
| enum ra8_cnecc_limits_t : uint16_t |
Instance count and per-instance stride.
| Enumerator | |
|---|---|
| k_ra8_cnecc_instance_count | ECCMB0 + ECCMB1. |
| k_ra8_cnecc_stride | Bytes between instances. |
| k_ra8_cnecc_ead_max | Largest valid ECEAD[9:0]. |
Definition at line 66 of file ra8_cnecc_regs.h.
| enum ra8_cnecc_tmc_bit_t : uint8_t |
EC710TMC bit positions (16-bit register).
HUM Ch 42.2.2 p 2871, cross-checked against FSP R_ECCMB0_EC710TMC_*_Pos.
Definition at line 136 of file ra8_cnecc_regs.h.
| enum ra8_cnecc_tmc_mask_t : uint16_t |
EC710TMC bit masks (16-bit register).
HUM Ch 42.2.2 p 2871. ETMA[1:0] = 10b is the write-unlock pattern for ECTMCE; the figure 42.2 procedure on p 2875 also writes the literal values 0x8000 (disable) / 0x8080 (enable) / 0x8082 (substitute decoder input) to this register.
Definition at line 153 of file ra8_cnecc_regs.h.
|
inlinestatic |
Get pointer to CNECC instance instance.
| [in] | instance | Instance index (0..1). |
Definition at line 205 of file ra8_cnecc_regs.h.
References k_ra8_cnecc0_base_addr, k_ra8_cnecc_instance_count, and k_ra8_cnecc_stride.
Referenced by internal_apply_instance(), ra8_cnecc_clear_status(), ra8_cnecc_deinit(), ra8_cnecc_disable_instance(), ra8_cnecc_enable_instance(), ra8_cnecc_enter_standby(), ra8_cnecc_get_status(), ra8_cnecc_inject_fault(), ra8_cnecc_isr_handler(), ra8_cnecc_set_correction_permission(), ra8_cnecc_set_irq_enables(), ra8_cnecc_test_mode_active(), and ra8_cnecc_test_mode_disable().