Lines Matching +full:broadr +full:- +full:reach
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2015-2017 Broadcom
6 #include "bcm-phy-lib.h"
192 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in bcm_phy_config_intr()
359 if (phydev->autoneg == AUTONEG_ENABLE) in bcm_phy_enable_apd()
367 /* Enable Auto Power-Down (APD) for the PHY */ in bcm_phy_enable_apd()
394 phydev->supported)) in bcm_phy_set_eee()
397 phydev->supported)) in bcm_phy_set_eee()
448 if (count - BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET > in bcm_phy_downshift_set()
451 return -ERANGE; in bcm_phy_downshift_set()
488 val |= (count - BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET) << in bcm_phy_downshift_set()
507 { "phy_receive_errors", -1, MII_BRCM_CORE_BASE12, 0, 16 },
508 { "phy_serdes_ber_errors", -1, MII_BRCM_CORE_BASE13, 8, 8 },
509 { "phy_false_carrier_sense_errors", -1, MII_BRCM_CORE_BASE13, 0, 8 },
510 { "phy_local_rcvr_nok", -1, MII_BRCM_CORE_BASE14, 8, 8 },
511 { "phy_remote_rcv_nok", -1, MII_BRCM_CORE_BASE14, 0, 8 },
548 val = val & ((1 << stat.bits) - 1); in bcm_phy_get_stat()
591 /* Adjust bias current trim by -3 */ in bcm_phy_28nm_a0b0_afe_config_init()
656 /* Auto-negotiation must be enabled for cable diagnostics to work, but in _bcm_phy_cable_test_start()
678 /* re-enable the RDB access even if there was an error */ in _bcm_phy_cable_test_start()
787 /* re-enable the RDB access even if there was an error */ in _bcm_phy_cable_test_get_status()
800 phydev->pause = 0; in bcm_setup_lre_forced()
801 phydev->asym_pause = 0; in bcm_setup_lre_forced()
803 if (phydev->speed == SPEED_100) in bcm_setup_lre_forced()
806 if (phydev->duplex != DUPLEX_FULL) in bcm_setup_lre_forced()
807 return -EOPNOTSUPP; in bcm_setup_lre_forced()
813 * bcm_linkmode_adv_to_lre_adv_t - translate linkmode advertisement to LDS
815 * Return: LDS Auto-Negotiation Advertised Ability register value
852 * mode. If, in the future, this is not true anymore, we have to re-implement
876 struct net_device *ndev = phydev->attached_dev; in bcm_phy_set_wol()
882 /* Allow a MAC driver to play through its own Wake-on-LAN in bcm_phy_set_wol()
885 if (wol->wolopts & ~BCM54XX_WOL_SUPPORTED_MASK) in bcm_phy_set_wol()
886 return -EOPNOTSUPP; in bcm_phy_set_wol()
891 BUILD_BUG_ON(sizeof(wol->sopass) != ETH_ALEN); in bcm_phy_set_wol()
904 if (!wol->wolopts) { in bcm_phy_set_wol()
906 disable_irq_wake(phydev->irq); in bcm_phy_set_wol()
914 /* Disable the global Wake-on-LAN enable bit */ in bcm_phy_set_wol()
920 /* Clear the previously configured mode and mask mode for Wake-on-LAN */ in bcm_phy_set_wol()
932 * - WAKE_UCAST -> MAC DA is the device's MAC with a perfect match in bcm_phy_set_wol()
933 * - WAKE_MCAST -> MAC DA is X1:XX:XX:XX:XX:XX where XX is don't care in bcm_phy_set_wol()
934 * - WAKE_BCAST -> MAC DA is FF:FF:FF:FF:FF:FF with a perfect match in bcm_phy_set_wol()
941 if (wol->wolopts & WAKE_MCAST) { in bcm_phy_set_wol()
947 if (wol->wolopts & WAKE_UCAST) { in bcm_phy_set_wol()
948 ether_addr_copy(da, ndev->dev_addr); in bcm_phy_set_wol()
949 } else if (wol->wolopts & WAKE_BCAST) { in bcm_phy_set_wol()
951 } else if (wol->wolopts & WAKE_MAGICSECURE) { in bcm_phy_set_wol()
952 ether_addr_copy(da, wol->sopass); in bcm_phy_set_wol()
953 } else if (wol->wolopts & WAKE_MAGIC) { in bcm_phy_set_wol()
960 if (wol->wolopts & (WAKE_MAGIC | WAKE_MAGICSECURE)) { in bcm_phy_set_wol()
962 BCM54XX_WOL_MPD_DATA1(2 - i), in bcm_phy_set_wol()
963 ndev->dev_addr[i * 2] << 8 | in bcm_phy_set_wol()
964 ndev->dev_addr[i * 2 + 1]); in bcm_phy_set_wol()
969 ret = bcm_phy_write_exp(phydev, BCM54XX_WOL_MPD_DATA2(2 - i), in bcm_phy_set_wol()
974 ret = bcm_phy_write_exp(phydev, BCM54XX_WOL_MASK(2 - i), in bcm_phy_set_wol()
980 if (wol->wolopts & WAKE_MAGICSECURE) { in bcm_phy_set_wol()
987 if (wol->wolopts & WAKE_MAGIC) in bcm_phy_set_wol()
995 /* Globally enable Wake-on-LAN */ in bcm_phy_set_wol()
1012 /* Enable all Wake-on-LAN interrupt sources */ in bcm_phy_set_wol()
1018 enable_irq_wake(phydev->irq); in bcm_phy_set_wol()
1026 struct net_device *ndev = phydev->attached_dev; in bcm_phy_get_wol()
1032 wol->supported = BCM54XX_WOL_SUPPORTED_MASK; in bcm_phy_get_wol()
1033 wol->wolopts = 0; in bcm_phy_get_wol()
1046 BCM54XX_WOL_MPD_DATA2(2 - i)); in bcm_phy_get_wol()
1056 wol->wolopts |= WAKE_BCAST; in bcm_phy_get_wol()
1058 wol->wolopts |= WAKE_MCAST; in bcm_phy_get_wol()
1059 else if (ether_addr_equal(da, ndev->dev_addr)) in bcm_phy_get_wol()
1060 wol->wolopts |= WAKE_UCAST; in bcm_phy_get_wol()
1065 wol->wolopts |= WAKE_MAGIC; in bcm_phy_get_wol()
1068 wol->wolopts |= WAKE_MAGICSECURE; in bcm_phy_get_wol()
1069 memcpy(wol->sopass, da, sizeof(da)); in bcm_phy_get_wol()
1092 return -EINVAL; in bcm_phy_led_brightness_set()
1115 switch (phydev->master_slave_set) { in bcm_setup_lre_master_slave()
1128 return -EOPNOTSUPP; in bcm_setup_lre_master_slave()
1148 if (phydev->autoneg != AUTONEG_ENABLE) in bcm_config_lre_aneg()
1162 * bcm_config_lre_advert - sanitize and advertise Long-Distance Signaling
1163 * auto-negotiation parameters
1174 u32 adv = bcm_linkmode_adv_to_lre_adv_t(phydev->advertising); in bcm_config_lre_advert()
1176 /* Setup BroadR-Reach mode advertisement */ in bcm_config_lre_advert()