uboot-2025: net: add rtl8221 phy driver

This commit is contained in:
hanwckf
2025-08-21 13:04:04 +08:00
parent fdca8cbf91
commit 0f1592f654

View File

@@ -396,6 +396,29 @@ static int rtl8211f_startup(struct phy_device *phydev)
return rtl8211f_parse_status(phydev);
}
static int rtl8221b_config(struct phy_device *phydev)
{
phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x75F3, 0);
phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x697A, 0x8002);
phy_write_mmd(phydev, MDIO_MMD_AN, 0, 0x3200);
return 0;
}
static int rtl8221b_startup(struct phy_device *phydev)
{
int ret;
ret = genphy_update_link(phydev);
if (ret)
return ret;
phydev->speed = SPEED_2500;
phydev->duplex = DUPLEX_FULL;
return 0;
}
/* Support for RTL8211B PHY */
U_BOOT_PHY_DRIVER(rtl8211b) = {
.name = "RealTek RTL8211B",
@@ -470,3 +493,14 @@ U_BOOT_PHY_DRIVER(rtl8201f) = {
.startup = &genphy_startup,
.shutdown = &genphy_shutdown,
};
/* Support for RTL8221B PHY */
U_BOOT_PHY_DRIVER(rtl8221b) = {
.name = "RealTek RTL8221B 10/100/1000/2500Mbps Ethernet",
.uid = 0x1cc849,
.mask = 0xffffff,
.features = PHY_GBIT_FEATURES,
.config = &rtl8221b_config,
.startup = &rtl8221b_startup,
.shutdown = &genphy_shutdown,
};