Lines Matching +full:quad +full:- +full:sgmii
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2018 Intel Corporation. */
17 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X550_x()
18 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_x()
19 struct ixgbe_link_info *link = &hw->link; in ixgbe_get_invariants_X550_x()
24 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_get_invariants_X550_x()
25 phy->ops.set_phy_power = NULL; in ixgbe_get_invariants_X550_x()
27 link->addr = IXGBE_CS4227; in ixgbe_get_invariants_X550_x()
34 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_x_fw()
39 phy->ops.set_phy_power = NULL; in ixgbe_get_invariants_X550_x_fw()
46 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X550_a()
47 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_a()
52 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_get_invariants_X550_a()
53 phy->ops.set_phy_power = NULL; in ixgbe_get_invariants_X550_a()
60 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_a_fw()
65 phy->ops.set_phy_power = NULL; in ixgbe_get_invariants_X550_a_fw()
70 /** ixgbe_setup_mux_ctl - Setup ESDP register for I2C mux control
77 if (hw->bus.lan_id) { in ixgbe_setup_mux_ctl()
87 * ixgbe_read_cs4227 - Read CS4227 register
96 return hw->link.ops.read_link_unlocked(hw, hw->link.addr, reg, value); in ixgbe_read_cs4227()
100 * ixgbe_write_cs4227 - Write CS4227 register
109 return hw->link.ops.write_link_unlocked(hw, hw->link.addr, reg, value); in ixgbe_write_cs4227()
113 * ixgbe_read_pe - Read register from port expander
131 * ixgbe_write_pe - Write register to port expander
150 * ixgbe_reset_cs4227 - Reset CS4227 using port expander
209 return -EIO; in ixgbe_reset_cs4227()
215 return -EIO; in ixgbe_reset_cs4227()
222 * ixgbe_check_cs4227 - Check CS4227 and reset as needed
227 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_check_cs4227()
233 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
249 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
254 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
273 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
275 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
286 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
287 msleep(hw->eeprom.semaphore_delay); in ixgbe_check_cs4227()
290 /** ixgbe_identify_phy_x550em - Get PHY type based on device id
297 switch (hw->device_id) { in ixgbe_identify_phy_x550em()
299 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
300 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
302 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
306 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; in ixgbe_identify_phy_x550em()
313 hw->phy.type = ixgbe_phy_x550em_kx4; in ixgbe_identify_phy_x550em()
316 hw->phy.type = ixgbe_phy_x550em_xfi; in ixgbe_identify_phy_x550em()
321 hw->phy.type = ixgbe_phy_x550em_kr; in ixgbe_identify_phy_x550em()
324 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
325 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
327 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
332 hw->phy.type = ixgbe_phy_ext_1g_t; in ixgbe_identify_phy_x550em()
336 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_x550em()
337 hw->phy.ops.read_reg = NULL; in ixgbe_identify_phy_x550em()
338 hw->phy.ops.write_reg = NULL; in ixgbe_identify_phy_x550em()
339 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
340 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
342 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
353 return -EOPNOTSUPP; in ixgbe_read_phy_reg_x550em()
359 return -EOPNOTSUPP; in ixgbe_write_phy_reg_x550em()
363 * ixgbe_read_i2c_combined_generic - Perform I2C read combined operation
378 * ixgbe_read_i2c_combined_generic_unlocked - Do I2C read combined operation
394 * ixgbe_write_i2c_combined_generic - Perform I2C write combined operation
409 * ixgbe_write_i2c_combined_generic_unlocked - Do I2C write combined operation
425 * ixgbe_fw_phy_activity - Perform an activity on a PHY
428 * @data: Pointer to 4 32-bit words of data
446 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_fw_phy_activity()
463 --retries; in ixgbe_fw_phy_activity()
466 return -EIO; in ixgbe_fw_phy_activity()
482 * ixgbe_get_phy_id_fw - Get the phy ID via firmware command
495 if (hw->phy.id) in ixgbe_get_phy_id_fw()
502 hw->phy.speeds_supported = 0; in ixgbe_get_phy_id_fw()
506 hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed; in ixgbe_get_phy_id_fw()
509 hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK; in ixgbe_get_phy_id_fw()
511 hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
512 hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
513 if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK) in ixgbe_get_phy_id_fw()
514 return -EFAULT; in ixgbe_get_phy_id_fw()
516 hw->phy.autoneg_advertised = hw->phy.speeds_supported; in ixgbe_get_phy_id_fw()
517 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL | in ixgbe_get_phy_id_fw()
519 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported; in ixgbe_get_phy_id_fw()
524 * ixgbe_identify_phy_fw - Get PHY type based on firmware command
531 if (hw->bus.lan_id) in ixgbe_identify_phy_fw()
532 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_fw()
534 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_fw()
536 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_fw()
537 hw->phy.ops.read_reg = NULL; in ixgbe_identify_phy_fw()
538 hw->phy.ops.write_reg = NULL; in ixgbe_identify_phy_fw()
543 * ixgbe_shutdown_fw_phy - Shutdown a firmware-controlled PHY
557 * ixgbe_setup_fw_link - Setup firmware-controlled PHYs
566 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_setup_fw_link()
569 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fw_link()
571 return -EINVAL; in ixgbe_setup_fw_link()
574 switch (hw->fc.requested_mode) { in ixgbe_setup_fw_link()
592 if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed) in ixgbe_setup_fw_link()
597 if (hw->phy.eee_speeds_advertised) in ixgbe_setup_fw_link()
605 return -EIO; in ixgbe_setup_fw_link()
611 * ixgbe_fc_autoneg_fw - Set up flow control for FW-controlled PHYs
618 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_fc_autoneg_fw()
619 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_fc_autoneg_fw()
624 /** ixgbe_init_eeprom_params_X550 - Initialize EEPROM params
632 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X550()
634 if (eeprom->type == ixgbe_eeprom_uninitialized) { in ixgbe_init_eeprom_params_X550()
638 eeprom->semaphore_delay = 10; in ixgbe_init_eeprom_params_X550()
639 eeprom->type = ixgbe_flash; in ixgbe_init_eeprom_params_X550()
643 eeprom->word_size = BIT(eeprom_size + in ixgbe_init_eeprom_params_X550()
647 eeprom->type, eeprom->word_size); in ixgbe_init_eeprom_params_X550()
654 * ixgbe_iosf_wait - Wait for IOSF command completion
680 return -EIO; in ixgbe_iosf_wait()
686 /** ixgbe_read_iosf_sb_reg_x550 - Writes a value to specified register of the
700 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
719 ret = -EIO; in ixgbe_read_iosf_sb_reg_x550()
727 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
732 * ixgbe_get_phy_token - Get the token for shared PHY access
744 token_cmd.port_number = hw->bus.lan_id; in ixgbe_get_phy_token()
755 return -EIO; in ixgbe_get_phy_token()
757 return -EAGAIN; in ixgbe_get_phy_token()
761 * ixgbe_put_phy_token - Put the token for shared PHY access
773 token_cmd.port_number = hw->bus.lan_id; in ixgbe_put_phy_token()
783 return -EIO; in ixgbe_put_phy_token()
787 * ixgbe_write_iosf_sb_reg_x550a - Write to IOSF PHY register
803 write_cmd.port_number = hw->bus.lan_id; in ixgbe_write_iosf_sb_reg_x550a()
813 * ixgbe_read_iosf_sb_reg_x550a - Read from IOSF PHY register
833 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_read_iosf_sb_reg_x550a()
846 /** ixgbe_read_ee_hostif_buffer_X550- Read EEPROM word(s) using hostif
865 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
867 hw_dbg(hw, "EEPROM read buffer - semaphore failed\n"); in ixgbe_read_ee_hostif_buffer_X550()
910 words -= words_to_read; in ixgbe_read_ee_hostif_buffer_X550()
914 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
918 /** ixgbe_checksum_ptr_x550 - Checksum one pointer region
947 return -EINVAL; in ixgbe_checksum_ptr_x550()
960 (ptr + length) >= hw->eeprom.word_size) in ixgbe_checksum_ptr_x550()
965 return -EINVAL; in ixgbe_checksum_ptr_x550()
967 for (i = start; length; i++, length--) { in ixgbe_checksum_ptr_x550()
987 /** ixgbe_calc_checksum_X550 - Calculates and returns the checksum
992 * Returns a negative error code on error, or the 16-bit checksum
1003 hw->eeprom.ops.init_params(hw); in ixgbe_calc_checksum_X550()
1017 return -EINVAL; in ixgbe_calc_checksum_X550()
1021 /* For X550 hardware include 0x0-0x41 in the checksum, skip the in ixgbe_calc_checksum_X550()
1028 /* Include all data from pointers 0x3, 0x6-0xE. This excludes the in ixgbe_calc_checksum_X550()
1039 pointer >= hw->eeprom.word_size) in ixgbe_calc_checksum_X550()
1061 checksum = (u16)IXGBE_EEPROM_SUM - checksum; in ixgbe_calc_checksum_X550()
1066 /** ixgbe_calc_eeprom_checksum_X550 - Calculates and returns the checksum
1069 * Returns a negative error code on error, or the 16-bit checksum
1076 /** ixgbe_read_ee_hostif_X550 - Read EEPROM word using a host interface command
1099 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
1110 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
1114 /** ixgbe_validate_eeprom_checksum_X550 - Validate EEPROM checksum
1132 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X550()
1138 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X550()
1153 status = -EIO; in ixgbe_validate_eeprom_checksum_X550()
1164 /** ixgbe_write_ee_hostif_X550 - Write EEPROM word using hostif
1192 /** ixgbe_write_ee_hostif_X550 - Write EEPROM word using hostif
1203 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == 0) { in ixgbe_write_ee_hostif_X550()
1205 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_X550()
1208 status = -EBUSY; in ixgbe_write_ee_hostif_X550()
1214 /** ixgbe_update_flash_X550 - Instruct HW to copy EEPROM to Flash device
1235 * ixgbe_get_bus_info_X550em - Set PCI bus info
1243 hw->bus.type = ixgbe_bus_type_internal; in ixgbe_get_bus_info_X550em()
1244 hw->bus.width = ixgbe_bus_width_unknown; in ixgbe_get_bus_info_X550em()
1245 hw->bus.speed = ixgbe_bus_speed_unknown; in ixgbe_get_bus_info_X550em()
1247 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_X550em()
1253 * ixgbe_fw_recovery_mode_X550 - Check FW NVM recovery mode
1266 /** ixgbe_disable_rx_x550 - Disable RX unit
1282 hw->mac.set_lben = true; in ixgbe_disable_rx_x550()
1284 hw->mac.set_lben = false; in ixgbe_disable_rx_x550()
1290 fw_cmd.port_number = hw->bus.lan_id; in ixgbe_disable_rx_x550()
1296 /* If we fail - disable RX using register write */ in ixgbe_disable_rx_x550()
1307 /** ixgbe_update_eeprom_checksum_X550 - Updates the EEPROM checksum and flash
1345 /** ixgbe_write_ee_hostif_buffer_X550 - Write EEPROM word(s) using hostif
1362 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1364 hw_dbg(hw, "EEPROM write buffer - semaphore failed\n"); in ixgbe_write_ee_hostif_buffer_X550()
1377 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1382 /** ixgbe_write_iosf_sb_reg_x550 - Writes a value to specified register of the
1397 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1419 return -EIO; in ixgbe_write_iosf_sb_reg_x550()
1423 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1428 * ixgbe_setup_ixfi_x550em_x - MAC specific iXFI configuration
1440 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1447 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1454 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1463 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1469 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1478 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1485 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1495 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1501 * ixgbe_restart_an_internal_phy_x550em - restart autonegotiation for the
1510 /* Restart auto-negotiation. */ in ixgbe_restart_an_internal_phy_x550em()
1511 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1512 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1516 hw_dbg(hw, "Auto-negotiation did not complete\n"); in ixgbe_restart_an_internal_phy_x550em()
1521 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1522 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1525 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_restart_an_internal_phy_x550em()
1529 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1530 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1534 hw_dbg(hw, "Auto-negotiation did not complete\n"); in ixgbe_restart_an_internal_phy_x550em()
1539 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1540 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1547 /** ixgbe_setup_ixfi_x550em - Configure the KR PHY for iXFI mode.
1556 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_ixfi_x550em()
1561 if (mac->type != ixgbe_mac_X550EM_x) in ixgbe_setup_ixfi_x550em()
1562 return -EIO; in ixgbe_setup_ixfi_x550em()
1566 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1584 return -EINVAL; in ixgbe_setup_ixfi_x550em()
1588 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1594 if (hw->mac.type == ixgbe_mac_X550EM_x) { in ixgbe_setup_ixfi_x550em()
1607 * ixgbe_supported_sfp_modules_X550em - Check if SFP module type is supported
1613 switch (hw->phy.sfp_type) { in ixgbe_supported_sfp_modules_X550em()
1615 return -ENOENT; in ixgbe_supported_sfp_modules_X550em()
1634 return -EOPNOTSUPP; in ixgbe_supported_sfp_modules_X550em()
1641 * ixgbe_setup_mac_link_sfp_x550em - Configure the KR PHY for SFP.
1664 if (status == -ENOENT) in ixgbe_setup_mac_link_sfp_x550em()
1674 reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
1680 status = hw->link.ops.write_link(hw, hw->link.addr, reg_slice, in ixgbe_setup_mac_link_sfp_x550em()
1687 * ixgbe_setup_sfi_x550a - Configure the internal PHY for native SFI mode
1696 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sfi_x550a()
1701 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
1702 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
1722 return -EINVAL; in ixgbe_setup_sfi_x550a()
1725 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
1726 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
1736 * ixgbe_setup_mac_link_sfp_n - Setup internal PHY for native SFP
1757 if (ret_val == -ENOENT) in ixgbe_setup_mac_link_sfp_n()
1764 ret_val = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_n()
1765 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_n()
1774 ret_val = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_n()
1775 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_n()
1785 * ixgbe_setup_mac_link_sfp_x550a - Setup internal PHY for SFP
1807 if (ret_val == -ENOENT) in ixgbe_setup_mac_link_sfp_x550a()
1816 if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE) in ixgbe_setup_mac_link_sfp_x550a()
1817 return -EFAULT; in ixgbe_setup_mac_link_sfp_x550a()
1820 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU, in ixgbe_setup_mac_link_sfp_x550a()
1825 /* When configuring quad port CS4223, the MAC instance is part in ixgbe_setup_mac_link_sfp_x550a()
1829 slice_offset = (hw->bus.lan_id + in ixgbe_setup_mac_link_sfp_x550a()
1830 (hw->bus.instance_id << 1)) << 12; in ixgbe_setup_mac_link_sfp_x550a()
1832 slice_offset = hw->bus.lan_id << 12; in ixgbe_setup_mac_link_sfp_x550a()
1837 ret_val = hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1850 ret_val = hw->phy.ops.write_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1856 return hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1861 * ixgbe_setup_mac_link_t_X550em - Sets the auto advertised link speed
1888 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_mac_link_t_X550em()
1889 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_mac_link_t_X550em()
1896 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_mac_link_t_X550em()
1899 /** ixgbe_check_link_t_X550em - Determine link and speed status
1915 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_check_link_t_X550em()
1916 return -EIO; in ixgbe_check_link_t_X550em()
1928 * back-to-back reads. in ixgbe_check_link_t_X550em()
1931 status = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_check_link_t_X550em()
1946 * ixgbe_setup_sgmii - Set up link for sgmii
1955 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii()
1959 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1960 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1970 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1971 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1976 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1977 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1984 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1985 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1990 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1991 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
1996 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1997 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
2008 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
2009 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
2019 * ixgbe_setup_sgmii_fw - Set up link for sgmii with firmware-controlled PHYs
2027 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii_fw()
2031 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2032 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2042 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2043 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2048 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2049 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2056 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2057 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2062 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2063 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2068 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2069 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2080 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2081 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2088 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_sgmii_fw()
2092 * ixgbe_fc_autoneg_sgmii_x550em_a - Enable flow control IEEE clause 37
2101 int status = -EIO; in ixgbe_fc_autoneg_sgmii_x550em_a()
2106 * - FC autoneg is disabled, or if in ixgbe_fc_autoneg_sgmii_x550em_a()
2107 * - link is not up. in ixgbe_fc_autoneg_sgmii_x550em_a()
2109 if (hw->fc.disable_fc_autoneg) in ixgbe_fc_autoneg_sgmii_x550em_a()
2112 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_sgmii_x550em_a()
2116 /* Check if auto-negotiation has completed */ in ixgbe_fc_autoneg_sgmii_x550em_a()
2119 status = -EIO; in ixgbe_fc_autoneg_sgmii_x550em_a()
2132 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_sgmii_x550em_a()
2134 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_sgmii_x550em_a()
2135 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_sgmii_x550em_a()
2139 /** ixgbe_init_mac_link_ops_X550em_a - Init mac link function pointers
2144 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em_a()
2146 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em_a()
2148 mac->ops.setup_fc = NULL; in ixgbe_init_mac_link_ops_X550em_a()
2149 mac->ops.fc_autoneg = ixgbe_fc_autoneg_fiber_x550em_a; in ixgbe_init_mac_link_ops_X550em_a()
2152 if (hw->device_id != IXGBE_DEV_ID_X550EM_A_1G_T && in ixgbe_init_mac_link_ops_X550em_a()
2153 hw->device_id != IXGBE_DEV_ID_X550EM_A_1G_T_L) { in ixgbe_init_mac_link_ops_X550em_a()
2154 mac->ops.setup_link = ixgbe_setup_mac_link_t_X550em; in ixgbe_init_mac_link_ops_X550em_a()
2157 mac->ops.fc_autoneg = ixgbe_fc_autoneg_sgmii_x550em_a; in ixgbe_init_mac_link_ops_X550em_a()
2158 mac->ops.setup_fc = ixgbe_fc_autoneg_fw; in ixgbe_init_mac_link_ops_X550em_a()
2159 mac->ops.setup_link = ixgbe_setup_sgmii_fw; in ixgbe_init_mac_link_ops_X550em_a()
2160 mac->ops.check_link = ixgbe_check_mac_link_generic; in ixgbe_init_mac_link_ops_X550em_a()
2163 mac->ops.fc_autoneg = ixgbe_fc_autoneg_backplane_x550em_a; in ixgbe_init_mac_link_ops_X550em_a()
2164 mac->ops.setup_fc = ixgbe_setup_fc_backplane_x550em_a; in ixgbe_init_mac_link_ops_X550em_a()
2171 /** ixgbe_init_mac_link_ops_X550em - init mac link function pointers
2176 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em()
2178 mac->ops.setup_fc = ixgbe_setup_fc_x550em; in ixgbe_init_mac_link_ops_X550em()
2180 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em()
2185 mac->ops.disable_tx_laser = NULL; in ixgbe_init_mac_link_ops_X550em()
2186 mac->ops.enable_tx_laser = NULL; in ixgbe_init_mac_link_ops_X550em()
2187 mac->ops.flap_tx_laser = NULL; in ixgbe_init_mac_link_ops_X550em()
2188 mac->ops.setup_link = ixgbe_setup_mac_link_multispeed_fiber; in ixgbe_init_mac_link_ops_X550em()
2189 switch (hw->device_id) { in ixgbe_init_mac_link_ops_X550em()
2191 mac->ops.setup_mac_link = ixgbe_setup_mac_link_sfp_n; in ixgbe_init_mac_link_ops_X550em()
2194 mac->ops.setup_mac_link = in ixgbe_init_mac_link_ops_X550em()
2198 mac->ops.setup_mac_link = in ixgbe_init_mac_link_ops_X550em()
2202 mac->ops.set_rate_select_speed = in ixgbe_init_mac_link_ops_X550em()
2206 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) in ixgbe_init_mac_link_ops_X550em()
2208 mac->ops.setup_link = ixgbe_setup_mac_link_t_X550em; in ixgbe_init_mac_link_ops_X550em()
2209 mac->ops.setup_fc = ixgbe_setup_fc_generic; in ixgbe_init_mac_link_ops_X550em()
2210 mac->ops.check_link = ixgbe_check_link_t_X550em; in ixgbe_init_mac_link_ops_X550em()
2213 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII || in ixgbe_init_mac_link_ops_X550em()
2214 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) in ixgbe_init_mac_link_ops_X550em()
2215 mac->ops.setup_link = ixgbe_setup_sgmii; in ixgbe_init_mac_link_ops_X550em()
2222 if (hw->mac.type == ixgbe_mac_x550em_a) in ixgbe_init_mac_link_ops_X550em()
2226 /** ixgbe_setup_sfp_modules_X550em - Setup SFP module
2240 hw->phy.ops.reset = NULL; in ixgbe_setup_sfp_modules_X550em()
2245 /** ixgbe_get_link_capabilities_x550em - Determines link capabilities
2254 if (hw->phy.type == ixgbe_phy_fw) { in ixgbe_get_link_capabilities_X550em()
2256 *speed = hw->phy.speeds_supported; in ixgbe_get_link_capabilities_X550em()
2261 if (hw->phy.media_type == ixgbe_media_type_fiber) { in ixgbe_get_link_capabilities_X550em()
2262 /* CS4227 SFP must not enable auto-negotiation */ in ixgbe_get_link_capabilities_X550em()
2265 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || in ixgbe_get_link_capabilities_X550em()
2266 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 || in ixgbe_get_link_capabilities_X550em()
2267 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || in ixgbe_get_link_capabilities_X550em()
2268 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) { in ixgbe_get_link_capabilities_X550em()
2274 if (hw->phy.multispeed_fiber) in ixgbe_get_link_capabilities_X550em()
2280 switch (hw->phy.type) { in ixgbe_get_link_capabilities_X550em()
2295 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_get_link_capabilities_X550em()
2297 if (hw->phy.nw_mng_if_sel & in ixgbe_get_link_capabilities_X550em()
2301 } else if (hw->device_id == in ixgbe_get_link_capabilities_X550em()
2319 * ixgbe_get_lasi_ext_t_x550em - Determime external Base T PHY interrupt cause
2338 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2345 /* Vendor Auto-Neg alarm triggered or Global alarm 1 triggered */ in ixgbe_get_lasi_ext_t_x550em()
2346 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2355 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, in ixgbe_get_lasi_ext_t_x550em()
2367 return -EIO; in ixgbe_get_lasi_ext_t_x550em()
2371 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG, in ixgbe_get_lasi_ext_t_x550em()
2382 return -EIO; in ixgbe_get_lasi_ext_t_x550em()
2387 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2394 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2, in ixgbe_get_lasi_ext_t_x550em()
2408 * ixgbe_enable_lasi_ext_t_x550em - Enable external Base T PHY interrupts
2430 * not support auto-negotiation. This is not required for X553 devices in ixgbe_enable_lasi_ext_t_x550em()
2431 * having KR support, which performs auto-negotiations and which is used in ixgbe_enable_lasi_ext_t_x550em()
2435 if (hw->mac.type != ixgbe_mac_x550em_a) { in ixgbe_enable_lasi_ext_t_x550em()
2436 status = hw->phy.ops.read_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2444 status = hw->phy.ops.write_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2452 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2461 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2467 /* Enable vendor Auto-Neg alarm and Global Interrupt Mask 1 alarm */ in ixgbe_enable_lasi_ext_t_x550em()
2468 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2477 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2483 /* Enable chip-wide vendor alarm */ in ixgbe_enable_lasi_ext_t_x550em()
2484 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2492 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2500 * ixgbe_handle_lasi_ext_t_x550em - Handle external Base T PHY interrupt
2511 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_handle_lasi_ext_t_x550em()
2519 if (lsc && phy->ops.setup_internal_link) in ixgbe_handle_lasi_ext_t_x550em()
2520 return phy->ops.setup_internal_link(hw); in ixgbe_handle_lasi_ext_t_x550em()
2526 * ixgbe_setup_kr_speed_x550em - Configure the KR PHY for link speed.
2538 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2539 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2556 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2557 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2560 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_setup_kr_speed_x550em()
2562 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2563 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2575 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2576 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2584 * ixgbe_setup_kr_x550em - Configure the KR PHY
2590 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) in ixgbe_setup_kr_x550em()
2596 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); in ixgbe_setup_kr_x550em()
2599 /** ixgbe_ext_phy_t_x550em_get_link - Get ext phy link status
2613 ret = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_ext_phy_t_x550em_get_link()
2618 ret = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_ext_phy_t_x550em_get_link()
2628 /** ixgbe_setup_internal_phy_t_x550em - Configure KR PHY to X557 link
2634 * between the PHYs to match the link speed of the BASE-T link.
2636 * A return of a non-zero value indicates an error, and the base driver should
2646 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_setup_internal_phy_t_x550em()
2647 return -EIO; in ixgbe_setup_internal_phy_t_x550em()
2649 if (!(hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_internal_phy_t_x550em()
2650 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE))) { in ixgbe_setup_internal_phy_t_x550em()
2664 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_setup_internal_phy_t_x550em()
2690 return -EINVAL; in ixgbe_setup_internal_phy_t_x550em()
2696 /** ixgbe_reset_phy_t_X550em - Performs X557 PHY reset and enables LASI
2713 * ixgbe_led_on_t_x550em - Turns on the software controllable LEDs.
2722 return -EINVAL; in ixgbe_led_on_t_x550em()
2725 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_x550em()
2728 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_x550em()
2735 * ixgbe_led_off_t_x550em - Turns off the software controllable LEDs.
2744 return -EINVAL; in ixgbe_led_off_t_x550em()
2747 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_x550em()
2750 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_x550em()
2757 * ixgbe_set_fw_drv_ver_x550 - Sends driver version to firmware
2768 * else returns -EBUSY when encountering an error acquiring
2769 * semaphore, -EIO when command fails or -ENIVAL when incorrect
2781 return -EINVAL; in ixgbe_set_fw_drv_ver_x550()
2786 fw_cmd.port_num = (u8)hw->bus.func; in ixgbe_set_fw_drv_ver_x550()
2806 return -EIO; in ixgbe_set_fw_drv_ver_x550()
2813 /** ixgbe_get_lcd_x550em - Determine lowest common denominator
2822 u16 word = hw->eeprom.ctrl_word_3; in ixgbe_get_lcd_t_x550em()
2828 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS, in ixgbe_get_lcd_t_x550em()
2841 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) || in ixgbe_get_lcd_t_x550em()
2851 * ixgbe_setup_fc_x550em - Set up flow control
2861 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_x550em()
2863 return -EINVAL; in ixgbe_setup_fc_x550em()
2869 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_x550em()
2870 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_x550em()
2873 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_x550em()
2898 return -EIO; in ixgbe_setup_fc_x550em()
2901 switch (hw->device_id) { in ixgbe_setup_fc_x550em()
2905 rc = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_x550em()
2906 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_x550em()
2918 rc = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_x550em()
2919 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_x550em()
2924 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_x550em()
2927 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_x550em()
2936 * ixgbe_fc_autoneg_backplane_x550em_a - Enable flow control IEEE clause 37
2943 int status = -EIO; in ixgbe_fc_autoneg_backplane_x550em_a()
2948 * - FC autoneg is disabled, or if in ixgbe_fc_autoneg_backplane_x550em_a()
2949 * - link is not up. in ixgbe_fc_autoneg_backplane_x550em_a()
2951 if (hw->fc.disable_fc_autoneg) { in ixgbe_fc_autoneg_backplane_x550em_a()
2956 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_backplane_x550em_a()
2962 /* Check at auto-negotiation has completed */ in ixgbe_fc_autoneg_backplane_x550em_a()
2963 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2964 IXGBE_KRM_LINK_S1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2968 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2969 status = -EIO; in ixgbe_fc_autoneg_backplane_x550em_a()
2976 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2977 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2981 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2985 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2986 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2990 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
3002 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_backplane_x550em_a()
3004 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_backplane_x550em_a()
3005 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_backplane_x550em_a()
3010 * ixgbe_fc_autoneg_fiber_x550em_a - passthrough FC settings
3015 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_fiber_x550em_a()
3016 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_fiber_x550em_a()
3019 /** ixgbe_enter_lplu_x550em - Transition to low power states
3023 * (from D0 to non-D0). Link is required to enter LPLU so avoid resetting
3042 status = hw->eeprom.ops.read(hw, NVM_INIT_CTRL_3, in ixgbe_enter_lplu_t_x550em()
3043 &hw->eeprom.ctrl_word_3); in ixgbe_enter_lplu_t_x550em()
3051 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) || in ixgbe_enter_lplu_t_x550em()
3052 !(hw->wol_enabled || ixgbe_mng_present(hw))) in ixgbe_enter_lplu_t_x550em()
3064 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_enter_lplu_t_x550em()
3086 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM, in ixgbe_enter_lplu_t_x550em()
3092 status = hw->phy.ops.read_reg(hw, MDIO_AN_10GBT_CTRL, in ixgbe_enter_lplu_t_x550em()
3098 status = hw->phy.ops.read_reg(hw, in ixgbe_enter_lplu_t_x550em()
3105 save_autoneg = hw->phy.autoneg_advertised; in ixgbe_enter_lplu_t_x550em()
3108 status = hw->mac.ops.setup_link(hw, lcd_speed, false); in ixgbe_enter_lplu_t_x550em()
3111 hw->phy.autoneg_advertised = save_autoneg; in ixgbe_enter_lplu_t_x550em()
3117 * ixgbe_reset_phy_fw - Reset firmware-controlled PHYs
3125 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_reset_phy_fw()
3141 * ixgbe_check_overtemp_fw - Check firmware-controlled PHYs for overtemp
3163 * ixgbe_read_mng_if_sel_x550em - Read NW_MNG_IF_SEL register
3173 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_read_mng_if_sel_x550em()
3178 if (hw->mac.type == ixgbe_mac_x550em_a && in ixgbe_read_mng_if_sel_x550em()
3179 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) { in ixgbe_read_mng_if_sel_x550em()
3180 hw->phy.mdio.prtad = FIELD_GET(IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD, in ixgbe_read_mng_if_sel_x550em()
3181 hw->phy.nw_mng_if_sel); in ixgbe_read_mng_if_sel_x550em()
3185 /** ixgbe_init_phy_ops_X550em - PHY/SFP specific init
3194 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_X550em()
3197 hw->mac.ops.set_lan_id(hw); in ixgbe_init_phy_ops_X550em()
3201 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { in ixgbe_init_phy_ops_X550em()
3202 phy->phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; in ixgbe_init_phy_ops_X550em()
3207 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_X550em()
3208 if (ret_val == -EOPNOTSUPP || ret_val == -EFAULT) in ixgbe_init_phy_ops_X550em()
3213 if (phy->sfp_type != ixgbe_sfp_type_unknown) in ixgbe_init_phy_ops_X550em()
3214 phy->ops.reset = NULL; in ixgbe_init_phy_ops_X550em()
3217 switch (hw->phy.type) { in ixgbe_init_phy_ops_X550em()
3219 phy->ops.setup_link = NULL; in ixgbe_init_phy_ops_X550em()
3220 phy->ops.read_reg = ixgbe_read_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3221 phy->ops.write_reg = ixgbe_write_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3224 phy->ops.setup_link = ixgbe_setup_kr_x550em; in ixgbe_init_phy_ops_X550em()
3225 phy->ops.read_reg = ixgbe_read_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3226 phy->ops.write_reg = ixgbe_write_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3230 phy->ops.setup_link = NULL; in ixgbe_init_phy_ops_X550em()
3231 phy->ops.read_reg = ixgbe_read_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3232 phy->ops.write_reg = ixgbe_write_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3238 phy->nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_init_phy_ops_X550em()
3243 phy->ops.setup_internal_link = in ixgbe_init_phy_ops_X550em()
3247 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_init_phy_ops_X550em()
3250 phy->ops.enter_lplu = ixgbe_enter_lplu_t_x550em; in ixgbe_init_phy_ops_X550em()
3252 phy->ops.handle_lasi = ixgbe_handle_lasi_ext_t_x550em; in ixgbe_init_phy_ops_X550em()
3253 phy->ops.reset = ixgbe_reset_phy_t_X550em; in ixgbe_init_phy_ops_X550em()
3256 phy->ops.setup_link = NULL; in ixgbe_init_phy_ops_X550em()
3259 phy->ops.setup_link = ixgbe_setup_fw_link; in ixgbe_init_phy_ops_X550em()
3260 phy->ops.reset = ixgbe_reset_phy_fw; in ixgbe_init_phy_ops_X550em()
3263 phy->ops.setup_link = NULL; in ixgbe_init_phy_ops_X550em()
3264 phy->ops.read_reg = NULL; in ixgbe_init_phy_ops_X550em()
3265 phy->ops.write_reg = NULL; in ixgbe_init_phy_ops_X550em()
3266 phy->ops.reset = NULL; in ixgbe_init_phy_ops_X550em()
3275 /** ixgbe_get_media_type_X550em - Get media type
3286 switch (hw->device_id) { in ixgbe_get_media_type_X550em()
3289 hw->phy.type = ixgbe_phy_sgmii; in ixgbe_get_media_type_X550em()
3317 /** ixgbe_init_ext_t_x550em - Start (unstall) the external Base T PHY.
3325 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
3333 * SW instance after a power on so the PHY FW must be un-stalled. in ixgbe_init_ext_t_x550em()
3336 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
3345 status = hw->phy.ops.write_reg(hw, in ixgbe_init_ext_t_x550em()
3357 * ixgbe_set_mdio_speed - Set MDIO clock speed
3364 switch (hw->device_id) { in ixgbe_set_mdio_speed()
3387 /** ixgbe_reset_hw_X550em - Perform hardware reset
3396 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_X550em()
3404 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X550em()
3415 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_X550em()
3416 if (status == -EOPNOTSUPP || status == -EFAULT) in ixgbe_reset_hw_X550em()
3420 if (hw->phy.type == ixgbe_phy_x550em_ext_t) { in ixgbe_reset_hw_X550em()
3427 if (hw->phy.sfp_setup_needed) { in ixgbe_reset_hw_X550em()
3428 status = hw->mac.ops.setup_sfp(hw); in ixgbe_reset_hw_X550em()
3429 hw->phy.sfp_setup_needed = false; in ixgbe_reset_hw_X550em()
3432 if (status == -EOPNOTSUPP) in ixgbe_reset_hw_X550em()
3436 if (!hw->phy.reset_disable && hw->phy.ops.reset) in ixgbe_reset_hw_X550em()
3437 hw->phy.ops.reset(hw); in ixgbe_reset_hw_X550em()
3447 if (!hw->force_full_reset) { in ixgbe_reset_hw_X550em()
3448 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_reset_hw_X550em()
3453 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
3456 return -EBUSY; in ixgbe_reset_hw_X550em()
3462 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
3465 /* Poll for reset bit to self-clear meaning reset is complete */ in ixgbe_reset_hw_X550em()
3474 status = -EIO; in ixgbe_reset_hw_X550em()
3484 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X550em()
3485 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X550em()
3490 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X550em()
3496 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_X550em()
3497 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X550em()
3501 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP) in ixgbe_reset_hw_X550em()
3507 /** ixgbe_set_ethertype_anti_spoofing_X550 - Enable/Disable Ethertype
3508 * anti-spoofing
3510 * @enable: enable or disable switch for Ethertype anti-spoofing
3511 * @vf: Virtual Function pool - VF Pool to set for Ethertype anti-spoofing
3529 /** ixgbe_set_source_address_pruning_X550 - Enable/Disbale src address pruning
3557 * ixgbe_setup_fc_backplane_x550em_a - Set up flow control
3568 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_backplane_x550em_a()
3570 return -EINVAL; in ixgbe_setup_fc_backplane_x550em_a()
3573 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_backplane_x550em_a()
3574 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_backplane_x550em_a()
3580 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
3581 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
3585 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_setup_fc_backplane_x550em_a()
3598 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_backplane_x550em_a()
3627 return -EIO; in ixgbe_setup_fc_backplane_x550em_a()
3630 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
3631 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
3634 /* Restart auto-negotiation. */ in ixgbe_setup_fc_backplane_x550em_a()
3641 * ixgbe_set_mux - Set mux for port 1 access with CS4227
3649 if (!hw->bus.lan_id) in ixgbe_set_mux()
3661 * ixgbe_acquire_swfw_sync_X550em - Acquire SWFW semaphore
3682 * ixgbe_release_swfw_sync_X550em - Release SWFW semaphore
3697 * ixgbe_acquire_swfw_sync_x550em_a - Acquire SWFW semaphore
3709 while (--retries) { in ixgbe_acquire_swfw_sync_x550em_a()
3723 if (status != -EAGAIN) in ixgbe_acquire_swfw_sync_x550em_a()
3732 * ixgbe_release_swfw_sync_x550em_a - Release SWFW semaphore
3750 * ixgbe_read_phy_reg_x550a - Reads specified PHY register
3763 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_read_phy_reg_x550a()
3766 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_read_phy_reg_x550a()
3767 return -EBUSY; in ixgbe_read_phy_reg_x550a()
3769 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data); in ixgbe_read_phy_reg_x550a()
3771 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_phy_reg_x550a()
3777 * ixgbe_write_phy_reg_x550a - Writes specified PHY register
3789 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_write_phy_reg_x550a()
3792 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_write_phy_reg_x550a()
3793 return -EBUSY; in ixgbe_write_phy_reg_x550a()
3796 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_write_phy_reg_x550a()