Lines Matching +full:rx +full:- +full:sample +full:- +full:delay +full:- +full:ns
1 // SPDX-License-Identifier: GPL-2.0+
14 #include <linux/delay.h>
99 struct device *dev = &phydev->mdio.dev; in rtl821x_probe()
101 u32 phy_id = phydev->drv->phy_id; in rtl821x_probe()
106 return -ENOMEM; in rtl821x_probe()
108 priv->clk = devm_clk_get_optional_enabled(dev, NULL); in rtl821x_probe()
109 if (IS_ERR(priv->clk)) in rtl821x_probe()
110 return dev_err_probe(dev, PTR_ERR(priv->clk), in rtl821x_probe()
117 priv->phycr1 = ret & (RTL8211F_ALDPS_PLL_OFF | RTL8211F_ALDPS_ENABLE | RTL8211F_ALDPS_XTAL_OFF); in rtl821x_probe()
118 if (of_property_read_bool(dev->of_node, "realtek,aldps-enable")) in rtl821x_probe()
119 priv->phycr1 |= RTL8211F_ALDPS_PLL_OFF | RTL8211F_ALDPS_ENABLE | RTL8211F_ALDPS_XTAL_OFF; in rtl821x_probe()
121 priv->has_phycr2 = !(phy_id == RTL_8211FVD_PHYID); in rtl821x_probe()
122 if (priv->has_phycr2) { in rtl821x_probe()
127 priv->phycr2 = ret & RTL8211F_CLKOUT_EN; in rtl821x_probe()
128 if (of_property_read_bool(dev->of_node, "realtek,clkout-disable")) in rtl821x_probe()
129 priv->phycr2 &= ~RTL8211F_CLKOUT_EN; in rtl821x_probe()
132 phydev->priv = priv; in rtl821x_probe()
169 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8201_config_intr()
192 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211b_config_intr()
214 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211e_config_intr()
237 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211f_config_intr()
327 if (phydev->speed == SPEED_100 && phydev->autoneg == AUTONEG_DISABLE) { in rtl8211_config_aneg()
347 struct rtl821x_priv *priv = phydev->priv; in rtl8211f_config_init()
348 struct device *dev = &phydev->mdio.dev; in rtl8211f_config_init()
354 priv->phycr1); in rtl8211f_config_init()
361 switch (phydev->interface) { in rtl8211f_config_init()
382 default: /* the rest of the modes imply leaving delay as is. */ in rtl8211f_config_init()
389 dev_err(dev, "Failed to update the TX delay register\n"); in rtl8211f_config_init()
393 "%s 2ns TX delay (and changing the value from pin-strapping RXD1 or the bootloader)\n", in rtl8211f_config_init()
397 "2ns TX delay was already %s (by pin-strapping RXD1 or bootloader configuration)\n", in rtl8211f_config_init()
404 dev_err(dev, "Failed to update the RX delay register\n"); in rtl8211f_config_init()
408 "%s 2ns RX delay (and changing the value from pin-strapping RXD0 or the bootloader)\n", in rtl8211f_config_init()
412 "2ns RX delay was already %s (by pin-strapping RXD0 or bootloader configuration)\n", in rtl8211f_config_init()
416 if (priv->has_phycr2) { in rtl8211f_config_init()
418 RTL8211F_CLKOUT_EN, priv->phycr2); in rtl8211f_config_init()
433 struct rtl821x_priv *priv = phydev->priv; in rtl821x_suspend()
436 if (!phydev->wol_enabled) { in rtl821x_suspend()
442 clk_disable_unprepare(priv->clk); in rtl821x_suspend()
450 struct rtl821x_priv *priv = phydev->priv; in rtl821x_resume()
453 if (!phydev->wol_enabled) in rtl821x_resume()
454 clk_prepare_enable(priv->clk); in rtl821x_resume()
470 /* enable TX/RX delay for rgmii-* modes, and disable them for rgmii. */ in rtl8211e_config_init()
471 switch (phydev->interface) { in rtl8211e_config_init()
488 /* According to a sample driver there is a 0x1c config register on the in rtl8211e_config_init()
490 * the RX/TX delays otherwise controlled by RXDLY/TXDLY pins. in rtl8211e_config_init()
493 * 13 = Force Tx RX Delay controlled by bit12 bit11, in rtl8211e_config_init()
494 * 12 = RX Delay, 11 = TX Delay in rtl8211e_config_init()
534 dev_err(&phydev->mdio.dev, in rtl8366rb_config_init()
546 if (!phydev->link) in rtlgen_get_speed()
555 phydev->speed = SPEED_10; in rtlgen_get_speed()
558 phydev->speed = SPEED_100; in rtlgen_get_speed()
561 phydev->speed = SPEED_1000; in rtlgen_get_speed()
564 phydev->speed = SPEED_10000; in rtlgen_get_speed()
567 phydev->speed = SPEED_2500; in rtlgen_get_speed()
570 phydev->speed = SPEED_5000; in rtlgen_get_speed()
607 ret = -EOPNOTSUPP; in rtlgen_read_mmd()
623 ret = -EOPNOTSUPP; in rtlgen_write_mmd()
633 if (ret != -EOPNOTSUPP) in rtl822x_read_mmd()
658 if (ret != -EOPNOTSUPP) in rtl822x_write_mmd()
679 phydev->supported, val & RTL_SUPPORTS_2500FULL); in rtl822x_get_features()
681 phydev->supported, val & RTL_SUPPORTS_5000FULL); in rtl822x_get_features()
683 phydev->supported, val & RTL_SUPPORTS_10000FULL); in rtl822x_get_features()
692 if (phydev->autoneg == AUTONEG_ENABLE) { in rtl822x_config_aneg()
696 phydev->advertising)) in rtl822x_config_aneg()
712 if (phydev->autoneg == AUTONEG_ENABLE) { in rtl822x_read_status()
719 phydev->lp_advertising, lpadv & RTL_LPADV_10000FULL); in rtl822x_read_status()
721 phydev->lp_advertising, lpadv & RTL_LPADV_5000FULL); in rtl822x_read_status()
723 phydev->lp_advertising, lpadv & RTL_LPADV_2500FULL); in rtl822x_read_status()
746 return phydev->phy_id == RTL_GENERIC_PHYID && in rtlgen_match_phy_device()
752 return phydev->phy_id == RTL_GENERIC_PHYID && in rtl8226_match_phy_device()
768 phydev->autoneg = AUTONEG_DISABLE; in rtl9000a_config_init()
769 phydev->speed = SPEED_100; in rtl9000a_config_init()
770 phydev->duplex = DUPLEX_FULL; in rtl9000a_config_init()
780 switch (phydev->master_slave_set) { in rtl9000a_config_aneg()
791 return -EOPNOTSUPP; in rtl9000a_config_aneg()
805 phydev->master_slave_get = MASTER_SLAVE_CFG_UNKNOWN; in rtl9000a_read_status()
806 phydev->master_slave_state = MASTER_SLAVE_STATE_UNKNOWN; in rtl9000a_read_status()
816 phydev->master_slave_get = MASTER_SLAVE_CFG_MASTER_FORCE; in rtl9000a_read_status()
818 phydev->master_slave_get = MASTER_SLAVE_CFG_SLAVE_FORCE; in rtl9000a_read_status()
824 phydev->master_slave_state = MASTER_SLAVE_STATE_MASTER; in rtl9000a_read_status()
826 phydev->master_slave_state = MASTER_SLAVE_STATE_SLAVE; in rtl9000a_read_status()
845 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl9000a_config_intr()
967 .name = "RTL8211F-VD Gigabit Ethernet",
979 .name = "Generic FE-GE Realtek PHY",
1014 .name = "RTL8226-CG 2.5Gbps PHY",
1024 .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY",
1034 .name = "RTL8221B-VB-CG 2.5Gbps PHY",
1044 .name = "RTL8221B-VM-CG 2.5Gbps PHY",
1080 .name = "RTL8365MB-VC Gigabit Ethernet",