Lines Matching +full:rx +full:- +full:pcs +full:- +full:m
1 // SPDX-License-Identifier: GPL-2.0
103 /* DSP 100M registers */
111 /* DSP 1000M registers */
122 /* PCS 1000M registers */
138 /* PCS 100M registers */
232 /* TEST_MODE_NORMAL: Non-hybrid results to calculate cable status(open/short/ok)
265 { "RX Good Count", MDIO_MMD_VEND1, LAN887X_MIS_PKT_STAT_REG1, 14},
266 { "RX ERR Count detected by PCS", MDIO_MMD_VEND1, LAN887X_MIS_PKT_STAT_REG3, 16},
268 { "RX CRC ERR Count", MDIO_MMD_VEND1, LAN887X_MIS_PKT_STAT_REG5, 8},
269 { "RX ERR Count for SGMII MII2GMII", MDIO_MMD_VEND1, LAN887X_MIS_PKT_STAT_REG6, 8},
288 mutex_lock(&phydev->lock); in lan937x_dsp_workaround()
308 mutex_unlock(&phydev->lock); in lan937x_dsp_workaround()
320 return -EINVAL; in access_ereg()
342 if (phydev->phy_id == PHY_ID_LAN937X) { in access_ereg()
364 return -EINVAL; in access_ereg_modify_changed()
397 switch (phydev->interface) { in lan87xx_config_rgmii_delay()
458 /* Equalizer Full Duplex Freeze - T1 Slave */ in lan87xx_phy_init()
482 /* Lock Stage 2-3 Multi Factor Config */ in lan87xx_phy_init()
585 /* Reset PCS to trigger hardware initialization */ in lan87xx_phy_init()
591 /* Tx AMP - 0x06 */ in lan87xx_phy_init()
623 if (phydev->master_slave_state == MASTER_SLAVE_STATE_SLAVE) { in lan87xx_phy_init()
641 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in lan87xx_phy_config_intr()
733 /* If auto-negotiation is enabled, but not complete, the cable in microchip_cable_test_start_common()
734 * test never completes. So disable auto-neg. in microchip_cable_test_start_common()
796 /* check if part is alive - if not, return diagnostic error */ in lan87xx_cable_test_start()
874 int detect = -1; in lan87xx_cable_test_report()
878 /* read non-hybrid results */ in lan87xx_cable_test_report()
889 /* calculate non-hybrid values */ in lan87xx_cable_test_report()
898 ((pos_peak_in_phases - neg_peak_in_phases) >= min_time_diff) && in lan87xx_cable_test_report()
899 ((pos_peak_in_phases - neg_peak_in_phases) < max_time_diff) && in lan87xx_cable_test_report()
903 ((neg_peak_in_phases - pos_peak_in_phases) >= min_time_diff) && in lan87xx_cable_test_report()
904 ((neg_peak_in_phases - pos_peak_in_phases) < max_time_diff) && in lan87xx_cable_test_report()
966 phydev->link = 1; in lan87xx_read_status()
968 phydev->link = 0; in lan87xx_read_status()
970 phydev->speed = SPEED_UNKNOWN; in lan87xx_read_status()
971 phydev->duplex = DUPLEX_UNKNOWN; in lan87xx_read_status()
972 phydev->pause = 0; in lan87xx_read_status()
973 phydev->asym_pause = 0; in lan87xx_read_status()
991 switch (phydev->master_slave_set) { in lan87xx_config_aneg()
1002 return -EOPNOTSUPP; in lan87xx_config_aneg()
1055 /* Disable PCS */ in lan887x_rgmii_init()
1062 /* LAN887x Errata: RGMII rx clock active in SGMII mode in lan887x_rgmii_init()
1064 * Re-enabling it for RGMII mode in lan887x_rgmii_init()
1089 /* LAN887x Errata: RGMII rx clock active in SGMII mode. in lan887x_sgmii_init()
1097 /* Enable PCS */ in lan887x_sgmii_init()
1117 /* Control bit to enable/disable RX DLL delay line in signal path */ in lan887x_config_rgmii_en()
1122 /* Configures the phy to enable RX/TX delay in lan887x_config_rgmii_en()
1123 * RGMII - TX & RX delays are either added by MAC or not needed, in lan887x_config_rgmii_en()
1125 * RGMII_ID - Configures phy to enable TX & RX delays, MAC shouldn't add in lan887x_config_rgmii_en()
1126 * RGMII_RX_ID - Configures the PHY to enable the RX delay. in lan887x_config_rgmii_en()
1127 * The MAC shouldn't add the RX delay in lan887x_config_rgmii_en()
1128 * RGMII_TX_ID - Configures the PHY to enable the TX delay. in lan887x_config_rgmii_en()
1131 switch (phydev->interface) { in lan887x_config_rgmii_en()
1149 WARN_ONCE(1, "Invalid phydev interface %d\n", phydev->interface); in lan887x_config_rgmii_en()
1153 /* Configures the PHY to enable/disable RX delay in signal path */ in lan887x_config_rgmii_en()
1182 switch (phydev->interface) { in lan887x_config_phy_interface()
1188 ret = -EOPNOTSUPP; in lan887x_config_phy_interface()
1196 ret = -EOPNOTSUPP; in lan887x_config_phy_interface()
1203 ret = -EOPNOTSUPP; in lan887x_config_phy_interface()
1218 linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT, phydev->supported); in lan887x_get_features()
1220 /* First patch only supports 100Mbps and 1000Mbps force-mode. in lan887x_get_features()
1221 * T1 Auto-Negotiation (Clause 98 of IEEE 802.3) will be added later. in lan887x_get_features()
1223 linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported); in lan887x_get_features()
1295 /* 1000T1 PCS writes */ in lan887x_phy_setup()
1308 if (phydev->master_slave_set == MASTER_SLAVE_CFG_MASTER_FORCE || in lan887x_100M_setup()
1309 phydev->master_slave_set == MASTER_SLAVE_CFG_MASTER_PREFERRED){ in lan887x_100M_setup()
1351 int ret = -EINVAL; in lan887x_link_setup()
1353 if (phydev->speed == SPEED_1000) in lan887x_link_setup()
1355 else if (phydev->speed == SPEED_100) in lan887x_link_setup()
1368 /* Clear 1000M link sync */ in lan887x_phy_reset()
1374 /* Clear 100M link sync */ in lan887x_phy_reset()
1380 /* Chiptop soft-reset to allow the speed/mode change */ in lan887x_phy_reset()
1386 /* CL22 soft-reset to let the link re-train */ in lan887x_phy_reset()
1400 linkmode_zero(phydev->advertising); in lan887x_phy_reconfig()
1427 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL); in lan887x_probe()
1429 return -ENOMEM; in lan887x_probe()
1431 phydev->priv = priv; in lan887x_probe()
1439 struct lan887x_priv *priv = phydev->priv; in lan887x_get_stat()
1451 val = val & ((1 << stat.bits) - 1); in lan887x_get_stat()
1452 priv->stats[i] += val; in lan887x_get_stat()
1453 ret = priv->stats[i]; in lan887x_get_stat()
1483 /* Chip hard-reset */ in lan887x_cd_reset()
1622 return -EAGAIN; in lan887x_cable_test_chk()
1662 /* Read non-hybrid results */ in lan887x_cable_test_report()
1698 /* Calculate non-hybrid values */ in lan887x_cable_test_report()
1708 ((pos_peak_in_phases - neg_peak_in_phases) >= in lan887x_cable_test_report()
1710 ((pos_peak_in_phases - neg_peak_in_phases) < in lan887x_cable_test_report()
1715 ((neg_peak_in_phases - pos_peak_in_phases) >= in lan887x_cable_test_report()
1717 ((neg_peak_in_phases - pos_peak_in_phases) < in lan887x_cable_test_report()
1733 /* Re-initialize PHY and start cable diag test */ in lan887x_cable_test_report()
1765 * distance = (peak_in_phases - peak_in_phases_hybrid) * in lan887x_cable_test_report()
1774 distance = (((pos_peak_in_phases - pos_peak_in_phases_hybrid) in lan887x_cable_test_report()
1777 distance = (((neg_peak_in_phases - pos_peak_in_phases_hybrid) in lan887x_cable_test_report()
1821 if (rc == -EAGAIN) in lan887x_cable_test_get_status()