Thread (26 messages) 26 messages, 5 authors, 2025-11-11

Re: [PATCH net-next 11/16] net: stmmac: starfive: use stmmac_get_phy_intf_sel()

From: Emil Renner Berthing <kernel@esmil.dk>
Date: 2025-11-07 16:00:47
Also in: linux-amlogic, linux-arm-kernel, linux-mediatek, netdev

Quoting Russell King (Oracle) (2025-11-07 15:28:55)
quoted hunk ↗ jump to hunk
Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
phy_intf_sel value, validate the result and use that to set the
control register to select the operating mode for the DWMAC core.

Signed-off-by: Russell King (Oracle) <redacted>
---
 .../ethernet/stmicro/stmmac/dwmac-starfive.c  | 22 +++++--------------
 1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
index 1ef72576c6f1..00078b7a6486 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
@@ -35,25 +35,15 @@ static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat)
        struct starfive_dwmac *dwmac = plat_dat->bsp_priv;
        struct regmap *regmap;
        unsigned int args[2];
-       unsigned int mode;
+       int phy_intf_sel;
        int err;

-       switch (plat_dat->phy_interface) {
-       case PHY_INTERFACE_MODE_RMII:
-               mode = STARFIVE_DWMAC_PHY_INFT_RMII;
-               break;
-
-       case PHY_INTERFACE_MODE_RGMII:
-       case PHY_INTERFACE_MODE_RGMII_ID:
-       case PHY_INTERFACE_MODE_RGMII_RXID:
-       case PHY_INTERFACE_MODE_RGMII_TXID:
-               mode = STARFIVE_DWMAC_PHY_INFT_RGMII;
-               break;
After these two patches the STARFIVE_DWMAC_PHY_INFT_RMII and ..RGMII macros are
left unused. Maybe just squash the patches and remove the definitions?

/Emil
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help