diff options
author | Luca Coelho <luciano.coelho@intel.com> | 2018-02-21 15:18:59 -0500 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2018-03-16 06:34:54 -0400 |
commit | 86a2b2043af79deff5cf000c5a08847faa4f2ee0 (patch) | |
tree | 4bc9ca60d2ba836e27da7e8749e0e192b281b2b5 | |
parent | 75fd4fec3e4c43b131c7c4958adb3ab9f1665513 (diff) |
iwlwifi: add shared clock PHY config flag for some devices
Some devices use a shared clock which is very sensitive to variations
and cause trouble in some situations. We need to set a bit in the phy
configuration to indicate that to the FW. To make this generic, add a
extra_phy_config_flags element to the device configuration and OR it
into the phy_cfg before sending it to the firmware. And also create a
set of configurations for devices that use shared clocks and need this
extra bit to be set.
Fixes: c62446d2b028 ("iwlwifi: add new 9460 series PCI IDs")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/cfg/9000.c | 62 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/file.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-config.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 38 |
5 files changed, 91 insertions, 19 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/9000.c b/drivers/net/wireless/intel/iwlwifi/cfg/9000.c index 90a1d14cf7d2..ab1469473e4f 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/9000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/9000.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <linux/stringify.h> | 53 | #include <linux/stringify.h> |
54 | #include "iwl-config.h" | 54 | #include "iwl-config.h" |
55 | #include "iwl-agn-hw.h" | 55 | #include "iwl-agn-hw.h" |
56 | #include "fw/file.h" | ||
56 | 57 | ||
57 | /* Highest firmware API version supported */ | 58 | /* Highest firmware API version supported */ |
58 | #define IWL9000_UCODE_API_MAX 36 | 59 | #define IWL9000_UCODE_API_MAX 36 |
@@ -265,6 +266,67 @@ const struct iwl_cfg iwl9560_2ac_cfg_soc = { | |||
265 | .integrated = true, | 266 | .integrated = true, |
266 | .soc_latency = 5000, | 267 | .soc_latency = 5000, |
267 | }; | 268 | }; |
269 | |||
270 | const struct iwl_cfg iwl9460_2ac_cfg_shared_clk = { | ||
271 | .name = "Intel(R) Dual Band Wireless AC 9460", | ||
272 | .fw_name_pre = IWL9000A_FW_PRE, | ||
273 | .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, | ||
274 | .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, | ||
275 | IWL_DEVICE_9000, | ||
276 | .ht_params = &iwl9000_ht_params, | ||
277 | .nvm_ver = IWL9000_NVM_VERSION, | ||
278 | .nvm_calib_ver = IWL9000_TX_POWER_VERSION, | ||
279 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, | ||
280 | .integrated = true, | ||
281 | .soc_latency = 5000, | ||
282 | .extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK | ||
283 | }; | ||
284 | |||
285 | const struct iwl_cfg iwl9461_2ac_cfg_shared_clk = { | ||
286 | .name = "Intel(R) Dual Band Wireless AC 9461", | ||
287 | .fw_name_pre = IWL9000A_FW_PRE, | ||
288 | .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, | ||
289 | .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, | ||
290 | IWL_DEVICE_9000, | ||
291 | .ht_params = &iwl9000_ht_params, | ||
292 | .nvm_ver = IWL9000_NVM_VERSION, | ||
293 | .nvm_calib_ver = IWL9000_TX_POWER_VERSION, | ||
294 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, | ||
295 | .integrated = true, | ||
296 | .soc_latency = 5000, | ||
297 | .extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK | ||
298 | }; | ||
299 | |||
300 | const struct iwl_cfg iwl9462_2ac_cfg_shared_clk = { | ||
301 | .name = "Intel(R) Dual Band Wireless AC 9462", | ||
302 | .fw_name_pre = IWL9000A_FW_PRE, | ||
303 | .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, | ||
304 | .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, | ||
305 | IWL_DEVICE_9000, | ||
306 | .ht_params = &iwl9000_ht_params, | ||
307 | .nvm_ver = IWL9000_NVM_VERSION, | ||
308 | .nvm_calib_ver = IWL9000_TX_POWER_VERSION, | ||
309 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, | ||
310 | .integrated = true, | ||
311 | .soc_latency = 5000, | ||
312 | .extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK | ||
313 | }; | ||
314 | |||
315 | const struct iwl_cfg iwl9560_2ac_cfg_shared_clk = { | ||
316 | .name = "Intel(R) Dual Band Wireless AC 9560", | ||
317 | .fw_name_pre = IWL9000A_FW_PRE, | ||
318 | .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, | ||
319 | .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, | ||
320 | IWL_DEVICE_9000, | ||
321 | .ht_params = &iwl9000_ht_params, | ||
322 | .nvm_ver = IWL9000_NVM_VERSION, | ||
323 | .nvm_calib_ver = IWL9000_TX_POWER_VERSION, | ||
324 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, | ||
325 | .integrated = true, | ||
326 | .soc_latency = 5000, | ||
327 | .extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK | ||
328 | }; | ||
329 | |||
268 | MODULE_FIRMWARE(IWL9000A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); | 330 | MODULE_FIRMWARE(IWL9000A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); |
269 | MODULE_FIRMWARE(IWL9000B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); | 331 | MODULE_FIRMWARE(IWL9000B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); |
270 | MODULE_FIRMWARE(IWL9000RFB_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); | 332 | MODULE_FIRMWARE(IWL9000RFB_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h index 1a05d506ac9a..2cb303c5c42e 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h | |||
@@ -441,6 +441,7 @@ enum iwl_fw_phy_cfg { | |||
441 | FW_PHY_CFG_TX_CHAIN = 0xf << FW_PHY_CFG_TX_CHAIN_POS, | 441 | FW_PHY_CFG_TX_CHAIN = 0xf << FW_PHY_CFG_TX_CHAIN_POS, |
442 | FW_PHY_CFG_RX_CHAIN_POS = 20, | 442 | FW_PHY_CFG_RX_CHAIN_POS = 20, |
443 | FW_PHY_CFG_RX_CHAIN = 0xf << FW_PHY_CFG_RX_CHAIN_POS, | 443 | FW_PHY_CFG_RX_CHAIN = 0xf << FW_PHY_CFG_RX_CHAIN_POS, |
444 | FW_PHY_CFG_SHARED_CLK = BIT(31), | ||
444 | }; | 445 | }; |
445 | 446 | ||
446 | #define IWL_UCODE_MAX_CS 1 | 447 | #define IWL_UCODE_MAX_CS 1 |
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h index 258d439bb0a9..f0f5636dd3ea 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h | |||
@@ -398,6 +398,7 @@ struct iwl_cfg { | |||
398 | u8 ucode_api_max; | 398 | u8 ucode_api_max; |
399 | u8 ucode_api_min; | 399 | u8 ucode_api_min; |
400 | u32 min_umac_error_event_table; | 400 | u32 min_umac_error_event_table; |
401 | u32 extra_phy_cfg_flags; | ||
401 | }; | 402 | }; |
402 | 403 | ||
403 | /* | 404 | /* |
@@ -477,6 +478,10 @@ extern const struct iwl_cfg iwl9460_2ac_cfg_soc; | |||
477 | extern const struct iwl_cfg iwl9461_2ac_cfg_soc; | 478 | extern const struct iwl_cfg iwl9461_2ac_cfg_soc; |
478 | extern const struct iwl_cfg iwl9462_2ac_cfg_soc; | 479 | extern const struct iwl_cfg iwl9462_2ac_cfg_soc; |
479 | extern const struct iwl_cfg iwl9560_2ac_cfg_soc; | 480 | extern const struct iwl_cfg iwl9560_2ac_cfg_soc; |
481 | extern const struct iwl_cfg iwl9460_2ac_cfg_shared_clk; | ||
482 | extern const struct iwl_cfg iwl9461_2ac_cfg_shared_clk; | ||
483 | extern const struct iwl_cfg iwl9462_2ac_cfg_shared_clk; | ||
484 | extern const struct iwl_cfg iwl9560_2ac_cfg_shared_clk; | ||
480 | extern const struct iwl_cfg iwl22000_2ac_cfg_hr; | 485 | extern const struct iwl_cfg iwl22000_2ac_cfg_hr; |
481 | extern const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb; | 486 | extern const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb; |
482 | extern const struct iwl_cfg iwl22000_2ac_cfg_jf; | 487 | extern const struct iwl_cfg iwl22000_2ac_cfg_jf; |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 0920be637b57..3c59109bea20 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c | |||
@@ -433,6 +433,10 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm) | |||
433 | 433 | ||
434 | /* Set parameters */ | 434 | /* Set parameters */ |
435 | phy_cfg_cmd.phy_cfg = cpu_to_le32(iwl_mvm_get_phy_config(mvm)); | 435 | phy_cfg_cmd.phy_cfg = cpu_to_le32(iwl_mvm_get_phy_config(mvm)); |
436 | |||
437 | /* set flags extra PHY configuration flags from the device's cfg */ | ||
438 | phy_cfg_cmd.phy_cfg |= cpu_to_le32(mvm->cfg->extra_phy_cfg_flags); | ||
439 | |||
436 | phy_cfg_cmd.calib_control.event_trigger = | 440 | phy_cfg_cmd.calib_control.event_trigger = |
437 | mvm->fw->default_calib[ucode_type].event_trigger; | 441 | mvm->fw->default_calib[ucode_type].event_trigger; |
438 | phy_cfg_cmd.calib_control.flow_trigger = | 442 | phy_cfg_cmd.calib_control.flow_trigger = |
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c index 56fc28750a41..e323d3abb6ac 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c | |||
@@ -579,25 +579,25 @@ static const struct pci_device_id iwl_hw_card_ids[] = { | |||
579 | {IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_soc)}, | 579 | {IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_soc)}, |
580 | {IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_soc)}, | 580 | {IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_soc)}, |
581 | {IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_soc)}, | 581 | {IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_soc)}, |
582 | {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg_soc)}, | 582 | {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg_shared_clk)}, |
583 | {IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_soc)}, | 583 | {IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_shared_clk)}, |
584 | {IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_cfg_soc)}, | 584 | {IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_cfg_shared_clk)}, |
585 | {IWL_PCI_DEVICE(0x31DC, 0x003C, iwl9560_2ac_cfg_soc)}, | 585 | {IWL_PCI_DEVICE(0x31DC, 0x003C, iwl9560_2ac_cfg_shared_clk)}, |
586 | {IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg_soc)}, | 586 | {IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg_shared_clk)}, |
587 | {IWL_PCI_DEVICE(0x31DC, 0x0064, iwl9461_2ac_cfg_soc)}, | 587 | {IWL_PCI_DEVICE(0x31DC, 0x0064, iwl9461_2ac_cfg_shared_clk)}, |
588 | {IWL_PCI_DEVICE(0x31DC, 0x00A0, iwl9462_2ac_cfg_soc)}, | 588 | {IWL_PCI_DEVICE(0x31DC, 0x00A0, iwl9462_2ac_cfg_shared_clk)}, |
589 | {IWL_PCI_DEVICE(0x31DC, 0x00A4, iwl9462_2ac_cfg_soc)}, | 589 | {IWL_PCI_DEVICE(0x31DC, 0x00A4, iwl9462_2ac_cfg_shared_clk)}, |
590 | {IWL_PCI_DEVICE(0x31DC, 0x0230, iwl9560_2ac_cfg_soc)}, | 590 | {IWL_PCI_DEVICE(0x31DC, 0x0230, iwl9560_2ac_cfg_shared_clk)}, |
591 | {IWL_PCI_DEVICE(0x31DC, 0x0234, iwl9560_2ac_cfg_soc)}, | 591 | {IWL_PCI_DEVICE(0x31DC, 0x0234, iwl9560_2ac_cfg_shared_clk)}, |
592 | {IWL_PCI_DEVICE(0x31DC, 0x0238, iwl9560_2ac_cfg_soc)}, | 592 | {IWL_PCI_DEVICE(0x31DC, 0x0238, iwl9560_2ac_cfg_shared_clk)}, |
593 | {IWL_PCI_DEVICE(0x31DC, 0x023C, iwl9560_2ac_cfg_soc)}, | 593 | {IWL_PCI_DEVICE(0x31DC, 0x023C, iwl9560_2ac_cfg_shared_clk)}, |
594 | {IWL_PCI_DEVICE(0x31DC, 0x0260, iwl9461_2ac_cfg_soc)}, | 594 | {IWL_PCI_DEVICE(0x31DC, 0x0260, iwl9461_2ac_cfg_shared_clk)}, |
595 | {IWL_PCI_DEVICE(0x31DC, 0x0264, iwl9461_2ac_cfg_soc)}, | 595 | {IWL_PCI_DEVICE(0x31DC, 0x0264, iwl9461_2ac_cfg_shared_clk)}, |
596 | {IWL_PCI_DEVICE(0x31DC, 0x02A0, iwl9462_2ac_cfg_soc)}, | 596 | {IWL_PCI_DEVICE(0x31DC, 0x02A0, iwl9462_2ac_cfg_shared_clk)}, |
597 | {IWL_PCI_DEVICE(0x31DC, 0x02A4, iwl9462_2ac_cfg_soc)}, | 597 | {IWL_PCI_DEVICE(0x31DC, 0x02A4, iwl9462_2ac_cfg_shared_clk)}, |
598 | {IWL_PCI_DEVICE(0x31DC, 0x4030, iwl9560_2ac_cfg_soc)}, | 598 | {IWL_PCI_DEVICE(0x31DC, 0x4030, iwl9560_2ac_cfg_shared_clk)}, |
599 | {IWL_PCI_DEVICE(0x31DC, 0x4034, iwl9560_2ac_cfg_soc)}, | 599 | {IWL_PCI_DEVICE(0x31DC, 0x4034, iwl9560_2ac_cfg_shared_clk)}, |
600 | {IWL_PCI_DEVICE(0x31DC, 0x40A4, iwl9462_2ac_cfg_soc)}, | 600 | {IWL_PCI_DEVICE(0x31DC, 0x40A4, iwl9462_2ac_cfg_shared_clk)}, |
601 | {IWL_PCI_DEVICE(0x34F0, 0x0030, iwl9560_2ac_cfg_soc)}, | 601 | {IWL_PCI_DEVICE(0x34F0, 0x0030, iwl9560_2ac_cfg_soc)}, |
602 | {IWL_PCI_DEVICE(0x34F0, 0x0034, iwl9560_2ac_cfg_soc)}, | 602 | {IWL_PCI_DEVICE(0x34F0, 0x0034, iwl9560_2ac_cfg_soc)}, |
603 | {IWL_PCI_DEVICE(0x34F0, 0x02A4, iwl9462_2ac_cfg_soc)}, | 603 | {IWL_PCI_DEVICE(0x34F0, 0x02A4, iwl9462_2ac_cfg_soc)}, |