]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: rk: convert rk3328 to use bsp_priv->id
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 26 Jan 2026 11:45:13 +0000 (11:45 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 27 Jan 2026 18:40:06 +0000 (10:40 -0800)
commitcdb5fdfcf39607823491668bf699024595431d61
treeecdde0d1a9db3066ec8268f3813ca1e5eca72ab3
parentaf6eaf70189785c4b616c7bea75c1b46bb8498bc
net: stmmac: rk: convert rk3328 to use bsp_priv->id

rk3328 contains two GMAC instances - gmac2io and gmac2phy. While the
gmac2io instance may be connected to an external PHY, the gmac2phy
instance is permanently connected via RMII to an on-SoC integrated PHY.

The driver currently tests for the gmac2phy instance by checking
bsp_priv->integrated_phy (determined from the PHY's phy-is-integrated
property) and sometimes that the interface mode is RMII. This works
because the rk3328.dtsi has:

gmac2phy: ethernet@ff550000 {
compatible = "rockchip,rk3328-gmac";
phy-mode = "rmii";
phy-handle = <&phy>;

mdio {
phy: ethernet-phy@0 {
phy-is-integrated;
};
};
};

The driver contains a mechanism to look up the MMIO address in a table
to determine bsp_priv->id, which is used for every other Rockchip
device. Switch rk3328 to use this mechanism to determine bsp_priv->id
and use that to select which GRF register is used for configuration,
similarly to how the other Rockchip SoCs handle such differences.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vkL1t-00000005usQ-0vjt@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c