blob: a6ec7ad39dcb8753b1e0e1b14561a777e6b00021 [file] [log] [blame]
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -08001/******************************************************************************
2 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +02003 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
Golan Ben Amia8cbb462017-10-22 15:58:26 +03004 * Copyright(c) 2018 Intel Corporation
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -08005 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080015 * The full GNU General Public License is included in this distribution in the
16 * file called LICENSE.
17 *
18 * Contact Information:
Emmanuel Grumbachd01c5362015-11-17 15:39:56 +020019 * Intel Linux Wireless <linuxwifi@intel.com>
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080020 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
21 *
22 *****************************************************************************/
23
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080024#include <linux/module.h>
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070025#include <linux/stringify.h>
Johannes Berge9676692012-04-10 14:10:28 -070026#include "iwl-config.h"
Johannes Berg0db19cd2012-04-03 20:57:59 +020027#include "iwl-agn-hw.h"
Johannes Berg1023fdc2012-05-15 12:16:34 +020028#include "dvm/commands.h" /* needed for BT for now */
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080029
30/* Highest firmware API version supported */
Johannes Bergca9a4602011-07-23 10:24:45 -070031#define IWL2030_UCODE_API_MAX 6
32#define IWL2000_UCODE_API_MAX 6
33#define IWL105_UCODE_API_MAX 6
34#define IWL135_UCODE_API_MAX 6
35
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080036/* Lowest firmware API version supported */
37#define IWL2030_UCODE_API_MIN 5
38#define IWL2000_UCODE_API_MIN 5
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -070039#define IWL105_UCODE_API_MIN 5
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070040#define IWL135_UCODE_API_MIN 5
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080041
Johannes Berg586aed92012-04-03 20:41:07 +020042/* EEPROM version */
43#define EEPROM_2000_TX_POWER_VERSION (6)
44#define EEPROM_2000_EEPROM_VERSION (0x805)
45
46
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080047#define IWL2030_FW_PRE "iwlwifi-2030-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070048#define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080049
50#define IWL2000_FW_PRE "iwlwifi-2000-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070051#define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080052
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -070053#define IWL105_FW_PRE "iwlwifi-105-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070054#define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080055
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070056#define IWL135_FW_PRE "iwlwifi-135-"
Fry, Donald H5092e472011-09-15 11:46:37 -070057#define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070058
Johannes Berg6794f3e2012-03-06 13:30:56 -080059static const struct iwl_base_params iwl2000_base_params = {
Luca Coelho3e2b49d2018-08-16 08:53:10 +030060 .eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080061 .num_of_queues = IWLAGN_NUM_QUEUES,
Golan Ben Ami7b3e42e2018-02-04 12:51:45 +020062 .max_tfd_queue_size = 256,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080063 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
64 .shadow_ram_support = true,
65 .led_compensation = 51,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080066 .wd_timeout = IWL_DEF_WD_TIMEOUT,
67 .max_event_log_size = 512,
Meenakshi Venkataraman66a77072012-05-16 22:35:59 +020068 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
Emmanuel Grumbache03bbb62014-04-13 10:49:16 +030069 .scd_chain_ext_wa = true,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080070};
71
72
Johannes Berg6794f3e2012-03-06 13:30:56 -080073static const struct iwl_base_params iwl2030_base_params = {
Luca Coelho3e2b49d2018-08-16 08:53:10 +030074 .eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080075 .num_of_queues = IWLAGN_NUM_QUEUES,
Golan Ben Ami7b3e42e2018-02-04 12:51:45 +020076 .max_tfd_queue_size = 256,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080077 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
78 .shadow_ram_support = true,
79 .led_compensation = 57,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080080 .wd_timeout = IWL_LONG_WD_TIMEOUT,
81 .max_event_log_size = 512,
Meenakshi Venkataraman66a77072012-05-16 22:35:59 +020082 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
Emmanuel Grumbache03bbb62014-04-13 10:49:16 +030083 .scd_chain_ext_wa = true,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080084};
85
Johannes Berg6794f3e2012-03-06 13:30:56 -080086static const struct iwl_ht_params iwl2000_ht_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080087 .ht_greenfield_support = true,
88 .use_rts_for_aggregation = true, /* use rts/cts protection */
Johannes Berg57fbcce2016-04-12 15:56:15 +020089 .ht40_bands = BIT(NL80211_BAND_2GHZ),
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080090};
91
Johannes Berg26a7ca92012-05-21 11:55:54 +020092static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
93 .regulatory_bands = {
94 EEPROM_REG_BAND_1_CHANNELS,
95 EEPROM_REG_BAND_2_CHANNELS,
96 EEPROM_REG_BAND_3_CHANNELS,
97 EEPROM_REG_BAND_4_CHANNELS,
98 EEPROM_REG_BAND_5_CHANNELS,
99 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
100 EEPROM_REGULATORY_BAND_NO_HT40,
101 },
102 .enhanced_txpower = true,
103};
104
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800105#define IWL_DEVICE_2000 \
106 .fw_name_pre = IWL2000_FW_PRE, \
107 .ucode_api_max = IWL2000_UCODE_API_MAX, \
108 .ucode_api_min = IWL2000_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700109 .device_family = IWL_DEVICE_FAMILY_2000, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200110 .max_inst_size = IWL60_RTC_INST_SIZE, \
111 .max_data_size = IWL60_RTC_DATA_SIZE, \
Johannes Berg0d8877a2013-05-17 10:36:29 +0200112 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
113 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800114 .base_params = &iwl2000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200115 .eeprom_params = &iwl20x0_eeprom_params, \
Emmanuel Grumbach540623c2015-02-23 02:40:07 +0200116 .led_mode = IWL_LED_RF_STATE, \
Golan Ben Amia8cbb462017-10-22 15:58:26 +0300117 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
118 .csr = &iwl_csr_v1
Emmanuel Grumbach540623c2015-02-23 02:40:07 +0200119
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800120
Johannes Berg706c4ff2012-03-05 11:24:33 -0800121const struct iwl_cfg iwl2000_2bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800122 .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800123 IWL_DEVICE_2000,
124 .ht_params = &iwl2000_ht_params,
125};
126
Johannes Berg706c4ff2012-03-05 11:24:33 -0800127const struct iwl_cfg iwl2000_2bgn_d_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800128 .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
Wey-Yi Guy1603dd42011-08-25 23:11:17 -0700129 IWL_DEVICE_2000,
Wey-Yi Guyec8f7342011-09-06 09:31:23 -0700130 .ht_params = &iwl2000_ht_params,
Wey-Yi Guy1603dd42011-08-25 23:11:17 -0700131};
132
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800133#define IWL_DEVICE_2030 \
134 .fw_name_pre = IWL2030_FW_PRE, \
135 .ucode_api_max = IWL2030_UCODE_API_MAX, \
136 .ucode_api_min = IWL2030_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700137 .device_family = IWL_DEVICE_FAMILY_2030, \
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 = &iwl2030_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200143 .eeprom_params = &iwl20x0_eeprom_params, \
Emmanuel Grumbach540623c2015-02-23 02:40:07 +0200144 .led_mode = IWL_LED_RF_STATE, \
Golan Ben Amia8cbb462017-10-22 15:58:26 +0300145 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
146 .csr = &iwl_csr_v1
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800147
Johannes Berg706c4ff2012-03-05 11:24:33 -0800148const struct iwl_cfg iwl2030_2bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800149 .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
Wey-Yi Guy96234cc2011-01-24 11:44:42 -0800150 IWL_DEVICE_2030,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800151 .ht_params = &iwl2000_ht_params,
152};
153
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700154#define IWL_DEVICE_105 \
155 .fw_name_pre = IWL105_FW_PRE, \
156 .ucode_api_max = IWL105_UCODE_API_MAX, \
157 .ucode_api_min = IWL105_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700158 .device_family = IWL_DEVICE_FAMILY_105, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200159 .max_inst_size = IWL60_RTC_INST_SIZE, \
160 .max_data_size = IWL60_RTC_DATA_SIZE, \
Eytan Lifshitzb7998c82012-12-01 20:59:49 +0200161 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
162 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800163 .base_params = &iwl2000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200164 .eeprom_params = &iwl20x0_eeprom_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800165 .led_mode = IWL_LED_RF_STATE, \
Emmanuel Grumbach540623c2015-02-23 02:40:07 +0200166 .rx_with_siso_diversity = true, \
Golan Ben Amia8cbb462017-10-22 15:58:26 +0300167 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
168 .csr = &iwl_csr_v1
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800169
Johannes Berg706c4ff2012-03-05 11:24:33 -0800170const struct iwl_cfg iwl105_bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800171 .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700172 IWL_DEVICE_105,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800173 .ht_params = &iwl2000_ht_params,
174};
175
Johannes Berg706c4ff2012-03-05 11:24:33 -0800176const struct iwl_cfg iwl105_bgn_d_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800177 .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
Wey-Yi Guyb319d3e2011-10-10 07:27:01 -0700178 IWL_DEVICE_105,
179 .ht_params = &iwl2000_ht_params,
180};
181
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700182#define IWL_DEVICE_135 \
Wey-Yi Guy54e9c402011-07-01 07:47:59 -0700183 .fw_name_pre = IWL135_FW_PRE, \
184 .ucode_api_max = IWL135_UCODE_API_MAX, \
185 .ucode_api_min = IWL135_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700186 .device_family = IWL_DEVICE_FAMILY_135, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200187 .max_inst_size = IWL60_RTC_INST_SIZE, \
188 .max_data_size = IWL60_RTC_DATA_SIZE, \
Eytan Lifshitzb7998c82012-12-01 20:59:49 +0200189 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
190 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800191 .base_params = &iwl2030_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200192 .eeprom_params = &iwl20x0_eeprom_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800193 .led_mode = IWL_LED_RF_STATE, \
Emmanuel Grumbach540623c2015-02-23 02:40:07 +0200194 .rx_with_siso_diversity = true, \
Golan Ben Amia8cbb462017-10-22 15:58:26 +0300195 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
196 .csr = &iwl_csr_v1
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800197
Johannes Berg706c4ff2012-03-05 11:24:33 -0800198const struct iwl_cfg iwl135_bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800199 .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700200 IWL_DEVICE_135,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800201 .ht_params = &iwl2000_ht_params,
202};
203
Emmanuel Grumbach9d9b21d2016-03-24 08:44:57 +0200204MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX));
205MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX));
206MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX));
207MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX));