|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Ethernet Agent (ETHA) per-port register layout for the RA8D2. More...
Go to the source code of this file.
Data Structures | |
| struct | r_etha_regs_t |
| Full ETHA per-port register window (HUM Ch 32, FSP R_ETHA0_Type). More... | |
Functions | |
| static volatile r_etha_regs_t * | ra8_etha (ra8_etha_port_t port) |
| Compile-time offset and size insurance for r_etha_regs_t. | |
Ethernet Agent (ETHA) per-port register layout for the RA8D2.
ETHA is the per-port "Ethernet Agent" block that sits between the top-level Ethernet Switch Module (ESWM, HUM Ch 29) and the on-chip Ethernet MAC (RMAC, HUM Ch 33). One ETHA instance exists per Ethernet port (m = 0, 1) and each instance is mapped 0x2000 apart:
ETHA0 = 0x403C_A000 (k_ra8_etha0_base_addr in ra8_ether_regs.h) ETHA1 = 0x403C_C000 (k_ra8_etha1_base_addr in ra8_ether_regs.h)
The register layout is HUM Table 32.3 "ETHA registers" (p 1628-1630), which runs EAMC (+0x0000) to EAEID2 (+0x0528). Every named register here corresponds 1:1 with a row of that table and every offset is pinned by a static_assert below; reserved gaps are kept as reservedNN placeholders so offset arithmetic matches the chip.
The window was previously sized 0x584 to mirror the Renesas FSP CMSIS type R_ETHA0_Type, which carries a trailing EASCR at +0x0580. Chapter 32 does not mention that symbol anywhere, so it was an FSP artefact rather than a documented register and has been removed along with the driver entry point that wrote it (#539). The manual, not the vendor header, is the authority for what exists.
Eight per-traffic-class arrays (EATMFSC, EATDQDC, EATDQM, EATDQMLM, EACAIVC, EACAULC, EACOIVM, EACOULM, EATASENC, EATASENM) follow the 802.1Q/802.1Qbv (TAS) traffic-class convention used by the chip – index 0 = best-effort, index 7 = highest priority.
Definition in file ra8_etha_regs.h.
| enum ra8_etha_afs_t : uint8_t |
EATPEC.AFS[1:0] additional fragment size policy for 802.3br.
Definition at line 374 of file ra8_etha_regs.h.
| enum ra8_etha_eaeis0_bits_t : uint32_t |
Selected EAEIS0 status flags exposed for tests / IRQ dispatch.
From HUM Ch 32.3.x "EAEIS0 : Error Interrupt Status Register 0", cross-referenced with the FSP EAEIS0_b bit-field layout. Bit positions match the chip; full set lives in the register block.
Definition at line 322 of file ra8_etha_regs.h.
| enum ra8_etha_eaeis2_bits_t : uint32_t |
Selected EAEIS2 (descriptor queue) status flags.
| Enumerator | |
|---|---|
| k_ra8_etha_eaeis2_dqoes_mask | TX queue overflow per-TC. |
| k_ra8_etha_eaeis2_ctdqoes | Cut-through queue overflow. |
| k_ra8_etha_eaeis2_dqses_mask | TX queue security per-TC. |
Definition at line 339 of file ra8_etha_regs.h.
| enum ra8_etha_field_pos_t : uint8_t |
Convenience right-shift positions for EATPEC / EAVCC bit fields.
Definition at line 267 of file ra8_etha_regs.h.
| enum ra8_etha_irq_class_t : uint8_t |
Identifier for one of the three error-interrupt blocks.
Each ETHA port has three independent error-interrupt status/enable triplets:
Definition at line 306 of file ra8_etha_regs.h.
| enum ra8_etha_mask_t : uint32_t |
ETHA bit masks for EAMC / EAMS / per-class fields.
Definition at line 193 of file ra8_etha_regs.h.
| enum ra8_etha_offset_t : uint16_t |
Selected ETHA per-port register byte offsets (HUM Ch 32.3).
Provided for callers that need to reach a register by offset (e.g. generic dump routines). The full layout is captured by r_etha_regs_t and each driver call uses the named field directly.
Definition at line 98 of file ra8_etha_regs.h.
| enum ra8_etha_opc_t : uint8_t |
ETHA EAMC.OPC[1:0] operating mode commands.
From HUM Ch 32.3.1.1 "EAMC : Mode Configuration Register" p 1630.
| Enumerator | |
|---|---|
| k_ra8_etha_opc_reset | Enter RESET mode. |
| k_ra8_etha_opc_disable | Enter DISABLE mode. |
| k_ra8_etha_opc_config | Enter CONFIG mode. |
| k_ra8_etha_opc_operation | Enter OPERATION mode. |
Definition at line 168 of file ra8_etha_regs.h.
| enum ra8_etha_ops_t : uint8_t |
ETHA EAMS.OPS[1:0] operating-mode status flag values.
From HUM Ch 32.3.1.2 "EAMS : Mode Status Register" p 1631.
| Enumerator | |
|---|---|
| k_ra8_etha_ops_reset | RESET mode active. |
| k_ra8_etha_ops_disable | DISABLE mode active. |
| k_ra8_etha_ops_config | CONFIG mode active. |
| k_ra8_etha_ops_operation | OPERATION mode active. |
Definition at line 182 of file ra8_etha_regs.h.
| enum ra8_etha_port_t : uint8_t |
ETHA port index (m = 0, 1).
Used as the first argument to every ra8_etha_* call. Maps directly to the per-port base addresses defined in ra8_ether_regs.h.
| Enumerator | |
|---|---|
| k_ra8_etha_port_0 | ETHA port 0 (base 0x403C_A000). |
| k_ra8_etha_port_1 | ETHA port 1 (base 0x403C_C000). |
| k_ra8_etha_port_count | Number of ETHA ports. |
Definition at line 60 of file ra8_etha_regs.h.
| enum ra8_etha_rsv_words_t : uint8_t |
Reserved-word array sizes (in 32-bit words) used inside the ETHA per-port register block.
Names each reserved gap so the struct definition does not depend on raw integer literals. Cross-checked against HUM Ch 32 register offset table.
Definition at line 391 of file ra8_etha_regs.h.
| enum ra8_etha_size_t : uint16_t |
ETHA register window total size, per HUM Table 32.3 (p 1628-1630).
The window ends at EAEID2 (+0x0528), the last row of Table 32.3, so the block is 0x52C bytes. It was previously sized 0x584 to match the FSP R_ETHA0_Type, whose trailing EASCR at +0x0580 the manual does not publish anywhere in Chapter 32 (#539).
| Enumerator | |
|---|---|
| k_ra8_etha_window_bytes | Total MMIO window, EAMC..EAEID2. |
Definition at line 515 of file ra8_etha_regs.h.
| enum ra8_etha_tas_bits_t : uint8_t |
Single-bit positions in the TAS learn / read / RAM-init registers.
Named from the HUM field tables so the TAS entry flow cannot repeat the defect it was written to fix: EATASGL1 bit 28 is TASGSL, the entry's one-bit GATE STATE (HUM Ch 32.3.5.14 "EATASGL1 : TAS Gate Learn Register 1" p 1652), and had been carrying an unrelated "cut-through" flag while the gate state was written into EATASGL0, whose TASGAL[7:0] field is the TAS RAM ENTRY ADDRESS (#539).
Definition at line 233 of file ra8_etha_regs.h.
| enum ra8_etha_tas_limits_t : uint16_t |
Capacity limits the TAS RAM imposes on a schedule.
TASGAL[7:0] addresses 256 TAS RAM entries, but HUM Ch 32.3.5.3 "EATASENCi : TAS Entry Number Configuration Register i" p 1647 caps the usable total: the sum of every EATASENCi.TASAEN (plus EATASCTENC.TASCTAEN) must be <= 119 when the schedule is changed while EATASC.TASE is already set, and <= 247 otherwise. The driver enforces the conservative 119 so a schedule accepted at bring-up stays legal if it is later re-programmed live.
| Enumerator | |
|---|---|
| k_ra8_etha_tas_entries_max | Max total entries across all queues. |
| k_ra8_etha_tas_addr_max | Highest TAS RAM address TASGAL can hold. |
| k_ra8_etha_tas_aen_max | EATASENCi.TASAEN[8:0] field ceiling. |
Definition at line 257 of file ra8_etha_regs.h.
| enum ra8_etha_tc_t : uint8_t |
Traffic-class index (q = 0..7) used by every per-class array.
From HUM Ch 32 figure 32.1 ("Block diagram"): each ETHA port owns eight traffic classes feeding the TX scheduler. Class 0 carries best-effort traffic; class 7 the highest priority. Used as the common index across EATMFSCq, EATDQDCq, EATDQMq, EATDQMLMq, EACAIVCq, EACAULCq, EACOIVMq, EACOULMq, EATASENCi, EATASENMi.
Definition at line 77 of file ra8_etha_regs.h.
| enum ra8_etha_vem_t : uint8_t |
EAVCC.VEM[2:0] VLAN extraction mode.
From HUM Ch 32.3.x "EAVCC : Ethernet Agent VLAN Control Configuration". Selects how the agent treats the inner / outer VLAN tag on RX.
Definition at line 353 of file ra8_etha_regs.h.
| enum ra8_etha_vim_t : uint8_t |
EAVCC.VIM VLAN insertion mode for TX.
| Enumerator | |
|---|---|
| k_ra8_etha_vim_disabled | No VLAN insertion on TX. |
| k_ra8_etha_vim_enabled | Insert tag from EAVTC on TX. |
Definition at line 365 of file ra8_etha_regs.h.
|
inlinestatic |
Compile-time offset and size insurance for r_etha_regs_t.
Every offset below is pinned to the value HUM Table 32.3 (p 1628-1630) prints for that register. If any field drifts (e.g. a reserved gap is mis-sized), these assertions fire at compile time before any test runs – silent frame corruption on the wire is avoided.
Get pointer to a per-port ETHA register block.
| [in] | port | Port identifier (k_ra8_etha_port_0 or k_ra8_etha_port_1). |
Definition at line 640 of file ra8_etha_regs.h.
References k_ra8_etha0_base_addr, k_ra8_etha1_base_addr, and k_ra8_etha_port_1.
Referenced by internal_etha_to_operation(), ra8_etha_clear_stats(), ra8_etha_clear_status(), ra8_etha_configure_cbs(), ra8_etha_configure_cut_through(), ra8_etha_deinit(), ra8_etha_descriptor_ring_init(), ra8_etha_disable_irq(), ra8_etha_dispatch(), ra8_etha_enable_irq(), ra8_etha_enable_tas(), ra8_etha_enter_stop(), ra8_etha_exit_stop(), ra8_etha_get_cbs_state(), ra8_etha_get_queue_level(), ra8_etha_get_status(), ra8_etha_init(), ra8_etha_read_stats(), ra8_etha_read_tas_entry(), ra8_etha_reset(), ra8_etha_set_ipv_remap(), ra8_etha_set_max_frame_size(), ra8_etha_set_mode(), ra8_etha_set_preemption(), ra8_etha_set_queue_arb(), ra8_etha_set_queue_depth(), ra8_etha_set_rx_tag_filter(), ra8_etha_set_tas_schedule(), ra8_etha_set_vlan_mode(), ra8_etha_set_vlan_tag(), and ra8_etha_tas_ram_reset().