Lines Matching full:hw

48 static s32  e1000_init_phy_params_82540(struct e1000_hw *hw);
49 static s32 e1000_init_nvm_params_82540(struct e1000_hw *hw);
50 static s32 e1000_init_mac_params_82540(struct e1000_hw *hw);
51 static s32 e1000_adjust_serdes_amplitude_82540(struct e1000_hw *hw);
52 static void e1000_clear_hw_cntrs_82540(struct e1000_hw *hw);
53 static s32 e1000_init_hw_82540(struct e1000_hw *hw);
54 static s32 e1000_reset_hw_82540(struct e1000_hw *hw);
55 static s32 e1000_set_phy_mode_82540(struct e1000_hw *hw);
56 static s32 e1000_set_vco_speed_82540(struct e1000_hw *hw);
57 static s32 e1000_setup_copper_link_82540(struct e1000_hw *hw);
58 static s32 e1000_setup_fiber_serdes_link_82540(struct e1000_hw *hw);
59 static void e1000_power_down_phy_copper_82540(struct e1000_hw *hw);
60 static s32 e1000_read_mac_addr_82540(struct e1000_hw *hw);
64 * @hw: pointer to the HW structure
66 static s32 e1000_init_phy_params_82540(struct e1000_hw *hw) in e1000_init_phy_params_82540() argument
68 struct e1000_phy_info *phy = &hw->phy; in e1000_init_phy_params_82540()
89 ret_val = e1000_get_phy_id(hw); in e1000_init_phy_params_82540()
94 switch (hw->mac.type) { in e1000_init_phy_params_82540()
115 * @hw: pointer to the HW structure
117 static s32 e1000_init_nvm_params_82540(struct e1000_hw *hw) in e1000_init_nvm_params_82540() argument
119 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_init_nvm_params_82540()
120 u32 eecd = E1000_READ_REG(hw, E1000_EECD); in e1000_init_nvm_params_82540()
156 * @hw: pointer to the HW structure
158 static s32 e1000_init_mac_params_82540(struct e1000_hw *hw) in e1000_init_mac_params_82540() argument
160 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_82540()
166 switch (hw->device_id) { in e1000_init_mac_params_82540()
171 hw->phy.media_type = e1000_media_type_fiber; in e1000_init_mac_params_82540()
175 hw->phy.media_type = e1000_media_type_internal_serdes; in e1000_init_mac_params_82540()
178 hw->phy.media_type = e1000_media_type_copper; in e1000_init_mac_params_82540()
195 /* hw initialization */ in e1000_init_mac_params_82540()
201 (hw->phy.media_type == e1000_media_type_copper) in e1000_init_mac_params_82540()
205 switch (hw->phy.media_type) { in e1000_init_mac_params_82540()
222 (hw->phy.media_type == e1000_media_type_copper) in e1000_init_mac_params_82540()
251 * @hw: pointer to the HW structure
255 void e1000_init_function_pointers_82540(struct e1000_hw *hw) in e1000_init_function_pointers_82540() argument
259 hw->mac.ops.init_params = e1000_init_mac_params_82540; in e1000_init_function_pointers_82540()
260 hw->nvm.ops.init_params = e1000_init_nvm_params_82540; in e1000_init_function_pointers_82540()
261 hw->phy.ops.init_params = e1000_init_phy_params_82540; in e1000_init_function_pointers_82540()
266 * @hw: pointer to the HW structure
270 static s32 e1000_reset_hw_82540(struct e1000_hw *hw) in e1000_reset_hw_82540() argument
278 E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); in e1000_reset_hw_82540()
280 E1000_WRITE_REG(hw, E1000_RCTL, 0); in e1000_reset_hw_82540()
281 E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); in e1000_reset_hw_82540()
282 E1000_WRITE_FLUSH(hw); in e1000_reset_hw_82540()
290 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_reset_hw_82540()
293 switch (hw->mac.type) { in e1000_reset_hw_82540()
296 E1000_WRITE_REG(hw, E1000_CTRL_DUP, ctrl | E1000_CTRL_RST); in e1000_reset_hw_82540()
304 E1000_WRITE_REG_IO(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); in e1000_reset_hw_82540()
311 /* Disable HW ARPs on ASF enabled adapters */ in e1000_reset_hw_82540()
312 manc = E1000_READ_REG(hw, E1000_MANC); in e1000_reset_hw_82540()
314 E1000_WRITE_REG(hw, E1000_MANC, manc); in e1000_reset_hw_82540()
316 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); in e1000_reset_hw_82540()
317 E1000_READ_REG(hw, E1000_ICR); in e1000_reset_hw_82540()
324 * @hw: pointer to the HW structure
328 static s32 e1000_init_hw_82540(struct e1000_hw *hw) in e1000_init_hw_82540() argument
330 struct e1000_mac_info *mac = &hw->mac; in e1000_init_hw_82540()
338 ret_val = mac->ops.id_led_init(hw); in e1000_init_hw_82540()
347 E1000_WRITE_REG(hw, E1000_VET, 0); in e1000_init_hw_82540()
349 mac->ops.clear_vfta(hw); in e1000_init_hw_82540()
352 e1000_init_rx_addrs_generic(hw, mac->rar_entry_count); in e1000_init_hw_82540()
357 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); in e1000_init_hw_82540()
366 E1000_WRITE_FLUSH(hw); in e1000_init_hw_82540()
370 e1000_pcix_mmrbc_workaround_generic(hw); in e1000_init_hw_82540()
373 ret_val = mac->ops.setup_link(hw); in e1000_init_hw_82540()
375 txdctl = E1000_READ_REG(hw, E1000_TXDCTL(0)); in e1000_init_hw_82540()
378 E1000_WRITE_REG(hw, E1000_TXDCTL(0), txdctl); in e1000_init_hw_82540()
386 e1000_clear_hw_cntrs_82540(hw); in e1000_init_hw_82540()
388 if ((hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER) || in e1000_init_hw_82540()
389 (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3)) { in e1000_init_hw_82540()
390 ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); in e1000_init_hw_82540()
396 E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); in e1000_init_hw_82540()
404 * @hw: pointer to the HW structure
411 static s32 e1000_setup_copper_link_82540(struct e1000_hw *hw) in e1000_setup_copper_link_82540() argument
419 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_setup_copper_link_82540()
422 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); in e1000_setup_copper_link_82540()
424 ret_val = e1000_set_phy_mode_82540(hw); in e1000_setup_copper_link_82540()
428 if (hw->mac.type == e1000_82545_rev_3 || in e1000_setup_copper_link_82540()
429 hw->mac.type == e1000_82546_rev_3) { in e1000_setup_copper_link_82540()
430 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, in e1000_setup_copper_link_82540()
435 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, in e1000_setup_copper_link_82540()
441 ret_val = e1000_copper_link_setup_m88(hw); in e1000_setup_copper_link_82540()
445 ret_val = e1000_setup_copper_link_generic(hw); in e1000_setup_copper_link_82540()
453 * @hw: pointer to the HW structure
460 static s32 e1000_setup_fiber_serdes_link_82540(struct e1000_hw *hw) in e1000_setup_fiber_serdes_link_82540() argument
462 struct e1000_mac_info *mac = &hw->mac; in e1000_setup_fiber_serdes_link_82540()
470 if (hw->phy.media_type == e1000_media_type_internal_serdes) { in e1000_setup_fiber_serdes_link_82540()
475 ret_val = e1000_adjust_serdes_amplitude_82540(hw); in e1000_setup_fiber_serdes_link_82540()
480 ret_val = e1000_set_vco_speed_82540(hw); in e1000_setup_fiber_serdes_link_82540()
487 ret_val = e1000_setup_fiber_serdes_link_generic(hw); in e1000_setup_fiber_serdes_link_82540()
495 * @hw: pointer to the HW structure
499 static s32 e1000_adjust_serdes_amplitude_82540(struct e1000_hw *hw) in e1000_adjust_serdes_amplitude_82540() argument
506 ret_val = hw->nvm.ops.read(hw, NVM_SERDES_AMPLITUDE, 1, &nvm_data); in e1000_adjust_serdes_amplitude_82540()
513 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_EXT_CTRL, in e1000_adjust_serdes_amplitude_82540()
525 * @hw: pointer to the HW structure
529 static s32 e1000_set_vco_speed_82540(struct e1000_hw *hw) in e1000_set_vco_speed_82540() argument
539 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_PAGE_SELECT, in e1000_set_vco_speed_82540()
544 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0005); in e1000_set_vco_speed_82540()
548 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_GEN_CONTROL, &phy_data); in e1000_set_vco_speed_82540()
553 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, phy_data); in e1000_set_vco_speed_82540()
559 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0004); in e1000_set_vco_speed_82540()
563 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_GEN_CONTROL, &phy_data); in e1000_set_vco_speed_82540()
568 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, phy_data); in e1000_set_vco_speed_82540()
572 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, in e1000_set_vco_speed_82540()
581 * @hw: pointer to the HW structure
588 static s32 e1000_set_phy_mode_82540(struct e1000_hw *hw) in e1000_set_phy_mode_82540() argument
595 if (hw->mac.type != e1000_82545_rev_3) in e1000_set_phy_mode_82540()
598 ret_val = hw->nvm.ops.read(hw, NVM_PHY_CLASS_WORD, 1, &nvm_data); in e1000_set_phy_mode_82540()
605 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, in e1000_set_phy_mode_82540()
611 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, in e1000_set_phy_mode_82540()
626 * @hw: pointer to the HW structure
631 static void e1000_power_down_phy_copper_82540(struct e1000_hw *hw) in e1000_power_down_phy_copper_82540() argument
634 if (!(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_SMBUS_EN)) in e1000_power_down_phy_copper_82540()
635 e1000_power_down_phy_copper(hw); in e1000_power_down_phy_copper_82540()
642 * @hw: pointer to the HW structure
646 static void e1000_clear_hw_cntrs_82540(struct e1000_hw *hw) in e1000_clear_hw_cntrs_82540() argument
650 e1000_clear_hw_cntrs_base_generic(hw); in e1000_clear_hw_cntrs_82540()
652 E1000_READ_REG(hw, E1000_PRC64); in e1000_clear_hw_cntrs_82540()
653 E1000_READ_REG(hw, E1000_PRC127); in e1000_clear_hw_cntrs_82540()
654 E1000_READ_REG(hw, E1000_PRC255); in e1000_clear_hw_cntrs_82540()
655 E1000_READ_REG(hw, E1000_PRC511); in e1000_clear_hw_cntrs_82540()
656 E1000_READ_REG(hw, E1000_PRC1023); in e1000_clear_hw_cntrs_82540()
657 E1000_READ_REG(hw, E1000_PRC1522); in e1000_clear_hw_cntrs_82540()
658 E1000_READ_REG(hw, E1000_PTC64); in e1000_clear_hw_cntrs_82540()
659 E1000_READ_REG(hw, E1000_PTC127); in e1000_clear_hw_cntrs_82540()
660 E1000_READ_REG(hw, E1000_PTC255); in e1000_clear_hw_cntrs_82540()
661 E1000_READ_REG(hw, E1000_PTC511); in e1000_clear_hw_cntrs_82540()
662 E1000_READ_REG(hw, E1000_PTC1023); in e1000_clear_hw_cntrs_82540()
663 E1000_READ_REG(hw, E1000_PTC1522); in e1000_clear_hw_cntrs_82540()
665 E1000_READ_REG(hw, E1000_ALGNERRC); in e1000_clear_hw_cntrs_82540()
666 E1000_READ_REG(hw, E1000_RXERRC); in e1000_clear_hw_cntrs_82540()
667 E1000_READ_REG(hw, E1000_TNCRS); in e1000_clear_hw_cntrs_82540()
668 E1000_READ_REG(hw, E1000_CEXTERR); in e1000_clear_hw_cntrs_82540()
669 E1000_READ_REG(hw, E1000_TSCTC); in e1000_clear_hw_cntrs_82540()
670 E1000_READ_REG(hw, E1000_TSCTFC); in e1000_clear_hw_cntrs_82540()
672 E1000_READ_REG(hw, E1000_MGTPRC); in e1000_clear_hw_cntrs_82540()
673 E1000_READ_REG(hw, E1000_MGTPDC); in e1000_clear_hw_cntrs_82540()
674 E1000_READ_REG(hw, E1000_MGTPTC); in e1000_clear_hw_cntrs_82540()
679 * @hw: pointer to the HW structure
691 s32 e1000_read_mac_addr_82540(struct e1000_hw *hw) in e1000_read_mac_addr_82540() argument
700 ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); in e1000_read_mac_addr_82540()
705 hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); in e1000_read_mac_addr_82540()
706 hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); in e1000_read_mac_addr_82540()
710 if (hw->bus.func == E1000_FUNC_1) in e1000_read_mac_addr_82540()
711 hw->mac.perm_addr[5] ^= 1; in e1000_read_mac_addr_82540()
714 hw->mac.addr[i] = hw->mac.perm_addr[i]; in e1000_read_mac_addr_82540()