diff options
author | Eran Harary <eran.harary@intel.com> | 2015-03-24 04:59:46 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-03-30 01:58:08 -0400 |
commit | d383c7409171452aaa6569f1451f9975d44f3d76 (patch) | |
tree | 1d303609eadcee26aa63853d02c8b553eec60854 | |
parent | 1e16707166caf7499e9e3decc403267d346a5fb7 (diff) |
iwlwifi: 8000: change PNVM in case it doesn't match to the HW step
There is a strong relationship between the NVM version and
the hardware step. Enforce that in the driver in case the
default NVM on the platform is the wrong one.
Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-8000.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-config.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/nvm.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/ops.c | 10 |
4 files changed, 46 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-8000.c b/drivers/net/wireless/iwlwifi/iwl-8000.c index 4ef50cf7d9a6..ce6321b7d241 100644 --- a/drivers/net/wireless/iwlwifi/iwl-8000.c +++ b/drivers/net/wireless/iwlwifi/iwl-8000.c | |||
@@ -94,7 +94,8 @@ | |||
94 | IWL8000_FW_PRE "-" __stringify(api) ".ucode" | 94 | IWL8000_FW_PRE "-" __stringify(api) ".ucode" |
95 | 95 | ||
96 | #define NVM_HW_SECTION_NUM_FAMILY_8000 10 | 96 | #define NVM_HW_SECTION_NUM_FAMILY_8000 10 |
97 | #define DEFAULT_NVM_FILE_FAMILY_8000 "iwl_nvm_8000B.bin" | 97 | #define DEFAULT_NVM_FILE_FAMILY_8000B "nvmData-8000B" |
98 | #define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C" | ||
98 | 99 | ||
99 | /* Max SDIO RX aggregation size of the ADDBA request/response */ | 100 | /* Max SDIO RX aggregation size of the ADDBA request/response */ |
100 | #define MAX_RX_AGG_SIZE_8260_SDIO 28 | 101 | #define MAX_RX_AGG_SIZE_8260_SDIO 28 |
@@ -176,7 +177,8 @@ const struct iwl_cfg iwl8260_2ac_sdio_cfg = { | |||
176 | .ht_params = &iwl8000_ht_params, | 177 | .ht_params = &iwl8000_ht_params, |
177 | .nvm_ver = IWL8000_NVM_VERSION, | 178 | .nvm_ver = IWL8000_NVM_VERSION, |
178 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, | 179 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, |
179 | .default_nvm_file = DEFAULT_NVM_FILE_FAMILY_8000, | 180 | .default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B, |
181 | .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, | ||
180 | .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, | 182 | .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, |
181 | .disable_dummy_notification = true, | 183 | .disable_dummy_notification = true, |
182 | .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, | 184 | .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, |
@@ -190,7 +192,8 @@ const struct iwl_cfg iwl4165_2ac_sdio_cfg = { | |||
190 | .ht_params = &iwl8000_ht_params, | 192 | .ht_params = &iwl8000_ht_params, |
191 | .nvm_ver = IWL8000_NVM_VERSION, | 193 | .nvm_ver = IWL8000_NVM_VERSION, |
192 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, | 194 | .nvm_calib_ver = IWL8000_TX_POWER_VERSION, |
193 | .default_nvm_file = DEFAULT_NVM_FILE_FAMILY_8000, | 195 | .default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B, |
196 | .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, | ||
194 | .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, | 197 | .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, |
195 | .bt_shared_single_ant = true, | 198 | .bt_shared_single_ant = true, |
196 | .disable_dummy_notification = true, | 199 | .disable_dummy_notification = true, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index aa41c778af83..bbed8fc010ce 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h | |||
@@ -303,7 +303,8 @@ struct iwl_cfg { | |||
303 | bool lp_xtal_workaround; | 303 | bool lp_xtal_workaround; |
304 | const struct iwl_pwr_tx_backoff *pwr_tx_backoffs; | 304 | const struct iwl_pwr_tx_backoff *pwr_tx_backoffs; |
305 | bool no_power_up_nic_in_init; | 305 | bool no_power_up_nic_in_init; |
306 | const char *default_nvm_file; | 306 | const char *default_nvm_file_B_step; |
307 | const char *default_nvm_file_C_step; | ||
307 | unsigned int max_rx_agg_size; | 308 | unsigned int max_rx_agg_size; |
308 | bool disable_dummy_notification; | 309 | bool disable_dummy_notification; |
309 | unsigned int max_tx_agg_size; | 310 | unsigned int max_tx_agg_size; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/nvm.c b/drivers/net/wireless/iwlwifi/mvm/nvm.c index 675197d9f03e..524ade241418 100644 --- a/drivers/net/wireless/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/iwlwifi/mvm/nvm.c | |||
@@ -418,6 +418,15 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm) | |||
418 | IWL_INFO(mvm, "NVM Version %08X\n", le32_to_cpu(dword_buff[2])); | 418 | IWL_INFO(mvm, "NVM Version %08X\n", le32_to_cpu(dword_buff[2])); |
419 | IWL_INFO(mvm, "NVM Manufacturing date %08X\n", | 419 | IWL_INFO(mvm, "NVM Manufacturing date %08X\n", |
420 | le32_to_cpu(dword_buff[3])); | 420 | le32_to_cpu(dword_buff[3])); |
421 | |||
422 | /* nvm file validation, dword_buff[2] holds the file version */ | ||
423 | if ((CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_C_STEP && | ||
424 | le32_to_cpu(dword_buff[2]) < 0xE4A) || | ||
425 | (CSR_HW_REV_STEP(mvm->trans->hw_rev) == SILICON_B_STEP && | ||
426 | le32_to_cpu(dword_buff[2]) >= 0xE4A)) { | ||
427 | ret = -EFAULT; | ||
428 | goto out; | ||
429 | } | ||
421 | } else { | 430 | } else { |
422 | file_sec = (void *)fw_entry->data; | 431 | file_sec = (void *)fw_entry->data; |
423 | } | 432 | } |
@@ -516,6 +525,8 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic) | |||
516 | int ret, section; | 525 | int ret, section; |
517 | u32 size_read = 0; | 526 | u32 size_read = 0; |
518 | u8 *nvm_buffer, *temp; | 527 | u8 *nvm_buffer, *temp; |
528 | const char *nvm_file_B = mvm->cfg->default_nvm_file_B_step; | ||
529 | const char *nvm_file_C = mvm->cfg->default_nvm_file_C_step; | ||
519 | 530 | ||
520 | if (WARN_ON_ONCE(mvm->cfg->nvm_hw_section_num >= NVM_MAX_NUM_SECTIONS)) | 531 | if (WARN_ON_ONCE(mvm->cfg->nvm_hw_section_num >= NVM_MAX_NUM_SECTIONS)) |
521 | return -EINVAL; | 532 | return -EINVAL; |
@@ -574,10 +585,27 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic) | |||
574 | 585 | ||
575 | /* load external NVM if configured */ | 586 | /* load external NVM if configured */ |
576 | if (mvm->nvm_file_name) { | 587 | if (mvm->nvm_file_name) { |
577 | /* move to External NVM flow */ | 588 | /* read External NVM file - take the default */ |
578 | ret = iwl_mvm_read_external_nvm(mvm); | 589 | ret = iwl_mvm_read_external_nvm(mvm); |
579 | if (ret) | 590 | if (ret) { |
580 | return ret; | 591 | /* choose the nvm_file name according to the |
592 | * HW step | ||
593 | */ | ||
594 | if (CSR_HW_REV_STEP(mvm->trans->hw_rev) == | ||
595 | SILICON_B_STEP) | ||
596 | mvm->nvm_file_name = nvm_file_B; | ||
597 | else | ||
598 | mvm->nvm_file_name = nvm_file_C; | ||
599 | |||
600 | if (ret == -EFAULT && mvm->nvm_file_name) { | ||
601 | /* in case nvm file was failed try again */ | ||
602 | ret = iwl_mvm_read_external_nvm(mvm); | ||
603 | if (ret) | ||
604 | return ret; | ||
605 | } else { | ||
606 | return ret; | ||
607 | } | ||
608 | } | ||
581 | } | 609 | } |
582 | 610 | ||
583 | /* parse the relevant nvm sections */ | 611 | /* parse the relevant nvm sections */ |
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c index 388886ce419d..67ed57e17dab 100644 --- a/drivers/net/wireless/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/iwlwifi/mvm/ops.c | |||
@@ -521,10 +521,14 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
521 | min_backoff = calc_min_backoff(trans, cfg); | 521 | min_backoff = calc_min_backoff(trans, cfg); |
522 | iwl_mvm_tt_initialize(mvm, min_backoff); | 522 | iwl_mvm_tt_initialize(mvm, min_backoff); |
523 | /* set the nvm_file_name according to priority */ | 523 | /* set the nvm_file_name according to priority */ |
524 | if (iwlwifi_mod_params.nvm_file) | 524 | if (iwlwifi_mod_params.nvm_file) { |
525 | mvm->nvm_file_name = iwlwifi_mod_params.nvm_file; | 525 | mvm->nvm_file_name = iwlwifi_mod_params.nvm_file; |
526 | else | 526 | } else if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) { |
527 | mvm->nvm_file_name = mvm->cfg->default_nvm_file; | 527 | if (CSR_HW_REV_STEP(trans->hw_rev) == SILICON_B_STEP) |
528 | mvm->nvm_file_name = mvm->cfg->default_nvm_file_B_step; | ||
529 | else | ||
530 | mvm->nvm_file_name = mvm->cfg->default_nvm_file_C_step; | ||
531 | } | ||
528 | 532 | ||
529 | if (WARN(cfg->no_power_up_nic_in_init && !mvm->nvm_file_name, | 533 | if (WARN(cfg->no_power_up_nic_in_init && !mvm->nvm_file_name, |
530 | "not allowing power-up and not having nvm_file\n")) | 534 | "not allowing power-up and not having nvm_file\n")) |