From: Andrew LaMarche Date: Mon, 9 Jun 2025 18:38:03 +0000 (+0000) Subject: kernel: support RTL8264 in rtl8261n driver X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2f9846760b9dd97b35b7c6a0b6c40f1a2439845;p=thirdparty%2Fopenwrt.git kernel: support RTL8264 in rtl8261n driver Add support for the RTL8264 (quad-10G phy) by matching the appropriate PHY_ID in the driver. Signed-off-by: Andrew LaMarche Link: https://github.com/openwrt/openwrt/pull/19081 Signed-off-by: Robert Marko --- diff --git a/target/linux/generic/files/drivers/net/phy/rtl8261n/rtk_phy.c b/target/linux/generic/files/drivers/net/phy/rtl8261n/rtk_phy.c index 2818a2736b7..23e1d8c4ec0 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8261n/rtk_phy.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8261n/rtk_phy.c @@ -13,6 +13,7 @@ #define REALTEK_PHY_ID_RTL8261N 0x001CCAF3 #define REALTEK_PHY_ID_RTL8264B 0x001CC813 +#define REALTEK_PHY_ID_RTL8264 0x001CCAF2 static int rtl826xb_get_features(struct phy_device *phydev) { @@ -66,7 +67,8 @@ static int rtkphy_config_init(struct phy_device *phydev) { case REALTEK_PHY_ID_RTL8261N: case REALTEK_PHY_ID_RTL8264B: - phydev_info(phydev, "%s:%u [RTL8261N/RTL826XB] phy_id: 0x%X PHYAD:%d\n", __FUNCTION__, __LINE__, phydev->drv->phy_id, phydev->mdio.addr); + case REALTEK_PHY_ID_RTL8264: + phydev_info(phydev, "%s:%u [RTL8261N/RTL8264/RTL826XB] phy_id: 0x%X PHYAD:%d\n", __FUNCTION__, __LINE__, phydev->drv->phy_id, phydev->mdio.addr); #if 1 /* toggle reset */ @@ -264,6 +266,18 @@ static struct phy_driver rtk_phy_drivers[] = { .aneg_done = rtkphy_c45_aneg_done, .read_status = rtkphy_c45_read_status, }, + { + PHY_ID_MATCH_EXACT(REALTEK_PHY_ID_RTL8264), + .name = "Realtek RTL8264", + .get_features = rtl826xb_get_features, + .config_init = rtkphy_config_init, + .probe = rtl826xb_probe, + .suspend = rtkphy_c45_suspend, + .resume = rtkphy_c45_resume, + .config_aneg = rtkphy_c45_config_aneg, + .aneg_done = rtkphy_c45_aneg_done, + .read_status = rtkphy_c45_read_status, + }, }; module_phy_driver(rtk_phy_drivers); @@ -272,6 +286,7 @@ module_phy_driver(rtk_phy_drivers); static struct mdio_device_id __maybe_unused rtk_phy_tbl[] = { { PHY_ID_MATCH_EXACT(REALTEK_PHY_ID_RTL8261N) }, { PHY_ID_MATCH_EXACT(REALTEK_PHY_ID_RTL8264B) }, + { PHY_ID_MATCH_EXACT(REALTEK_PHY_ID_RTL8264) }, { }, };