blob: a6ddd2f9fba0501acfa4ddcf11edc08d4e545ffb [file] [log] [blame]
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -08001/******************************************************************************
2 *
Johannes Berg128e63e2013-01-21 21:39:26 +01003 * Copyright(c) 2008 - 2013 Intel Corporation. All rights reserved.
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -08004 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080027#include <linux/module.h>
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070028#include <linux/stringify.h>
Johannes Berge9676692012-04-10 14:10:28 -070029#include "iwl-config.h"
Johannes Berg0db19cd2012-04-03 20:57:59 +020030#include "iwl-agn-hw.h"
Johannes Berg1023fdc2012-05-15 12:16:34 +020031#include "dvm/commands.h" /* needed for BT for now */
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080032
33/* Highest firmware API version supported */
Johannes Bergca9a4602011-07-23 10:24:45 -070034#define IWL2030_UCODE_API_MAX 6
35#define IWL2000_UCODE_API_MAX 6
36#define IWL105_UCODE_API_MAX 6
37#define IWL135_UCODE_API_MAX 6
38
39/* Oldest version we won't warn about */
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -070040#define IWL2030_UCODE_API_OK 6
41#define IWL2000_UCODE_API_OK 6
42#define IWL105_UCODE_API_OK 6
43#define IWL135_UCODE_API_OK 6
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080044
45/* Lowest firmware API version supported */
46#define IWL2030_UCODE_API_MIN 5
47#define IWL2000_UCODE_API_MIN 5
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -070048#define IWL105_UCODE_API_MIN 5
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070049#define IWL135_UCODE_API_MIN 5
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080050
Johannes Berg586aed92012-04-03 20:41:07 +020051/* EEPROM version */
52#define EEPROM_2000_TX_POWER_VERSION (6)
53#define EEPROM_2000_EEPROM_VERSION (0x805)
54
55
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080056#define IWL2030_FW_PRE "iwlwifi-2030-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070057#define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080058
59#define IWL2000_FW_PRE "iwlwifi-2000-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070060#define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080061
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -070062#define IWL105_FW_PRE "iwlwifi-105-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070063#define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080064
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070065#define IWL135_FW_PRE "iwlwifi-135-"
Fry, Donald H5092e472011-09-15 11:46:37 -070066#define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070067
Johannes Berg6794f3e2012-03-06 13:30:56 -080068static const struct iwl_base_params iwl2000_base_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080069 .eeprom_size = OTP_LOW_IMAGE_SIZE,
70 .num_of_queues = IWLAGN_NUM_QUEUES,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080071 .pll_cfg_val = 0,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080072 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
73 .shadow_ram_support = true,
74 .led_compensation = 51,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080075 .adv_thermal_throttle = true,
76 .support_ct_kill_exit = true,
77 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
78 .chain_noise_scale = 1000,
79 .wd_timeout = IWL_DEF_WD_TIMEOUT,
80 .max_event_log_size = 512,
Meenakshi Venkataraman66a77072012-05-16 22:35:59 +020081 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
Wey-Yi Guyae7f9a72011-07-23 10:24:50 -070082 .hd_v2 = true,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080083};
84
85
Johannes Berg6794f3e2012-03-06 13:30:56 -080086static const struct iwl_base_params iwl2030_base_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080087 .eeprom_size = OTP_LOW_IMAGE_SIZE,
88 .num_of_queues = IWLAGN_NUM_QUEUES,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080089 .pll_cfg_val = 0,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080090 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
91 .shadow_ram_support = true,
92 .led_compensation = 57,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080093 .adv_thermal_throttle = true,
94 .support_ct_kill_exit = true,
95 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
96 .chain_noise_scale = 1000,
97 .wd_timeout = IWL_LONG_WD_TIMEOUT,
98 .max_event_log_size = 512,
Meenakshi Venkataraman66a77072012-05-16 22:35:59 +020099 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
Wey-Yi Guyae7f9a72011-07-23 10:24:50 -0700100 .hd_v2 = true,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800101};
102
Johannes Berg6794f3e2012-03-06 13:30:56 -0800103static const struct iwl_ht_params iwl2000_ht_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800104 .ht_greenfield_support = true,
105 .use_rts_for_aggregation = true, /* use rts/cts protection */
Johannes Bergd3704932012-05-21 20:03:01 +0200106 .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800107};
108
Johannes Berg6794f3e2012-03-06 13:30:56 -0800109static const struct iwl_bt_params iwl2030_bt_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800110 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
111 .advanced_bt_coexist = true,
112 .agg_time_limit = BT_AGG_THRESHOLD_DEF,
113 .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
Wey-Yi Guye911ede2012-06-23 09:06:19 -0700114 .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT32,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800115 .bt_sco_disable = true,
Wey-Yi Guy60132702011-02-18 17:23:54 -0800116 .bt_session_2 = true,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800117};
118
Johannes Berg26a7ca92012-05-21 11:55:54 +0200119static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
120 .regulatory_bands = {
121 EEPROM_REG_BAND_1_CHANNELS,
122 EEPROM_REG_BAND_2_CHANNELS,
123 EEPROM_REG_BAND_3_CHANNELS,
124 EEPROM_REG_BAND_4_CHANNELS,
125 EEPROM_REG_BAND_5_CHANNELS,
126 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
127 EEPROM_REGULATORY_BAND_NO_HT40,
128 },
129 .enhanced_txpower = true,
130};
131
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800132#define IWL_DEVICE_2000 \
133 .fw_name_pre = IWL2000_FW_PRE, \
134 .ucode_api_max = IWL2000_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700135 .ucode_api_ok = IWL2000_UCODE_API_OK, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800136 .ucode_api_min = IWL2000_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700137 .device_family = IWL_DEVICE_FAMILY_2000, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200138 .max_inst_size = IWL60_RTC_INST_SIZE, \
139 .max_data_size = IWL60_RTC_DATA_SIZE, \
Eytan Lifshitzb7998c82012-12-01 20:59:49 +0200140 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
141 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800142 .base_params = &iwl2000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200143 .eeprom_params = &iwl20x0_eeprom_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800144 .need_temp_offset_calib = true, \
Wey-Yi Guyc6f30342011-09-15 11:46:50 -0700145 .temp_offset_v2 = true, \
Johannes Bergcf616862012-03-15 13:26:49 -0700146 .led_mode = IWL_LED_RF_STATE
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800147
Johannes Berg706c4ff2012-03-05 11:24:33 -0800148const struct iwl_cfg iwl2000_2bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800149 .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800150 IWL_DEVICE_2000,
151 .ht_params = &iwl2000_ht_params,
152};
153
Johannes Berg706c4ff2012-03-05 11:24:33 -0800154const struct iwl_cfg iwl2000_2bgn_d_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800155 .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
Wey-Yi Guy1603dd42011-08-25 23:11:17 -0700156 IWL_DEVICE_2000,
Wey-Yi Guyec8f7342011-09-06 09:31:23 -0700157 .ht_params = &iwl2000_ht_params,
Wey-Yi Guy1603dd42011-08-25 23:11:17 -0700158};
159
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800160#define IWL_DEVICE_2030 \
161 .fw_name_pre = IWL2030_FW_PRE, \
162 .ucode_api_max = IWL2030_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700163 .ucode_api_ok = IWL2030_UCODE_API_OK, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800164 .ucode_api_min = IWL2030_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700165 .device_family = IWL_DEVICE_FAMILY_2030, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200166 .max_inst_size = IWL60_RTC_INST_SIZE, \
167 .max_data_size = IWL60_RTC_DATA_SIZE, \
Eytan Lifshitzb7998c82012-12-01 20:59:49 +0200168 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
169 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800170 .base_params = &iwl2030_base_params, \
171 .bt_params = &iwl2030_bt_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200172 .eeprom_params = &iwl20x0_eeprom_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800173 .need_temp_offset_calib = true, \
Wey-Yi Guyc6f30342011-09-15 11:46:50 -0700174 .temp_offset_v2 = true, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800175 .led_mode = IWL_LED_RF_STATE, \
Johannes Bergcf616862012-03-15 13:26:49 -0700176 .adv_pm = true
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800177
Johannes Berg706c4ff2012-03-05 11:24:33 -0800178const struct iwl_cfg iwl2030_2bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800179 .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
Wey-Yi Guy96234cc2011-01-24 11:44:42 -0800180 IWL_DEVICE_2030,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800181 .ht_params = &iwl2000_ht_params,
182};
183
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700184#define IWL_DEVICE_105 \
185 .fw_name_pre = IWL105_FW_PRE, \
186 .ucode_api_max = IWL105_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700187 .ucode_api_ok = IWL105_UCODE_API_OK, \
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700188 .ucode_api_min = IWL105_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700189 .device_family = IWL_DEVICE_FAMILY_105, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200190 .max_inst_size = IWL60_RTC_INST_SIZE, \
191 .max_data_size = IWL60_RTC_DATA_SIZE, \
Eytan Lifshitzb7998c82012-12-01 20:59:49 +0200192 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
193 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800194 .base_params = &iwl2000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200195 .eeprom_params = &iwl20x0_eeprom_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800196 .need_temp_offset_calib = true, \
Wey-Yi Guyc6f30342011-09-15 11:46:50 -0700197 .temp_offset_v2 = true, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800198 .led_mode = IWL_LED_RF_STATE, \
199 .adv_pm = true, \
Johannes Bergcf616862012-03-15 13:26:49 -0700200 .rx_with_siso_diversity = true
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800201
Johannes Berg706c4ff2012-03-05 11:24:33 -0800202const struct iwl_cfg iwl105_bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800203 .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700204 IWL_DEVICE_105,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800205 .ht_params = &iwl2000_ht_params,
206};
207
Johannes Berg706c4ff2012-03-05 11:24:33 -0800208const struct iwl_cfg iwl105_bgn_d_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800209 .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
Wey-Yi Guyb319d3e2011-10-10 07:27:01 -0700210 IWL_DEVICE_105,
211 .ht_params = &iwl2000_ht_params,
212};
213
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700214#define IWL_DEVICE_135 \
Wey-Yi Guy54e9c402011-07-01 07:47:59 -0700215 .fw_name_pre = IWL135_FW_PRE, \
216 .ucode_api_max = IWL135_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700217 .ucode_api_ok = IWL135_UCODE_API_OK, \
Wey-Yi Guy54e9c402011-07-01 07:47:59 -0700218 .ucode_api_min = IWL135_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700219 .device_family = IWL_DEVICE_FAMILY_135, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200220 .max_inst_size = IWL60_RTC_INST_SIZE, \
221 .max_data_size = IWL60_RTC_DATA_SIZE, \
Eytan Lifshitzb7998c82012-12-01 20:59:49 +0200222 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
223 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800224 .base_params = &iwl2030_base_params, \
225 .bt_params = &iwl2030_bt_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200226 .eeprom_params = &iwl20x0_eeprom_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800227 .need_temp_offset_calib = true, \
Wey-Yi Guyc6f30342011-09-15 11:46:50 -0700228 .temp_offset_v2 = true, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800229 .led_mode = IWL_LED_RF_STATE, \
230 .adv_pm = true, \
Johannes Bergcf616862012-03-15 13:26:49 -0700231 .rx_with_siso_diversity = true
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800232
Johannes Berg706c4ff2012-03-05 11:24:33 -0800233const struct iwl_cfg iwl135_bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800234 .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700235 IWL_DEVICE_135,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800236 .ht_params = &iwl2000_ht_params,
237};
238
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -0700239MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
240MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
241MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
242MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));