net: stmmac: convert meson8b to use stmmac_get_phy_intf_sel()
Subsystems (5)
v2 cover net: stmmac: convert meson8b to use stmmac_get_phy_intf_sel()
This series splits out meson8b from the previous 16 patch series as that now has r-b tags.
This series converts meson8b to use stmmac_get_phy_intf_sel(). This driver is not converted to the set_phy_intf_sel() method as it is unclear whether there are ordering dependencies that would prevent it. I would appreciate the driver author looking in to whether this conversion is possible.
Technically v2, since these changes were posted as part of the 16 patch series. No changes other than r-b tags added.
.../net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 30 ++++++++-------------- 1 file changed, 10 insertions(+), 20 deletions(-)
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
PATCH v2 1/3 net: stmmac: meson8b: use PHY_INTF_SEL_x
Use PHY_INTF_SEL_x definitions for phy_intf_sel bitfield.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +2 -2
@@ -26,8 +26,8 @@#define PRG_ETH0_RGMII_MODE BIT(0)#define PRG_ETH0_EXT_PHY_MODE_MASK GENMASK(2, 0) -#define PRG_ETH0_EXT_RGMII_MODE 1 -#define PRG_ETH0_EXT_RMII_MODE 4 +#define PRG_ETH0_EXT_RGMII_MODE PHY_INTF_SEL_RGMII +#define PRG_ETH0_EXT_RMII_MODE PHY_INTF_SEL_RMII/* mux to choose between fclk_div2 (bit unset) and mpll2 (bit set) */ #define PRG_ETH0_CLK_M250_SEL_MASK GENMASK(4, 4)
Signature · 1 line
2.47.3
PATCH v2 2/3 net: stmmac: meson8b: use phy_intf_sel directly
In reply to Russell King (Oracle)Rearrange meson_axg_set_phy_mode() to use phy_intf_sel directly, converting it to the register field for meson8b_dwmac_mask_bits().
--- .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +8 -8
@@ -26,8 +26,6 @@#define PRG_ETH0_RGMII_MODE BIT(0)#define PRG_ETH0_EXT_PHY_MODE_MASK GENMASK(2, 0) -#define PRG_ETH0_EXT_RGMII_MODE PHY_INTF_SEL_RGMII -#define PRG_ETH0_EXT_RMII_MODE PHY_INTF_SEL_RMII/* mux to choose between fclk_div2 (bit unset) and mpll2 (bit set) */ #define PRG_ETH0_CLK_M250_SEL_MASK GENMASK(4, 4)
@@ -238,21 +236,19 @@ static int meson8b_set_phy_mode(struct meson8b_dwmac *dwmac)static int meson_axg_set_phy_mode (struct meson8b_dwmac *dwmac) { +int phy_intf_sel; +switch (dwmac->phy_mode) {case PHY_INTERFACE_MODE_RGMII :case PHY_INTERFACE_MODE_RGMII_RXID :case PHY_INTERFACE_MODE_RGMII_ID :case PHY_INTERFACE_MODE_RGMII_TXID :/* enable RGMII mode */ -meson8b_dwmac_mask_bits (dwmac,PRG_ETH0 , -PRG_ETH0_EXT_PHY_MODE_MASK , -PRG_ETH0_EXT_RGMII_MODE ); + phy_intf_sel =PHY_INTF_SEL_RGMII ;break ;case PHY_INTERFACE_MODE_RMII :/* disable RGMII mode -> enables RMII mode */ -meson8b_dwmac_mask_bits (dwmac,PRG_ETH0 , -PRG_ETH0_EXT_PHY_MODE_MASK , -PRG_ETH0_EXT_RMII_MODE ); + phy_intf_sel =PHY_INTF_SEL_RMII ;break ;default : dev_err(dwmac->dev, "fail to set phy-mode %s\n",
@@ -260,6 +256,10 @@ static int meson_axg_set_phy_mode(struct meson8b_dwmac *dwmac)return -EINVAL ; } +meson8b_dwmac_mask_bits (dwmac,PRG_ETH0 ,PRG_ETH0_EXT_PHY_MODE_MASK , +FIELD_PREP (PRG_ETH0_EXT_PHY_MODE_MASK , + phy_intf_sel)); +return 0 ; }
Signature · 1 line
2.47.3
PATCH v2 3/3 net: stmmac: meson8b: use stmmac_get_phy_intf_sel()
In reply to Russell King (Oracle)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.
--- .../ethernet/stmicro/stmmac/dwmac-meson8b.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +4 -14
@@ -238,22 +238,12 @@ static int meson_axg_set_phy_mode(struct meson8b_dwmac *dwmac) {int phy_intf_sel; -switch (dwmac->phy_mode) { -case PHY_INTERFACE_MODE_RGMII : -case PHY_INTERFACE_MODE_RGMII_RXID : -case PHY_INTERFACE_MODE_RGMII_ID : -case PHY_INTERFACE_MODE_RGMII_TXID : -/* enable RGMII mode */ - phy_intf_sel =PHY_INTF_SEL_RGMII ; -break ; -case PHY_INTERFACE_MODE_RMII : -/* disable RGMII mode -> enables RMII mode */ - phy_intf_sel =PHY_INTF_SEL_RMII ; -break ; -default : + phy_intf_sel =stmmac_get_phy_intf_sel (dwmac->phy_mode); +if (phy_intf_sel !=PHY_INTF_SEL_RGMII && + phy_intf_sel !=PHY_INTF_SEL_RMII ) {dev_err (dwmac->dev,"fail to set phy-mode %s\n" ,phy_modes (dwmac->phy_mode)); -return -EINVAL ; +return phy_intf_sel <0 ? phy_intf_sel : -EINVAL ; } meson8b_dwmac_mask_bits(dwmac, PRG_ETH0, PRG_ETH0_EXT_PHY_MODE_MASK,
Signature · 1 line
2.47.3
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 10 Nov 2025 14:42:26 +0000 you wrote:
This series splits out meson8b from the previous 16 patch series as that now has r-b tags.
This series converts meson8b to use
stmmac_get_phy_intf_sel(). This driver is not converted to theset_phy_intf_sel()method as it is unclear whether there are ordering dependencies that would prevent it. I would appreciate the driver author looking in to whether this conversion is possible.[...]
Here is the summary with links:
- [net-next,v2,1/3] net: stmmac: meson8b: use PHY_INTF_SEL_x
https://git.kernel.org/netdev/net-next/c/12f42597ab14 - [net-next,v2,2/3] net: stmmac: meson8b: use phy_intf_sel directly https://git.kernel.org/netdev/net-next/c/52d639da6fee - [net-next,v2,3/3] net: stmmac: meson8b: use stmmac_get_phy_intf_sel() https://git.kernel.org/netdev/net-next/c/da3d1501235d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html