Lines Matching refs:phy
33 hw->phy.type = txgbe_get_phy_type_from_id(hw->phy.id); in txgbe_identify_extphy()
34 if (hw->phy.type == txgbe_phy_unknown) { in txgbe_identify_extphy()
36 hw->phy.read_reg(hw, TXGBE_MD_PHY_EXT_ABILITY, in txgbe_identify_extphy()
42 hw->phy.type = txgbe_phy_cu_unknown; in txgbe_identify_extphy()
44 hw->phy.type = txgbe_phy_generic; in txgbe_identify_extphy()
59 hw->phy.media_type = hw->phy.get_media_type(hw); in txgbe_read_phy_if()
64 hw->phy.nw_mng_if_sel = rd32(hw, TXGBE_ETHPHYIF); in txgbe_read_phy_if()
67 if (hw->phy.nw_mng_if_sel & TXGBE_ETHPHYIF_MDIO_ACT) in txgbe_read_phy_if()
68 hw->phy.addr = TXGBE_ETHPHYIF_MDIO_BASE(hw->phy.nw_mng_if_sel); in txgbe_read_phy_if()
70 if (!hw->phy.phy_semaphore_mask) { in txgbe_read_phy_if()
72 hw->phy.phy_semaphore_mask = TXGBE_MNGSEM_SWPHY; in txgbe_read_phy_if()
74 hw->phy.phy_semaphore_mask = TXGBE_MNGSEM_SWPHY; in txgbe_read_phy_if()
94 if (hw->phy.type != txgbe_phy_unknown) in txgbe_identify_phy()
98 if (hw->phy.media_type == txgbe_media_type_copper) { in txgbe_identify_phy()
100 } else if (hw->phy.media_type == txgbe_media_type_fiber) { in txgbe_identify_phy()
103 hw->phy.type = txgbe_phy_none; in txgbe_identify_phy()
108 if (hw->phy.type == txgbe_phy_sfp_unsupported) in txgbe_identify_phy()
151 hw->phy.addr = phy_addr; in txgbe_validate_phy_addr()
152 hw->phy.read_reg(hw, TXGBE_MD_PHY_ID_HIGH, in txgbe_validate_phy_addr()
176 err = hw->phy.read_reg(hw, TXGBE_MD_PHY_ID_HIGH, in txgbe_get_phy_id()
181 hw->phy.id = (u32)(phy_id_high << 16); in txgbe_get_phy_id()
182 err = hw->phy.read_reg(hw, TXGBE_MD_PHY_ID_LOW, in txgbe_get_phy_id()
185 hw->phy.id |= (u32)(phy_id_low & TXGBE_PHY_REVISION_MASK); in txgbe_get_phy_id()
186 hw->phy.revision = (u32)(phy_id_low & ~TXGBE_PHY_REVISION_MASK); in txgbe_get_phy_id()
232 err = hw->phy.read_reg(hw, TXGBE_MD_PORT_CTRL, in txgbe_reset_extphy()
237 err = hw->phy.write_reg(hw, TXGBE_MD_PORT_CTRL, in txgbe_reset_extphy()
249 err = hw->phy.read_reg(hw, TXGBE_MD_PORT_CTRL, in txgbe_reset_extphy()
278 if (hw->phy.type == txgbe_phy_unknown) in txgbe_reset_phy()
281 if (err != 0 || hw->phy.type == txgbe_phy_none) in txgbe_reset_phy()
285 if (hw->phy.check_overtemp(hw) == TXGBE_ERR_OVERTEMP) in txgbe_reset_phy()
292 switch (hw->phy.type) { in txgbe_reset_phy()
319 TXGBE_MDIOSCA_PORT(hw->phy.addr); in txgbe_read_phy_reg_mdi()
355 u32 gssr = hw->phy.phy_semaphore_mask; in txgbe_read_phy_reg()
362 err = hw->phy.read_reg_mdi(hw, reg_addr, device_type, phy_data); in txgbe_read_phy_reg()
385 TXGBE_MDIOSCA_PORT(hw->phy.addr); in txgbe_write_phy_reg_mdi()
415 u32 gssr = hw->phy.phy_semaphore_mask; in txgbe_write_phy_reg()
422 err = hw->phy.write_reg_mdi(hw, reg_addr, device_type, in txgbe_write_phy_reg()
447 hw->phy.read_reg(hw, TXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG, in txgbe_setup_phy_link()
452 if ((hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_10GB_FULL) && in txgbe_setup_phy_link()
456 hw->phy.write_reg(hw, TXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG, in txgbe_setup_phy_link()
460 hw->phy.read_reg(hw, TXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG, in txgbe_setup_phy_link()
466 if ((hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_5GB_FULL) && in txgbe_setup_phy_link()
472 if ((hw->phy.autoneg_advertised & in txgbe_setup_phy_link()
478 if ((hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_1GB_FULL) && in txgbe_setup_phy_link()
482 hw->phy.write_reg(hw, TXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG, in txgbe_setup_phy_link()
487 hw->phy.read_reg(hw, TXGBE_MII_AUTONEG_ADVERTISE_REG, in txgbe_setup_phy_link()
493 if ((hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_100M_FULL) && in txgbe_setup_phy_link()
497 hw->phy.write_reg(hw, TXGBE_MII_AUTONEG_ADVERTISE_REG, in txgbe_setup_phy_link()
506 hw->phy.read_reg(hw, TXGBE_MD_AUTO_NEG_CONTROL, in txgbe_setup_phy_link()
511 hw->phy.write_reg(hw, TXGBE_MD_AUTO_NEG_CONTROL, in txgbe_setup_phy_link()
535 hw->phy.autoneg_advertised = 0; in txgbe_setup_phy_link_speed()
538 hw->phy.autoneg_advertised |= TXGBE_LINK_SPEED_10GB_FULL; in txgbe_setup_phy_link_speed()
541 hw->phy.autoneg_advertised |= TXGBE_LINK_SPEED_5GB_FULL; in txgbe_setup_phy_link_speed()
544 hw->phy.autoneg_advertised |= TXGBE_LINK_SPEED_2_5GB_FULL; in txgbe_setup_phy_link_speed()
547 hw->phy.autoneg_advertised |= TXGBE_LINK_SPEED_1GB_FULL; in txgbe_setup_phy_link_speed()
550 hw->phy.autoneg_advertised |= TXGBE_LINK_SPEED_100M_FULL; in txgbe_setup_phy_link_speed()
553 hw->phy.autoneg_advertised |= TXGBE_LINK_SPEED_10M_FULL; in txgbe_setup_phy_link_speed()
556 hw->phy.setup_link(hw); in txgbe_setup_phy_link_speed()
573 err = hw->phy.read_reg(hw, TXGBE_MD_PHY_SPEED_ABILITY, in txgbe_get_copper_speeds_supported()
580 hw->phy.speeds_supported |= TXGBE_LINK_SPEED_10GB_FULL; in txgbe_get_copper_speeds_supported()
582 hw->phy.speeds_supported |= TXGBE_LINK_SPEED_1GB_FULL; in txgbe_get_copper_speeds_supported()
584 hw->phy.speeds_supported |= TXGBE_LINK_SPEED_100M_FULL; in txgbe_get_copper_speeds_supported()
604 if (!hw->phy.speeds_supported) in txgbe_get_copper_link_capabilities()
607 *speed = hw->phy.speeds_supported; in txgbe_get_copper_link_capabilities()
643 err = hw->phy.read_reg(hw, in txgbe_check_phy_link_tnx()
681 hw->phy.read_reg(hw, TXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG, in txgbe_setup_phy_link_tnx()
686 if (hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_10GB_FULL) in txgbe_setup_phy_link_tnx()
689 hw->phy.write_reg(hw, TXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG, in txgbe_setup_phy_link_tnx()
696 hw->phy.read_reg(hw, TXGBE_MII_AUTONEG_XNP_TX_REG, in txgbe_setup_phy_link_tnx()
701 if (hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_1GB_FULL) in txgbe_setup_phy_link_tnx()
704 hw->phy.write_reg(hw, TXGBE_MII_AUTONEG_XNP_TX_REG, in txgbe_setup_phy_link_tnx()
711 hw->phy.read_reg(hw, TXGBE_MII_AUTONEG_ADVERTISE_REG, in txgbe_setup_phy_link_tnx()
716 if (hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_100M_FULL) in txgbe_setup_phy_link_tnx()
719 hw->phy.write_reg(hw, TXGBE_MII_AUTONEG_ADVERTISE_REG, in txgbe_setup_phy_link_tnx()
729 hw->phy.read_reg(hw, TXGBE_MD_AUTO_NEG_CONTROL, in txgbe_setup_phy_link_tnx()
734 hw->phy.write_reg(hw, TXGBE_MD_AUTO_NEG_CONTROL, in txgbe_setup_phy_link_tnx()
752 switch (hw->phy.media_type) { in txgbe_identify_module()
762 hw->phy.sfp_type = txgbe_sfp_type_not_present; in txgbe_identify_module()
780 enum txgbe_sfp_type stored_sfp_type = hw->phy.sfp_type; in txgbe_identify_sfp_module()
791 if (hw->phy.media_type != txgbe_media_type_fiber) { in txgbe_identify_sfp_module()
792 hw->phy.sfp_type = txgbe_sfp_type_not_present; in txgbe_identify_sfp_module()
796 err = hw->phy.read_i2c_eeprom(hw, TXGBE_SFF_IDENTIFIER, in txgbe_identify_sfp_module()
800 hw->phy.sfp_type = txgbe_sfp_type_not_present; in txgbe_identify_sfp_module()
801 if (hw->phy.type != txgbe_phy_nl) { in txgbe_identify_sfp_module()
802 hw->phy.id = 0; in txgbe_identify_sfp_module()
803 hw->phy.type = txgbe_phy_unknown; in txgbe_identify_sfp_module()
809 hw->phy.type = txgbe_phy_sfp_unsupported; in txgbe_identify_sfp_module()
813 err = hw->phy.read_i2c_eeprom(hw, TXGBE_SFF_1GBE_COMP_CODES, in txgbe_identify_sfp_module()
818 err = hw->phy.read_i2c_eeprom(hw, TXGBE_SFF_10GBE_COMP_CODES, in txgbe_identify_sfp_module()
823 err = hw->phy.read_i2c_eeprom(hw, TXGBE_SFF_CABLE_TECHNOLOGY, in txgbe_identify_sfp_module()
846 hw->phy.sfp_type = txgbe_sfp_type_da_cu_core0; in txgbe_identify_sfp_module()
848 hw->phy.sfp_type = txgbe_sfp_type_da_cu_core1; in txgbe_identify_sfp_module()
850 err = hw->phy.read_i2c_eeprom(hw, in txgbe_identify_sfp_module()
855 hw->phy.sfp_type = (hw->bus.lan_id == 0 in txgbe_identify_sfp_module()
859 hw->phy.sfp_type = txgbe_sfp_type_unknown; in txgbe_identify_sfp_module()
864 hw->phy.sfp_type = (hw->bus.lan_id == 0 in txgbe_identify_sfp_module()
868 hw->phy.sfp_type = (hw->bus.lan_id == 0 in txgbe_identify_sfp_module()
872 hw->phy.sfp_type = (hw->bus.lan_id == 0 in txgbe_identify_sfp_module()
876 hw->phy.sfp_type = (hw->bus.lan_id == 0 in txgbe_identify_sfp_module()
880 hw->phy.sfp_type = txgbe_sfp_type_unknown; in txgbe_identify_sfp_module()
883 if (hw->phy.sfp_type != stored_sfp_type) in txgbe_identify_sfp_module()
884 hw->phy.sfp_setup_needed = true; in txgbe_identify_sfp_module()
887 hw->phy.multispeed_fiber = false; in txgbe_identify_sfp_module()
892 hw->phy.multispeed_fiber = true; in txgbe_identify_sfp_module()
895 if (hw->phy.type != txgbe_phy_nl) { in txgbe_identify_sfp_module()
896 hw->phy.id = identifier; in txgbe_identify_sfp_module()
897 err = hw->phy.read_i2c_eeprom(hw, in txgbe_identify_sfp_module()
902 err = hw->phy.read_i2c_eeprom(hw, in txgbe_identify_sfp_module()
907 err = hw->phy.read_i2c_eeprom(hw, in txgbe_identify_sfp_module()
918 hw->phy.type = txgbe_phy_sfp_tyco_passive; in txgbe_identify_sfp_module()
922 hw->phy.type = txgbe_phy_sfp_ftl_active; in txgbe_identify_sfp_module()
924 hw->phy.type = txgbe_phy_sfp_ftl; in txgbe_identify_sfp_module()
927 hw->phy.type = txgbe_phy_sfp_avago; in txgbe_identify_sfp_module()
930 hw->phy.type = txgbe_phy_sfp_intel; in txgbe_identify_sfp_module()
934 hw->phy.type = txgbe_phy_sfp_unknown_passive; in txgbe_identify_sfp_module()
936 hw->phy.type = txgbe_phy_sfp_unknown_active; in txgbe_identify_sfp_module()
938 hw->phy.type = txgbe_phy_sfp_unknown; in txgbe_identify_sfp_module()
951 !(hw->phy.sfp_type == txgbe_sfp_type_1g_cu_core1 || in txgbe_identify_sfp_module()
952 hw->phy.sfp_type == txgbe_sfp_type_1g_cu_core0 || in txgbe_identify_sfp_module()
953 hw->phy.sfp_type == txgbe_sfp_type_1g_lx_core0 || in txgbe_identify_sfp_module()
954 hw->phy.sfp_type == txgbe_sfp_type_1g_lx_core1 || in txgbe_identify_sfp_module()
955 hw->phy.sfp_type == txgbe_sfp_type_1g_sx_core0 || in txgbe_identify_sfp_module()
956 hw->phy.sfp_type == txgbe_sfp_type_1g_sx_core1)) { in txgbe_identify_sfp_module()
957 hw->phy.type = txgbe_phy_sfp_unsupported; in txgbe_identify_sfp_module()
964 !(hw->phy.sfp_type == txgbe_sfp_type_1g_cu_core0 || in txgbe_identify_sfp_module()
965 hw->phy.sfp_type == txgbe_sfp_type_1g_cu_core1 || in txgbe_identify_sfp_module()
966 hw->phy.sfp_type == txgbe_sfp_type_1g_lx_core0 || in txgbe_identify_sfp_module()
967 hw->phy.sfp_type == txgbe_sfp_type_1g_lx_core1 || in txgbe_identify_sfp_module()
968 hw->phy.sfp_type == txgbe_sfp_type_1g_sx_core0 || in txgbe_identify_sfp_module()
969 hw->phy.sfp_type == txgbe_sfp_type_1g_sx_core1)) { in txgbe_identify_sfp_module()
971 hw->phy.type = txgbe_phy_sfp_unsupported; in txgbe_identify_sfp_module()
988 enum txgbe_sfp_type stored_sfp_type = hw->phy.sfp_type; in txgbe_identify_qsfp_module()
1001 if (hw->phy.media_type != txgbe_media_type_fiber_qsfp) { in txgbe_identify_qsfp_module()
1002 hw->phy.sfp_type = txgbe_sfp_type_not_present; in txgbe_identify_qsfp_module()
1007 err = hw->phy.read_i2c_eeprom(hw, TXGBE_SFF_IDENTIFIER, in txgbe_identify_qsfp_module()
1011 hw->phy.sfp_type = txgbe_sfp_type_not_present; in txgbe_identify_qsfp_module()
1012 hw->phy.id = 0; in txgbe_identify_qsfp_module()
1013 hw->phy.type = txgbe_phy_unknown; in txgbe_identify_qsfp_module()
1017 hw->phy.type = txgbe_phy_sfp_unsupported; in txgbe_identify_qsfp_module()
1022 hw->phy.id = identifier; in txgbe_identify_qsfp_module()
1024 err = hw->phy.read_i2c_eeprom(hw, TXGBE_SFF_QSFP_10GBE_COMP, in txgbe_identify_qsfp_module()
1030 err = hw->phy.read_i2c_eeprom(hw, TXGBE_SFF_QSFP_1GBE_COMP, in txgbe_identify_qsfp_module()
1037 hw->phy.type = txgbe_phy_qsfp_unknown_passive; in txgbe_identify_qsfp_module()
1039 hw->phy.sfp_type = txgbe_sfp_type_da_cu_core0; in txgbe_identify_qsfp_module()
1041 hw->phy.sfp_type = txgbe_sfp_type_da_cu_core1; in txgbe_identify_qsfp_module()
1045 hw->phy.sfp_type = txgbe_sfp_type_srlr_core0; in txgbe_identify_qsfp_module()
1047 hw->phy.sfp_type = txgbe_sfp_type_srlr_core1; in txgbe_identify_qsfp_module()
1053 hw->phy.read_i2c_eeprom(hw, in txgbe_identify_qsfp_module()
1057 hw->phy.read_i2c_eeprom(hw, in txgbe_identify_qsfp_module()
1061 hw->phy.read_i2c_eeprom(hw, in txgbe_identify_qsfp_module()
1074 hw->phy.type = txgbe_phy_qsfp_unknown_active; in txgbe_identify_qsfp_module()
1076 hw->phy.sfp_type = in txgbe_identify_qsfp_module()
1079 hw->phy.sfp_type = in txgbe_identify_qsfp_module()
1083 hw->phy.type = txgbe_phy_sfp_unsupported; in txgbe_identify_qsfp_module()
1089 if (hw->phy.sfp_type != stored_sfp_type) in txgbe_identify_qsfp_module()
1090 hw->phy.sfp_setup_needed = true; in txgbe_identify_qsfp_module()
1093 hw->phy.multispeed_fiber = false; in txgbe_identify_qsfp_module()
1098 hw->phy.multispeed_fiber = true; in txgbe_identify_qsfp_module()
1103 err = hw->phy.read_i2c_eeprom(hw, in txgbe_identify_qsfp_module()
1110 err = hw->phy.read_i2c_eeprom(hw, in txgbe_identify_qsfp_module()
1117 err = hw->phy.read_i2c_eeprom(hw, in txgbe_identify_qsfp_module()
1130 hw->phy.type = txgbe_phy_qsfp_intel; in txgbe_identify_qsfp_module()
1132 hw->phy.type = txgbe_phy_qsfp_unknown; in txgbe_identify_qsfp_module()
1137 if (hw->phy.type == txgbe_phy_qsfp_intel) { in txgbe_identify_qsfp_module()
1147 hw->phy.type = in txgbe_identify_qsfp_module()
1174 return hw->phy.read_i2c_byte(hw, byte_offset, in txgbe_read_i2c_eeprom()
1190 return hw->phy.read_i2c_byte(hw, byte_offset, in txgbe_read_i2c_sff8472()
1208 return hw->phy.write_i2c_byte(hw, byte_offset, in txgbe_write_i2c_eeprom()
1269 u32 swfw_mask = hw->phy.phy_semaphore_mask; in txgbe_read_i2c_byte()
1330 u32 swfw_mask = hw->phy.phy_semaphore_mask; in txgbe_write_i2c_byte()
1980 if (hw->phy.sfp_type == txgbe_sfp_type_da_cu_core0 || in txgbe_set_link_to_sfi()
1981 hw->phy.sfp_type == txgbe_sfp_type_da_cu_core1) { in txgbe_set_link_to_sfi()
2003 if (hw->phy.sfp_type == txgbe_sfp_type_da_cu_core0 || in txgbe_set_link_to_sfi()
2004 hw->phy.sfp_type == txgbe_sfp_type_da_cu_core1) { in txgbe_set_link_to_sfi()
2058 if (hw->phy.sfp_type == txgbe_sfp_type_da_cu_core0 || in txgbe_set_link_to_sfi()
2059 hw->phy.sfp_type == txgbe_sfp_type_da_cu_core1) { in txgbe_set_link_to_sfi()
2130 if (hw->phy.multispeed_fiber) { in txgbe_autoc_read()
2141 hw->phy.link_mode = TXGBE_PHYSICAL_LAYER_10GBASE_T; in txgbe_autoc_read()
2144 hw->phy.link_mode = TXGBE_PHYSICAL_LAYER_1000BASE_T | in txgbe_autoc_read()
2162 hw->phy.link_mode = TXGBE_PHYSICAL_LAYER_1000BASE_KX; in txgbe_autoc_read()
2169 hw->phy.link_mode = TXGBE_PHYSICAL_LAYER_10GBASE_KX4; in txgbe_autoc_read()
2176 hw->phy.link_mode = TXGBE_PHYSICAL_LAYER_10GBASE_KR; in txgbe_autoc_read()
2186 hw->phy.link_mode = TXGBE_PHYSICAL_LAYER_10GBASE_KR | in txgbe_autoc_read()
2212 switch (hw->phy.link_mode) { in txgbe_autoc_write()