|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Cross-TU shared surface for the ra8_eth driver split. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_eth_state_t |
| Driver-private NIC state. More... | |
Enumerations | |
| enum | ra8_eth_phy_t : uint16_t { k_ra8_eth_phy_addr_default = 0U , k_ra8_eth_phy_reg_bmcr = 0U , k_ra8_eth_phy_reg_bmsr = 1U , k_ra8_eth_phy_reg_anlpar = 5U , k_ra8_eth_phy_reg_gbsr = 10U , k_ra8_eth_phy_bmsr_link_up = 0x0004U , k_ra8_eth_phy_bmsr_an_done = 0x0020U , k_ra8_eth_phy_bmcr_speed100 = 0x2000U , k_ra8_eth_phy_bmcr_speed1000 = 0x0040U , k_ra8_eth_phy_bmcr_duplex = 0x0100U , k_ra8_eth_phy_anlpar_10h = 0x0020U , k_ra8_eth_phy_anlpar_10f = 0x0040U , k_ra8_eth_phy_anlpar_100h = 0x0080U , k_ra8_eth_phy_anlpar_100f = 0x0100U , k_ra8_eth_phy_gbsr_1000h = 0x0400U , k_ra8_eth_phy_gbsr_1000f = 0x0800U , k_ra8_eth_phy_speed_10 = 10U , k_ra8_eth_phy_speed_100 = 100U , k_ra8_eth_phy_speed_1000 = 1000U } |
| PHY-side MIIM constants shared by both ra8_eth TUs: the ra8_eth.c open path checks PHY readiness and ra8_eth_link.c polls link status. More... | |
Functions | |
| ra8_rmac_port_t | priv_ra8_eth_channel_to_port (uint8_t channel) |
| Map a logical channel index to an RMAC port identifier. | |
Variables | |
| volatile uint16_t | g_ra8_eth_phy_bmsr_after_wait |
| BMSR snapshot AFTER the auto-neg wait. | |
| ra8_eth_state_t | s_eth_state |
| Singleton NIC runtime state. | |
| bool | g_eth_mac_speed_resynced |
| Latch – true once ra8_eth_link_status has re-programmed MPIC.LSC / MPIC.PIPP to match the PHY's negotiated link. | |
Cross-TU shared surface for the ra8_eth driver split.
The ra8_eth driver is split across two translation units to stay under the per-file line-count cap: ra8_eth.c holds the ESWM block, the GWCA-backed NIC frame path (open / close / write / read / get_stats), and the test-inject hook; ra8_eth_link.c holds the PHY link-status poller plus the MAC speed/duplex resync that realigns MPIC with the PHY's auto-negotiation result. This src/-local header carries the handful of symbols both TUs share: the singleton NIC runtime state, the one-shot MAC-resync latch, and the channel-to-port mapping predicate. It is NOT part of the public ABI.
Definition in file ra8_eth_internal.h.
| enum ra8_eth_phy_t : uint16_t |
PHY-side MIIM constants shared by both ra8_eth TUs: the ra8_eth.c open path checks PHY readiness and ra8_eth_link.c polls link status.
Definition at line 41 of file ra8_eth_internal.h.
| ra8_rmac_port_t priv_ra8_eth_channel_to_port | ( | uint8_t | channel | ) |
Map a logical channel index to an RMAC port identifier.
Shared mapping used by both ra8_eth translation units: the NIC frame path (ra8_eth.c) selects the RMAC port for teardown, and the link-status TU (ra8_eth_link.c) selects the port whose PHY it polls. Pure; no side effects.
| [in] | channel | Channel id from ra8_eth_cfg_t (0 or 1). |
| k_ra8_rmac_port_0 | channel == 0. |
| k_ra8_rmac_port_1 | channel != 0. |
Definition at line 347 of file ra8_eth.c.
References k_ra8_rmac_port_0, and k_ra8_rmac_port_1.
Referenced by internal_bring_up_rmac(), ra8_eth_close(), and ra8_eth_link_status().
|
extern |
Latch – true once ra8_eth_link_status has re-programmed MPIC.LSC / MPIC.PIPP to match the PHY's negotiated link.
Reset to false in ra8_eth_open / ra8_eth_close. The MAC speed resync only needs to fire once per link bring-up; further calls to ra8_eth_link_status skip the MPIC write so they remain read-only status pollers. Defined here and updated from ra8_eth_link.c via ra8_eth_internal.h.
Reset to false in ra8_eth_open / ra8_eth_close. The MAC speed resync only needs to fire once per link bring-up; further calls to ra8_eth_link_status skip the MPIC write so they remain read-only status pollers. Defined once in ra8_eth.c and updated from ra8_eth_link.c via this declaration.
Definition at line 294 of file ra8_eth.c.
Referenced by internal_resync_mac_speed(), ra8_eth_close(), ra8_eth_link_status(), and ra8_eth_open().
|
extern |
BMSR snapshot AFTER the auto-neg wait.
BMSR snapshot AFTER the internal_wait_for_autoneg poll.
Defined once in ra8_eth_link.c; referenced from ra8_eth.c via this declaration.
Definition at line 58 of file ra8_eth_link.c.
Referenced by internal_wait_for_autoneg().
|
extern |
Singleton NIC runtime state.
Defined here and shared with the split-out link-status TU (ra8_eth_link.c) via ra8_eth_internal.h.
Defined once in ra8_eth.c and referenced from the split-out link-status TU (ra8_eth_link.c) via this declaration. Holds the cached configuration, the cumulative software counters, and the "open" flag.
Definition at line 277 of file ra8_eth.c.
Referenced by internal_capture_state(), ra8_eth_close(), ra8_eth_get_stats(), ra8_eth_link_status(), ra8_eth_read(), and ra8_eth_write().