.. | .. |
---|
271 | 271 | u16 count = 20; |
---|
272 | 272 | |
---|
273 | 273 | do { |
---|
274 | | - usleep_range(5000, 10000); |
---|
| 274 | + usleep_range(5000, 6000); |
---|
275 | 275 | } while (!(er32(CTRL_EXT) & E1000_CTRL_EXT_LPCD) && count--); |
---|
276 | 276 | |
---|
277 | 277 | msleep(30); |
---|
.. | .. |
---|
300 | 300 | * so forcibly disable it. |
---|
301 | 301 | */ |
---|
302 | 302 | hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_unknown; |
---|
303 | | - e1000_disable_ulp_lpt_lp(hw, true); |
---|
| 303 | + ret_val = e1000_disable_ulp_lpt_lp(hw, true); |
---|
| 304 | + if (ret_val) |
---|
| 305 | + e_warn("Failed to disable ULP\n"); |
---|
304 | 306 | |
---|
305 | 307 | ret_val = hw->phy.ops.acquire(hw); |
---|
306 | 308 | if (ret_val) { |
---|
.. | .. |
---|
316 | 318 | case e1000_pch_lpt: |
---|
317 | 319 | case e1000_pch_spt: |
---|
318 | 320 | case e1000_pch_cnp: |
---|
| 321 | + case e1000_pch_tgp: |
---|
| 322 | + case e1000_pch_adp: |
---|
| 323 | + case e1000_pch_mtp: |
---|
319 | 324 | if (e1000_phy_is_accessible_pchlan(hw)) |
---|
320 | 325 | break; |
---|
321 | 326 | |
---|
.. | .. |
---|
332 | 337 | */ |
---|
333 | 338 | msleep(50); |
---|
334 | 339 | |
---|
335 | | - /* fall-through */ |
---|
| 340 | + fallthrough; |
---|
336 | 341 | case e1000_pch2lan: |
---|
337 | 342 | if (e1000_phy_is_accessible_pchlan(hw)) |
---|
338 | 343 | break; |
---|
339 | 344 | |
---|
340 | | - /* fall-through */ |
---|
| 345 | + fallthrough; |
---|
341 | 346 | case e1000_pchlan: |
---|
342 | 347 | if ((hw->mac.type == e1000_pchlan) && |
---|
343 | 348 | (fwsm & E1000_ICH_FWSM_FW_VALID)) |
---|
.. | .. |
---|
405 | 410 | /* Ungate automatic PHY configuration on non-managed 82579 */ |
---|
406 | 411 | if ((hw->mac.type == e1000_pch2lan) && |
---|
407 | 412 | !(fwsm & E1000_ICH_FWSM_FW_VALID)) { |
---|
408 | | - usleep_range(10000, 20000); |
---|
| 413 | + usleep_range(10000, 11000); |
---|
409 | 414 | e1000_gate_hw_phy_config_ich8lan(hw, false); |
---|
410 | 415 | } |
---|
411 | 416 | |
---|
.. | .. |
---|
453 | 458 | return ret_val; |
---|
454 | 459 | if ((phy->id != 0) && (phy->id != PHY_REVISION_MASK)) |
---|
455 | 460 | break; |
---|
456 | | - /* fall-through */ |
---|
| 461 | + fallthrough; |
---|
457 | 462 | case e1000_pch2lan: |
---|
458 | 463 | case e1000_pch_lpt: |
---|
459 | 464 | case e1000_pch_spt: |
---|
460 | 465 | case e1000_pch_cnp: |
---|
| 466 | + case e1000_pch_tgp: |
---|
| 467 | + case e1000_pch_adp: |
---|
| 468 | + case e1000_pch_mtp: |
---|
461 | 469 | /* In case the PHY needs to be in mdio slow mode, |
---|
462 | 470 | * set slow mode and try to get the PHY id again. |
---|
463 | 471 | */ |
---|
.. | .. |
---|
531 | 539 | phy->id = 0; |
---|
532 | 540 | while ((e1000_phy_unknown == e1000e_get_phy_type_from_id(phy->id)) && |
---|
533 | 541 | (i++ < 100)) { |
---|
534 | | - usleep_range(1000, 2000); |
---|
| 542 | + usleep_range(1000, 1100); |
---|
535 | 543 | ret_val = e1000e_get_phy_id(hw); |
---|
536 | 544 | if (ret_val) |
---|
537 | 545 | return ret_val; |
---|
.. | .. |
---|
696 | 704 | case e1000_pch2lan: |
---|
697 | 705 | mac->rar_entry_count = E1000_PCH2_RAR_ENTRIES; |
---|
698 | 706 | mac->ops.rar_set = e1000_rar_set_pch2lan; |
---|
699 | | - /* fall-through */ |
---|
| 707 | + fallthrough; |
---|
700 | 708 | case e1000_pch_lpt: |
---|
701 | 709 | case e1000_pch_spt: |
---|
702 | 710 | case e1000_pch_cnp: |
---|
| 711 | + case e1000_pch_tgp: |
---|
| 712 | + case e1000_pch_adp: |
---|
| 713 | + case e1000_pch_mtp: |
---|
703 | 714 | case e1000_pchlan: |
---|
704 | 715 | /* check management mode */ |
---|
705 | 716 | mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; |
---|
.. | .. |
---|
735 | 746 | /** |
---|
736 | 747 | * __e1000_access_emi_reg_locked - Read/write EMI register |
---|
737 | 748 | * @hw: pointer to the HW structure |
---|
738 | | - * @addr: EMI address to program |
---|
| 749 | + * @address: EMI address to program |
---|
739 | 750 | * @data: pointer to value to read/write from/to the EMI address |
---|
740 | 751 | * @read: boolean flag to indicate read or write |
---|
741 | 752 | * |
---|
.. | .. |
---|
995 | 1006 | { |
---|
996 | 1007 | u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) | |
---|
997 | 1008 | link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND; |
---|
998 | | - u16 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */ |
---|
999 | | - u16 lat_enc_d = 0; /* latency decoded */ |
---|
| 1009 | + u32 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */ |
---|
| 1010 | + u32 lat_enc_d = 0; /* latency decoded */ |
---|
1000 | 1011 | u16 lat_enc = 0; /* latency encoded */ |
---|
1001 | 1012 | |
---|
1002 | 1013 | if (link) { |
---|
.. | .. |
---|
1241 | 1252 | return 0; |
---|
1242 | 1253 | |
---|
1243 | 1254 | if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) { |
---|
| 1255 | + struct e1000_adapter *adapter = hw->adapter; |
---|
| 1256 | + bool firmware_bug = false; |
---|
| 1257 | + |
---|
1244 | 1258 | if (force) { |
---|
1245 | 1259 | /* Request ME un-configure ULP mode in the PHY */ |
---|
1246 | 1260 | mac_reg = er32(H2ME); |
---|
.. | .. |
---|
1249 | 1263 | ew32(H2ME, mac_reg); |
---|
1250 | 1264 | } |
---|
1251 | 1265 | |
---|
1252 | | - /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */ |
---|
| 1266 | + /* Poll up to 2.5 seconds for ME to clear ULP_CFG_DONE. |
---|
| 1267 | + * If this takes more than 1 second, show a warning indicating a |
---|
| 1268 | + * firmware bug |
---|
| 1269 | + */ |
---|
1253 | 1270 | while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) { |
---|
1254 | | - if (i++ == 30) { |
---|
| 1271 | + if (i++ == 250) { |
---|
1255 | 1272 | ret_val = -E1000_ERR_PHY; |
---|
1256 | 1273 | goto out; |
---|
1257 | 1274 | } |
---|
| 1275 | + if (i > 100 && !firmware_bug) |
---|
| 1276 | + firmware_bug = true; |
---|
1258 | 1277 | |
---|
1259 | | - usleep_range(10000, 20000); |
---|
| 1278 | + usleep_range(10000, 11000); |
---|
1260 | 1279 | } |
---|
1261 | | - e_dbg("ULP_CONFIG_DONE cleared after %dmsec\n", i * 10); |
---|
| 1280 | + if (firmware_bug) |
---|
| 1281 | + e_warn("ULP_CONFIG_DONE took %dmsec. This is a firmware bug\n", i * 10); |
---|
| 1282 | + else |
---|
| 1283 | + e_dbg("ULP_CONFIG_DONE cleared after %dmsec\n", i * 10); |
---|
1262 | 1284 | |
---|
1263 | 1285 | if (force) { |
---|
1264 | 1286 | mac_reg = er32(H2ME); |
---|
.. | .. |
---|
1561 | 1583 | ret_val = e1000_k1_workaround_lv(hw); |
---|
1562 | 1584 | if (ret_val) |
---|
1563 | 1585 | return ret_val; |
---|
1564 | | - /* fall-thru */ |
---|
| 1586 | + fallthrough; |
---|
1565 | 1587 | case e1000_pchlan: |
---|
1566 | 1588 | if (hw->phy.type == e1000_phy_82578) { |
---|
1567 | 1589 | ret_val = e1000_link_stall_workaround_hv(hw); |
---|
.. | .. |
---|
1650 | 1672 | case e1000_pch_lpt: |
---|
1651 | 1673 | case e1000_pch_spt: |
---|
1652 | 1674 | case e1000_pch_cnp: |
---|
| 1675 | + case e1000_pch_tgp: |
---|
| 1676 | + case e1000_pch_adp: |
---|
| 1677 | + case e1000_pch_mtp: |
---|
1653 | 1678 | rc = e1000_init_phy_params_pchlan(hw); |
---|
1654 | 1679 | break; |
---|
1655 | 1680 | default: |
---|
.. | .. |
---|
2021 | 2046 | |
---|
2022 | 2047 | while ((blocked = !(er32(FWSM) & E1000_ICH_FWSM_RSPCIPHY)) && |
---|
2023 | 2048 | (i++ < 30)) |
---|
2024 | | - usleep_range(10000, 20000); |
---|
| 2049 | + usleep_range(10000, 11000); |
---|
2025 | 2050 | return blocked ? E1000_BLK_PHY_RESET : 0; |
---|
2026 | 2051 | } |
---|
2027 | 2052 | |
---|
.. | .. |
---|
2096 | 2121 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; |
---|
2097 | 2122 | break; |
---|
2098 | 2123 | } |
---|
2099 | | - /* Fall-thru */ |
---|
| 2124 | + fallthrough; |
---|
2100 | 2125 | case e1000_pchlan: |
---|
2101 | 2126 | case e1000_pch2lan: |
---|
2102 | 2127 | case e1000_pch_lpt: |
---|
2103 | 2128 | case e1000_pch_spt: |
---|
2104 | 2129 | case e1000_pch_cnp: |
---|
| 2130 | + case e1000_pch_tgp: |
---|
| 2131 | + case e1000_pch_adp: |
---|
| 2132 | + case e1000_pch_mtp: |
---|
2105 | 2133 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; |
---|
2106 | 2134 | break; |
---|
2107 | 2135 | default: |
---|
.. | .. |
---|
2266 | 2294 | /** |
---|
2267 | 2295 | * e1000_configure_k1_ich8lan - Configure K1 power state |
---|
2268 | 2296 | * @hw: pointer to the HW structure |
---|
2269 | | - * @enable: K1 state to configure |
---|
| 2297 | + * @k1_enable: K1 state to configure |
---|
2270 | 2298 | * |
---|
2271 | 2299 | * Configure the K1 power state based on the provided parameter. |
---|
2272 | 2300 | * Assumes semaphore already acquired. |
---|
.. | .. |
---|
2405 | 2433 | } |
---|
2406 | 2434 | |
---|
2407 | 2435 | /** |
---|
2408 | | - * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be |
---|
2409 | | - * done after every PHY reset. |
---|
| 2436 | + * e1000_hv_phy_workarounds_ich8lan - apply PHY workarounds |
---|
| 2437 | + * @hw: pointer to the HW structure |
---|
| 2438 | + * |
---|
| 2439 | + * A series of PHY workarounds to be done after every PHY reset. |
---|
2410 | 2440 | **/ |
---|
2411 | 2441 | static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) |
---|
2412 | 2442 | { |
---|
.. | .. |
---|
2694 | 2724 | } |
---|
2695 | 2725 | |
---|
2696 | 2726 | /** |
---|
2697 | | - * e1000_lv_phy_workarounds_ich8lan - A series of Phy workarounds to be |
---|
2698 | | - * done after every PHY reset. |
---|
| 2727 | + * e1000_lv_phy_workarounds_ich8lan - apply ich8 specific workarounds |
---|
| 2728 | + * @hw: pointer to the HW structure |
---|
| 2729 | + * |
---|
| 2730 | + * A series of PHY workarounds to be done after every PHY reset. |
---|
2699 | 2731 | **/ |
---|
2700 | 2732 | static s32 e1000_lv_phy_workarounds_ich8lan(struct e1000_hw *hw) |
---|
2701 | 2733 | { |
---|
.. | .. |
---|
2840 | 2872 | return 0; |
---|
2841 | 2873 | |
---|
2842 | 2874 | /* Allow time for h/w to get to quiescent state after reset */ |
---|
2843 | | - usleep_range(10000, 20000); |
---|
| 2875 | + usleep_range(10000, 11000); |
---|
2844 | 2876 | |
---|
2845 | 2877 | /* Perform any necessary post-reset workarounds */ |
---|
2846 | 2878 | switch (hw->mac.type) { |
---|
.. | .. |
---|
2876 | 2908 | if (hw->mac.type == e1000_pch2lan) { |
---|
2877 | 2909 | /* Ungate automatic PHY configuration on non-managed 82579 */ |
---|
2878 | 2910 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { |
---|
2879 | | - usleep_range(10000, 20000); |
---|
| 2911 | + usleep_range(10000, 11000); |
---|
2880 | 2912 | e1000_gate_hw_phy_config_ich8lan(hw, false); |
---|
2881 | 2913 | } |
---|
2882 | 2914 | |
---|
.. | .. |
---|
3139 | 3171 | switch (hw->mac.type) { |
---|
3140 | 3172 | case e1000_pch_spt: |
---|
3141 | 3173 | case e1000_pch_cnp: |
---|
| 3174 | + case e1000_pch_tgp: |
---|
| 3175 | + case e1000_pch_adp: |
---|
| 3176 | + case e1000_pch_mtp: |
---|
3142 | 3177 | bank1_offset = nvm->flash_bank_size; |
---|
3143 | 3178 | act_offset = E1000_ICH_NVM_SIG_WORD; |
---|
3144 | 3179 | |
---|
.. | .. |
---|
3185 | 3220 | return 0; |
---|
3186 | 3221 | } |
---|
3187 | 3222 | e_dbg("Unable to determine valid NVM bank via EEC - reading flash signature\n"); |
---|
3188 | | - /* fall-thru */ |
---|
| 3223 | + fallthrough; |
---|
3189 | 3224 | default: |
---|
3190 | 3225 | /* set bank to 0 in case flash read fails */ |
---|
3191 | 3226 | *bank = 0; |
---|
.. | .. |
---|
3897 | 3932 | */ |
---|
3898 | 3933 | if (!ret_val) { |
---|
3899 | 3934 | nvm->ops.reload(hw); |
---|
3900 | | - usleep_range(10000, 20000); |
---|
| 3935 | + usleep_range(10000, 11000); |
---|
3901 | 3936 | } |
---|
3902 | 3937 | |
---|
3903 | 3938 | out: |
---|
.. | .. |
---|
4048 | 4083 | */ |
---|
4049 | 4084 | if (!ret_val) { |
---|
4050 | 4085 | nvm->ops.reload(hw); |
---|
4051 | | - usleep_range(10000, 20000); |
---|
| 4086 | + usleep_range(10000, 11000); |
---|
4052 | 4087 | } |
---|
4053 | 4088 | |
---|
4054 | 4089 | out: |
---|
.. | .. |
---|
4082 | 4117 | case e1000_pch_lpt: |
---|
4083 | 4118 | case e1000_pch_spt: |
---|
4084 | 4119 | case e1000_pch_cnp: |
---|
| 4120 | + case e1000_pch_tgp: |
---|
| 4121 | + case e1000_pch_adp: |
---|
| 4122 | + case e1000_pch_mtp: |
---|
4085 | 4123 | word = NVM_COMPAT; |
---|
4086 | 4124 | valid_csum_mask = NVM_COMPAT_VALID_CSUM; |
---|
4087 | 4125 | break; |
---|
.. | .. |
---|
4096 | 4134 | return ret_val; |
---|
4097 | 4135 | |
---|
4098 | 4136 | if (!(data & valid_csum_mask)) { |
---|
4099 | | - data |= valid_csum_mask; |
---|
4100 | | - ret_val = e1000_write_nvm(hw, word, 1, &data); |
---|
4101 | | - if (ret_val) |
---|
4102 | | - return ret_val; |
---|
4103 | | - ret_val = e1000e_update_nvm_checksum(hw); |
---|
4104 | | - if (ret_val) |
---|
4105 | | - return ret_val; |
---|
| 4137 | + e_dbg("NVM Checksum valid bit not set\n"); |
---|
| 4138 | + |
---|
| 4139 | + if (hw->mac.type < e1000_pch_tgp) { |
---|
| 4140 | + data |= valid_csum_mask; |
---|
| 4141 | + ret_val = e1000_write_nvm(hw, word, 1, &data); |
---|
| 4142 | + if (ret_val) |
---|
| 4143 | + return ret_val; |
---|
| 4144 | + ret_val = e1000e_update_nvm_checksum(hw); |
---|
| 4145 | + if (ret_val) |
---|
| 4146 | + return ret_val; |
---|
| 4147 | + } |
---|
4106 | 4148 | } |
---|
4107 | 4149 | |
---|
4108 | 4150 | return e1000e_validate_nvm_checksum_generic(hw); |
---|
.. | .. |
---|
4672 | 4714 | ew32(TCTL, E1000_TCTL_PSP); |
---|
4673 | 4715 | e1e_flush(); |
---|
4674 | 4716 | |
---|
4675 | | - usleep_range(10000, 20000); |
---|
| 4717 | + usleep_range(10000, 11000); |
---|
4676 | 4718 | |
---|
4677 | 4719 | /* Workaround for ICH8 bit corruption issue in FIFO memory */ |
---|
4678 | 4720 | if (hw->mac.type == e1000_ich8lan) { |
---|
.. | .. |
---|
4769 | 4811 | static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) |
---|
4770 | 4812 | { |
---|
4771 | 4813 | struct e1000_mac_info *mac = &hw->mac; |
---|
4772 | | - u32 ctrl_ext, txdctl, snoop; |
---|
| 4814 | + u32 ctrl_ext, txdctl, snoop, fflt_dbg; |
---|
4773 | 4815 | s32 ret_val; |
---|
4774 | 4816 | u16 i; |
---|
4775 | 4817 | |
---|
.. | .. |
---|
4827 | 4869 | else |
---|
4828 | 4870 | snoop = (u32)~(PCIE_NO_SNOOP_ALL); |
---|
4829 | 4871 | e1000e_set_pcie_no_snoop(hw, snoop); |
---|
| 4872 | + |
---|
| 4873 | + /* Enable workaround for packet loss issue on TGP PCH |
---|
| 4874 | + * Do not gate DMA clock from the modPHY block |
---|
| 4875 | + */ |
---|
| 4876 | + if (mac->type >= e1000_pch_tgp) { |
---|
| 4877 | + fflt_dbg = er32(FFLT_DBG); |
---|
| 4878 | + fflt_dbg |= E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK; |
---|
| 4879 | + ew32(FFLT_DBG, fflt_dbg); |
---|
| 4880 | + } |
---|
4830 | 4881 | |
---|
4831 | 4882 | ctrl_ext = er32(CTRL_EXT); |
---|
4832 | 4883 | ctrl_ext |= E1000_CTRL_EXT_RO_DIS; |
---|
.. | .. |
---|
5948 | 5999 | .phy_ops = &ich8_phy_ops, |
---|
5949 | 6000 | .nvm_ops = &spt_nvm_ops, |
---|
5950 | 6001 | }; |
---|
| 6002 | + |
---|
| 6003 | +const struct e1000_info e1000_pch_tgp_info = { |
---|
| 6004 | + .mac = e1000_pch_tgp, |
---|
| 6005 | + .flags = FLAG_IS_ICH |
---|
| 6006 | + | FLAG_HAS_WOL |
---|
| 6007 | + | FLAG_HAS_HW_TIMESTAMP |
---|
| 6008 | + | FLAG_HAS_CTRLEXT_ON_LOAD |
---|
| 6009 | + | FLAG_HAS_AMT |
---|
| 6010 | + | FLAG_HAS_FLASH |
---|
| 6011 | + | FLAG_HAS_JUMBO_FRAMES |
---|
| 6012 | + | FLAG_APME_IN_WUC, |
---|
| 6013 | + .flags2 = FLAG2_HAS_PHY_STATS |
---|
| 6014 | + | FLAG2_HAS_EEE, |
---|
| 6015 | + .pba = 26, |
---|
| 6016 | + .max_hw_frame_size = 9022, |
---|
| 6017 | + .get_variants = e1000_get_variants_ich8lan, |
---|
| 6018 | + .mac_ops = &ich8_mac_ops, |
---|
| 6019 | + .phy_ops = &ich8_phy_ops, |
---|
| 6020 | + .nvm_ops = &spt_nvm_ops, |
---|
| 6021 | +}; |
---|