summaryrefslogtreecommitdiffstats
path: root/target/linux/realtek
diff options
context:
space:
mode:
authorStijn Tintel <stijn@linux-ipv6.be>2024-04-27 01:40:07 +0300
committerStijn Tintel <stijn@linux-ipv6.be>2024-05-07 12:27:30 +0300
commit1626b06683edfb53d8fca4d2c6fd5f19b49d3a6d (patch)
treebaf33d823bc19297c247355d57a5c35d7be3b9ad /target/linux/realtek
parent3dde7861635dffa8975049e67e44a4a3def33290 (diff)
downloadopenwrt-1626b06683edfb53d8fca4d2c6fd5f19b49d3a6d.tar.gz
openwrt-1626b06683edfb53d8fca4d2c6fd5f19b49d3a6d.tar.bz2
openwrt-1626b06683edfb53d8fca4d2c6fd5f19b49d3a6d.zip
realtek/rtl839x: respect phy-is-integrated property
Respect the phy-is-integrated property on ethernet-phy nodes. There are RTL8393M switches where the PHYs at address 48 and 49 are provided by an external RTL8214FC. Hardcoding them to use the internal SerDes makes it impossible to use the ports connected to such an external PHY. Respect the phy-is-integrated property on ethernet-phy nodes as a first step to support such ports. The potential impact for this should be limited to RTL8393 based switches, and looking at the commit messages and device tree files of the supported switches based on this SoC, the SFP and/or combo ports are either not working (D-Link DGS-1210-52, Netgear GS750E, TP-Link SG2452P/T1600G-52PS), use PHYs at a different address (Panasonic SwitchM48EG PN28480K), or already have the phy-is-integrated property set on the PHYs at address 48 and 49. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> Acked-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/realtek')
-rw-r--r--target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c
index 54e592aeaa..71e7937336 100644
--- a/target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c
@@ -1658,7 +1658,7 @@ static int rtl839x_mdio_read_paged(struct mii_bus *bus, int mii_id, u16 page, in
int err;
struct rtl838x_eth_priv *priv = bus->priv;
- if (mii_id >= 48 && mii_id <= 49 && priv->id == 0x8393)
+ if (priv->phy_is_internal[mii_id])
return rtl839x_read_sds_phy(mii_id, regnum);
if (regnum & (MII_ADDR_C45 | MII_ADDR_C22_MMD)) {
@@ -1797,7 +1797,7 @@ static int rtl839x_mdio_write_paged(struct mii_bus *bus, int mii_id, u16 page,
struct rtl838x_eth_priv *priv = bus->priv;
int err;
- if (mii_id >= 48 && mii_id <= 49 && priv->id == 0x8393)
+ if (priv->phy_is_internal[mii_id])
return rtl839x_write_sds_phy(mii_id, regnum, value);
if (regnum & (MII_ADDR_C45 | MII_ADDR_C22_MMD)) {