Lines Matching +full:event +full:- +full:tap

47  *     PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS
76 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
107 * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS
125 #include "xgbe-common.h"
127 #define XGBE_BLWC_PROPERTY "amd,serdes-blwc"
128 #define XGBE_CDR_RATE_PROPERTY "amd,serdes-cdr-rate"
129 #define XGBE_PQ_SKEW_PROPERTY "amd,serdes-pq-skew"
130 #define XGBE_TX_AMP_PROPERTY "amd,serdes-tx-amp"
131 #define XGBE_DFE_CFG_PROPERTY "amd,serdes-dfe-tap-config"
132 #define XGBE_DFE_ENA_PROPERTY "amd,serdes-dfe-tap-enable"
165 /* Rate-change complete wait/retry count */
234 struct ethtool_link_ksettings *lks = &pdata->phy.lks; in xgbe_phy_an_outcome()
235 struct xgbe_phy_data *phy_data = pdata->phy_data; in xgbe_phy_an_outcome()
250 if (pdata->phy.pause_autoneg) { in xgbe_phy_an_outcome()
251 /* Set flow control based on auto-negotiation result */ in xgbe_phy_an_outcome()
252 pdata->phy.tx_pause = 0; in xgbe_phy_an_outcome()
253 pdata->phy.rx_pause = 0; in xgbe_phy_an_outcome()
256 pdata->phy.tx_pause = 1; in xgbe_phy_an_outcome()
257 pdata->phy.rx_pause = 1; in xgbe_phy_an_outcome()
260 pdata->phy.rx_pause = 1; in xgbe_phy_an_outcome()
262 pdata->phy.tx_pause = 1; in xgbe_phy_an_outcome()
272 if (phy_data->speed_set == XGBE_SPEEDSET_2500_10000) in xgbe_phy_an_outcome()
282 if (phy_data->speed_set == XGBE_SPEEDSET_2500_10000) in xgbe_phy_an_outcome()
302 struct ethtool_link_ksettings *slks = &pdata->phy.lks; in xgbe_phy_an_advertising()
349 while (wait--) { in xgbe_phy_complete_ratechange()
358 netif_dbg(pdata, link, pdata->netdev, "SerDes rx/tx not ready (%#hx)\n", in xgbe_phy_complete_ratechange()
369 struct xgbe_phy_data *phy_data = pdata->phy_data; in xgbe_phy_kr_mode()
393 phy_data->cdr_rate[XGBE_SPEED_10000]); in xgbe_phy_kr_mode()
395 phy_data->tx_amp[XGBE_SPEED_10000]); in xgbe_phy_kr_mode()
397 phy_data->blwc[XGBE_SPEED_10000]); in xgbe_phy_kr_mode()
399 phy_data->pq_skew[XGBE_SPEED_10000]); in xgbe_phy_kr_mode()
401 phy_data->dfe_tap_cfg[XGBE_SPEED_10000]); in xgbe_phy_kr_mode()
403 phy_data->dfe_tap_ena[XGBE_SPEED_10000]); in xgbe_phy_kr_mode()
407 netif_dbg(pdata, link, pdata->netdev, "10GbE KR mode set\n"); in xgbe_phy_kr_mode()
412 struct xgbe_phy_data *phy_data = pdata->phy_data; in xgbe_phy_kx_2500_mode()
436 phy_data->cdr_rate[XGBE_SPEED_2500]); in xgbe_phy_kx_2500_mode()
438 phy_data->tx_amp[XGBE_SPEED_2500]); in xgbe_phy_kx_2500_mode()
440 phy_data->blwc[XGBE_SPEED_2500]); in xgbe_phy_kx_2500_mode()
442 phy_data->pq_skew[XGBE_SPEED_2500]); in xgbe_phy_kx_2500_mode()
444 phy_data->dfe_tap_cfg[XGBE_SPEED_2500]); in xgbe_phy_kx_2500_mode()
446 phy_data->dfe_tap_ena[XGBE_SPEED_2500]); in xgbe_phy_kx_2500_mode()
450 netif_dbg(pdata, link, pdata->netdev, "2.5GbE KX mode set\n"); in xgbe_phy_kx_2500_mode()
455 struct xgbe_phy_data *phy_data = pdata->phy_data; in xgbe_phy_kx_1000_mode()
479 phy_data->cdr_rate[XGBE_SPEED_1000]); in xgbe_phy_kx_1000_mode()
481 phy_data->tx_amp[XGBE_SPEED_1000]); in xgbe_phy_kx_1000_mode()
483 phy_data->blwc[XGBE_SPEED_1000]); in xgbe_phy_kx_1000_mode()
485 phy_data->pq_skew[XGBE_SPEED_1000]); in xgbe_phy_kx_1000_mode()
487 phy_data->dfe_tap_cfg[XGBE_SPEED_1000]); in xgbe_phy_kx_1000_mode()
489 phy_data->dfe_tap_ena[XGBE_SPEED_1000]); in xgbe_phy_kx_1000_mode()
493 netif_dbg(pdata, link, pdata->netdev, "1GbE KX mode set\n"); in xgbe_phy_kx_1000_mode()
498 struct xgbe_phy_data *phy_data = pdata->phy_data; in xgbe_phy_cur_mode()
508 if (phy_data->speed_set == XGBE_SPEEDSET_2500_10000) in xgbe_phy_cur_mode()
519 struct xgbe_phy_data *phy_data = pdata->phy_data; in xgbe_phy_switch_mode()
522 /* If we are in KR switch to KX, and vice-versa */ in xgbe_phy_switch_mode()
524 if (phy_data->speed_set == XGBE_SPEEDSET_2500_10000) in xgbe_phy_switch_mode()
538 struct xgbe_phy_data *phy_data = pdata->phy_data; in xgbe_phy_get_mode()
542 return (phy_data->speed_set == XGBE_SPEEDSET_1000_10000) in xgbe_phy_get_mode()
545 return (phy_data->speed_set == XGBE_SPEEDSET_2500_10000) in xgbe_phy_get_mode()
574 if (pdata->phy.autoneg == AUTONEG_ENABLE) { in xgbe_phy_check_mode()
579 cur_mode = xgbe_phy_get_mode(pdata, pdata->phy.speed); in xgbe_phy_check_mode()
589 struct ethtool_link_ksettings *lks = &pdata->phy.lks; in xgbe_phy_use_mode()
608 struct xgbe_phy_data *phy_data = pdata->phy_data; in xgbe_phy_valid_speed()
612 if (phy_data->speed_set != XGBE_SPEEDSET_1000_10000) in xgbe_phy_valid_speed()
616 if (phy_data->speed_set != XGBE_SPEEDSET_2500_10000) in xgbe_phy_valid_speed()
665 } while ((reg & MDIO_CTRL1_RESET) && --count); in xgbe_phy_reset()
668 return -ETIMEDOUT; in xgbe_phy_reset()
680 struct ethtool_link_ksettings *lks = &pdata->phy.lks; in xgbe_phy_init()
684 phy_data = devm_kzalloc(pdata->dev, sizeof(*phy_data), GFP_KERNEL); in xgbe_phy_init()
686 return -ENOMEM; in xgbe_phy_init()
689 ret = device_property_read_u32(pdata->phy_dev, XGBE_SPEEDSET_PROPERTY, in xgbe_phy_init()
690 &phy_data->speed_set); in xgbe_phy_init()
692 dev_err(pdata->dev, "invalid %s property\n", in xgbe_phy_init()
697 switch (phy_data->speed_set) { in xgbe_phy_init()
702 dev_err(pdata->dev, "invalid %s property\n", in xgbe_phy_init()
704 return -EINVAL; in xgbe_phy_init()
708 if (device_property_present(pdata->phy_dev, XGBE_BLWC_PROPERTY)) { in xgbe_phy_init()
709 ret = device_property_read_u32_array(pdata->phy_dev, in xgbe_phy_init()
711 phy_data->blwc, in xgbe_phy_init()
714 dev_err(pdata->dev, "invalid %s property\n", in xgbe_phy_init()
719 memcpy(phy_data->blwc, xgbe_phy_blwc, in xgbe_phy_init()
720 sizeof(phy_data->blwc)); in xgbe_phy_init()
723 if (device_property_present(pdata->phy_dev, XGBE_CDR_RATE_PROPERTY)) { in xgbe_phy_init()
724 ret = device_property_read_u32_array(pdata->phy_dev, in xgbe_phy_init()
726 phy_data->cdr_rate, in xgbe_phy_init()
729 dev_err(pdata->dev, "invalid %s property\n", in xgbe_phy_init()
734 memcpy(phy_data->cdr_rate, xgbe_phy_cdr_rate, in xgbe_phy_init()
735 sizeof(phy_data->cdr_rate)); in xgbe_phy_init()
738 if (device_property_present(pdata->phy_dev, XGBE_PQ_SKEW_PROPERTY)) { in xgbe_phy_init()
739 ret = device_property_read_u32_array(pdata->phy_dev, in xgbe_phy_init()
741 phy_data->pq_skew, in xgbe_phy_init()
744 dev_err(pdata->dev, "invalid %s property\n", in xgbe_phy_init()
749 memcpy(phy_data->pq_skew, xgbe_phy_pq_skew, in xgbe_phy_init()
750 sizeof(phy_data->pq_skew)); in xgbe_phy_init()
753 if (device_property_present(pdata->phy_dev, XGBE_TX_AMP_PROPERTY)) { in xgbe_phy_init()
754 ret = device_property_read_u32_array(pdata->phy_dev, in xgbe_phy_init()
756 phy_data->tx_amp, in xgbe_phy_init()
759 dev_err(pdata->dev, "invalid %s property\n", in xgbe_phy_init()
764 memcpy(phy_data->tx_amp, xgbe_phy_tx_amp, in xgbe_phy_init()
765 sizeof(phy_data->tx_amp)); in xgbe_phy_init()
768 if (device_property_present(pdata->phy_dev, XGBE_DFE_CFG_PROPERTY)) { in xgbe_phy_init()
769 ret = device_property_read_u32_array(pdata->phy_dev, in xgbe_phy_init()
771 phy_data->dfe_tap_cfg, in xgbe_phy_init()
774 dev_err(pdata->dev, "invalid %s property\n", in xgbe_phy_init()
779 memcpy(phy_data->dfe_tap_cfg, xgbe_phy_dfe_tap_cfg, in xgbe_phy_init()
780 sizeof(phy_data->dfe_tap_cfg)); in xgbe_phy_init()
783 if (device_property_present(pdata->phy_dev, XGBE_DFE_ENA_PROPERTY)) { in xgbe_phy_init()
784 ret = device_property_read_u32_array(pdata->phy_dev, in xgbe_phy_init()
786 phy_data->dfe_tap_ena, in xgbe_phy_init()
789 dev_err(pdata->dev, "invalid %s property\n", in xgbe_phy_init()
794 memcpy(phy_data->dfe_tap_ena, xgbe_phy_dfe_tap_ena, in xgbe_phy_init()
795 sizeof(phy_data->dfe_tap_ena)); in xgbe_phy_init()
805 switch (phy_data->speed_set) { in xgbe_phy_init()
814 if (pdata->fec_ability & MDIO_PMA_10GBR_FECABLE_ABLE) in xgbe_phy_init()
817 pdata->phy_data = phy_data; in xgbe_phy_init()
824 struct xgbe_phy_impl_if *phy_impl = &phy_if->phy_impl; in xgbe_init_function_ptrs_phy_v1()
826 phy_impl->init = xgbe_phy_init; in xgbe_init_function_ptrs_phy_v1()
827 phy_impl->exit = xgbe_phy_exit; in xgbe_init_function_ptrs_phy_v1()
829 phy_impl->reset = xgbe_phy_reset; in xgbe_init_function_ptrs_phy_v1()
830 phy_impl->start = xgbe_phy_start; in xgbe_init_function_ptrs_phy_v1()
831 phy_impl->stop = xgbe_phy_stop; in xgbe_init_function_ptrs_phy_v1()
833 phy_impl->link_status = xgbe_phy_link_status; in xgbe_init_function_ptrs_phy_v1()
835 phy_impl->valid_speed = xgbe_phy_valid_speed; in xgbe_init_function_ptrs_phy_v1()
837 phy_impl->use_mode = xgbe_phy_use_mode; in xgbe_init_function_ptrs_phy_v1()
838 phy_impl->set_mode = xgbe_phy_set_mode; in xgbe_init_function_ptrs_phy_v1()
839 phy_impl->get_mode = xgbe_phy_get_mode; in xgbe_init_function_ptrs_phy_v1()
840 phy_impl->switch_mode = xgbe_phy_switch_mode; in xgbe_init_function_ptrs_phy_v1()
841 phy_impl->cur_mode = xgbe_phy_cur_mode; in xgbe_init_function_ptrs_phy_v1()
843 phy_impl->an_mode = xgbe_phy_an_mode; in xgbe_init_function_ptrs_phy_v1()
845 phy_impl->an_config = xgbe_phy_an_config; in xgbe_init_function_ptrs_phy_v1()
847 phy_impl->an_advertising = xgbe_phy_an_advertising; in xgbe_init_function_ptrs_phy_v1()
849 phy_impl->an_outcome = xgbe_phy_an_outcome; in xgbe_init_function_ptrs_phy_v1()
851 phy_impl->kr_training_pre = xgbe_phy_kr_training_pre; in xgbe_init_function_ptrs_phy_v1()
852 phy_impl->kr_training_post = xgbe_phy_kr_training_post; in xgbe_init_function_ptrs_phy_v1()