Commit e02a9d60 authored by Eran Harary's avatar Eran Harary Committed by Emmanuel Grumbach

iwlwifi: 8000: add default NVM file name in family 8000

The 8000 family products need a file on the file system
which is used as NVM. This file is a must, if no filename
is supplied as module parameter, use a default filename.
Signed-off-by: default avatarEran Harary <eran.harary@intel.com>
Reviewed-by: default avatarDor Shaish <dor.shaish@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent aeb0cf3c
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
#define IWL8000_MODULE_FIRMWARE(api) IWL8000_FW_PRE __stringify(api) ".ucode" #define IWL8000_MODULE_FIRMWARE(api) IWL8000_FW_PRE __stringify(api) ".ucode"
#define NVM_HW_SECTION_NUM_FAMILY_8000 10 #define NVM_HW_SECTION_NUM_FAMILY_8000 10
#define DEFAULT_NVM_FILE_FAMILY_8000 "iwl_nvm_8000.bin"
static const struct iwl_base_params iwl8000_base_params = { static const struct iwl_base_params iwl8000_base_params = {
.eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000, .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000,
...@@ -118,6 +119,7 @@ const struct iwl_cfg iwl8260_2ac_cfg = { ...@@ -118,6 +119,7 @@ const struct iwl_cfg iwl8260_2ac_cfg = {
.ht_params = &iwl8000_ht_params, .ht_params = &iwl8000_ht_params,
.nvm_ver = IWL8000_NVM_VERSION, .nvm_ver = IWL8000_NVM_VERSION,
.nvm_calib_ver = IWL8000_TX_POWER_VERSION, .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
.default_nvm_file = DEFAULT_NVM_FILE_FAMILY_8000,
}; };
const struct iwl_cfg iwl8260_n_cfg = { const struct iwl_cfg iwl8260_n_cfg = {
...@@ -127,6 +129,7 @@ const struct iwl_cfg iwl8260_n_cfg = { ...@@ -127,6 +129,7 @@ const struct iwl_cfg iwl8260_n_cfg = {
.ht_params = &iwl8000_ht_params, .ht_params = &iwl8000_ht_params,
.nvm_ver = IWL8000_NVM_VERSION, .nvm_ver = IWL8000_NVM_VERSION,
.nvm_calib_ver = IWL8000_TX_POWER_VERSION, .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
.default_nvm_file = DEFAULT_NVM_FILE_FAMILY_8000,
}; };
MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_OK)); MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_OK));
...@@ -275,6 +275,7 @@ struct iwl_cfg { ...@@ -275,6 +275,7 @@ struct iwl_cfg {
bool lp_xtal_workaround; bool lp_xtal_workaround;
const struct iwl_pwr_tx_backoff *pwr_tx_backoffs; const struct iwl_pwr_tx_backoff *pwr_tx_backoffs;
bool no_power_up_nic_in_init; bool no_power_up_nic_in_init;
const char *default_nvm_file;
}; };
/* /*
......
...@@ -303,7 +303,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) ...@@ -303,7 +303,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
} }
/* In case we read the NVM from external file, load it to the NIC */ /* In case we read the NVM from external file, load it to the NIC */
if (iwlwifi_mod_params.nvm_file) if (mvm->nvm_file_name)
iwl_mvm_load_nvm_to_nic(mvm); iwl_mvm_load_nvm_to_nic(mvm);
ret = iwl_nvm_check_version(mvm->nvm_data, mvm->trans); ret = iwl_nvm_check_version(mvm->nvm_data, mvm->trans);
......
...@@ -501,6 +501,7 @@ struct iwl_mvm { ...@@ -501,6 +501,7 @@ struct iwl_mvm {
u8 queue_to_mac80211[IWL_MAX_HW_QUEUES]; u8 queue_to_mac80211[IWL_MAX_HW_QUEUES];
atomic_t queue_stop_count[IWL_MAX_HW_QUEUES]; atomic_t queue_stop_count[IWL_MAX_HW_QUEUES];
const char *nvm_file_name;
struct iwl_nvm_data *nvm_data; struct iwl_nvm_data *nvm_data;
/* NVM sections */ /* NVM sections */
struct iwl_nvm_section nvm_sections[NVM_MAX_NUM_SECTIONS]; struct iwl_nvm_section nvm_sections[NVM_MAX_NUM_SECTIONS];
......
...@@ -318,16 +318,16 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm) ...@@ -318,16 +318,16 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm)
* get here after that we assume the NVM request can be satisfied * get here after that we assume the NVM request can be satisfied
* synchronously. * synchronously.
*/ */
ret = request_firmware(&fw_entry, iwlwifi_mod_params.nvm_file, ret = request_firmware(&fw_entry, mvm->nvm_file_name,
mvm->trans->dev); mvm->trans->dev);
if (ret) { if (ret) {
IWL_ERR(mvm, "ERROR: %s isn't available %d\n", IWL_ERR(mvm, "ERROR: %s isn't available %d\n",
iwlwifi_mod_params.nvm_file, ret); mvm->nvm_file_name, ret);
return ret; return ret;
} }
IWL_INFO(mvm, "Loaded NVM file %s (%zu bytes)\n", IWL_INFO(mvm, "Loaded NVM file %s (%zu bytes)\n",
iwlwifi_mod_params.nvm_file, fw_entry->size); mvm->nvm_file_name, fw_entry->size);
if (fw_entry->size < sizeof(*file_sec)) { if (fw_entry->size < sizeof(*file_sec)) {
IWL_ERR(mvm, "NVM file too small\n"); IWL_ERR(mvm, "NVM file too small\n");
...@@ -513,7 +513,7 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic) ...@@ -513,7 +513,7 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic)
} }
/* load external NVM if configured */ /* load external NVM if configured */
if (iwlwifi_mod_params.nvm_file) { if (mvm->nvm_file_name) {
/* move to External NVM flow */ /* move to External NVM flow */
ret = iwl_mvm_read_external_nvm(mvm); ret = iwl_mvm_read_external_nvm(mvm);
if (ret) if (ret)
......
...@@ -466,8 +466,13 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -466,8 +466,13 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
min_backoff = calc_min_backoff(trans, cfg); min_backoff = calc_min_backoff(trans, cfg);
iwl_mvm_tt_initialize(mvm, min_backoff); iwl_mvm_tt_initialize(mvm, min_backoff);
/* set the nvm_file_name according to priority */
if (iwlwifi_mod_params.nvm_file)
mvm->nvm_file_name = iwlwifi_mod_params.nvm_file;
else
mvm->nvm_file_name = mvm->cfg->default_nvm_file;
if (WARN(cfg->no_power_up_nic_in_init && !iwlwifi_mod_params.nvm_file, if (WARN(cfg->no_power_up_nic_in_init && !mvm->nvm_file_name,
"not allowing power-up and not having nvm_file\n")) "not allowing power-up and not having nvm_file\n"))
goto out_free; goto out_free;
...@@ -477,7 +482,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -477,7 +482,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
* and not in the file. * and not in the file.
* for nics with no_power_up_nic_in_init: rely completley on nvm_file * for nics with no_power_up_nic_in_init: rely completley on nvm_file
*/ */
if (cfg->no_power_up_nic_in_init && iwlwifi_mod_params.nvm_file) { if (cfg->no_power_up_nic_in_init && mvm->nvm_file_name) {
err = iwl_nvm_init(mvm, false); err = iwl_nvm_init(mvm, false);
if (err) if (err)
goto out_free; goto out_free;
...@@ -525,7 +530,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -525,7 +530,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
out_free: out_free:
iwl_phy_db_free(mvm->phy_db); iwl_phy_db_free(mvm->phy_db);
kfree(mvm->scan_cmd); kfree(mvm->scan_cmd);
if (!cfg->no_power_up_nic_in_init || !iwlwifi_mod_params.nvm_file) if (!cfg->no_power_up_nic_in_init || !mvm->nvm_file_name)
iwl_trans_op_mode_leave(trans); iwl_trans_op_mode_leave(trans);
ieee80211_free_hw(mvm->hw); ieee80211_free_hw(mvm->hw);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment