Skip to content

Commit 0c61952

Browse files
lucacoelhogregkh
authored andcommitted
iwlwifi: add shared clock PHY config flag for some devices
commit 86a2b20 upstream. 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: c62446d ("iwlwifi: add new 9460 series PCI IDs") Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3059370 commit 0c61952

File tree

5 files changed

+91
-19
lines changed

5 files changed

+91
-19
lines changed

drivers/net/wireless/intel/iwlwifi/cfg/9000.c

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include <linux/stringify.h>
5454
#include "iwl-config.h"
5555
#include "iwl-agn-hw.h"
56+
#include "fw/file.h"
5657

5758
/* Highest firmware API version supported */
5859
#define IWL9000_UCODE_API_MAX 34
@@ -264,6 +265,67 @@ const struct iwl_cfg iwl9560_2ac_cfg_soc = {
264265
.integrated = true,
265266
.soc_latency = 5000,
266267
};
268+
269+
const struct iwl_cfg iwl9460_2ac_cfg_shared_clk = {
270+
.name = "Intel(R) Dual Band Wireless AC 9460",
271+
.fw_name_pre = IWL9000A_FW_PRE,
272+
.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
273+
.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
274+
IWL_DEVICE_9000,
275+
.ht_params = &iwl9000_ht_params,
276+
.nvm_ver = IWL9000_NVM_VERSION,
277+
.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
278+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
279+
.integrated = true,
280+
.soc_latency = 5000,
281+
.extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK
282+
};
283+
284+
const struct iwl_cfg iwl9461_2ac_cfg_shared_clk = {
285+
.name = "Intel(R) Dual Band Wireless AC 9461",
286+
.fw_name_pre = IWL9000A_FW_PRE,
287+
.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
288+
.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
289+
IWL_DEVICE_9000,
290+
.ht_params = &iwl9000_ht_params,
291+
.nvm_ver = IWL9000_NVM_VERSION,
292+
.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
293+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
294+
.integrated = true,
295+
.soc_latency = 5000,
296+
.extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK
297+
};
298+
299+
const struct iwl_cfg iwl9462_2ac_cfg_shared_clk = {
300+
.name = "Intel(R) Dual Band Wireless AC 9462",
301+
.fw_name_pre = IWL9000A_FW_PRE,
302+
.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
303+
.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
304+
IWL_DEVICE_9000,
305+
.ht_params = &iwl9000_ht_params,
306+
.nvm_ver = IWL9000_NVM_VERSION,
307+
.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
308+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
309+
.integrated = true,
310+
.soc_latency = 5000,
311+
.extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK
312+
};
313+
314+
const struct iwl_cfg iwl9560_2ac_cfg_shared_clk = {
315+
.name = "Intel(R) Dual Band Wireless AC 9560",
316+
.fw_name_pre = IWL9000A_FW_PRE,
317+
.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
318+
.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
319+
IWL_DEVICE_9000,
320+
.ht_params = &iwl9000_ht_params,
321+
.nvm_ver = IWL9000_NVM_VERSION,
322+
.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
323+
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
324+
.integrated = true,
325+
.soc_latency = 5000,
326+
.extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK
327+
};
328+
267329
MODULE_FIRMWARE(IWL9000A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
268330
MODULE_FIRMWARE(IWL9000B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
269331
MODULE_FIRMWARE(IWL9000RFB_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));

drivers/net/wireless/intel/iwlwifi/fw/file.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ enum iwl_fw_phy_cfg {
434434
FW_PHY_CFG_TX_CHAIN = 0xf << FW_PHY_CFG_TX_CHAIN_POS,
435435
FW_PHY_CFG_RX_CHAIN_POS = 20,
436436
FW_PHY_CFG_RX_CHAIN = 0xf << FW_PHY_CFG_RX_CHAIN_POS,
437+
FW_PHY_CFG_SHARED_CLK = BIT(31),
437438
};
438439

439440
#define IWL_UCODE_MAX_CS 1

drivers/net/wireless/intel/iwlwifi/iwl-config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ struct iwl_cfg {
394394
u8 max_vht_ampdu_exponent;
395395
u8 ucode_api_max;
396396
u8 ucode_api_min;
397+
u32 extra_phy_cfg_flags;
397398
};
398399

399400
/*
@@ -476,6 +477,10 @@ extern const struct iwl_cfg iwl9460_2ac_cfg_soc;
476477
extern const struct iwl_cfg iwl9461_2ac_cfg_soc;
477478
extern const struct iwl_cfg iwl9462_2ac_cfg_soc;
478479
extern const struct iwl_cfg iwl9560_2ac_cfg_soc;
480+
extern const struct iwl_cfg iwl9460_2ac_cfg_shared_clk;
481+
extern const struct iwl_cfg iwl9461_2ac_cfg_shared_clk;
482+
extern const struct iwl_cfg iwl9462_2ac_cfg_shared_clk;
483+
extern const struct iwl_cfg iwl9560_2ac_cfg_shared_clk;
479484
extern const struct iwl_cfg iwla000_2ac_cfg_hr;
480485
extern const struct iwl_cfg iwla000_2ac_cfg_hr_cdb;
481486
extern const struct iwl_cfg iwla000_2ac_cfg_jf;

drivers/net/wireless/intel/iwlwifi/mvm/fw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
435435

436436
/* Set parameters */
437437
phy_cfg_cmd.phy_cfg = cpu_to_le32(iwl_mvm_get_phy_config(mvm));
438+
439+
/* set flags extra PHY configuration flags from the device's cfg */
440+
phy_cfg_cmd.phy_cfg |= cpu_to_le32(mvm->cfg->extra_phy_cfg_flags);
441+
438442
phy_cfg_cmd.calib_control.event_trigger =
439443
mvm->fw->default_calib[ucode_type].event_trigger;
440444
phy_cfg_cmd.calib_control.flow_trigger =

drivers/net/wireless/intel/iwlwifi/pcie/drv.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -577,25 +577,25 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
577577
{IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_soc)},
578578
{IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_soc)},
579579
{IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_soc)},
580-
{IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg_soc)},
581-
{IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_soc)},
582-
{IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_cfg_soc)},
583-
{IWL_PCI_DEVICE(0x31DC, 0x003C, iwl9560_2ac_cfg_soc)},
584-
{IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg_soc)},
585-
{IWL_PCI_DEVICE(0x31DC, 0x0064, iwl9461_2ac_cfg_soc)},
586-
{IWL_PCI_DEVICE(0x31DC, 0x00A0, iwl9462_2ac_cfg_soc)},
587-
{IWL_PCI_DEVICE(0x31DC, 0x00A4, iwl9462_2ac_cfg_soc)},
588-
{IWL_PCI_DEVICE(0x31DC, 0x0230, iwl9560_2ac_cfg_soc)},
589-
{IWL_PCI_DEVICE(0x31DC, 0x0234, iwl9560_2ac_cfg_soc)},
590-
{IWL_PCI_DEVICE(0x31DC, 0x0238, iwl9560_2ac_cfg_soc)},
591-
{IWL_PCI_DEVICE(0x31DC, 0x023C, iwl9560_2ac_cfg_soc)},
592-
{IWL_PCI_DEVICE(0x31DC, 0x0260, iwl9461_2ac_cfg_soc)},
593-
{IWL_PCI_DEVICE(0x31DC, 0x0264, iwl9461_2ac_cfg_soc)},
594-
{IWL_PCI_DEVICE(0x31DC, 0x02A0, iwl9462_2ac_cfg_soc)},
595-
{IWL_PCI_DEVICE(0x31DC, 0x02A4, iwl9462_2ac_cfg_soc)},
596-
{IWL_PCI_DEVICE(0x31DC, 0x4030, iwl9560_2ac_cfg_soc)},
597-
{IWL_PCI_DEVICE(0x31DC, 0x4034, iwl9560_2ac_cfg_soc)},
598-
{IWL_PCI_DEVICE(0x31DC, 0x40A4, iwl9462_2ac_cfg_soc)},
580+
{IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg_shared_clk)},
581+
{IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_shared_clk)},
582+
{IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_cfg_shared_clk)},
583+
{IWL_PCI_DEVICE(0x31DC, 0x003C, iwl9560_2ac_cfg_shared_clk)},
584+
{IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg_shared_clk)},
585+
{IWL_PCI_DEVICE(0x31DC, 0x0064, iwl9461_2ac_cfg_shared_clk)},
586+
{IWL_PCI_DEVICE(0x31DC, 0x00A0, iwl9462_2ac_cfg_shared_clk)},
587+
{IWL_PCI_DEVICE(0x31DC, 0x00A4, iwl9462_2ac_cfg_shared_clk)},
588+
{IWL_PCI_DEVICE(0x31DC, 0x0230, iwl9560_2ac_cfg_shared_clk)},
589+
{IWL_PCI_DEVICE(0x31DC, 0x0234, iwl9560_2ac_cfg_shared_clk)},
590+
{IWL_PCI_DEVICE(0x31DC, 0x0238, iwl9560_2ac_cfg_shared_clk)},
591+
{IWL_PCI_DEVICE(0x31DC, 0x023C, iwl9560_2ac_cfg_shared_clk)},
592+
{IWL_PCI_DEVICE(0x31DC, 0x0260, iwl9461_2ac_cfg_shared_clk)},
593+
{IWL_PCI_DEVICE(0x31DC, 0x0264, iwl9461_2ac_cfg_shared_clk)},
594+
{IWL_PCI_DEVICE(0x31DC, 0x02A0, iwl9462_2ac_cfg_shared_clk)},
595+
{IWL_PCI_DEVICE(0x31DC, 0x02A4, iwl9462_2ac_cfg_shared_clk)},
596+
{IWL_PCI_DEVICE(0x31DC, 0x4030, iwl9560_2ac_cfg_shared_clk)},
597+
{IWL_PCI_DEVICE(0x31DC, 0x4034, iwl9560_2ac_cfg_shared_clk)},
598+
{IWL_PCI_DEVICE(0x31DC, 0x40A4, iwl9462_2ac_cfg_shared_clk)},
599599
{IWL_PCI_DEVICE(0x34F0, 0x0030, iwl9560_2ac_cfg_soc)},
600600
{IWL_PCI_DEVICE(0x34F0, 0x0034, iwl9560_2ac_cfg_soc)},
601601
{IWL_PCI_DEVICE(0x34F0, 0x02A4, iwl9462_2ac_cfg_soc)},

0 commit comments

Comments
 (0)