Lines Matching full:hw
46 static s32 e1000_init_phy_params_82541(struct e1000_hw *hw);
47 static s32 e1000_init_nvm_params_82541(struct e1000_hw *hw);
48 static s32 e1000_init_mac_params_82541(struct e1000_hw *hw);
49 static s32 e1000_reset_hw_82541(struct e1000_hw *hw);
50 static s32 e1000_init_hw_82541(struct e1000_hw *hw);
51 static s32 e1000_get_link_up_info_82541(struct e1000_hw *hw, u16 *speed,
53 static s32 e1000_phy_hw_reset_82541(struct e1000_hw *hw);
54 static s32 e1000_setup_copper_link_82541(struct e1000_hw *hw);
55 static s32 e1000_check_for_link_82541(struct e1000_hw *hw);
56 static s32 e1000_get_cable_length_igp_82541(struct e1000_hw *hw);
57 static s32 e1000_set_d3_lplu_state_82541(struct e1000_hw *hw,
59 static s32 e1000_setup_led_82541(struct e1000_hw *hw);
60 static s32 e1000_cleanup_led_82541(struct e1000_hw *hw);
61 static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw);
62 static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw);
63 static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw,
65 static s32 e1000_phy_init_script_82541(struct e1000_hw *hw);
66 static void e1000_power_down_phy_copper_82541(struct e1000_hw *hw);
83 * @hw: pointer to the HW structure
85 static s32 e1000_init_phy_params_82541(struct e1000_hw *hw) in e1000_init_phy_params_82541() argument
87 struct e1000_phy_info *phy = &hw->phy; in e1000_init_phy_params_82541()
110 ret_val = e1000_get_phy_id(hw); in e1000_init_phy_params_82541()
126 * @hw: pointer to the HW structure
128 static s32 e1000_init_nvm_params_82541(struct e1000_hw *hw) in e1000_init_nvm_params_82541() argument
130 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_init_nvm_params_82541()
132 u32 eecd = E1000_READ_REG(hw, E1000_EECD); in e1000_init_nvm_params_82541()
182 ret_val = nvm->ops.read(hw, NVM_CFG, 1, &size); in e1000_init_nvm_params_82541()
217 * @hw: pointer to the HW structure
219 static s32 e1000_init_mac_params_82541(struct e1000_hw *hw) in e1000_init_mac_params_82541() argument
221 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_82541()
226 hw->phy.media_type = e1000_media_type_copper; in e1000_init_mac_params_82541()
242 /* hw initialization */ in e1000_init_mac_params_82541()
277 * @hw: pointer to the HW structure
281 void e1000_init_function_pointers_82541(struct e1000_hw *hw) in e1000_init_function_pointers_82541() argument
285 hw->mac.ops.init_params = e1000_init_mac_params_82541; in e1000_init_function_pointers_82541()
286 hw->nvm.ops.init_params = e1000_init_nvm_params_82541; in e1000_init_function_pointers_82541()
287 hw->phy.ops.init_params = e1000_init_phy_params_82541; in e1000_init_function_pointers_82541()
292 * @hw: pointer to the HW structure
296 static s32 e1000_reset_hw_82541(struct e1000_hw *hw) in e1000_reset_hw_82541() argument
303 E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); in e1000_reset_hw_82541()
305 E1000_WRITE_REG(hw, E1000_RCTL, 0); in e1000_reset_hw_82541()
306 E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); in e1000_reset_hw_82541()
307 E1000_WRITE_FLUSH(hw); in e1000_reset_hw_82541()
315 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_reset_hw_82541()
318 if ((hw->mac.type == e1000_82541) || (hw->mac.type == e1000_82547)) { in e1000_reset_hw_82541()
319 E1000_WRITE_REG(hw, E1000_CTRL, (ctrl | E1000_CTRL_PHY_RST)); in e1000_reset_hw_82541()
320 E1000_WRITE_FLUSH(hw); in e1000_reset_hw_82541()
325 switch (hw->mac.type) { in e1000_reset_hw_82541()
333 E1000_WRITE_REG_IO(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); in e1000_reset_hw_82541()
336 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); in e1000_reset_hw_82541()
343 /* Disable HW ARPs on ASF enabled adapters */ in e1000_reset_hw_82541()
344 manc = E1000_READ_REG(hw, E1000_MANC); in e1000_reset_hw_82541()
346 E1000_WRITE_REG(hw, E1000_MANC, manc); in e1000_reset_hw_82541()
348 if ((hw->mac.type == e1000_82541) || (hw->mac.type == e1000_82547)) { in e1000_reset_hw_82541()
349 e1000_phy_init_script_82541(hw); in e1000_reset_hw_82541()
352 ledctl = E1000_READ_REG(hw, E1000_LEDCTL); in e1000_reset_hw_82541()
355 E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl); in e1000_reset_hw_82541()
360 E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); in e1000_reset_hw_82541()
363 E1000_READ_REG(hw, E1000_ICR); in e1000_reset_hw_82541()
370 * @hw: pointer to the HW structure
374 static s32 e1000_init_hw_82541(struct e1000_hw *hw) in e1000_init_hw_82541() argument
376 struct e1000_mac_info *mac = &hw->mac; in e1000_init_hw_82541()
377 struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; in e1000_init_hw_82541()
384 ret_val = mac->ops.id_led_init(hw); in e1000_init_hw_82541()
391 ret_val = hw->phy.ops.read_reg(hw, IGP01E1000_GMII_FIFO, in e1000_init_hw_82541()
398 mac->ops.clear_vfta(hw); in e1000_init_hw_82541()
401 e1000_init_rx_addrs_generic(hw, mac->rar_entry_count); in e1000_init_hw_82541()
406 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); in e1000_init_hw_82541()
413 E1000_WRITE_FLUSH(hw); in e1000_init_hw_82541()
417 ret_val = mac->ops.setup_link(hw); in e1000_init_hw_82541()
419 txdctl = E1000_READ_REG(hw, E1000_TXDCTL(0)); in e1000_init_hw_82541()
422 E1000_WRITE_REG(hw, E1000_TXDCTL(0), txdctl); in e1000_init_hw_82541()
430 e1000_clear_hw_cntrs_82541(hw); in e1000_init_hw_82541()
438 * @hw: pointer to the HW structure
444 static s32 e1000_get_link_up_info_82541(struct e1000_hw *hw, u16 *speed, in e1000_get_link_up_info_82541() argument
447 struct e1000_phy_info *phy = &hw->phy; in e1000_get_link_up_info_82541()
453 ret_val = e1000_get_speed_and_duplex_copper_generic(hw, speed, duplex); in e1000_get_link_up_info_82541()
466 ret_val = phy->ops.read_reg(hw, PHY_AUTONEG_EXP, &data); in e1000_get_link_up_info_82541()
473 ret_val = phy->ops.read_reg(hw, PHY_LP_ABILITY, &data); in e1000_get_link_up_info_82541()
492 * @hw: pointer to the HW structure
499 static s32 e1000_phy_hw_reset_82541(struct e1000_hw *hw) in e1000_phy_hw_reset_82541() argument
506 ret_val = e1000_phy_hw_reset_generic(hw); in e1000_phy_hw_reset_82541()
510 e1000_phy_init_script_82541(hw); in e1000_phy_hw_reset_82541()
512 if ((hw->mac.type == e1000_82541) || (hw->mac.type == e1000_82547)) { in e1000_phy_hw_reset_82541()
514 ledctl = E1000_READ_REG(hw, E1000_LEDCTL); in e1000_phy_hw_reset_82541()
517 E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl); in e1000_phy_hw_reset_82541()
526 * @hw: pointer to the HW structure
533 static s32 e1000_setup_copper_link_82541(struct e1000_hw *hw) in e1000_setup_copper_link_82541() argument
535 struct e1000_phy_info *phy = &hw->phy; in e1000_setup_copper_link_82541()
536 struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; in e1000_setup_copper_link_82541()
542 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_setup_copper_link_82541()
545 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_setup_copper_link_82541()
549 if (hw->mac.type == e1000_82541 || hw->mac.type == e1000_82547) { in e1000_setup_copper_link_82541()
556 ret_val = e1000_copper_link_setup_igp(hw); in e1000_setup_copper_link_82541()
560 if (hw->mac.autoneg) { in e1000_setup_copper_link_82541()
566 ledctl = E1000_READ_REG(hw, E1000_LEDCTL); in e1000_setup_copper_link_82541()
569 E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl); in e1000_setup_copper_link_82541()
571 ret_val = e1000_setup_copper_link_generic(hw); in e1000_setup_copper_link_82541()
579 * @hw: pointer to the HW structure
582 * results in the hw->mac structure.
584 static s32 e1000_check_for_link_82541(struct e1000_hw *hw) in e1000_check_for_link_82541() argument
586 struct e1000_mac_info *mac = &hw->mac; in e1000_check_for_link_82541()
608 ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link); in e1000_check_for_link_82541()
613 ret_val = e1000_config_dsp_after_link_change_82541(hw, false); in e1000_check_for_link_82541()
623 e1000_check_downshift_generic(hw); in e1000_check_for_link_82541()
634 ret_val = e1000_config_dsp_after_link_change_82541(hw, true); in e1000_check_for_link_82541()
641 mac->ops.config_collision_dist(hw); in e1000_check_for_link_82541()
649 ret_val = e1000_config_fc_after_link_up_generic(hw); in e1000_check_for_link_82541()
659 * @hw: pointer to the HW structure
668 static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw, in e1000_config_dsp_after_link_change_82541() argument
671 struct e1000_phy_info *phy = &hw->phy; in e1000_config_dsp_after_link_change_82541()
672 struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; in e1000_config_dsp_after_link_change_82541()
686 ret_val = hw->mac.ops.get_link_up_info(hw, &speed, &duplex); in e1000_config_dsp_after_link_change_82541()
697 ret_val = phy->ops.get_cable_length(hw); in e1000_config_dsp_after_link_change_82541()
705 ret_val = phy->ops.read_reg(hw, in e1000_config_dsp_after_link_change_82541()
713 ret_val = phy->ops.write_reg(hw, in e1000_config_dsp_after_link_change_82541()
729 ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &phy_data); in e1000_config_dsp_after_link_change_82541()
735 ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, in e1000_config_dsp_after_link_change_82541()
744 ret_val = phy->ops.write_reg(hw, in e1000_config_dsp_after_link_change_82541()
762 ret_val = phy->ops.read_reg(hw, 0x2F5B, in e1000_config_dsp_after_link_change_82541()
768 ret_val = phy->ops.write_reg(hw, 0x2F5B, 0x0003); in e1000_config_dsp_after_link_change_82541()
774 ret_val = phy->ops.write_reg(hw, 0x0000, in e1000_config_dsp_after_link_change_82541()
779 ret_val = phy->ops.read_reg(hw, in e1000_config_dsp_after_link_change_82541()
788 ret_val = phy->ops.write_reg(hw, in e1000_config_dsp_after_link_change_82541()
795 ret_val = phy->ops.write_reg(hw, 0x0000, in e1000_config_dsp_after_link_change_82541()
803 ret_val = phy->ops.write_reg(hw, 0x2F5B, in e1000_config_dsp_after_link_change_82541()
820 ret_val = phy->ops.read_reg(hw, 0x2F5B, &phy_saved_data); in e1000_config_dsp_after_link_change_82541()
825 ret_val = phy->ops.write_reg(hw, 0x2F5B, 0x0003); in e1000_config_dsp_after_link_change_82541()
831 ret_val = phy->ops.write_reg(hw, 0x0000, in e1000_config_dsp_after_link_change_82541()
836 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_DSP_FFE, in e1000_config_dsp_after_link_change_82541()
841 ret_val = phy->ops.write_reg(hw, 0x0000, in e1000_config_dsp_after_link_change_82541()
849 ret_val = phy->ops.write_reg(hw, 0x2F5B, phy_saved_data); in e1000_config_dsp_after_link_change_82541()
863 * @hw: pointer to the HW structure
872 static s32 e1000_get_cable_length_igp_82541(struct e1000_hw *hw) in e1000_get_cable_length_igp_82541() argument
874 struct e1000_phy_info *phy = &hw->phy; in e1000_get_cable_length_igp_82541()
888 ret_val = phy->ops.read_reg(hw, agc_reg_array[i], &data); in e1000_get_cable_length_igp_82541()
933 * @hw: pointer to the HW structure
945 static s32 e1000_set_d3_lplu_state_82541(struct e1000_hw *hw, bool active) in e1000_set_d3_lplu_state_82541() argument
947 struct e1000_phy_info *phy = &hw->phy; in e1000_set_d3_lplu_state_82541()
953 switch (hw->mac.type) { in e1000_set_d3_lplu_state_82541()
958 ret_val = e1000_set_d3_lplu_state_generic(hw, active); in e1000_set_d3_lplu_state_82541()
963 ret_val = phy->ops.read_reg(hw, IGP01E1000_GMII_FIFO, &data); in e1000_set_d3_lplu_state_82541()
969 ret_val = phy->ops.write_reg(hw, IGP01E1000_GMII_FIFO, data); in e1000_set_d3_lplu_state_82541()
980 ret_val = phy->ops.read_reg(hw, in e1000_set_d3_lplu_state_82541()
987 ret_val = phy->ops.write_reg(hw, in e1000_set_d3_lplu_state_82541()
993 ret_val = phy->ops.read_reg(hw, in e1000_set_d3_lplu_state_82541()
1000 ret_val = phy->ops.write_reg(hw, in e1000_set_d3_lplu_state_82541()
1010 ret_val = phy->ops.write_reg(hw, IGP01E1000_GMII_FIFO, data); in e1000_set_d3_lplu_state_82541()
1015 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000_set_d3_lplu_state_82541()
1021 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in e1000_set_d3_lplu_state_82541()
1031 * @hw: pointer to the HW structure
1036 static s32 e1000_setup_led_82541(struct e1000_hw *hw) in e1000_setup_led_82541() argument
1038 struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; in e1000_setup_led_82541()
1043 ret_val = hw->phy.ops.read_reg(hw, IGP01E1000_GMII_FIFO, in e1000_setup_led_82541()
1048 ret_val = hw->phy.ops.write_reg(hw, IGP01E1000_GMII_FIFO, in e1000_setup_led_82541()
1054 E1000_WRITE_REG(hw, E1000_LEDCTL, hw->mac.ledctl_mode1); in e1000_setup_led_82541()
1062 * @hw: pointer to the HW structure
1067 static s32 e1000_cleanup_led_82541(struct e1000_hw *hw) in e1000_cleanup_led_82541() argument
1069 struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; in e1000_cleanup_led_82541()
1074 ret_val = hw->phy.ops.write_reg(hw, IGP01E1000_GMII_FIFO, in e1000_cleanup_led_82541()
1079 E1000_WRITE_REG(hw, E1000_LEDCTL, hw->mac.ledctl_default); in e1000_cleanup_led_82541()
1087 * @hw: pointer to the HW structure
1091 static s32 e1000_phy_init_script_82541(struct e1000_hw *hw) in e1000_phy_init_script_82541() argument
1093 struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; in e1000_phy_init_script_82541()
1111 ret_val = hw->phy.ops.read_reg(hw, 0x2F5B, &phy_saved_data); in e1000_phy_init_script_82541()
1114 hw->phy.ops.write_reg(hw, 0x2F5B, 0x0003); in e1000_phy_init_script_82541()
1118 hw->phy.ops.write_reg(hw, 0x0000, 0x0140); in e1000_phy_init_script_82541()
1122 switch (hw->mac.type) { in e1000_phy_init_script_82541()
1125 hw->phy.ops.write_reg(hw, 0x1F95, 0x0001); in e1000_phy_init_script_82541()
1127 hw->phy.ops.write_reg(hw, 0x1F71, 0xBD21); in e1000_phy_init_script_82541()
1129 hw->phy.ops.write_reg(hw, 0x1F79, 0x0018); in e1000_phy_init_script_82541()
1131 hw->phy.ops.write_reg(hw, 0x1F30, 0x1600); in e1000_phy_init_script_82541()
1133 hw->phy.ops.write_reg(hw, 0x1F31, 0x0014); in e1000_phy_init_script_82541()
1135 hw->phy.ops.write_reg(hw, 0x1F32, 0x161C); in e1000_phy_init_script_82541()
1137 hw->phy.ops.write_reg(hw, 0x1F94, 0x0003); in e1000_phy_init_script_82541()
1139 hw->phy.ops.write_reg(hw, 0x1F96, 0x003F); in e1000_phy_init_script_82541()
1141 hw->phy.ops.write_reg(hw, 0x2010, 0x0008); in e1000_phy_init_script_82541()
1145 hw->phy.ops.write_reg(hw, 0x1F73, 0x0099); in e1000_phy_init_script_82541()
1151 hw->phy.ops.write_reg(hw, 0x0000, 0x3300); in e1000_phy_init_script_82541()
1156 hw->phy.ops.write_reg(hw, 0x2F5B, phy_saved_data); in e1000_phy_init_script_82541()
1158 if (hw->mac.type == e1000_82547) { in e1000_phy_init_script_82541()
1162 hw->phy.ops.read_reg(hw, IGP01E1000_ANALOG_SPARE_FUSE_STATUS, in e1000_phy_init_script_82541()
1166 hw->phy.ops.read_reg(hw, IGP01E1000_ANALOG_FUSE_STATUS, in e1000_phy_init_script_82541()
1183 hw->phy.ops.write_reg(hw, in e1000_phy_init_script_82541()
1186 hw->phy.ops.write_reg(hw, in e1000_phy_init_script_82541()
1198 * @hw: pointer to the HW structure
1204 void e1000_init_script_state_82541(struct e1000_hw *hw, bool state) in e1000_init_script_state_82541() argument
1206 struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; in e1000_init_script_state_82541()
1210 if (hw->phy.type != e1000_phy_igp) { in e1000_init_script_state_82541()
1223 * @hw: pointer to the HW structure
1228 static void e1000_power_down_phy_copper_82541(struct e1000_hw *hw) in e1000_power_down_phy_copper_82541() argument
1231 if (!(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_SMBUS_EN)) in e1000_power_down_phy_copper_82541()
1232 e1000_power_down_phy_copper(hw); in e1000_power_down_phy_copper_82541()
1239 * @hw: pointer to the HW structure
1243 static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw) in e1000_clear_hw_cntrs_82541() argument
1247 e1000_clear_hw_cntrs_base_generic(hw); in e1000_clear_hw_cntrs_82541()
1249 E1000_READ_REG(hw, E1000_PRC64); in e1000_clear_hw_cntrs_82541()
1250 E1000_READ_REG(hw, E1000_PRC127); in e1000_clear_hw_cntrs_82541()
1251 E1000_READ_REG(hw, E1000_PRC255); in e1000_clear_hw_cntrs_82541()
1252 E1000_READ_REG(hw, E1000_PRC511); in e1000_clear_hw_cntrs_82541()
1253 E1000_READ_REG(hw, E1000_PRC1023); in e1000_clear_hw_cntrs_82541()
1254 E1000_READ_REG(hw, E1000_PRC1522); in e1000_clear_hw_cntrs_82541()
1255 E1000_READ_REG(hw, E1000_PTC64); in e1000_clear_hw_cntrs_82541()
1256 E1000_READ_REG(hw, E1000_PTC127); in e1000_clear_hw_cntrs_82541()
1257 E1000_READ_REG(hw, E1000_PTC255); in e1000_clear_hw_cntrs_82541()
1258 E1000_READ_REG(hw, E1000_PTC511); in e1000_clear_hw_cntrs_82541()
1259 E1000_READ_REG(hw, E1000_PTC1023); in e1000_clear_hw_cntrs_82541()
1260 E1000_READ_REG(hw, E1000_PTC1522); in e1000_clear_hw_cntrs_82541()
1262 E1000_READ_REG(hw, E1000_ALGNERRC); in e1000_clear_hw_cntrs_82541()
1263 E1000_READ_REG(hw, E1000_RXERRC); in e1000_clear_hw_cntrs_82541()
1264 E1000_READ_REG(hw, E1000_TNCRS); in e1000_clear_hw_cntrs_82541()
1265 E1000_READ_REG(hw, E1000_CEXTERR); in e1000_clear_hw_cntrs_82541()
1266 E1000_READ_REG(hw, E1000_TSCTC); in e1000_clear_hw_cntrs_82541()
1267 E1000_READ_REG(hw, E1000_TSCTFC); in e1000_clear_hw_cntrs_82541()
1269 E1000_READ_REG(hw, E1000_MGTPRC); in e1000_clear_hw_cntrs_82541()
1270 E1000_READ_REG(hw, E1000_MGTPDC); in e1000_clear_hw_cntrs_82541()
1271 E1000_READ_REG(hw, E1000_MGTPTC); in e1000_clear_hw_cntrs_82541()
1276 * @hw: pointer to the HW structure
1280 static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw) in e1000_read_mac_addr_82541() argument
1289 ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); in e1000_read_mac_addr_82541()
1294 hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); in e1000_read_mac_addr_82541()
1295 hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); in e1000_read_mac_addr_82541()
1299 hw->mac.addr[i] = hw->mac.perm_addr[i]; in e1000_read_mac_addr_82541()