Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /******************************************************************************
0003  *
0004  * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
0005  * Copyright(c) 2018 - 2020 Intel Corporation
0006  *****************************************************************************/
0007 
0008 #include <linux/module.h>
0009 #include <linux/stringify.h>
0010 #include "iwl-config.h"
0011 #include "iwl-agn-hw.h"
0012 #include "dvm/commands.h" /* needed for BT for now */
0013 
0014 /* Highest firmware API version supported */
0015 #define IWL6000_UCODE_API_MAX 6
0016 #define IWL6050_UCODE_API_MAX 5
0017 #define IWL6000G2_UCODE_API_MAX 6
0018 #define IWL6035_UCODE_API_MAX 6
0019 
0020 /* Lowest firmware API version supported */
0021 #define IWL6000_UCODE_API_MIN 4
0022 #define IWL6050_UCODE_API_MIN 4
0023 #define IWL6000G2_UCODE_API_MIN 5
0024 #define IWL6035_UCODE_API_MIN 6
0025 
0026 /* EEPROM versions */
0027 #define EEPROM_6000_TX_POWER_VERSION    (4)
0028 #define EEPROM_6000_EEPROM_VERSION  (0x423)
0029 #define EEPROM_6050_TX_POWER_VERSION    (4)
0030 #define EEPROM_6050_EEPROM_VERSION  (0x532)
0031 #define EEPROM_6150_TX_POWER_VERSION    (6)
0032 #define EEPROM_6150_EEPROM_VERSION  (0x553)
0033 #define EEPROM_6005_TX_POWER_VERSION    (6)
0034 #define EEPROM_6005_EEPROM_VERSION  (0x709)
0035 #define EEPROM_6030_TX_POWER_VERSION    (6)
0036 #define EEPROM_6030_EEPROM_VERSION  (0x709)
0037 #define EEPROM_6035_TX_POWER_VERSION    (6)
0038 #define EEPROM_6035_EEPROM_VERSION  (0x753)
0039 
0040 #define IWL6000_FW_PRE "iwlwifi-6000-"
0041 #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
0042 
0043 #define IWL6050_FW_PRE "iwlwifi-6050-"
0044 #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
0045 
0046 #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
0047 #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
0048 
0049 #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
0050 #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
0051 
0052 static const struct iwl_base_params iwl6000_base_params = {
0053     .eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
0054     .num_of_queues = IWLAGN_NUM_QUEUES,
0055     .max_tfd_queue_size = 256,
0056     .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
0057     .shadow_ram_support = true,
0058     .led_compensation = 51,
0059     .wd_timeout = IWL_DEF_WD_TIMEOUT,
0060     .max_event_log_size = 512,
0061     .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
0062     .scd_chain_ext_wa = true,
0063 };
0064 
0065 static const struct iwl_base_params iwl6050_base_params = {
0066     .eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
0067     .num_of_queues = IWLAGN_NUM_QUEUES,
0068     .max_tfd_queue_size = 256,
0069     .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
0070     .shadow_ram_support = true,
0071     .led_compensation = 51,
0072     .wd_timeout = IWL_DEF_WD_TIMEOUT,
0073     .max_event_log_size = 1024,
0074     .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
0075     .scd_chain_ext_wa = true,
0076 };
0077 
0078 static const struct iwl_base_params iwl6000_g2_base_params = {
0079     .eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
0080     .num_of_queues = IWLAGN_NUM_QUEUES,
0081     .max_tfd_queue_size = 256,
0082     .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
0083     .shadow_ram_support = true,
0084     .led_compensation = 57,
0085     .wd_timeout = IWL_LONG_WD_TIMEOUT,
0086     .max_event_log_size = 512,
0087     .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
0088     .scd_chain_ext_wa = true,
0089 };
0090 
0091 static const struct iwl_ht_params iwl6000_ht_params = {
0092     .ht_greenfield_support = true,
0093     .use_rts_for_aggregation = true, /* use rts/cts protection */
0094     .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
0095 };
0096 
0097 static const struct iwl_eeprom_params iwl6000_eeprom_params = {
0098     .regulatory_bands = {
0099         EEPROM_REG_BAND_1_CHANNELS,
0100         EEPROM_REG_BAND_2_CHANNELS,
0101         EEPROM_REG_BAND_3_CHANNELS,
0102         EEPROM_REG_BAND_4_CHANNELS,
0103         EEPROM_REG_BAND_5_CHANNELS,
0104         EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
0105         EEPROM_REG_BAND_52_HT40_CHANNELS
0106     },
0107     .enhanced_txpower = true,
0108 };
0109 
0110 #define IWL_DEVICE_6005                     \
0111     .fw_name_pre = IWL6005_FW_PRE,              \
0112     .ucode_api_max = IWL6000G2_UCODE_API_MAX,       \
0113     .ucode_api_min = IWL6000G2_UCODE_API_MIN,       \
0114     .trans.device_family = IWL_DEVICE_FAMILY_6005,      \
0115     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0116     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0117     .nvm_ver = EEPROM_6005_EEPROM_VERSION,      \
0118     .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION,  \
0119     .trans.base_params = &iwl6000_g2_base_params,       \
0120     .eeprom_params = &iwl6000_eeprom_params,        \
0121     .led_mode = IWL_LED_RF_STATE
0122 
0123 const struct iwl_cfg iwl6005_2agn_cfg = {
0124     .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
0125     IWL_DEVICE_6005,
0126     .ht_params = &iwl6000_ht_params,
0127 };
0128 
0129 const struct iwl_cfg iwl6005_2abg_cfg = {
0130     .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
0131     IWL_DEVICE_6005,
0132 };
0133 
0134 const struct iwl_cfg iwl6005_2bg_cfg = {
0135     .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
0136     IWL_DEVICE_6005,
0137 };
0138 
0139 const struct iwl_cfg iwl6005_2agn_sff_cfg = {
0140     .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
0141     IWL_DEVICE_6005,
0142     .ht_params = &iwl6000_ht_params,
0143 };
0144 
0145 const struct iwl_cfg iwl6005_2agn_d_cfg = {
0146     .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
0147     IWL_DEVICE_6005,
0148     .ht_params = &iwl6000_ht_params,
0149 };
0150 
0151 const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
0152     .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
0153     IWL_DEVICE_6005,
0154     .ht_params = &iwl6000_ht_params,
0155 };
0156 
0157 const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
0158     .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
0159     IWL_DEVICE_6005,
0160     .ht_params = &iwl6000_ht_params,
0161 };
0162 
0163 #define IWL_DEVICE_6030                     \
0164     .fw_name_pre = IWL6030_FW_PRE,              \
0165     .ucode_api_max = IWL6000G2_UCODE_API_MAX,       \
0166     .ucode_api_min = IWL6000G2_UCODE_API_MIN,       \
0167     .trans.device_family = IWL_DEVICE_FAMILY_6030,      \
0168     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0169     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0170     .nvm_ver = EEPROM_6030_EEPROM_VERSION,      \
0171     .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION,  \
0172     .trans.base_params = &iwl6000_g2_base_params,       \
0173     .eeprom_params = &iwl6000_eeprom_params,        \
0174     .led_mode = IWL_LED_RF_STATE
0175 
0176 const struct iwl_cfg iwl6030_2agn_cfg = {
0177     .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
0178     IWL_DEVICE_6030,
0179     .ht_params = &iwl6000_ht_params,
0180 };
0181 
0182 const struct iwl_cfg iwl6030_2abg_cfg = {
0183     .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
0184     IWL_DEVICE_6030,
0185 };
0186 
0187 const struct iwl_cfg iwl6030_2bgn_cfg = {
0188     .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
0189     IWL_DEVICE_6030,
0190     .ht_params = &iwl6000_ht_params,
0191 };
0192 
0193 const struct iwl_cfg iwl6030_2bg_cfg = {
0194     .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
0195     IWL_DEVICE_6030,
0196 };
0197 
0198 #define IWL_DEVICE_6035                     \
0199     .fw_name_pre = IWL6030_FW_PRE,              \
0200     .ucode_api_max = IWL6035_UCODE_API_MAX,         \
0201     .ucode_api_min = IWL6035_UCODE_API_MIN,         \
0202     .trans.device_family = IWL_DEVICE_FAMILY_6030,      \
0203     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0204     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0205     .nvm_ver = EEPROM_6030_EEPROM_VERSION,      \
0206     .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION,  \
0207     .trans.base_params = &iwl6000_g2_base_params,       \
0208     .eeprom_params = &iwl6000_eeprom_params,        \
0209     .led_mode = IWL_LED_RF_STATE
0210 
0211 const struct iwl_cfg iwl6035_2agn_cfg = {
0212     .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
0213     IWL_DEVICE_6035,
0214     .ht_params = &iwl6000_ht_params,
0215 };
0216 
0217 const struct iwl_cfg iwl6035_2agn_sff_cfg = {
0218     .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
0219     IWL_DEVICE_6035,
0220     .ht_params = &iwl6000_ht_params,
0221 };
0222 
0223 const struct iwl_cfg iwl1030_bgn_cfg = {
0224     .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
0225     IWL_DEVICE_6030,
0226     .ht_params = &iwl6000_ht_params,
0227 };
0228 
0229 const struct iwl_cfg iwl1030_bg_cfg = {
0230     .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
0231     IWL_DEVICE_6030,
0232 };
0233 
0234 const struct iwl_cfg iwl130_bgn_cfg = {
0235     .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
0236     IWL_DEVICE_6030,
0237     .ht_params = &iwl6000_ht_params,
0238     .rx_with_siso_diversity = true,
0239 };
0240 
0241 const struct iwl_cfg iwl130_bg_cfg = {
0242     .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
0243     IWL_DEVICE_6030,
0244     .rx_with_siso_diversity = true,
0245 };
0246 
0247 /*
0248  * "i": Internal configuration, use internal Power Amplifier
0249  */
0250 #define IWL_DEVICE_6000i                    \
0251     .fw_name_pre = IWL6000_FW_PRE,              \
0252     .ucode_api_max = IWL6000_UCODE_API_MAX,         \
0253     .ucode_api_min = IWL6000_UCODE_API_MIN,         \
0254     .trans.device_family = IWL_DEVICE_FAMILY_6000i,     \
0255     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0256     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0257     .valid_tx_ant = ANT_BC,     /* .cfg overwrite */    \
0258     .valid_rx_ant = ANT_BC,     /* .cfg overwrite */    \
0259     .nvm_ver = EEPROM_6000_EEPROM_VERSION,      \
0260     .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,  \
0261     .trans.base_params = &iwl6000_base_params,      \
0262     .eeprom_params = &iwl6000_eeprom_params,        \
0263     .led_mode = IWL_LED_BLINK
0264 
0265 const struct iwl_cfg iwl6000i_2agn_cfg = {
0266     .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
0267     IWL_DEVICE_6000i,
0268     .ht_params = &iwl6000_ht_params,
0269 };
0270 
0271 const struct iwl_cfg iwl6000i_2abg_cfg = {
0272     .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
0273     IWL_DEVICE_6000i,
0274 };
0275 
0276 const struct iwl_cfg iwl6000i_2bg_cfg = {
0277     .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
0278     IWL_DEVICE_6000i,
0279 };
0280 
0281 #define IWL_DEVICE_6050                     \
0282     .fw_name_pre = IWL6050_FW_PRE,              \
0283     .ucode_api_max = IWL6050_UCODE_API_MAX,         \
0284     .ucode_api_min = IWL6050_UCODE_API_MIN,         \
0285     .trans.device_family = IWL_DEVICE_FAMILY_6050,      \
0286     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0287     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0288     .valid_tx_ant = ANT_AB,     /* .cfg overwrite */    \
0289     .valid_rx_ant = ANT_AB,     /* .cfg overwrite */    \
0290     .nvm_ver = EEPROM_6050_EEPROM_VERSION,      \
0291     .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION,  \
0292     .trans.base_params = &iwl6050_base_params,      \
0293     .eeprom_params = &iwl6000_eeprom_params,        \
0294     .led_mode = IWL_LED_BLINK,              \
0295     .internal_wimax_coex = true
0296 
0297 const struct iwl_cfg iwl6050_2agn_cfg = {
0298     .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
0299     IWL_DEVICE_6050,
0300     .ht_params = &iwl6000_ht_params,
0301 };
0302 
0303 const struct iwl_cfg iwl6050_2abg_cfg = {
0304     .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
0305     IWL_DEVICE_6050,
0306 };
0307 
0308 #define IWL_DEVICE_6150                     \
0309     .fw_name_pre = IWL6050_FW_PRE,              \
0310     .ucode_api_max = IWL6050_UCODE_API_MAX,         \
0311     .ucode_api_min = IWL6050_UCODE_API_MIN,         \
0312     .trans.device_family = IWL_DEVICE_FAMILY_6150,      \
0313     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0314     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0315     .nvm_ver = EEPROM_6150_EEPROM_VERSION,      \
0316     .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION,  \
0317     .trans.base_params = &iwl6050_base_params,      \
0318     .eeprom_params = &iwl6000_eeprom_params,        \
0319     .led_mode = IWL_LED_BLINK,              \
0320     .internal_wimax_coex = true
0321 
0322 const struct iwl_cfg iwl6150_bgn_cfg = {
0323     .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
0324     IWL_DEVICE_6150,
0325     .ht_params = &iwl6000_ht_params,
0326 };
0327 
0328 const struct iwl_cfg iwl6150_bg_cfg = {
0329     .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
0330     IWL_DEVICE_6150,
0331 };
0332 
0333 const struct iwl_cfg iwl6000_3agn_cfg = {
0334     .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
0335     .fw_name_pre = IWL6000_FW_PRE,
0336     .ucode_api_max = IWL6000_UCODE_API_MAX,
0337     .ucode_api_min = IWL6000_UCODE_API_MIN,
0338     .trans.device_family = IWL_DEVICE_FAMILY_6000,
0339     .max_inst_size = IWL60_RTC_INST_SIZE,
0340     .max_data_size = IWL60_RTC_DATA_SIZE,
0341     .nvm_ver = EEPROM_6000_EEPROM_VERSION,
0342     .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
0343     .trans.base_params = &iwl6000_base_params,
0344     .eeprom_params = &iwl6000_eeprom_params,
0345     .ht_params = &iwl6000_ht_params,
0346     .led_mode = IWL_LED_BLINK,
0347 };
0348 
0349 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
0350 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
0351 MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
0352 MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));