iwlagn: remove bootstrap code
Only 4965 had a bootstrap microcode image, so the agn driver can completely ignore that and we can remove some code from it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
35b1d92dfb
commit
1fc352765f
@ -141,7 +141,6 @@ static int iwl1000_hw_set_hw_params(struct iwl_priv *priv)
|
|||||||
priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
|
priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
|
||||||
priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
|
priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
|
||||||
|
|
||||||
priv->hw_params.max_bsm_size = 0;
|
|
||||||
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
||||||
BIT(IEEE80211_BAND_5GHZ);
|
BIT(IEEE80211_BAND_5GHZ);
|
||||||
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
||||||
|
@ -147,7 +147,6 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv)
|
|||||||
priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
|
priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
|
||||||
priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
|
priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
|
||||||
|
|
||||||
priv->hw_params.max_bsm_size = 0;
|
|
||||||
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
||||||
BIT(IEEE80211_BAND_5GHZ);
|
BIT(IEEE80211_BAND_5GHZ);
|
||||||
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
||||||
|
@ -185,7 +185,6 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
|
|||||||
priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
|
priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
|
||||||
priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
|
priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
|
||||||
|
|
||||||
priv->hw_params.max_bsm_size = 0;
|
|
||||||
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
||||||
BIT(IEEE80211_BAND_5GHZ);
|
BIT(IEEE80211_BAND_5GHZ);
|
||||||
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
||||||
@ -231,7 +230,6 @@ static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
|
|||||||
priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
|
priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
|
||||||
priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
|
priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
|
||||||
|
|
||||||
priv->hw_params.max_bsm_size = 0;
|
|
||||||
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
||||||
BIT(IEEE80211_BAND_5GHZ);
|
BIT(IEEE80211_BAND_5GHZ);
|
||||||
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
||||||
|
@ -176,7 +176,6 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
|
|||||||
priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
|
priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
|
||||||
priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
|
priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
|
||||||
|
|
||||||
priv->hw_params.max_bsm_size = 0;
|
|
||||||
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
|
||||||
BIT(IEEE80211_BAND_5GHZ);
|
BIT(IEEE80211_BAND_5GHZ);
|
||||||
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
|
||||||
|
@ -1181,7 +1181,6 @@ static void iwl_dealloc_ucode_pci(struct iwl_priv *priv)
|
|||||||
iwl_free_fw_desc(priv->pci_dev, &priv->ucode_data_backup);
|
iwl_free_fw_desc(priv->pci_dev, &priv->ucode_data_backup);
|
||||||
iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init);
|
iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init);
|
||||||
iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init_data);
|
iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init_data);
|
||||||
iwl_free_fw_desc(priv->pci_dev, &priv->ucode_boot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void iwl_nic_start(struct iwl_priv *priv)
|
static void iwl_nic_start(struct iwl_priv *priv)
|
||||||
@ -1239,8 +1238,8 @@ static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct iwlagn_firmware_pieces {
|
struct iwlagn_firmware_pieces {
|
||||||
const void *inst, *data, *init, *init_data, *boot;
|
const void *inst, *data, *init, *init_data;
|
||||||
size_t inst_size, data_size, init_size, init_data_size, boot_size;
|
size_t inst_size, data_size, init_size, init_data_size;
|
||||||
|
|
||||||
u32 build;
|
u32 build;
|
||||||
|
|
||||||
@ -1271,7 +1270,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
|
|||||||
pieces->data_size = le32_to_cpu(ucode->u.v2.data_size);
|
pieces->data_size = le32_to_cpu(ucode->u.v2.data_size);
|
||||||
pieces->init_size = le32_to_cpu(ucode->u.v2.init_size);
|
pieces->init_size = le32_to_cpu(ucode->u.v2.init_size);
|
||||||
pieces->init_data_size = le32_to_cpu(ucode->u.v2.init_data_size);
|
pieces->init_data_size = le32_to_cpu(ucode->u.v2.init_data_size);
|
||||||
pieces->boot_size = le32_to_cpu(ucode->u.v2.boot_size);
|
|
||||||
src = ucode->u.v2.data;
|
src = ucode->u.v2.data;
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
@ -1287,7 +1285,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
|
|||||||
pieces->data_size = le32_to_cpu(ucode->u.v1.data_size);
|
pieces->data_size = le32_to_cpu(ucode->u.v1.data_size);
|
||||||
pieces->init_size = le32_to_cpu(ucode->u.v1.init_size);
|
pieces->init_size = le32_to_cpu(ucode->u.v1.init_size);
|
||||||
pieces->init_data_size = le32_to_cpu(ucode->u.v1.init_data_size);
|
pieces->init_data_size = le32_to_cpu(ucode->u.v1.init_data_size);
|
||||||
pieces->boot_size = le32_to_cpu(ucode->u.v1.boot_size);
|
|
||||||
src = ucode->u.v1.data;
|
src = ucode->u.v1.data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1295,7 +1292,7 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
|
|||||||
/* Verify size of file vs. image size info in file's header */
|
/* Verify size of file vs. image size info in file's header */
|
||||||
if (ucode_raw->size != hdr_size + pieces->inst_size +
|
if (ucode_raw->size != hdr_size + pieces->inst_size +
|
||||||
pieces->data_size + pieces->init_size +
|
pieces->data_size + pieces->init_size +
|
||||||
pieces->init_data_size + pieces->boot_size) {
|
pieces->init_data_size) {
|
||||||
|
|
||||||
IWL_ERR(priv,
|
IWL_ERR(priv,
|
||||||
"uCode file size %d does not match expected size\n",
|
"uCode file size %d does not match expected size\n",
|
||||||
@ -1311,8 +1308,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
|
|||||||
src += pieces->init_size;
|
src += pieces->init_size;
|
||||||
pieces->init_data = src;
|
pieces->init_data = src;
|
||||||
src += pieces->init_data_size;
|
src += pieces->init_data_size;
|
||||||
pieces->boot = src;
|
|
||||||
src += pieces->boot_size;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1413,8 +1408,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
|
|||||||
pieces->init_data_size = tlv_len;
|
pieces->init_data_size = tlv_len;
|
||||||
break;
|
break;
|
||||||
case IWL_UCODE_TLV_BOOT:
|
case IWL_UCODE_TLV_BOOT:
|
||||||
pieces->boot = tlv_data;
|
IWL_ERR(priv, "Found unexpected BOOT ucode\n");
|
||||||
pieces->boot_size = tlv_len;
|
|
||||||
break;
|
break;
|
||||||
case IWL_UCODE_TLV_PROBE_MAX_LEN:
|
case IWL_UCODE_TLV_PROBE_MAX_LEN:
|
||||||
if (tlv_len != sizeof(u32))
|
if (tlv_len != sizeof(u32))
|
||||||
@ -1614,8 +1608,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
|
|||||||
pieces.init_size);
|
pieces.init_size);
|
||||||
IWL_DEBUG_INFO(priv, "f/w package hdr init data size = %Zd\n",
|
IWL_DEBUG_INFO(priv, "f/w package hdr init data size = %Zd\n",
|
||||||
pieces.init_data_size);
|
pieces.init_data_size);
|
||||||
IWL_DEBUG_INFO(priv, "f/w package hdr boot inst size = %Zd\n",
|
|
||||||
pieces.boot_size);
|
|
||||||
|
|
||||||
/* Verify that uCode images will fit in card's SRAM */
|
/* Verify that uCode images will fit in card's SRAM */
|
||||||
if (pieces.inst_size > priv->hw_params.max_inst_size) {
|
if (pieces.inst_size > priv->hw_params.max_inst_size) {
|
||||||
@ -1642,12 +1634,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
|
|||||||
goto try_again;
|
goto try_again;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pieces.boot_size > priv->hw_params.max_bsm_size) {
|
|
||||||
IWL_ERR(priv, "uCode boot instr len %Zd too large to fit in\n",
|
|
||||||
pieces.boot_size);
|
|
||||||
goto try_again;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Allocate ucode buffers for card's bus-master loading ... */
|
/* Allocate ucode buffers for card's bus-master loading ... */
|
||||||
|
|
||||||
/* Runtime instructions and 2 copies of data:
|
/* Runtime instructions and 2 copies of data:
|
||||||
@ -1678,15 +1664,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
|
|||||||
goto err_pci_alloc;
|
goto err_pci_alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bootstrap (instructions only, no data) */
|
|
||||||
if (pieces.boot_size) {
|
|
||||||
priv->ucode_boot.len = pieces.boot_size;
|
|
||||||
iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_boot);
|
|
||||||
|
|
||||||
if (!priv->ucode_boot.v_addr)
|
|
||||||
goto err_pci_alloc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now that we can no longer fail, copy information */
|
/* Now that we can no longer fail, copy information */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1749,11 +1726,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
|
|||||||
pieces.init_data_size);
|
pieces.init_data_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bootstrap instructions */
|
|
||||||
IWL_DEBUG_INFO(priv, "Copying (but not loading) boot instr len %Zd\n",
|
|
||||||
pieces.boot_size);
|
|
||||||
memcpy(priv->ucode_boot.v_addr, pieces.boot, pieces.boot_size);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* figure out the offset of chain noise reset and gain commands
|
* figure out the offset of chain noise reset and gain commands
|
||||||
* base on the size of standard phy calibration commands table size
|
* base on the size of standard phy calibration commands table size
|
||||||
|
@ -641,7 +641,6 @@ struct iwl_hw_params {
|
|||||||
u8 max_beacon_itrvl; /* in 1024 ms */
|
u8 max_beacon_itrvl; /* in 1024 ms */
|
||||||
u32 max_inst_size;
|
u32 max_inst_size;
|
||||||
u32 max_data_size;
|
u32 max_data_size;
|
||||||
u32 max_bsm_size;
|
|
||||||
u32 ct_kill_threshold; /* value in hw-dependent units */
|
u32 ct_kill_threshold; /* value in hw-dependent units */
|
||||||
u32 ct_kill_exit_threshold; /* value in hw-dependent units */
|
u32 ct_kill_exit_threshold; /* value in hw-dependent units */
|
||||||
/* for 1000, 6000 series and up */
|
/* for 1000, 6000 series and up */
|
||||||
@ -1263,7 +1262,6 @@ struct iwl_priv {
|
|||||||
struct fw_desc ucode_data_backup; /* runtime data save/restore */
|
struct fw_desc ucode_data_backup; /* runtime data save/restore */
|
||||||
struct fw_desc ucode_init; /* initialization inst */
|
struct fw_desc ucode_init; /* initialization inst */
|
||||||
struct fw_desc ucode_init_data; /* initialization data */
|
struct fw_desc ucode_init_data; /* initialization data */
|
||||||
struct fw_desc ucode_boot; /* bootstrap inst */
|
|
||||||
enum ucode_type ucode_type;
|
enum ucode_type ucode_type;
|
||||||
u8 ucode_write_complete; /* the image write is complete */
|
u8 ucode_write_complete; /* the image write is complete */
|
||||||
char firmware_name[25];
|
char firmware_name[25];
|
||||||
|
Loading…
Reference in New Issue
Block a user