Lines Matching +full:realtek +full:- +full:mdio

1 // SPDX-License-Identifier: GPL-2.0+
2 /* drivers/net/phy/realtek.c
4 * Driver for Realtek PHYs
75 MODULE_DESCRIPTION("Realtek PHY driver");
97 struct device *dev = &phydev->mdio.dev; in rtl821x_probe()
99 u32 phy_id = phydev->drv->phy_id; in rtl821x_probe()
104 return -ENOMEM; in rtl821x_probe()
110 priv->phycr1 = ret & (RTL8211F_ALDPS_PLL_OFF | RTL8211F_ALDPS_ENABLE | RTL8211F_ALDPS_XTAL_OFF); in rtl821x_probe()
111 if (of_property_read_bool(dev->of_node, "realtek,aldps-enable")) in rtl821x_probe()
112 priv->phycr1 |= RTL8211F_ALDPS_PLL_OFF | RTL8211F_ALDPS_ENABLE | RTL8211F_ALDPS_XTAL_OFF; in rtl821x_probe()
114 priv->has_phycr2 = !(phy_id == RTL_8211FVD_PHYID); in rtl821x_probe()
115 if (priv->has_phycr2) { in rtl821x_probe()
120 priv->phycr2 = ret & RTL8211F_CLKOUT_EN; in rtl821x_probe()
121 if (of_property_read_bool(dev->of_node, "realtek,clkout-disable")) in rtl821x_probe()
122 priv->phycr2 &= ~RTL8211F_CLKOUT_EN; in rtl821x_probe()
125 phydev->priv = priv; in rtl821x_probe()
162 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8201_config_intr()
185 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211b_config_intr()
207 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211e_config_intr()
230 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211f_config_intr()
320 if (phydev->speed == SPEED_100 && phydev->autoneg == AUTONEG_DISABLE) { in rtl8211_config_aneg()
340 struct rtl821x_priv *priv = phydev->priv; in rtl8211f_config_init()
341 struct device *dev = &phydev->mdio.dev; in rtl8211f_config_init()
347 priv->phycr1); in rtl8211f_config_init()
354 switch (phydev->interface) { in rtl8211f_config_init()
386 "%s 2ns TX delay (and changing the value from pin-strapping RXD1 or the bootloader)\n", in rtl8211f_config_init()
390 "2ns TX delay was already %s (by pin-strapping RXD1 or bootloader configuration)\n", in rtl8211f_config_init()
401 "%s 2ns RX delay (and changing the value from pin-strapping RXD0 or the bootloader)\n", in rtl8211f_config_init()
405 "2ns RX delay was already %s (by pin-strapping RXD0 or bootloader configuration)\n", in rtl8211f_config_init()
409 if (priv->has_phycr2) { in rtl8211f_config_init()
411 RTL8211F_CLKOUT_EN, priv->phycr2); in rtl8211f_config_init()
440 /* enable TX/RX delay for rgmii-* modes, and disable them for rgmii. */ in rtl8211e_config_init()
441 switch (phydev->interface) { in rtl8211e_config_init()
465 * 10:0 = Test && debug settings reserved by realtek in rtl8211e_config_init()
504 dev_err(&phydev->mdio.dev, in rtl8366rb_config_init()
516 if (!phydev->link) in rtlgen_get_speed()
525 phydev->speed = SPEED_10; in rtlgen_get_speed()
528 phydev->speed = SPEED_100; in rtlgen_get_speed()
531 phydev->speed = SPEED_1000; in rtlgen_get_speed()
534 phydev->speed = SPEED_10000; in rtlgen_get_speed()
537 phydev->speed = SPEED_2500; in rtlgen_get_speed()
540 phydev->speed = SPEED_5000; in rtlgen_get_speed()
577 ret = -EOPNOTSUPP; in rtlgen_read_mmd()
593 ret = -EOPNOTSUPP; in rtlgen_write_mmd()
603 if (ret != -EOPNOTSUPP) in rtl822x_read_mmd()
628 if (ret != -EOPNOTSUPP) in rtl822x_write_mmd()
649 phydev->supported, val & RTL_SUPPORTS_2500FULL); in rtl822x_get_features()
651 phydev->supported, val & RTL_SUPPORTS_5000FULL); in rtl822x_get_features()
653 phydev->supported, val & RTL_SUPPORTS_10000FULL); in rtl822x_get_features()
662 if (phydev->autoneg == AUTONEG_ENABLE) { in rtl822x_config_aneg()
666 phydev->advertising)) in rtl822x_config_aneg()
682 if (phydev->autoneg == AUTONEG_ENABLE) { in rtl822x_read_status()
689 phydev->lp_advertising, lpadv & RTL_LPADV_10000FULL); in rtl822x_read_status()
691 phydev->lp_advertising, lpadv & RTL_LPADV_5000FULL); in rtl822x_read_status()
693 phydev->lp_advertising, lpadv & RTL_LPADV_2500FULL); in rtl822x_read_status()
716 return phydev->phy_id == RTL_GENERIC_PHYID && in rtlgen_match_phy_device()
722 return phydev->phy_id == RTL_GENERIC_PHYID && in rtl8226_match_phy_device()
738 phydev->autoneg = AUTONEG_DISABLE; in rtl9000a_config_init()
739 phydev->speed = SPEED_100; in rtl9000a_config_init()
740 phydev->duplex = DUPLEX_FULL; in rtl9000a_config_init()
750 switch (phydev->master_slave_set) { in rtl9000a_config_aneg()
761 return -EOPNOTSUPP; in rtl9000a_config_aneg()
775 phydev->master_slave_get = MASTER_SLAVE_CFG_UNKNOWN; in rtl9000a_read_status()
776 phydev->master_slave_state = MASTER_SLAVE_STATE_UNKNOWN; in rtl9000a_read_status()
786 phydev->master_slave_get = MASTER_SLAVE_CFG_MASTER_FORCE; in rtl9000a_read_status()
788 phydev->master_slave_get = MASTER_SLAVE_CFG_SLAVE_FORCE; in rtl9000a_read_status()
794 phydev->master_slave_state = MASTER_SLAVE_STATE_MASTER; in rtl9000a_read_status()
796 phydev->master_slave_state = MASTER_SLAVE_STATE_SLAVE; in rtl9000a_read_status()
815 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl9000a_config_intr()
936 .name = "RTL8211F-VD Gigabit Ethernet",
947 .name = "Generic FE-GE Realtek PHY",
982 .name = "RTL8226-CG 2.5Gbps PHY",
992 .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY",
1002 .name = "RTL8221B-VB-CG 2.5Gbps PHY",
1012 .name = "RTL8221B-VM-CG 2.5Gbps PHY",
1048 .name = "RTL8365MB-VC Gigabit Ethernet",
1064 MODULE_DEVICE_TABLE(mdio, realtek_tbl);