Lines Matching +full:mac +full:- +full:phy

3   Copyright (c) 2001-2020, Intel Corporation
47 * ixgbe_init_ops_X550 - Inits func ptrs and MAC type
50 * Initialize the function pointers and assign the MAC type for X550.
55 struct ixgbe_mac_info *mac = &hw->mac;
56 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
62 mac->ops.dmac_config = ixgbe_dmac_config_X550;
63 mac->ops.dmac_config_tcs = ixgbe_dmac_config_tcs_X550;
64 mac->ops.dmac_update_tcs = ixgbe_dmac_update_tcs_X550;
65 mac->ops.setup_eee = NULL;
66 mac->ops.set_source_address_pruning =
68 mac->ops.set_ethertype_anti_spoofing =
71 mac->ops.get_rtrup2tc = ixgbe_dcb_get_rtrup2tc_generic;
72 eeprom->ops.init_params = ixgbe_init_eeprom_params_X550;
73 eeprom->ops.calc_checksum = ixgbe_calc_eeprom_checksum_X550;
74 eeprom->ops.read = ixgbe_read_ee_hostif_X550;
75 eeprom->ops.read_buffer = ixgbe_read_ee_hostif_buffer_X550;
76 eeprom->ops.write = ixgbe_write_ee_hostif_X550;
77 eeprom->ops.write_buffer = ixgbe_write_ee_hostif_buffer_X550;
78 eeprom->ops.update_checksum = ixgbe_update_eeprom_checksum_X550;
79 eeprom->ops.validate_checksum = ixgbe_validate_eeprom_checksum_X550;
81 mac->ops.disable_mdd = ixgbe_disable_mdd_X550;
82 mac->ops.enable_mdd = ixgbe_enable_mdd_X550;
83 mac->ops.mdd_event = ixgbe_mdd_event_X550;
84 mac->ops.restore_mdd_vf = ixgbe_restore_mdd_vf_X550;
85 mac->ops.fw_recovery_mode = ixgbe_fw_recovery_mode_X550;
86 mac->ops.disable_rx = ixgbe_disable_rx_x550;
88 mac->ops.set_fw_drv_ver = ixgbe_set_fw_drv_ver_x550;
89 switch (hw->device_id) {
91 hw->mac.ops.led_on = NULL;
92 hw->mac.ops.led_off = NULL;
96 hw->mac.ops.led_on = ixgbe_led_on_t_X550em;
97 hw->mac.ops.led_off = ixgbe_led_off_t_X550em;
106 * ixgbe_read_cs4227 - Read CS4227 register
115 return hw->link.ops.read_link_unlocked(hw, hw->link.addr, reg, value);
119 * ixgbe_write_cs4227 - Write CS4227 register
128 return hw->link.ops.write_link_unlocked(hw, hw->link.addr, reg, value);
132 * ixgbe_read_pe - Read register from port expander
151 * ixgbe_write_pe - Write register to port expander
170 * ixgbe_reset_cs4227 - Reset CS4227 using port expander
246 * ixgbe_check_cs4227 - Check CS4227 and reset as needed
252 u32 swfw_mask = hw->phy.phy_semaphore_mask;
257 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
277 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
283 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
304 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
306 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
318 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
319 msec_delay(hw->eeprom.semaphore_delay);
323 * ixgbe_setup_mux_ctl - Setup ESDP register for I2C mux control
330 if (hw->bus.lan_id) {
340 * ixgbe_identify_phy_x550em - Get PHY type based on device id
347 hw->mac.ops.set_lan_id(hw);
351 switch (hw->device_id) {
363 hw->phy.type = ixgbe_phy_x550em_kx4;
366 hw->phy.type = ixgbe_phy_x550em_xfi;
371 hw->phy.type = ixgbe_phy_x550em_kr;
377 hw->phy.type = ixgbe_phy_ext_1g_t;
381 hw->phy.type = ixgbe_phy_fw;
382 if (hw->bus.lan_id)
383 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
385 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
394 * ixgbe_fw_phy_activity - Perform an activity on a PHY
397 * @data: Pointer to 4 32-bit words of data
415 hic.cmd.port_number = hw->bus.lan_id;
433 --retries;
452 * ixgbe_get_phy_id_fw - Get the phy ID via firmware command
469 hw->phy.speeds_supported = 0;
473 hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed;
475 if (!hw->phy.autoneg_advertised)
476 hw->phy.autoneg_advertised = hw->phy.speeds_supported;
478 hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK;
480 hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK;
481 hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK;
482 if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK)
488 * ixgbe_identify_phy_fw - Get PHY type based on firmware command
495 if (hw->bus.lan_id)
496 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM;
498 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM;
500 hw->phy.type = ixgbe_phy_fw;
501 hw->phy.ops.read_reg = NULL;
502 hw->phy.ops.write_reg = NULL;
507 * ixgbe_shutdown_fw_phy - Shutdown a firmware-controlled PHY
535 * ixgbe_read_i2c_combined_generic - Perform I2C read combined operation
550 * ixgbe_read_i2c_combined_generic_unlocked - Do I2C read combined operation
566 * ixgbe_write_i2c_combined_generic - Perform I2C write combined operation
581 * ixgbe_write_i2c_combined_generic_unlocked - Do I2C write combined operation
597 * ixgbe_init_ops_X550EM - Inits func ptrs and MAC type
600 * Initialize the function pointers and for MAC type X550EM.
605 struct ixgbe_mac_info *mac = &hw->mac;
606 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
607 struct ixgbe_phy_info *phy = &hw->phy;
621 mac->ops.get_thermal_sensor_data = NULL;
622 mac->ops.init_thermal_sensor_thresh = NULL;
623 mac->thermal_sensor_enabled = false;
626 mac->ops.bypass_rw = NULL;
627 mac->ops.bypass_valid_rd = NULL;
628 mac->ops.bypass_set = NULL;
629 mac->ops.bypass_rd_eep = NULL;
632 mac->ops.get_san_mac_addr = NULL;
633 mac->ops.set_san_mac_addr = NULL;
634 mac->ops.get_wwn_prefix = NULL;
635 mac->ops.get_fcoe_boot_status = NULL;
638 mac->ops.disable_sec_rx_path = NULL;
639 mac->ops.enable_sec_rx_path = NULL;
642 mac->ops.prot_autoc_read = NULL;
643 mac->ops.prot_autoc_write = NULL;
646 hw->bus.type = ixgbe_bus_type_internal;
647 mac->ops.get_bus_info = ixgbe_get_bus_info_X550em;
650 mac->ops.get_media_type = ixgbe_get_media_type_X550em;
651 mac->ops.setup_sfp = ixgbe_setup_sfp_modules_X550em;
652 mac->ops.get_link_capabilities = ixgbe_get_link_capabilities_X550em;
653 mac->ops.reset_hw = ixgbe_reset_hw_X550em;
654 mac->ops.get_supported_physical_layer =
657 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper)
658 mac->ops.setup_fc = ixgbe_setup_fc_generic;
660 mac->ops.setup_fc = ixgbe_setup_fc_X550em;
662 /* PHY */
663 phy->ops.init = ixgbe_init_phy_ops_X550em;
664 switch (hw->device_id) {
667 mac->ops.setup_fc = NULL;
668 phy->ops.identify = ixgbe_identify_phy_fw;
669 phy->ops.set_phy_power = NULL;
670 phy->ops.get_firmware_version = NULL;
673 mac->ops.setup_fc = NULL;
674 phy->ops.identify = ixgbe_identify_phy_x550em;
675 phy->ops.set_phy_power = NULL;
678 phy->ops.identify = ixgbe_identify_phy_x550em;
681 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper)
682 phy->ops.set_phy_power = NULL;
686 eeprom->ops.init_params = ixgbe_init_eeprom_params_X540;
687 eeprom->ops.read = ixgbe_read_ee_hostif_X550;
688 eeprom->ops.read_buffer = ixgbe_read_ee_hostif_buffer_X550;
689 eeprom->ops.write = ixgbe_write_ee_hostif_X550;
690 eeprom->ops.write_buffer = ixgbe_write_ee_hostif_buffer_X550;
691 eeprom->ops.update_checksum = ixgbe_update_eeprom_checksum_X550;
692 eeprom->ops.validate_checksum = ixgbe_validate_eeprom_checksum_X550;
693 eeprom->ops.calc_checksum = ixgbe_calc_eeprom_checksum_X550;
699 * ixgbe_setup_fw_link - Setup firmware-controlled PHYs
708 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw))
711 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
717 switch (hw->fc.requested_mode) {
735 if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed)
740 if (hw->phy.eee_speeds_advertised)
752 * ixgbe_fc_autoneg_fw - Set up flow control for FW-controlled PHYs
759 if (hw->fc.requested_mode == ixgbe_fc_default)
760 hw->fc.requested_mode = ixgbe_fc_full;
766 * ixgbe_setup_eee_fw - Enable/disable EEE support
771 * This function controls EEE for firmware-based PHY implementations.
775 if (!!hw->phy.eee_speeds_advertised == enable_eee)
778 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported;
780 hw->phy.eee_speeds_advertised = 0;
781 return hw->phy.ops.setup_link(hw);
785 * ixgbe_init_ops_X550EM_a - Inits func ptrs and MAC type
788 * Initialize the function pointers and for MAC type X550EM_a.
793 struct ixgbe_mac_info *mac = &hw->mac;
801 mac->ops.read_iosf_sb_reg = ixgbe_read_iosf_sb_reg_x550;
802 mac->ops.write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550;
803 mac->ops.acquire_swfw_sync = ixgbe_acquire_swfw_sync_X550a;
804 mac->ops.release_swfw_sync = ixgbe_release_swfw_sync_X550a;
806 switch (mac->ops.get_media_type(hw)) {
808 mac->ops.setup_fc = NULL;
809 mac->ops.fc_autoneg = ixgbe_fc_autoneg_fiber_x550em_a;
812 mac->ops.fc_autoneg = ixgbe_fc_autoneg_backplane_x550em_a;
813 mac->ops.setup_fc = ixgbe_setup_fc_backplane_x550em_a;
819 switch (hw->device_id) {
822 mac->ops.fc_autoneg = ixgbe_fc_autoneg_sgmii_x550em_a;
823 mac->ops.setup_fc = ixgbe_fc_autoneg_fw;
824 mac->ops.setup_eee = ixgbe_setup_eee_fw;
825 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL |
827 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported;
837 * ixgbe_init_ops_X550EM_x - Inits func ptrs and MAC type
840 * Initialize the function pointers and for MAC type X550EM_x.
845 struct ixgbe_mac_info *mac = &hw->mac;
846 struct ixgbe_link_info *link = &hw->link;
854 mac->ops.read_iosf_sb_reg = ixgbe_read_iosf_sb_reg_x550;
855 mac->ops.write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550;
856 mac->ops.acquire_swfw_sync = ixgbe_acquire_swfw_sync_X550em;
857 mac->ops.release_swfw_sync = ixgbe_release_swfw_sync_X550em;
858 link->ops.read_link = ixgbe_read_i2c_combined_generic;
859 link->ops.read_link_unlocked = ixgbe_read_i2c_combined_generic_unlocked;
860 link->ops.write_link = ixgbe_write_i2c_combined_generic;
861 link->ops.write_link_unlocked =
863 link->addr = IXGBE_CS4227;
865 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) {
866 mac->ops.setup_fc = NULL;
867 mac->ops.setup_eee = NULL;
868 mac->ops.init_led_link_act = NULL;
893 if (!hw->mac.dmac_config.watchdog_timer)
903 reg |= (hw->mac.dmac_config.watchdog_timer * 100) / 4096;
907 if (hw->mac.dmac_config.fcoe_en) {
908 high_pri_tc = 1 << hw->mac.dmac_config.fcoe_tc;
936 switch (hw->mac.dmac_config.link_speed) {
957 if (tc < hw->mac.dmac_config.num_tcs) {
965 rx_pb_size = rx_pb_size - pb_headroom;
1006 * ixgbe_init_eeprom_params_X550 - Initialize EEPROM params
1014 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
1020 if (eeprom->type == ixgbe_eeprom_uninitialized) {
1021 eeprom->semaphore_delay = 10;
1022 eeprom->type = ixgbe_flash;
1027 eeprom->word_size = 1 << (eeprom_size +
1031 eeprom->type, eeprom->word_size);
1038 * ixgbe_set_source_address_pruning_X550 - Enable/Disbale source address pruning
1065 * ixgbe_set_ethertype_anti_spoofing_X550 - Configure Ethertype anti-spoofing
1067 * @enable: enable or disable switch for Ethertype anti-spoofing
1068 * @vf: Virtual Function pool - VF Pool to set for Ethertype anti-spoofing
1090 * ixgbe_iosf_wait - Wait for IOSF command completion
1123 * ixgbe_write_iosf_sb_reg_x550 - Writes a value to specified register
1126 * @reg_addr: 32 bit PHY register to write
1170 * ixgbe_read_iosf_sb_reg_x550 - Reads specified register of the IOSF device
1172 * @reg_addr: 32 bit PHY register to write
1216 * ixgbe_get_phy_token - Get the token for shared phy access
1229 token_cmd.port_number = hw->bus.lan_id;
1254 * ixgbe_put_phy_token - Put the token for shared phy access
1267 token_cmd.port_number = hw->bus.lan_id;
1279 DEBUGOUT("Put PHY Token host interface command failed");
1427 * ixgbe_get_media_type_X550em - Get media type
1438 /* Detect if there is a copper PHY attached. */
1439 switch (hw->device_id) {
1462 hw->phy.type = ixgbe_phy_sgmii;
1476 * ixgbe_supported_sfp_modules_X550em - Check if SFP module type is supported
1484 switch (hw->phy.sfp_type) {
1512 * ixgbe_identify_sfp_module_X550em - Identifies SFP modules
1515 * Searches for and identifies the SFP module and assigns appropriate PHY type.
1536 * ixgbe_setup_sfp_modules_X550em - Setup MAC link ops
1553 hw->phy.ops.reset = NULL;
1559 * ixgbe_restart_an_internal_phy_x550em - restart autonegotiation for the
1560 * internal PHY
1568 /* Restart auto-negotiation. */
1569 status = hw->mac.ops.read_iosf_sb_reg(hw,
1570 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1574 DEBUGOUT("Auto-negotiation did not complete\n");
1579 status = hw->mac.ops.write_iosf_sb_reg(hw,
1580 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1583 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1587 status = hw->mac.ops.read_iosf_sb_reg(hw,
1588 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1592 DEBUGOUT("Auto-negotiation did not complete\n");
1597 status = hw->mac.ops.write_iosf_sb_reg(hw,
1598 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1606 * ixgbe_setup_sgmii - Set up link for sgmii
1614 struct ixgbe_mac_info *mac = &hw->mac;
1618 rc = mac->ops.read_iosf_sb_reg(hw,
1619 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1629 rc = mac->ops.write_iosf_sb_reg(hw,
1630 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1635 rc = mac->ops.read_iosf_sb_reg(hw,
1636 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1643 rc = mac->ops.write_iosf_sb_reg(hw,
1644 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1649 rc = mac->ops.read_iosf_sb_reg(hw,
1650 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1661 rc = mac->ops.write_iosf_sb_reg(hw,
1662 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1671 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait);
1675 * ixgbe_setup_sgmii_fw - Set up link for internal PHY SGMII auto-negotiation
1683 struct ixgbe_mac_info *mac = &hw->mac;
1687 rc = mac->ops.read_iosf_sb_reg(hw,
1688 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1698 rc = mac->ops.write_iosf_sb_reg(hw,
1699 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1704 rc = mac->ops.read_iosf_sb_reg(hw,
1705 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1712 rc = mac->ops.write_iosf_sb_reg(hw,
1713 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1718 rc = mac->ops.write_iosf_sb_reg(hw,
1719 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1724 rc = mac->ops.read_iosf_sb_reg(hw,
1725 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1736 rc = mac->ops.write_iosf_sb_reg(hw,
1737 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1744 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait);
1748 * ixgbe_init_mac_link_ops_X550em - init mac link function pointers
1753 struct ixgbe_mac_info *mac = &hw->mac;
1757 switch (hw->mac.ops.get_media_type(hw)) {
1762 mac->ops.disable_tx_laser = NULL;
1763 mac->ops.enable_tx_laser = NULL;
1764 mac->ops.flap_tx_laser = NULL;
1765 mac->ops.setup_link = ixgbe_setup_mac_link_multispeed_fiber;
1766 mac->ops.set_rate_select_speed =
1769 if ((hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) ||
1770 (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP))
1771 mac->ops.setup_mac_link =
1774 mac->ops.setup_mac_link =
1778 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T)
1780 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1781 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
1782 hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L) {
1783 mac->ops.setup_link = ixgbe_setup_sgmii_fw;
1784 mac->ops.check_link =
1787 mac->ops.setup_link =
1791 mac->ops.setup_link = ixgbe_setup_mac_link_t_X550em;
1792 mac->ops.check_link = ixgbe_check_link_t_X550em;
1796 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII ||
1797 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L)
1798 mac->ops.setup_link = ixgbe_setup_sgmii;
1806 * ixgbe_get_link_capabilities_X550em - Determines link capabilities
1818 if (hw->phy.type == ixgbe_phy_fw) {
1820 *speed = hw->phy.speeds_supported;
1825 if (hw->phy.media_type == ixgbe_media_type_fiber) {
1827 /* CS4227 SFP must not enable auto-negotiation */
1831 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
1832 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1
1833 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1834 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) {
1840 if (hw->phy.multispeed_fiber)
1848 switch (hw->phy.type) {
1859 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1861 if (hw->phy.nw_mng_if_sel &
1865 } else if (hw->device_id ==
1885 * ixgbe_get_lasi_ext_t_x550em - Determime external Base T PHY interrupt cause
1888 * PHY interrupt is lsc
1890 * Determime if external Base T PHY interrupt cause is high temperature
1894 * failure alarm, else return PHY access status.
1904 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG,
1912 /* Vendor Auto-Neg alarm triggered or Global alarm 1 triggered */
1913 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG,
1923 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1,
1932 /* power down the PHY in case the PHY FW didn't already */
1937 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG,
1946 /* power down the PHY in case the PHY FW didn't */
1953 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG,
1961 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2,
1975 * ixgbe_enable_lasi_ext_t_x550em - Enable external Base T PHY interrupts
1979 * Base T PHY
1981 * Returns PHY access status
1995 * of the link configurations of the external PHY and correspondingly
1997 * not support auto-negotiation. This is not required for X553 devices
1998 * having KR support, which performs auto-negotiations and which is used
1999 * as the internal link to the external PHY. Hence adding a check here
2002 if (hw->mac.type != ixgbe_mac_X550EM_a) {
2003 status = hw->phy.ops.read_reg(hw,
2012 status = hw->phy.ops.write_reg(hw,
2021 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
2031 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
2038 /* Enable vendor Auto-Neg alarm and Global Interrupt Mask 1 alarm */
2039 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK,
2049 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK,
2056 /* Enable chip-wide vendor alarm */
2057 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK,
2066 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK,
2074 * ixgbe_setup_kr_speed_x550em - Configure the KR PHY for link speed.
2078 * Configures the integrated KR PHY.
2086 status = hw->mac.ops.read_iosf_sb_reg(hw,
2087 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2104 status = hw->mac.ops.write_iosf_sb_reg(hw,
2105 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2108 if (hw->mac.type == ixgbe_mac_X550EM_a) {
2110 status = hw->mac.ops.read_iosf_sb_reg(hw,
2111 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2123 status = hw->mac.ops.write_iosf_sb_reg(hw,
2124 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2132 * ixgbe_reset_phy_fw - Reset firmware-controlled PHYs
2140 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw))
2156 * ixgbe_check_overtemp_fw - Check firmware-controlled PHYs for overtemp
2176 * ixgbe_read_mng_if_sel_x550em - Read NW_MNG_IF_SEL register
2185 * to determine internal PHY mode.
2187 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL);
2189 /* If X552 (X550EM_a) and MDIO is connected to external PHY, then set
2190 * PHY address. This register field was has only been used for X552.
2192 if (hw->mac.type == ixgbe_mac_X550EM_a &&
2193 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) {
2194 hw->phy.addr = (hw->phy.nw_mng_if_sel &
2203 * ixgbe_init_phy_ops_X550em - PHY/SFP specific init
2207 * set during init_shared_code because the PHY/SFP type was
2212 struct ixgbe_phy_info *phy = &hw->phy;
2217 hw->mac.ops.set_lan_id(hw);
2220 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
2221 phy->phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
2223 phy->ops.identify_sfp = ixgbe_identify_sfp_module_X550em;
2226 switch (hw->device_id) {
2229 phy->ops.read_reg_mdi = NULL;
2230 phy->ops.write_reg_mdi = NULL;
2231 hw->phy.ops.read_reg = NULL;
2232 hw->phy.ops.write_reg = NULL;
2233 phy->ops.check_overtemp = ixgbe_check_overtemp_fw;
2234 if (hw->bus.lan_id)
2235 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
2237 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
2242 hw->phy.ops.read_reg = ixgbe_read_phy_reg_x550a;
2243 hw->phy.ops.write_reg = ixgbe_write_phy_reg_x550a;
2244 if (hw->bus.lan_id)
2245 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
2247 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
2251 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
2254 phy->ops.read_reg_mdi = NULL;
2255 phy->ops.write_reg_mdi = NULL;
2260 /* Identify the PHY or SFP module */
2261 ret_val = phy->ops.identify(hw);
2268 if (phy->sfp_type != ixgbe_sfp_type_unknown)
2269 phy->ops.reset = NULL;
2271 /* Set functions pointers based on phy type */
2272 switch (hw->phy.type) {
2274 phy->ops.setup_link = NULL;
2275 phy->ops.read_reg = ixgbe_read_phy_reg_x550em;
2276 phy->ops.write_reg = ixgbe_write_phy_reg_x550em;
2279 phy->ops.setup_link = ixgbe_setup_kr_x550em;
2280 phy->ops.read_reg = ixgbe_read_phy_reg_x550em;
2281 phy->ops.write_reg = ixgbe_write_phy_reg_x550em;
2285 phy->ops.setup_link = NULL;
2286 phy->ops.reset = NULL;
2290 phy->ops.setup_link = NULL;
2291 phy->ops.read_reg = ixgbe_read_phy_reg_x550em;
2292 phy->ops.write_reg = ixgbe_write_phy_reg_x550em;
2298 phy->ops.setup_internal_link =
2302 if ((hw->mac.type == ixgbe_mac_X550EM_x) &&
2305 phy->ops.enter_lplu = ixgbe_enter_lplu_t_x550em;
2307 phy->ops.handle_lasi = ixgbe_handle_lasi_ext_t_x550em;
2308 phy->ops.reset = ixgbe_reset_phy_t_X550em;
2311 phy->ops.setup_link = NULL;
2314 phy->ops.setup_link = ixgbe_setup_fw_link;
2315 phy->ops.reset = ixgbe_reset_phy_fw;
2324 * ixgbe_set_mdio_speed - Set MDIO clock speed
2331 switch (hw->device_id) {
2338 /* Config MDIO clock speed before the first MDIO PHY access */
2356 * ixgbe_reset_hw_X550em - Perform hardware reset
2360 * and clears all interrupts, perform a PHY reset, and perform a link (MAC)
2370 u32 swfw_mask = hw->phy.phy_semaphore_mask;
2375 status = hw->mac.ops.stop_adapter(hw);
2385 /* PHY ops must be identified and initialized prior to reset */
2386 status = hw->phy.ops.init(hw);
2389 DEBUGOUT1("Failed to initialize PHY ops, STATUS = %d\n",
2394 DEBUGOUT("Returning from reset HW due to PHY init failure\n");
2398 /* start the external PHY */
2399 if (hw->phy.type == ixgbe_phy_x550em_ext_t) {
2402 DEBUGOUT1("Failed to start the external PHY, STATUS = %d\n",
2409 if (hw->phy.sfp_setup_needed) {
2410 status = hw->mac.ops.setup_sfp(hw);
2411 hw->phy.sfp_setup_needed = false;
2417 /* Reset PHY */
2418 if (!hw->phy.reset_disable && hw->phy.ops.reset) {
2419 if (hw->phy.ops.reset(hw) == IXGBE_ERR_OVERTEMP)
2424 /* Issue global reset to the MAC. Needs to be SW reset if link is up.
2425 * If link reset is used when link is up, it might reset the PHY when
2430 if (!hw->force_full_reset) {
2431 hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
2436 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
2445 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
2447 /* Poll for reset bit to self-clear meaning reset is complete */
2466 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) {
2467 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED;
2471 /* Store the permanent mac address */
2472 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
2474 /* Store MAC address from RAR0, clear receive address registers, and
2476 * since we modify this value when programming the SAN MAC address.
2478 hw->mac.num_rar_entries = 128;
2479 hw->mac.ops.init_rx_addrs(hw);
2483 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP)
2493 * ixgbe_init_ext_t_x550em - Start (unstall) the external Base T PHY.
2501 status = hw->phy.ops.read_reg(hw,
2509 /* If PHY FW reset completed bit is set then this is the first
2510 * SW instance after a power on so the PHY FW must be un-stalled.
2513 status = hw->phy.ops.read_reg(hw,
2523 status = hw->phy.ops.write_reg(hw,
2536 * ixgbe_setup_kr_x550em - Configure the KR PHY.
2542 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL)
2548 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised);
2552 * ixgbe_setup_mac_link_sfp_x550em - Setup internal/external the PHY for SFP
2557 * Configure the external PHY and the integrated KR PHY for SFP support.
2573 * not excepted in the setup MAC link flow.
2581 /* Configure internal PHY for KR/KX. */
2586 (hw->bus.lan_id << 12);
2591 ret_val = hw->link.ops.write_link(hw, hw->link.addr, reg_slice,
2597 * ixgbe_setup_sfi_x550a - Configure the internal PHY for native SFI mode
2601 * Configures the integrated PHY for native SFI mode. Used to connect the
2602 * internal PHY directly to an SFP cage, without autonegotiation.
2606 struct ixgbe_mac_info *mac = &hw->mac;
2611 status = mac->ops.read_iosf_sb_reg(hw,
2612 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2622 /* Select forced link speed for internal PHY. */
2631 /* Other link speeds are not supported by internal PHY. */
2635 status = mac->ops.write_iosf_sb_reg(hw,
2636 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2646 * ixgbe_setup_mac_link_sfp_x550a - Setup internal PHY for SFP
2651 * Configure the integrated PHY for SFP support.
2668 * SFP not present error is not excepted in the setup MAC link flow.
2676 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) {
2677 /* Configure internal PHY for native SFI based on module type */
2678 ret_val = hw->mac.ops.read_iosf_sb_reg(hw,
2679 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2689 ret_val = hw->mac.ops.write_iosf_sb_reg(hw,
2690 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2699 /* Configure internal PHY for KR/KX. */
2702 if (hw->phy.addr == 0x0 || hw->phy.addr == 0xFFFF) {
2708 /* Get external PHY SKU id */
2709 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU,
2715 /* When configuring quad port CS4223, the MAC instance is part
2719 slice_offset = (hw->bus.lan_id +
2720 (hw->bus.instance_id << 1)) << 12;
2722 slice_offset = hw->bus.lan_id << 12;
2727 ret_val = hw->phy.ops.read_reg(hw, reg_slice,
2740 ret_val = hw->phy.ops.write_reg(hw, reg_slice,
2744 ret_val = hw->phy.ops.read_reg(hw, reg_slice,
2751 * ixgbe_setup_ixfi_x550em_x - MAC specific iXFI configuration
2758 struct ixgbe_mac_info *mac = &hw->mac;
2763 status = mac->ops.read_iosf_sb_reg(hw,
2764 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
2769 status = mac->ops.write_iosf_sb_reg(hw,
2770 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
2776 status = mac->ops.read_iosf_sb_reg(hw,
2777 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id),
2784 status = mac->ops.write_iosf_sb_reg(hw,
2785 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id),
2789 status = mac->ops.read_iosf_sb_reg(hw,
2790 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id),
2797 status = mac->ops.write_iosf_sb_reg(hw,
2798 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id),
2804 status = mac->ops.read_iosf_sb_reg(hw,
2805 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id),
2813 status = mac->ops.write_iosf_sb_reg(hw,
2814 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id),
2820 * ixgbe_setup_ixfi_x550em - Configure the KR PHY for iXFI mode.
2824 * Configures the integrated KR PHY to use iXFI mode. Used to connect an
2825 * internal and external PHY at a specific speed, without autonegotiation.
2829 struct ixgbe_mac_info *mac = &hw->mac;
2834 if (mac->type != ixgbe_mac_X550EM_x)
2838 status = mac->ops.read_iosf_sb_reg(hw,
2839 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2847 /* Select forced link speed for internal PHY. */
2856 /* Other link speeds are not supported by internal KR PHY. */
2860 status = mac->ops.write_iosf_sb_reg(hw,
2861 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2867 if (hw->mac.type == ixgbe_mac_X550EM_x) {
2880 * ixgbe_ext_phy_t_x550em_get_link - Get ext phy link status
2894 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
2900 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
2912 * ixgbe_setup_internal_phy_t_x550em - Configure KR PHY to X557 link
2915 * Configures the link between the integrated KR PHY and the external X557 PHY
2917 * interrupt from the X557 PHY. This function configures the link speed
2918 * between the PHYs to match the link speed of the BASE-T link.
2920 * A return of a non-zero value indicates an error, and the base driver should
2930 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
2933 if (hw->mac.type == ixgbe_mac_X550EM_x &&
2934 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
2943 status = hw->phy.ops.read_reg(hw,
2950 /* If link is still down - no setup is required so return */
2968 /* Internal PHY does not support anything else */
2981 * ixgbe_setup_phy_loopback_x550em - Configure the KR PHY for loopback.
2984 * Configures the integrated KR PHY to use internal loopback mode.
2992 status = hw->mac.ops.read_iosf_sb_reg(hw,
2993 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
3000 status = hw->mac.ops.write_iosf_sb_reg(hw,
3001 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
3006 /* Set near-end loopback clocks. */
3007 status = hw->mac.ops.read_iosf_sb_reg(hw,
3008 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id),
3014 status = hw->mac.ops.write_iosf_sb_reg(hw,
3015 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id),
3021 status = hw->mac.ops.read_iosf_sb_reg(hw,
3022 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id),
3027 status = hw->mac.ops.write_iosf_sb_reg(hw,
3028 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id),
3034 status = hw->mac.ops.read_iosf_sb_reg(hw,
3035 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
3040 status = hw->mac.ops.write_iosf_sb_reg(hw,
3041 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
3048 * ixgbe_read_ee_hostif_X550 - Read EEPROM word using a host interface command
3076 status = hw->mac.ops.acquire_swfw_sync(hw, mask);
3087 hw->mac.ops.release_swfw_sync(hw, mask);
3092 * ixgbe_read_ee_hostif_buffer_X550- Read EEPROM word(s) using hostif
3113 status = hw->mac.ops.acquire_swfw_sync(hw, mask);
3115 DEBUGOUT("EEPROM read buffer - semaphore failed\n");
3159 words -= words_to_read;
3163 hw->mac.ops.release_swfw_sync(hw, mask);
3168 * ixgbe_write_ee_hostif_data_X550 - Write EEPROM word using hostif
3212 * ixgbe_write_ee_hostif_X550 - Write EEPROM word using hostif
3226 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) ==
3229 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
3239 * ixgbe_write_ee_hostif_buffer_X550 - Write EEPROM word(s) using hostif
3256 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
3258 DEBUGOUT("EEPROM write buffer - semaphore failed\n");
3272 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
3279 * ixgbe_checksum_ptr_x550 - Checksum one pointer region
3323 (ptr + length) >= hw->eeprom.word_size)
3330 for (i = start; length; i++, length--) {
3351 * ixgbe_calc_checksum_X550 - Calculates and returns the checksum
3356 * Returns a negative error code on error, or the 16-bit checksum
3368 hw->eeprom.ops.init_params(hw);
3387 * For X550 hardware include 0x0-0x41 in the checksum, skip the
3395 * Include all data from pointers 0x3, 0x6-0xE. This excludes the
3396 * FW, PHY module, and PCIe Expansion/Option ROM pointers.
3406 pointer >= hw->eeprom.word_size)
3428 checksum = (u16)IXGBE_EEPROM_SUM - checksum;
3434 * ixgbe_calc_eeprom_checksum_X550 - Calculates and returns the checksum
3437 * Returns a negative error code on error, or the 16-bit checksum
3445 * ixgbe_validate_eeprom_checksum_X550 - Validate EEPROM checksum
3464 status = hw->eeprom.ops.read(hw, 0, &checksum);
3470 status = hw->eeprom.ops.calc_checksum(hw);
3498 * ixgbe_update_eeprom_checksum_X550 - Updates the EEPROM checksum and flash
3539 * ixgbe_update_flash_X550 - Instruct HW to copy EEPROM to Flash device
3564 * ixgbe_get_supported_physical_layer_X550em - Returns physical layer type
3576 hw->phy.ops.identify(hw);
3578 switch (hw->phy.type) {
3580 if (hw->mac.type == ixgbe_mac_X550EM_a) {
3581 if (hw->phy.nw_mng_if_sel &
3586 } else if (hw->device_id ==
3605 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY,
3614 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_1GB_FULL)
3616 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_100_FULL)
3618 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL)
3631 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber)
3638 * ixgbe_get_bus_info_X550em - Set PCI bus info
3649 hw->bus.width = ixgbe_bus_width_unknown;
3650 hw->bus.speed = ixgbe_bus_speed_unknown;
3652 hw->mac.ops.set_lan_id(hw);
3658 * ixgbe_disable_rx_x550 - Disable RX unit
3677 hw->mac.set_lben = true;
3679 hw->mac.set_lben = false;
3685 fw_cmd.port_number = (u8)hw->bus.lan_id;
3691 /* If we fail - disable RX using register write */
3703 * ixgbe_enter_lplu_t_x550em - Transition to low power states
3707 * (from D0 to non-D0). Link is required to enter LPLU so avoid resetting the
3708 * X557 PHY immediately prior to entering LPLU.
3719 if ((hw->mac.type == ixgbe_mac_X550EM_x) &&
3732 status = ixgbe_read_eeprom(hw, NVM_INIT_CTRL_3, &hw->eeprom.ctrl_word_3);
3740 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) ||
3741 !(hw->wol_enabled || ixgbe_mng_present(hw)))
3754 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT,
3777 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM,
3784 status = hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
3791 status = hw->phy.ops.read_reg(hw,
3799 save_autoneg = hw->phy.autoneg_advertised;
3802 status = hw->mac.ops.setup_link(hw, lcd_speed, false);
3805 hw->phy.autoneg_advertised = save_autoneg;
3811 * ixgbe_get_lcd_t_x550em - Determine lowest common denominator
3821 u16 word = hw->eeprom.ctrl_word_3;
3825 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS,
3839 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) ||
3849 * ixgbe_setup_fc_X550em - Set up flow control
3862 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
3872 if (hw->fc.requested_mode == ixgbe_fc_default)
3873 hw->fc.requested_mode = ixgbe_fc_full;
3876 switch (hw->fc.requested_mode) {
3905 switch (hw->device_id) {
3909 ret_val = hw->mac.ops.read_iosf_sb_reg(hw,
3910 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
3920 ret_val = hw->mac.ops.write_iosf_sb_reg(hw,
3921 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
3925 hw->fc.disable_fc_autoneg = true;
3928 hw->fc.disable_fc_autoneg = true;
3939 * ixgbe_fc_autoneg_backplane_x550em_a - Enable flow control IEEE clause 37
3953 * - FC autoneg is disabled, or if
3954 * - link is not up.
3956 if (hw->fc.disable_fc_autoneg) {
3962 hw->mac.ops.check_link(hw, &speed, &link_up, false);
3968 /* Check at auto-negotiation has completed */
3969 status = hw->mac.ops.read_iosf_sb_reg(hw,
3970 IXGBE_KRM_LINK_S1(hw->bus.lan_id),
3975 DEBUGOUT("Auto-Negotiation did not complete\n");
3983 status = hw->mac.ops.read_iosf_sb_reg(hw,
3984 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
3988 DEBUGOUT("Auto-Negotiation did not complete\n");
3992 status = hw->mac.ops.read_iosf_sb_reg(hw,
3993 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id),
3997 DEBUGOUT("Auto-Negotiation did not complete\n");
4009 hw->fc.fc_was_autonegged = true;
4011 hw->fc.fc_was_autonegged = false;
4012 hw->fc.current_mode = hw->fc.requested_mode;
4017 * ixgbe_fc_autoneg_fiber_x550em_a - passthrough FC settings
4023 hw->fc.fc_was_autonegged = false;
4024 hw->fc.current_mode = hw->fc.requested_mode;
4028 * ixgbe_fc_autoneg_sgmii_x550em_a - Enable flow control IEEE clause 37
4042 * - FC autoneg is disabled, or if
4043 * - link is not up.
4045 if (hw->fc.disable_fc_autoneg) {
4051 hw->mac.ops.check_link(hw, &speed, &link_up, false);
4057 /* Check if auto-negotiation has completed */
4061 DEBUGOUT("Auto-Negotiation did not complete\n");
4075 hw->fc.fc_was_autonegged = true;
4077 hw->fc.fc_was_autonegged = false;
4078 hw->fc.current_mode = hw->fc.requested_mode;
4083 * ixgbe_setup_fc_backplane_x550em_a - Set up flow control
4096 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
4102 if (hw->fc.requested_mode == ixgbe_fc_default)
4103 hw->fc.requested_mode = ixgbe_fc_full;
4109 status = hw->mac.ops.read_iosf_sb_reg(hw,
4110 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
4114 DEBUGOUT("Auto-Negotiation did not complete\n");
4127 switch (hw->fc.requested_mode) {
4160 status = hw->mac.ops.write_iosf_sb_reg(hw,
4161 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
4164 /* Restart auto-negotiation. */
4171 * ixgbe_set_mux - Set mux for port 1 access with CS4227
4179 if (!hw->bus.lan_id)
4191 * ixgbe_acquire_swfw_sync_X550em - Acquire SWFW semaphore
4214 * ixgbe_release_swfw_sync_X550em - Release SWFW semaphore
4231 * ixgbe_acquire_swfw_sync_X550a - Acquire SWFW semaphore
4235 * Acquires the SWFW semaphore and get the shared phy token as needed
4257 while (--retries) {
4264 DEBUGOUT1("Retry acquiring the PHY token failed, Status = %d\n", status);
4271 DEBUGOUT1("Could not acquire PHY token, Status = %d\n",
4278 DEBUGOUT1("Semaphore acquisition retries failed!: PHY ID = 0x%08X\n",
4279 hw->phy.id);
4284 * ixgbe_release_swfw_sync_X550a - Release SWFW semaphore
4288 * Releases the SWFW semaphore and puts the shared phy token as needed
4304 * ixgbe_read_phy_reg_x550a - Reads specified PHY register
4306 * @reg_addr: 32 bit address of PHY register to read
4308 * @phy_data: Pointer to read data from PHY register
4310 * Reads a value from a specified PHY register using the SWFW lock and PHY
4311 * Token. The PHY Token is needed since the MDIO is shared between to MAC
4318 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM;
4322 if (hw->mac.ops.acquire_swfw_sync(hw, mask))
4325 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data);
4327 hw->mac.ops.release_swfw_sync(hw, mask);
4333 * ixgbe_write_phy_reg_x550a - Writes specified PHY register
4335 * @reg_addr: 32 bit PHY register to write
4337 * @phy_data: Data to write to the PHY register
4339 * Writes a value to specified PHY register using the SWFW lock and PHY Token.
4340 * The PHY Token is needed since the MDIO is shared between to MAC instances.
4346 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM;
4350 if (hw->mac.ops.acquire_swfw_sync(hw, mask) == IXGBE_SUCCESS) {
4351 status = hw->phy.ops.write_reg_mdi(hw, reg_addr, device_type,
4353 hw->mac.ops.release_swfw_sync(hw, mask);
4362 * ixgbe_handle_lasi_ext_t_x550em - Handle external Base T PHY interrupt
4365 * Handle external Base T PHY interrupt. If high temperature
4367 * then setup internal/external PHY link
4370 * failure alarm, else return PHY access status.
4389 * ixgbe_setup_mac_link_t_X550em - Sets the auto advertised link speed
4394 * Setup internal/external PHY link speed based on link speed, then set
4395 * external PHY auto advertised link speed.
4410 /* Setup internal/external PHY link speed to iXFI (10G), unless
4420 if (hw->mac.type == ixgbe_mac_X550EM_x &&
4421 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
4441 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete);
4445 * ixgbe_check_link_t_X550em - Determine link and speed status
4451 * Check that both the MAC and X557 external PHY have link.
4459 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
4465 /* If check link fails or MAC link is not up, then return */
4469 /* MAC link is up, so check external PHY link.
4470 * X557 PHY. Link status is latching low, and can only be used to detect
4472 * back-to-back reads.
4475 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
4483 /* If external PHY link is not up, then indicate link not up */
4491 * ixgbe_reset_phy_t_X550em - Performs X557 PHY reset and enables LASI
4508 * ixgbe_led_on_t_X550em - Turns on the software controllable LEDs.
4528 /* Some designs have the LEDs wired to the MAC */
4533 * ixgbe_led_off_t_X550em - Turns off the software controllable LEDs.
4553 /* Some designs have the LEDs wired to the MAC */
4558 * ixgbe_set_fw_drv_ver_x550 - Sends driver version to firmware
4588 fw_cmd.port_num = (u8)hw->bus.func;
4619 * ixgbe_fw_recovery_mode_X550 - Check FW NVM recovery mode