Lines Matching +full:force +full:- +full:internal +full:- +full:phy

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() local
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() local
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() local
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() local
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
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()
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()
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()
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()
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()
609 * ixgbe_fc_autoneg_fw - Set up flow control for FW-controlled PHYs
616 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_fc_autoneg_fw()
617 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_fc_autoneg_fw()
622 /** ixgbe_init_eeprom_params_X550 - Initialize EEPROM params
630 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()
635 eeprom->semaphore_delay = 10; in ixgbe_init_eeprom_params_X550()
636 eeprom->type = ixgbe_flash; in ixgbe_init_eeprom_params_X550()
641 eeprom->word_size = BIT(eeprom_size + in ixgbe_init_eeprom_params_X550()
645 eeprom->type, eeprom->word_size); in ixgbe_init_eeprom_params_X550()
652 * ixgbe_iosf_wait - Wait for IOSF command completion
684 /** ixgbe_read_iosf_sb_reg_x550 - Writes a value to specified register of the
687 * @reg_addr: 32 bit PHY register to write
698 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
725 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
730 * ixgbe_get_phy_token - Get the token for shared PHY access
742 token_cmd.port_number = hw->bus.lan_id; in ixgbe_get_phy_token()
759 * ixgbe_put_phy_token - Put the token for shared PHY access
771 token_cmd.port_number = hw->bus.lan_id; in ixgbe_put_phy_token()
785 * ixgbe_write_iosf_sb_reg_x550a - Write to IOSF PHY register
787 * @reg_addr: 32 bit PHY register to write
801 write_cmd.port_number = hw->bus.lan_id; in ixgbe_write_iosf_sb_reg_x550a()
811 * ixgbe_read_iosf_sb_reg_x550a - Read from IOSF PHY register
813 * @reg_addr: 32 bit PHY register to write
831 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_read_iosf_sb_reg_x550a()
844 /** ixgbe_read_ee_hostif_buffer_X550- Read EEPROM word(s) using hostif
863 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
865 hw_dbg(hw, "EEPROM read buffer - semaphore failed\n"); in ixgbe_read_ee_hostif_buffer_X550()
908 words -= words_to_read; in ixgbe_read_ee_hostif_buffer_X550()
912 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
916 /** ixgbe_checksum_ptr_x550 - Checksum one pointer region
958 (ptr + length) >= hw->eeprom.word_size) in ixgbe_checksum_ptr_x550()
965 for (i = start; length; i++, length--) { in ixgbe_checksum_ptr_x550()
985 /** ixgbe_calc_checksum_X550 - Calculates and returns the checksum
990 * Returns a negative error code on error, or the 16-bit checksum
1001 hw->eeprom.ops.init_params(hw); in ixgbe_calc_checksum_X550()
1019 /* For X550 hardware include 0x0-0x41 in the checksum, skip the in ixgbe_calc_checksum_X550()
1026 /* Include all data from pointers 0x3, 0x6-0xE. This excludes the in ixgbe_calc_checksum_X550()
1027 * FW, PHY module, and PCIe Expansion/Option ROM pointers. in ixgbe_calc_checksum_X550()
1037 pointer >= hw->eeprom.word_size) in ixgbe_calc_checksum_X550()
1059 checksum = (u16)IXGBE_EEPROM_SUM - checksum; in ixgbe_calc_checksum_X550()
1064 /** ixgbe_calc_eeprom_checksum_X550 - Calculates and returns the checksum
1067 * Returns a negative error code on error, or the 16-bit checksum
1074 /** ixgbe_read_ee_hostif_X550 - Read EEPROM word using a host interface command
1097 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
1108 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
1112 /** ixgbe_validate_eeprom_checksum_X550 - Validate EEPROM checksum
1130 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X550()
1136 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X550()
1162 /** ixgbe_write_ee_hostif_X550 - Write EEPROM word using hostif
1190 /** ixgbe_write_ee_hostif_X550 - Write EEPROM word using hostif
1201 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == 0) { in ixgbe_write_ee_hostif_X550()
1203 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_X550()
1212 /** ixgbe_update_flash_X550 - Instruct HW to copy EEPROM to Flash device
1233 * ixgbe_get_bus_info_X550em - Set PCI bus info
1241 hw->bus.type = ixgbe_bus_type_internal; in ixgbe_get_bus_info_X550em()
1242 hw->bus.width = ixgbe_bus_width_unknown; in ixgbe_get_bus_info_X550em()
1243 hw->bus.speed = ixgbe_bus_speed_unknown; in ixgbe_get_bus_info_X550em()
1245 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_X550em()
1251 * ixgbe_fw_recovery_mode - Check FW NVM recovery mode
1264 /** ixgbe_disable_rx_x550 - Disable RX unit
1280 hw->mac.set_lben = true; in ixgbe_disable_rx_x550()
1282 hw->mac.set_lben = false; in ixgbe_disable_rx_x550()
1288 fw_cmd.port_number = hw->bus.lan_id; in ixgbe_disable_rx_x550()
1294 /* If we fail - disable RX using register write */ in ixgbe_disable_rx_x550()
1305 /** ixgbe_update_eeprom_checksum_X550 - Updates the EEPROM checksum and flash
1343 /** ixgbe_write_ee_hostif_buffer_X550 - Write EEPROM word(s) using hostif
1360 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1362 hw_dbg(hw, "EEPROM write buffer - semaphore failed\n"); in ixgbe_write_ee_hostif_buffer_X550()
1375 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1380 /** ixgbe_write_iosf_sb_reg_x550 - Writes a value to specified register of the
1384 * @reg_addr: 32 bit PHY register to write
1395 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1422 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1427 * ixgbe_setup_ixfi_x550em_x - MAC specific iXFI configuration
1439 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1446 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1453 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1462 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1468 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1477 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1484 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1494 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1500 * ixgbe_restart_an_internal_phy_x550em - restart autonegotiation for the
1501 * internal PHY
1509 /* Restart auto-negotiation. */ in ixgbe_restart_an_internal_phy_x550em()
1510 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1511 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1515 hw_dbg(hw, "Auto-negotiation did not complete\n"); in ixgbe_restart_an_internal_phy_x550em()
1520 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1521 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1524 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_restart_an_internal_phy_x550em()
1528 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1529 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1533 hw_dbg(hw, "Auto-negotiation did not complete\n"); in ixgbe_restart_an_internal_phy_x550em()
1538 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1539 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1546 /** ixgbe_setup_ixfi_x550em - Configure the KR PHY for iXFI mode.
1548 * @speed: the link speed to force
1550 * Configures the integrated KR PHY to use iXFI mode. Used to connect an
1551 * internal and external PHY at a specific speed, without autonegotiation.
1555 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_ixfi_x550em()
1560 if (mac->type != ixgbe_mac_X550EM_x) in ixgbe_setup_ixfi_x550em()
1563 /* Disable AN and force speed to 10G Serial. */ in ixgbe_setup_ixfi_x550em()
1565 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1573 /* Select forced link speed for internal PHY. */ in ixgbe_setup_ixfi_x550em()
1582 /* Other link speeds are not supported by internal KR PHY. */ in ixgbe_setup_ixfi_x550em()
1587 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1593 if (hw->mac.type == ixgbe_mac_X550EM_x) { in ixgbe_setup_ixfi_x550em()
1606 * ixgbe_supported_sfp_modules_X550em - Check if SFP module type is supported
1612 switch (hw->phy.sfp_type) { in ixgbe_supported_sfp_modules_X550em()
1640 * ixgbe_setup_mac_link_sfp_x550em - Configure the KR PHY for SFP.
1642 * @speed: the link speed to force
1645 * Configures the extern PHY and the integrated KR PHY for SFP support.
1669 /* Configure internal PHY for KR/KX. */ in ixgbe_setup_mac_link_sfp_x550em()
1673 reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
1679 status = hw->link.ops.write_link(hw, hw->link.addr, reg_slice, in ixgbe_setup_mac_link_sfp_x550em()
1686 * ixgbe_setup_sfi_x550a - Configure the internal PHY for native SFI mode
1688 * @speed: the link speed to force
1690 * Configures the integrated PHY for native SFI mode. Used to connect the
1691 * internal PHY directly to an SFP cage, without autonegotiation.
1695 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sfi_x550a()
1699 /* Disable all AN and force speed to 10G Serial. */ in ixgbe_setup_sfi_x550a()
1700 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
1701 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
1711 /* Select forced link speed for internal PHY. */ in ixgbe_setup_sfi_x550a()
1720 /* Other link speeds are not supported by internal PHY. */ in ixgbe_setup_sfi_x550a()
1724 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
1725 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
1735 * ixgbe_setup_mac_link_sfp_n - Setup internal PHY for native SFP
1740 * Configure the the integrated PHY for native SFP support.
1762 /* Configure internal PHY for native SFI based on module type */ in ixgbe_setup_mac_link_sfp_n()
1763 ret_val = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_n()
1764 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_n()
1773 ret_val = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_n()
1774 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_n()
1779 /* Setup SFI internal link. */ in ixgbe_setup_mac_link_sfp_n()
1784 * ixgbe_setup_mac_link_sfp_x550a - Setup internal PHY for SFP
1789 * Configure the the integrated PHY for SFP support.
1812 /* Configure internal PHY for KR/KX. */ in ixgbe_setup_mac_link_sfp_x550a()
1815 if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE) in ixgbe_setup_mac_link_sfp_x550a()
1818 /* Get external PHY SKU id */ in ixgbe_setup_mac_link_sfp_x550a()
1819 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU, in ixgbe_setup_mac_link_sfp_x550a()
1828 slice_offset = (hw->bus.lan_id + in ixgbe_setup_mac_link_sfp_x550a()
1829 (hw->bus.instance_id << 1)) << 12; in ixgbe_setup_mac_link_sfp_x550a()
1831 slice_offset = hw->bus.lan_id << 12; in ixgbe_setup_mac_link_sfp_x550a()
1836 ret_val = hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1849 ret_val = hw->phy.ops.write_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1855 return hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1860 * ixgbe_setup_mac_link_t_X550em - Sets the auto advertised link speed
1865 * Setup internal/external PHY link speed based on link speed, then set
1866 * external PHY auto advertised link speed.
1877 /* Setup internal/external PHY link speed to iXFI (10G), unless in ixgbe_setup_mac_link_t_X550em()
1885 /* If X552 and internal link mode is XFI, then setup XFI internal link. in ixgbe_setup_mac_link_t_X550em()
1887 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_mac_link_t_X550em()
1888 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_mac_link_t_X550em()
1895 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_mac_link_t_X550em()
1898 /** ixgbe_check_link_t_X550em - Determine link and speed status
1904 * Check that both the MAC and X557 external PHY have link.
1914 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_check_link_t_X550em()
1924 /* MAC link is up, so check external PHY link. in ixgbe_check_link_t_X550em()
1927 * back-to-back reads. in ixgbe_check_link_t_X550em()
1930 status = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_check_link_t_X550em()
1937 /* If external PHY link is not up, then indicate link not up */ in ixgbe_check_link_t_X550em()
1945 * ixgbe_setup_sgmii - Set up link for sgmii
1954 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii()
1958 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1959 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1969 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1970 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1975 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1976 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1983 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1984 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1989 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1990 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
1995 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1996 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
2007 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
2008 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
2018 * ixgbe_setup_sgmii_fw - Set up link for sgmii with firmware-controlled PHYs
2020 * @speed: the link speed to force
2026 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii_fw()
2030 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2031 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2041 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2042 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2047 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2048 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2055 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2056 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2061 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2062 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2067 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2068 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2079 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2080 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2087 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_sgmii_fw()
2091 * ixgbe_fc_autoneg_sgmii_x550em_a - Enable flow control IEEE clause 37
2105 * - FC autoneg is disabled, or if in ixgbe_fc_autoneg_sgmii_x550em_a()
2106 * - link is not up. in ixgbe_fc_autoneg_sgmii_x550em_a()
2108 if (hw->fc.disable_fc_autoneg) in ixgbe_fc_autoneg_sgmii_x550em_a()
2111 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_sgmii_x550em_a()
2115 /* Check if auto-negotiation has completed */ in ixgbe_fc_autoneg_sgmii_x550em_a()
2131 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_sgmii_x550em_a()
2133 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_sgmii_x550em_a()
2134 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_sgmii_x550em_a()
2138 /** ixgbe_init_mac_link_ops_X550em_a - Init mac link function pointers
2143 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em_a()
2145 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em_a()
2147 mac->ops.setup_fc = NULL; in ixgbe_init_mac_link_ops_X550em_a()
2148 mac->ops.fc_autoneg = ixgbe_fc_autoneg_fiber_x550em_a; in ixgbe_init_mac_link_ops_X550em_a()
2151 if (hw->device_id != IXGBE_DEV_ID_X550EM_A_1G_T && in ixgbe_init_mac_link_ops_X550em_a()
2152 hw->device_id != IXGBE_DEV_ID_X550EM_A_1G_T_L) { in ixgbe_init_mac_link_ops_X550em_a()
2153 mac->ops.setup_link = ixgbe_setup_mac_link_t_X550em; in ixgbe_init_mac_link_ops_X550em_a()
2156 mac->ops.fc_autoneg = ixgbe_fc_autoneg_sgmii_x550em_a; in ixgbe_init_mac_link_ops_X550em_a()
2157 mac->ops.setup_fc = ixgbe_fc_autoneg_fw; in ixgbe_init_mac_link_ops_X550em_a()
2158 mac->ops.setup_link = ixgbe_setup_sgmii_fw; in ixgbe_init_mac_link_ops_X550em_a()
2159 mac->ops.check_link = ixgbe_check_mac_link_generic; in ixgbe_init_mac_link_ops_X550em_a()
2162 mac->ops.fc_autoneg = ixgbe_fc_autoneg_backplane_x550em_a; in ixgbe_init_mac_link_ops_X550em_a()
2163 mac->ops.setup_fc = ixgbe_setup_fc_backplane_x550em_a; in ixgbe_init_mac_link_ops_X550em_a()
2170 /** ixgbe_init_mac_link_ops_X550em - init mac link function pointers
2175 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em()
2177 mac->ops.setup_fc = ixgbe_setup_fc_x550em; in ixgbe_init_mac_link_ops_X550em()
2179 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em()
2184 mac->ops.disable_tx_laser = NULL; in ixgbe_init_mac_link_ops_X550em()
2185 mac->ops.enable_tx_laser = NULL; in ixgbe_init_mac_link_ops_X550em()
2186 mac->ops.flap_tx_laser = NULL; in ixgbe_init_mac_link_ops_X550em()
2187 mac->ops.setup_link = ixgbe_setup_mac_link_multispeed_fiber; in ixgbe_init_mac_link_ops_X550em()
2188 switch (hw->device_id) { in ixgbe_init_mac_link_ops_X550em()
2190 mac->ops.setup_mac_link = ixgbe_setup_mac_link_sfp_n; in ixgbe_init_mac_link_ops_X550em()
2193 mac->ops.setup_mac_link = in ixgbe_init_mac_link_ops_X550em()
2197 mac->ops.setup_mac_link = in ixgbe_init_mac_link_ops_X550em()
2201 mac->ops.set_rate_select_speed = in ixgbe_init_mac_link_ops_X550em()
2205 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) in ixgbe_init_mac_link_ops_X550em()
2207 mac->ops.setup_link = ixgbe_setup_mac_link_t_X550em; in ixgbe_init_mac_link_ops_X550em()
2208 mac->ops.setup_fc = ixgbe_setup_fc_generic; in ixgbe_init_mac_link_ops_X550em()
2209 mac->ops.check_link = ixgbe_check_link_t_X550em; in ixgbe_init_mac_link_ops_X550em()
2212 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII || in ixgbe_init_mac_link_ops_X550em()
2213 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) in ixgbe_init_mac_link_ops_X550em()
2214 mac->ops.setup_link = ixgbe_setup_sgmii; in ixgbe_init_mac_link_ops_X550em()
2221 if (hw->mac.type == ixgbe_mac_x550em_a) in ixgbe_init_mac_link_ops_X550em()
2225 /** ixgbe_setup_sfp_modules_X550em - Setup SFP module
2239 hw->phy.ops.reset = NULL; in ixgbe_setup_sfp_modules_X550em()
2244 /** ixgbe_get_link_capabilities_x550em - Determines link capabilities
2253 if (hw->phy.type == ixgbe_phy_fw) { in ixgbe_get_link_capabilities_X550em()
2255 *speed = hw->phy.speeds_supported; in ixgbe_get_link_capabilities_X550em()
2260 if (hw->phy.media_type == ixgbe_media_type_fiber) { in ixgbe_get_link_capabilities_X550em()
2261 /* CS4227 SFP must not enable auto-negotiation */ in ixgbe_get_link_capabilities_X550em()
2264 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || in ixgbe_get_link_capabilities_X550em()
2265 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 || in ixgbe_get_link_capabilities_X550em()
2266 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || in ixgbe_get_link_capabilities_X550em()
2267 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) { in ixgbe_get_link_capabilities_X550em()
2273 if (hw->phy.multispeed_fiber) in ixgbe_get_link_capabilities_X550em()
2279 switch (hw->phy.type) { in ixgbe_get_link_capabilities_X550em()
2294 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_get_link_capabilities_X550em()
2296 if (hw->phy.nw_mng_if_sel & in ixgbe_get_link_capabilities_X550em()
2300 } else if (hw->device_id == in ixgbe_get_link_capabilities_X550em()
2318 * ixgbe_get_lasi_ext_t_x550em - Determime external Base T PHY interrupt cause
2321 * PHY interrupt is lsc
2323 * Determime if external Base T PHY interrupt cause is high temperature
2327 * failure alarm, else return PHY access status.
2337 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2344 /* Vendor Auto-Neg alarm triggered or Global alarm 1 triggered */ in ixgbe_get_lasi_ext_t_x550em()
2345 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2354 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, in ixgbe_get_lasi_ext_t_x550em()
2363 /* power down the PHY in case the PHY FW didn't already */ in ixgbe_get_lasi_ext_t_x550em()
2369 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG, in ixgbe_get_lasi_ext_t_x550em()
2377 /* power down the PHY in case the PHY FW didn't */ in ixgbe_get_lasi_ext_t_x550em()
2384 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2391 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2, in ixgbe_get_lasi_ext_t_x550em()
2405 * ixgbe_enable_lasi_ext_t_x550em - Enable external Base T PHY interrupts
2409 * Base T PHY
2411 * Returns PHY access status
2425 * of the link configurations of the external PHY and correspondingly in ixgbe_enable_lasi_ext_t_x550em()
2426 * support the configuration of the internal iXFI link, since iXFI does in ixgbe_enable_lasi_ext_t_x550em()
2427 * not support auto-negotiation. This is not required for X553 devices in ixgbe_enable_lasi_ext_t_x550em()
2428 * having KR support, which performs auto-negotiations and which is used in ixgbe_enable_lasi_ext_t_x550em()
2429 * as the internal link to the external PHY. Hence adding a check here in ixgbe_enable_lasi_ext_t_x550em()
2432 if (hw->mac.type != ixgbe_mac_x550em_a) { in ixgbe_enable_lasi_ext_t_x550em()
2433 status = hw->phy.ops.read_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2441 status = hw->phy.ops.write_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2449 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2458 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2464 /* Enable vendor Auto-Neg alarm and Global Interrupt Mask 1 alarm */ in ixgbe_enable_lasi_ext_t_x550em()
2465 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2474 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2480 /* Enable chip-wide vendor alarm */ in ixgbe_enable_lasi_ext_t_x550em()
2481 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2489 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2497 * ixgbe_handle_lasi_ext_t_x550em - Handle external Base T PHY interrupt
2500 * Handle external Base T PHY interrupt. If high temperature
2502 * then setup internal/external PHY link
2505 * failure alarm, else return PHY access status.
2509 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_handle_lasi_ext_t_x550em() local
2517 if (lsc && phy->ops.setup_internal_link) in ixgbe_handle_lasi_ext_t_x550em()
2518 return phy->ops.setup_internal_link(hw); in ixgbe_handle_lasi_ext_t_x550em()
2524 * ixgbe_setup_kr_speed_x550em - Configure the KR PHY for link speed.
2528 * Configures the integrated KR PHY.
2536 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2537 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2554 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2555 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2558 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_setup_kr_speed_x550em()
2560 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2561 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2573 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2574 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2582 * ixgbe_setup_kr_x550em - Configure the KR PHY
2588 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) in ixgbe_setup_kr_x550em()
2594 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); in ixgbe_setup_kr_x550em()
2597 /** ixgbe_ext_phy_t_x550em_get_link - Get ext phy link status
2611 ret = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_ext_phy_t_x550em_get_link()
2616 ret = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_ext_phy_t_x550em_get_link()
2626 /** ixgbe_setup_internal_phy_t_x550em - Configure KR PHY to X557 link
2629 * Configures the link between the integrated KR PHY and the external X557 PHY
2631 * interrupt from the X557 PHY. This function configures the link speed
2632 * between the PHYs to match the link speed of the BASE-T link.
2634 * A return of a non-zero value indicates an error, and the base driver should
2644 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_setup_internal_phy_t_x550em()
2647 if (!(hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_internal_phy_t_x550em()
2648 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE))) { in ixgbe_setup_internal_phy_t_x550em()
2662 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_setup_internal_phy_t_x550em()
2687 /* Internal PHY does not support anything else */ in ixgbe_setup_internal_phy_t_x550em()
2694 /** ixgbe_reset_phy_t_X550em - Performs X557 PHY reset and enables LASI
2711 * ixgbe_led_on_t_x550em - Turns on the software controllable LEDs.
2723 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_x550em()
2726 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_x550em()
2733 * ixgbe_led_off_t_x550em - Turns off the software controllable LEDs.
2745 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_x550em()
2748 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_x550em()
2755 * ixgbe_set_fw_drv_ver_x550 - Sends driver version to firmware
2783 fw_cmd.port_num = (u8)hw->bus.func; in ixgbe_set_fw_drv_ver_x550()
2810 /** ixgbe_get_lcd_x550em - Determine lowest common denominator
2821 u16 word = hw->eeprom.ctrl_word_3; in ixgbe_get_lcd_t_x550em()
2825 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS, in ixgbe_get_lcd_t_x550em()
2838 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) || in ixgbe_get_lcd_t_x550em()
2848 * ixgbe_setup_fc_x550em - Set up flow control
2858 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_x550em()
2866 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_x550em()
2867 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_x550em()
2870 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_x550em()
2898 switch (hw->device_id) { in ixgbe_setup_fc_x550em()
2902 rc = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_x550em()
2903 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_x550em()
2915 rc = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_x550em()
2916 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_x550em()
2921 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_x550em()
2924 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_x550em()
2933 * ixgbe_fc_autoneg_backplane_x550em_a - Enable flow control IEEE clause 37
2945 * - FC autoneg is disabled, or if in ixgbe_fc_autoneg_backplane_x550em_a()
2946 * - link is not up. in ixgbe_fc_autoneg_backplane_x550em_a()
2948 if (hw->fc.disable_fc_autoneg) { in ixgbe_fc_autoneg_backplane_x550em_a()
2953 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_backplane_x550em_a()
2959 /* Check at auto-negotiation has completed */ in ixgbe_fc_autoneg_backplane_x550em_a()
2960 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2961 IXGBE_KRM_LINK_S1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2965 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2973 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2974 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2978 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2982 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2983 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2987 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2999 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_backplane_x550em_a()
3001 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_backplane_x550em_a()
3002 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_backplane_x550em_a()
3007 * ixgbe_fc_autoneg_fiber_x550em_a - passthrough FC settings
3012 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_fiber_x550em_a()
3013 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_fiber_x550em_a()
3016 /** ixgbe_enter_lplu_x550em - Transition to low power states
3020 * (from D0 to non-D0). Link is required to enter LPLU so avoid resetting
3021 * the X557 PHY immediately prior to entering LPLU.
3039 status = hw->eeprom.ops.read(hw, NVM_INIT_CTRL_3, in ixgbe_enter_lplu_t_x550em()
3040 &hw->eeprom.ctrl_word_3); in ixgbe_enter_lplu_t_x550em()
3045 * manageability disabled, then force link down by entering in ixgbe_enter_lplu_t_x550em()
3048 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) || in ixgbe_enter_lplu_t_x550em()
3049 !(hw->wol_enabled || ixgbe_mng_present(hw))) in ixgbe_enter_lplu_t_x550em()
3057 /* If no valid LCD link speed, then force link down and exit. */ in ixgbe_enter_lplu_t_x550em()
3061 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_enter_lplu_t_x550em()
3083 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM, in ixgbe_enter_lplu_t_x550em()
3089 status = hw->phy.ops.read_reg(hw, MDIO_AN_10GBT_CTRL, in ixgbe_enter_lplu_t_x550em()
3095 status = hw->phy.ops.read_reg(hw, in ixgbe_enter_lplu_t_x550em()
3102 save_autoneg = hw->phy.autoneg_advertised; in ixgbe_enter_lplu_t_x550em()
3105 status = hw->mac.ops.setup_link(hw, lcd_speed, false); in ixgbe_enter_lplu_t_x550em()
3108 hw->phy.autoneg_advertised = save_autoneg; in ixgbe_enter_lplu_t_x550em()
3114 * ixgbe_reset_phy_fw - Reset firmware-controlled PHYs
3122 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_reset_phy_fw()
3138 * ixgbe_check_overtemp_fw - Check firmware-controlled PHYs for overtemp
3158 * ixgbe_read_mng_if_sel_x550em - Read NW_MNG_IF_SEL register
3166 * to determine internal PHY mode. in ixgbe_read_mng_if_sel_x550em()
3168 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_read_mng_if_sel_x550em()
3170 /* If X552 (X550EM_a) and MDIO is connected to external PHY, then set in ixgbe_read_mng_if_sel_x550em()
3171 * PHY address. This register field was has only been used for X552. in ixgbe_read_mng_if_sel_x550em()
3173 if (hw->mac.type == ixgbe_mac_x550em_a && in ixgbe_read_mng_if_sel_x550em()
3174 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) { in ixgbe_read_mng_if_sel_x550em()
3175 hw->phy.mdio.prtad = (hw->phy.nw_mng_if_sel & in ixgbe_read_mng_if_sel_x550em()
3181 /** ixgbe_init_phy_ops_X550em - PHY/SFP specific init
3185 * set during init_shared_code because the PHY/SFP type was
3190 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_X550em() local
3193 hw->mac.ops.set_lan_id(hw); in ixgbe_init_phy_ops_X550em()
3197 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { in ixgbe_init_phy_ops_X550em()
3198 phy->phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; in ixgbe_init_phy_ops_X550em()
3202 /* Identify the PHY or SFP module */ in ixgbe_init_phy_ops_X550em()
3203 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_X550em()
3210 if (phy->sfp_type != ixgbe_sfp_type_unknown) in ixgbe_init_phy_ops_X550em()
3211 phy->ops.reset = NULL; in ixgbe_init_phy_ops_X550em()
3213 /* Set functions pointers based on phy type */ in ixgbe_init_phy_ops_X550em()
3214 switch (hw->phy.type) { in ixgbe_init_phy_ops_X550em()
3216 phy->ops.setup_link = NULL; in ixgbe_init_phy_ops_X550em()
3217 phy->ops.read_reg = ixgbe_read_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3218 phy->ops.write_reg = ixgbe_write_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3221 phy->ops.setup_link = ixgbe_setup_kr_x550em; in ixgbe_init_phy_ops_X550em()
3222 phy->ops.read_reg = ixgbe_read_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3223 phy->ops.write_reg = ixgbe_write_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3227 phy->ops.setup_link = NULL; in ixgbe_init_phy_ops_X550em()
3228 phy->ops.read_reg = ixgbe_read_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3229 phy->ops.write_reg = ixgbe_write_phy_reg_x550em; in ixgbe_init_phy_ops_X550em()
3233 * to determine internal PHY mode in ixgbe_init_phy_ops_X550em()
3235 phy->nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_init_phy_ops_X550em()
3237 /* If internal link mode is XFI, then setup iXFI internal link, in ixgbe_init_phy_ops_X550em()
3240 phy->ops.setup_internal_link = in ixgbe_init_phy_ops_X550em()
3244 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_init_phy_ops_X550em()
3247 phy->ops.enter_lplu = ixgbe_enter_lplu_t_x550em; in ixgbe_init_phy_ops_X550em()
3249 phy->ops.handle_lasi = ixgbe_handle_lasi_ext_t_x550em; in ixgbe_init_phy_ops_X550em()
3250 phy->ops.reset = ixgbe_reset_phy_t_X550em; in ixgbe_init_phy_ops_X550em()
3253 phy->ops.setup_link = NULL; in ixgbe_init_phy_ops_X550em()
3256 phy->ops.setup_link = ixgbe_setup_fw_link; in ixgbe_init_phy_ops_X550em()
3257 phy->ops.reset = ixgbe_reset_phy_fw; in ixgbe_init_phy_ops_X550em()
3260 phy->ops.setup_link = NULL; in ixgbe_init_phy_ops_X550em()
3261 phy->ops.read_reg = NULL; in ixgbe_init_phy_ops_X550em()
3262 phy->ops.write_reg = NULL; in ixgbe_init_phy_ops_X550em()
3263 phy->ops.reset = NULL; in ixgbe_init_phy_ops_X550em()
3272 /** ixgbe_get_media_type_X550em - Get media type
3282 /* Detect if there is a copper PHY attached. */ in ixgbe_get_media_type_X550em()
3283 switch (hw->device_id) { in ixgbe_get_media_type_X550em()
3286 hw->phy.type = ixgbe_phy_sgmii; in ixgbe_get_media_type_X550em()
3314 /** ixgbe_init_ext_t_x550em - Start (unstall) the external Base T PHY.
3322 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
3329 /* If PHY FW reset completed bit is set then this is the first in ixgbe_init_ext_t_x550em()
3330 * SW instance after a power on so the PHY FW must be un-stalled. in ixgbe_init_ext_t_x550em()
3333 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
3342 status = hw->phy.ops.write_reg(hw, in ixgbe_init_ext_t_x550em()
3354 * ixgbe_set_mdio_speed - Set MDIO clock speed
3361 switch (hw->device_id) { in ixgbe_set_mdio_speed()
3367 /* Config MDIO clock speed before the first MDIO PHY access */ in ixgbe_set_mdio_speed()
3384 /** ixgbe_reset_hw_X550em - Perform hardware reset
3388 ** and clears all interrupts, perform a PHY reset, and perform a link (MAC)
3398 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_X550em()
3401 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X550em()
3408 /* PHY ops must be identified and initialized prior to reset */ in ixgbe_reset_hw_X550em()
3409 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_X550em()
3414 /* start the external PHY */ in ixgbe_reset_hw_X550em()
3415 if (hw->phy.type == ixgbe_phy_x550em_ext_t) { in ixgbe_reset_hw_X550em()
3422 if (hw->phy.sfp_setup_needed) { in ixgbe_reset_hw_X550em()
3423 status = hw->mac.ops.setup_sfp(hw); in ixgbe_reset_hw_X550em()
3424 hw->phy.sfp_setup_needed = false; in ixgbe_reset_hw_X550em()
3430 /* Reset PHY */ in ixgbe_reset_hw_X550em()
3431 if (!hw->phy.reset_disable && hw->phy.ops.reset) in ixgbe_reset_hw_X550em()
3432 hw->phy.ops.reset(hw); in ixgbe_reset_hw_X550em()
3436 * If link reset is used when link is up, it might reset the PHY when in ixgbe_reset_hw_X550em()
3437 * mng is using it. If link is down or the flag to force full link in ixgbe_reset_hw_X550em()
3442 if (!hw->force_full_reset) { in ixgbe_reset_hw_X550em()
3443 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_reset_hw_X550em()
3448 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
3457 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
3460 /* Poll for reset bit to self-clear meaning reset is complete */ in ixgbe_reset_hw_X550em()
3479 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X550em()
3480 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X550em()
3485 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X550em()
3491 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_X550em()
3492 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X550em()
3496 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP) in ixgbe_reset_hw_X550em()
3502 /** ixgbe_set_ethertype_anti_spoofing_X550 - Enable/Disable Ethertype
3503 * anti-spoofing
3505 * @enable: enable or disable switch for Ethertype anti-spoofing
3506 * @vf: Virtual Function pool - VF Pool to set for Ethertype anti-spoofing
3524 /** ixgbe_set_source_address_pruning_X550 - Enable/Disbale src address pruning
3552 * ixgbe_setup_fc_backplane_x550em_a - Set up flow control
3563 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_backplane_x550em_a()
3568 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_backplane_x550em_a()
3569 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_backplane_x550em_a()
3575 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
3576 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
3580 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_setup_fc_backplane_x550em_a()
3593 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_backplane_x550em_a()
3625 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
3626 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
3629 /* Restart auto-negotiation. */ in ixgbe_setup_fc_backplane_x550em_a()
3636 * ixgbe_set_mux - Set mux for port 1 access with CS4227
3644 if (!hw->bus.lan_id) in ixgbe_set_mux()
3656 * ixgbe_acquire_swfw_sync_X550em - Acquire SWFW semaphore
3677 * ixgbe_release_swfw_sync_X550em - Release SWFW semaphore
3692 * ixgbe_acquire_swfw_sync_x550em_a - Acquire SWFW semaphore
3696 * Acquires the SWFW semaphore and get the shared PHY token as needed
3704 while (--retries) { in ixgbe_acquire_swfw_sync_x550em_a()
3727 * ixgbe_release_swfw_sync_x550em_a - Release SWFW semaphore
3731 * Release the SWFW semaphore and puts the shared PHY token as needed
3745 * ixgbe_read_phy_reg_x550a - Reads specified PHY register
3747 * @reg_addr: 32 bit address of PHY register to read
3749 * @phy_data: Pointer to read data from PHY register
3751 * Reads a value from a specified PHY register using the SWFW lock and PHY
3752 * Token. The PHY Token is needed since the MDIO is shared between to MAC
3758 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_read_phy_reg_x550a()
3761 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_read_phy_reg_x550a()
3764 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data); in ixgbe_read_phy_reg_x550a()
3766 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_phy_reg_x550a()
3772 * ixgbe_write_phy_reg_x550a - Writes specified PHY register
3774 * @reg_addr: 32 bit PHY register to write
3776 * @phy_data: Data to write to the PHY register
3778 * Writes a value to specified PHY register using the SWFW lock and PHY Token.
3779 * The PHY Token is needed since the MDIO is shared between to MAC instances.
3784 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_write_phy_reg_x550a()
3787 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_write_phy_reg_x550a()
3791 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_write_phy_reg_x550a()