Re: [PATCH net-next 2/2] net: lan743x: add support for RMII interface

From: Russell King (Oracle)

Date: Fri Mar 27 2026 - 04:59:17 EST


On Fri, Mar 27, 2026 at 11:10:08AM +0530, Thangaraj Samynathan wrote:
> Enable RMII interface in the lan743x driver for PHY and MAC
> configuration.
>
> - Select RMII interface in lan743x_phy_interface_select().
> - Update phylink supported_interfaces and MAC capabilities.
> - Enable RMII via RMII_CTL in lan743x_hardware_init().
> - Define RMII_CTL register and enable bit in lan743x_main.h.
>
> Signed-off-by: Thangaraj Samynathan <thangaraj.s@xxxxxxxxxxxxx>
> ---
> drivers/net/ethernet/microchip/lan743x_main.c | 18 ++++++++++++++++++
> drivers/net/ethernet/microchip/lan743x_main.h | 3 +++
> 2 files changed, 21 insertions(+)
>
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index b7b1584d867d..86d35810460f 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -1370,6 +1370,8 @@ static void lan743x_phy_interface_select(struct lan743x_adapter *adapter)
>
> if (adapter->is_pci11x1x && adapter->is_sgmii_en)
> adapter->phy_interface = PHY_INTERFACE_MODE_SGMII;
> + else if (adapter->is_pci11x1x && adapter->is_rmii_en)
> + adapter->phy_interface = PHY_INTERFACE_MODE_RMII;
> else if (id_rev == ID_REV_ID_LAN7430_)
> adapter->phy_interface = PHY_INTERFACE_MODE_GMII;
> else if ((id_rev == ID_REV_ID_LAN7431_) && (data & MAC_CR_MII_EN_))
> @@ -3158,6 +3160,13 @@ static int lan743x_phylink_create(struct lan743x_adapter *adapter)
> __set_bit(PHY_INTERFACE_MODE_MII,
> adapter->phylink_config.supported_interfaces);
> break;
> + case PHY_INTERFACE_MODE_RMII:
> + __set_bit(PHY_INTERFACE_MODE_RMII,
> + adapter->phylink_config.supported_interfaces);
> + adapter->phylink_config.mac_capabilities &= ~MAC_1000FD;

Phylink already knows that gigabit isn't supported with RMII. See
phy_caps_from_interface():

case PHY_INTERFACE_MODE_REVRMII:
case PHY_INTERFACE_MODE_RMII:
case PHY_INTERFACE_MODE_SMII:
case PHY_INTERFACE_MODE_REVMII:
case PHY_INTERFACE_MODE_MII:
link_caps |= BIT(LINK_CAPA_10HD) | BIT(LINK_CAPA_10FD);
fallthrough;

case PHY_INTERFACE_MODE_100BASEX:
link_caps |= BIT(LINK_CAPA_100HD) | BIT(LINK_CAPA_100FD);
break;

which is used by phylink_get_capabilities() to reduce the MAC
capabilities depending on the interface and rate matching.

The only case to do this is where the MAC really has no 1G support.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!