From: Maxime Chevallier Date: Tue, 24 Mar 2026 09:20:56 +0000 (+0100) Subject: net: stmmac: dwmac-socfpga: Move internal helpers X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=845a0441111812a540c928e3264602ecf1c17df9;p=thirdparty%2Flinux.git net: stmmac: dwmac-socfpga: Move internal helpers This is preparatory work to allow reusing the SGMII configuration helper and the wrapper to get the interface in the fix_mac_speed() callback. Signed-off-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) Link: https://patch.msgid.link/20260324092102.687082-2-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 5f89fd968ae9..42da73b92ceb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -72,6 +72,18 @@ struct socfpga_dwmac { const struct socfpga_dwmac_ops *ops; }; +static int socfpga_get_plat_phymode(struct socfpga_dwmac *dwmac) +{ + return dwmac->plat_dat->phy_interface; +} + +static void socfpga_sgmii_config(struct socfpga_dwmac *dwmac, bool enable) +{ + u16 val = enable ? SGMII_ADAPTER_ENABLE : SGMII_ADAPTER_DISABLE; + + writew(val, dwmac->sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); +} + static void socfpga_dwmac_fix_mac_speed(void *bsp_priv, phy_interface_t interface, int speed, unsigned int mode) @@ -244,18 +256,6 @@ err_node_put: return ret; } -static int socfpga_get_plat_phymode(struct socfpga_dwmac *dwmac) -{ - return dwmac->plat_dat->phy_interface; -} - -static void socfpga_sgmii_config(struct socfpga_dwmac *dwmac, bool enable) -{ - u16 val = enable ? SGMII_ADAPTER_ENABLE : SGMII_ADAPTER_DISABLE; - - writew(val, dwmac->sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); -} - static int socfpga_set_phy_mode_common(int phymode, u32 *val) { switch (phymode) {