Skip to content

Commit 86a2b20

Browse files
committed
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: c62446d ("iwlwifi: add new 9460 series PCI IDs") Signed-off-by: Luca Coelho <[email protected]>
1 parent 75fd4fe commit 86a2b20

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 36
@@ -265,6 +266,67 @@ const struct iwl_cfg iwl9560_2ac_cfg_soc = {
265266
.integrated = true,
266267
.soc_latency = 5000,
267268
};
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+
268330
MODULE_FIRMWARE(IWL9000A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
269331
MODULE_FIRMWARE(IWL9000B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
270332
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
@@ -441,6 +441,7 @@ enum iwl_fw_phy_cfg {
441441
FW_PHY_CFG_TX_CHAIN = 0xf << FW_PHY_CFG_TX_CHAIN_POS,
442442
FW_PHY_CFG_RX_CHAIN_POS = 20,
443443
FW_PHY_CFG_RX_CHAIN = 0xf << FW_PHY_CFG_RX_CHAIN_POS,
444+
FW_PHY_CFG_SHARED_CLK = BIT(31),
444445
};
445446

446447
#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
@@ -398,6 +398,7 @@ struct iwl_cfg {
398398
u8 ucode_api_max;
399399
u8 ucode_api_min;
400400
u32 min_umac_error_event_table;
401+
u32 extra_phy_cfg_flags;
401402
};
402403

403404
/*
@@ -477,6 +478,10 @@ extern const struct iwl_cfg iwl9460_2ac_cfg_soc;
477478
extern const struct iwl_cfg iwl9461_2ac_cfg_soc;
478479
extern const struct iwl_cfg iwl9462_2ac_cfg_soc;
479480
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;
480485
extern const struct iwl_cfg iwl22000_2ac_cfg_hr;
481486
extern const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb;
482487
extern const struct iwl_cfg iwl22000_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
@@ -433,6 +433,10 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
433433

434434
/* Set parameters */
435435
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+
436440
phy_cfg_cmd.calib_control.event_trigger =
437441
mvm->fw->default_calib[ucode_type].event_trigger;
438442
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
@@ -579,25 +579,25 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
579579
{IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_soc)},
580580
{IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_soc)},
581581
{IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_soc)},
582-
{IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg_soc)},
583-
{IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_soc)},
584-
{IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_cfg_soc)},
585-
{IWL_PCI_DEVICE(0x31DC, 0x003C, iwl9560_2ac_cfg_soc)},
586-
{IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg_soc)},
587-
{IWL_PCI_DEVICE(0x31DC, 0x0064, iwl9461_2ac_cfg_soc)},
588-
{IWL_PCI_DEVICE(0x31DC, 0x00A0, iwl9462_2ac_cfg_soc)},
589-
{IWL_PCI_DEVICE(0x31DC, 0x00A4, iwl9462_2ac_cfg_soc)},
590-
{IWL_PCI_DEVICE(0x31DC, 0x0230, iwl9560_2ac_cfg_soc)},
591-
{IWL_PCI_DEVICE(0x31DC, 0x0234, iwl9560_2ac_cfg_soc)},
592-
{IWL_PCI_DEVICE(0x31DC, 0x0238, iwl9560_2ac_cfg_soc)},
593-
{IWL_PCI_DEVICE(0x31DC, 0x023C, iwl9560_2ac_cfg_soc)},
594-
{IWL_PCI_DEVICE(0x31DC, 0x0260, iwl9461_2ac_cfg_soc)},
595-
{IWL_PCI_DEVICE(0x31DC, 0x0264, iwl9461_2ac_cfg_soc)},
596-
{IWL_PCI_DEVICE(0x31DC, 0x02A0, iwl9462_2ac_cfg_soc)},
597-
{IWL_PCI_DEVICE(0x31DC, 0x02A4, iwl9462_2ac_cfg_soc)},
598-
{IWL_PCI_DEVICE(0x31DC, 0x4030, iwl9560_2ac_cfg_soc)},
599-
{IWL_PCI_DEVICE(0x31DC, 0x4034, iwl9560_2ac_cfg_soc)},
600-
{IWL_PCI_DEVICE(0x31DC, 0x40A4, iwl9462_2ac_cfg_soc)},
582+
{IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg_shared_clk)},
583+
{IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_shared_clk)},
584+
{IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_cfg_shared_clk)},
585+
{IWL_PCI_DEVICE(0x31DC, 0x003C, iwl9560_2ac_cfg_shared_clk)},
586+
{IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg_shared_clk)},
587+
{IWL_PCI_DEVICE(0x31DC, 0x0064, iwl9461_2ac_cfg_shared_clk)},
588+
{IWL_PCI_DEVICE(0x31DC, 0x00A0, iwl9462_2ac_cfg_shared_clk)},
589+
{IWL_PCI_DEVICE(0x31DC, 0x00A4, iwl9462_2ac_cfg_shared_clk)},
590+
{IWL_PCI_DEVICE(0x31DC, 0x0230, iwl9560_2ac_cfg_shared_clk)},
591+
{IWL_PCI_DEVICE(0x31DC, 0x0234, iwl9560_2ac_cfg_shared_clk)},
592+
{IWL_PCI_DEVICE(0x31DC, 0x0238, iwl9560_2ac_cfg_shared_clk)},
593+
{IWL_PCI_DEVICE(0x31DC, 0x023C, iwl9560_2ac_cfg_shared_clk)},
594+
{IWL_PCI_DEVICE(0x31DC, 0x0260, iwl9461_2ac_cfg_shared_clk)},
595+
{IWL_PCI_DEVICE(0x31DC, 0x0264, iwl9461_2ac_cfg_shared_clk)},
596+
{IWL_PCI_DEVICE(0x31DC, 0x02A0, iwl9462_2ac_cfg_shared_clk)},
597+
{IWL_PCI_DEVICE(0x31DC, 0x02A4, iwl9462_2ac_cfg_shared_clk)},
598+
{IWL_PCI_DEVICE(0x31DC, 0x4030, iwl9560_2ac_cfg_shared_clk)},
599+
{IWL_PCI_DEVICE(0x31DC, 0x4034, iwl9560_2ac_cfg_shared_clk)},
600+
{IWL_PCI_DEVICE(0x31DC, 0x40A4, iwl9462_2ac_cfg_shared_clk)},
601601
{IWL_PCI_DEVICE(0x34F0, 0x0030, iwl9560_2ac_cfg_soc)},
602602
{IWL_PCI_DEVICE(0x34F0, 0x0034, iwl9560_2ac_cfg_soc)},
603603
{IWL_PCI_DEVICE(0x34F0, 0x02A4, iwl9462_2ac_cfg_soc)},

0 commit comments

Comments
 (0)