kernel: support RTL8264 in rtl8261n driver
authorAndrew LaMarche <andrewjlamarche@gmail.com>
Mon, 9 Jun 2025 18:38:03 +0000 (18:38 +0000)
committerRobert Marko <robimarko@gmail.com>
Wed, 9 Jul 2025 12:45:14 +0000 (14:45 +0200)
Add support for the RTL8264 (quad-10G phy) by matching the appropriate PHY_ID
in the driver.

Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19081
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/generic/files/drivers/net/phy/rtl8261n/rtk_phy.c

index 2818a2736b73bc6b5746fab5cc8557686da0aead..23e1d8c4ec0ccad2863e9403e2ec48ded371f264 100644 (file)
@@ -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) },
     { },
 };