|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ESWM media mux: select a port's MII/RGMII mode and release its block. More...
#include "ra8_check.h"#include "ra8_err.h"#include "ra8_eth.h"#include "ra8_ether_regs.h"#include "ra8_log.h"Go to the source code of this file.
Functions | |
| ra8_err_t | ra8_eth_rgmii_select (ra8_eth_mii_port_t port) |
| Select RGMII on a port's ESWM media-interface mux and enable it. | |
ESWM media mux: select a port's MII/RGMII mode and release its block.
The media half of the Ethernet HAL, kept apart from the frame-level NIC API in ra8_eth.c. Choosing how a port talks to its PHY, and taking that port's interface block out of reset, happens once during bring-up and has nothing in common with opening a NIC or moving frames – and ra8_eth.c had grown to the 1000-line cap, which the file-size policy answers by splitting a responsibility rather than by granting a waiver.
Definition in file ra8_eth_media.c.
|
nodiscard |
Select RGMII on a port's ESWM media-interface mux and enable it.
The chip-generic ESWM RGMII media-select every RA8 RGMII board runs once during Ethernet bring-up. After power-on reset MIICRm.MIISEL reads 0 (GMII/MII) and MIIRR.RGRSTm reads 0 (RGMII block held in reset), so the RGMII data path is dead until the driver explicitly:
It previously lived open-coded in the EK-RA8D2 board Ethernet bring-up; the accesses are chip-generic, so they belong here in the HAL. Which port is wired, and any board TX/RX skew choices in the PHY, remain board concerns.
| [in] | port | ESWM media-interface port to route to RGMII. Must be a valid ra8_eth_mii_port_t (< k_ra8_eth_mii_port_count). |
| k_ra8_ok | Port routed to RGMII and its block enabled. |
| k_ra8_err_invalid_arg | port is out of range. |
Log tag – block scope: this is the only function here that logs.
Definition at line 26 of file ra8_eth_media.c.
References k_ra8_err_invalid_arg, k_ra8_eswm_miicr_miisel_rgmii, k_ra8_eswm_miicr_txcide, k_ra8_eswm_miirr_rgrst0, k_ra8_eswm_miirr_rgrst1, k_ra8_eth_mii_port_0, k_ra8_eth_mii_port_1, k_ra8_ok, RA8_CHECK_RANGE_TAG, ra8_eswm_miicr0(), ra8_eswm_miicr1(), ra8_eswm_miirr(), and ra8_log_info.
Referenced by ehb_run_once(), and ra8_board_ethernet_init().