xref: /linux/drivers/net/wireless/intel/iwlwifi/cfg/6000.c (revision 0b897fbd900e12a08baa3d1a0457944046a882ea)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /******************************************************************************
3  *
4  * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
5  * Copyright(c) 2018 - 2020, 2023, 2025 Intel Corporation
6  *****************************************************************************/
7 
8 #include <linux/module.h>
9 #include <linux/stringify.h>
10 #include "iwl-config.h"
11 #include "iwl-agn-hw.h"
12 #include "dvm/commands.h" /* needed for BT for now */
13 
14 /* Highest firmware API version supported */
15 #define IWL6000_UCODE_API_MAX 6
16 #define IWL6050_UCODE_API_MAX 5
17 #define IWL6000G2_UCODE_API_MAX 6
18 #define IWL6035_UCODE_API_MAX 6
19 
20 /* Lowest firmware API version supported */
21 #define IWL6000_UCODE_API_MIN 4
22 #define IWL6050_UCODE_API_MIN 4
23 #define IWL6000G2_UCODE_API_MIN 5
24 #define IWL6035_UCODE_API_MIN 6
25 
26 /* EEPROM versions */
27 #define EEPROM_6000_TX_POWER_VERSION	(4)
28 #define EEPROM_6000_EEPROM_VERSION	(0x423)
29 #define EEPROM_6050_TX_POWER_VERSION	(4)
30 #define EEPROM_6050_EEPROM_VERSION	(0x532)
31 #define EEPROM_6150_TX_POWER_VERSION	(6)
32 #define EEPROM_6150_EEPROM_VERSION	(0x553)
33 #define EEPROM_6005_TX_POWER_VERSION	(6)
34 #define EEPROM_6005_EEPROM_VERSION	(0x709)
35 #define EEPROM_6030_TX_POWER_VERSION	(6)
36 #define EEPROM_6030_EEPROM_VERSION	(0x709)
37 #define EEPROM_6035_TX_POWER_VERSION	(6)
38 #define EEPROM_6035_EEPROM_VERSION	(0x753)
39 
40 #define IWL6000_FW_PRE "iwlwifi-6000"
41 #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE "-" __stringify(api) ".ucode"
42 
43 #define IWL6050_FW_PRE "iwlwifi-6050"
44 #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE "-" __stringify(api) ".ucode"
45 
46 #define IWL6005_FW_PRE "iwlwifi-6000g2a"
47 #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE "-" __stringify(api) ".ucode"
48 
49 #define IWL6030_FW_PRE "iwlwifi-6000g2b"
50 #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE "-" __stringify(api) ".ucode"
51 
52 static const struct iwl_base_params iwl6000_base_params = {
53 	.eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
54 	.num_of_queues = IWLAGN_NUM_QUEUES,
55 	.max_tfd_queue_size = 256,
56 	.max_ll_items = OTP_MAX_LL_ITEMS_6x00,
57 	.shadow_ram_support = true,
58 	.led_compensation = 51,
59 	.wd_timeout = IWL_DEF_WD_TIMEOUT,
60 	.max_event_log_size = 512,
61 	.shadow_reg_enable = false, /* TODO: fix bugs using this feature */
62 	.scd_chain_ext_wa = true,
63 };
64 
65 static const struct iwl_base_params iwl6050_base_params = {
66 	.eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
67 	.num_of_queues = IWLAGN_NUM_QUEUES,
68 	.max_tfd_queue_size = 256,
69 	.max_ll_items = OTP_MAX_LL_ITEMS_6x50,
70 	.shadow_ram_support = true,
71 	.led_compensation = 51,
72 	.wd_timeout = IWL_DEF_WD_TIMEOUT,
73 	.max_event_log_size = 1024,
74 	.shadow_reg_enable = false, /* TODO: fix bugs using this feature */
75 	.scd_chain_ext_wa = true,
76 };
77 
78 static const struct iwl_base_params iwl6000_g2_base_params = {
79 	.eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
80 	.num_of_queues = IWLAGN_NUM_QUEUES,
81 	.max_tfd_queue_size = 256,
82 	.max_ll_items = OTP_MAX_LL_ITEMS_6x00,
83 	.shadow_ram_support = true,
84 	.led_compensation = 57,
85 	.wd_timeout = IWL_LONG_WD_TIMEOUT,
86 	.max_event_log_size = 512,
87 	.shadow_reg_enable = false, /* TODO: fix bugs using this feature */
88 	.scd_chain_ext_wa = true,
89 };
90 
91 static const struct iwl_ht_params iwl6000_ht_params = {
92 	.ht_greenfield_support = true,
93 	.use_rts_for_aggregation = true, /* use rts/cts protection */
94 	.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
95 };
96 
97 static const struct iwl_eeprom_params iwl6000_eeprom_params = {
98 	.regulatory_bands = {
99 		EEPROM_REG_BAND_1_CHANNELS,
100 		EEPROM_REG_BAND_2_CHANNELS,
101 		EEPROM_REG_BAND_3_CHANNELS,
102 		EEPROM_REG_BAND_4_CHANNELS,
103 		EEPROM_REG_BAND_5_CHANNELS,
104 		EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
105 		EEPROM_REG_BAND_52_HT40_CHANNELS
106 	},
107 	.enhanced_txpower = true,
108 };
109 
110 const struct iwl_cfg_trans_params iwl6005_trans_cfg = {
111 	.device_family = IWL_DEVICE_FAMILY_6005,
112 	.base_params = &iwl6000_g2_base_params,
113 };
114 
115 #define IWL_DEVICE_6005						\
116 	.fw_name_pre = IWL6005_FW_PRE,				\
117 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
118 	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
119 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
120 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
121 	.nvm_ver = EEPROM_6005_EEPROM_VERSION,		\
122 	.nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION,	\
123 	.eeprom_params = &iwl6000_eeprom_params,		\
124 	.led_mode = IWL_LED_RF_STATE
125 
126 const struct iwl_cfg iwl6005_n_cfg = {
127 	IWL_DEVICE_6005,
128 	.ht_params = &iwl6000_ht_params,
129 };
130 
131 const char iwl6005_2agn_name[] = "Intel(R) Centrino(R) Advanced-N 6205 AGN";
132 const char iwl6005_2agn_sff_name[] = "Intel(R) Centrino(R) Advanced-N 6205S AGN";
133 const char iwl6005_2agn_d_name[] = "Intel(R) Centrino(R) Advanced-N 6205D AGN";
134 const char iwl6005_2agn_mow1_name[] = "Intel(R) Centrino(R) Advanced-N 6206 AGN";
135 const char iwl6005_2agn_mow2_name[] = "Intel(R) Centrino(R) Advanced-N 6207 AGN";
136 
137 const struct iwl_cfg iwl6005_non_n_cfg = {
138 	IWL_DEVICE_6005,
139 };
140 
141 const char iwl6005_2abg_name[] = "Intel(R) Centrino(R) Advanced-N 6205 ABG";
142 const char iwl6005_2bg_name[] = "Intel(R) Centrino(R) Advanced-N 6205 BG";
143 
144 const struct iwl_cfg_trans_params iwl6030_trans_cfg = {
145 	.device_family = IWL_DEVICE_FAMILY_6030,
146 	.base_params = &iwl6000_g2_base_params,
147 };
148 
149 #define IWL_DEVICE_6030						\
150 	.fw_name_pre = IWL6030_FW_PRE,				\
151 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
152 	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
153 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
154 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
155 	.nvm_ver = EEPROM_6030_EEPROM_VERSION,		\
156 	.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION,	\
157 	.eeprom_params = &iwl6000_eeprom_params,		\
158 	.led_mode = IWL_LED_RF_STATE
159 
160 const struct iwl_cfg iwl6030_n_cfg = {
161 	IWL_DEVICE_6030,
162 	.ht_params = &iwl6000_ht_params,
163 };
164 
165 const char iwl6030_2agn_name[] = "Intel(R) Centrino(R) Advanced-N 6230 AGN";
166 const char iwl6030_2bgn_name[] = "Intel(R) Centrino(R) Advanced-N 6230 BGN";
167 const char iwl1030_bgn_name[] = "Intel(R) Centrino(R) Wireless-N 1030 BGN";
168 const char iwl1030_bg_name[] = "Intel(R) Centrino(R) Wireless-N 1030 BG";
169 
170 const struct iwl_cfg iwl6030_non_n_cfg = {
171 	IWL_DEVICE_6030,
172 };
173 
174 const char iwl6030_2abg_name[] = "Intel(R) Centrino(R) Advanced-N 6230 ABG";
175 const char iwl6030_2bg_name[] = "Intel(R) Centrino(R) Advanced-N 6230 BG";
176 
177 #define IWL_DEVICE_6035						\
178 	.fw_name_pre = IWL6030_FW_PRE,				\
179 	.ucode_api_max = IWL6035_UCODE_API_MAX,			\
180 	.ucode_api_min = IWL6035_UCODE_API_MIN,			\
181 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
182 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
183 	.nvm_ver = EEPROM_6030_EEPROM_VERSION,		\
184 	.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION,	\
185 	.eeprom_params = &iwl6000_eeprom_params,		\
186 	.led_mode = IWL_LED_RF_STATE
187 
188 const struct iwl_cfg iwl6035_2agn_cfg = {
189 	IWL_DEVICE_6035,
190 	.ht_params = &iwl6000_ht_params,
191 };
192 
193 const char iwl6035_2agn_name[] = "Intel(R) Centrino(R) Advanced-N 6235 AGN";
194 const char iwl6035_2agn_sff_name[] = "Intel(R) Centrino(R) Ultimate-N 6235 AGN";
195 
196 const struct iwl_cfg iwl130_bgn_cfg = {
197 	IWL_DEVICE_6030,
198 	.ht_params = &iwl6000_ht_params,
199 	.rx_with_siso_diversity = true,
200 };
201 
202 const char iwl130_bgn_name[] = "Intel(R) Centrino(R) Wireless-N 130 BGN";
203 
204 const struct iwl_cfg iwl130_bg_cfg = {
205 	IWL_DEVICE_6030,
206 	.rx_with_siso_diversity = true,
207 };
208 
209 const char iwl130_bg_name[] = "Intel(R) Centrino(R) Wireless-N 130 BG";
210 
211 const struct iwl_cfg_trans_params iwl6000i_trans_cfg = {
212 	.device_family = IWL_DEVICE_FAMILY_6000i,
213 	.base_params = &iwl6000_base_params,
214 };
215 
216 /*
217  * "i": Internal configuration, use internal Power Amplifier
218  */
219 #define IWL_DEVICE_6000i					\
220 	.fw_name_pre = IWL6000_FW_PRE,				\
221 	.ucode_api_max = IWL6000_UCODE_API_MAX,			\
222 	.ucode_api_min = IWL6000_UCODE_API_MIN,			\
223 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
224 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
225 	.valid_tx_ant = ANT_BC,		/* .cfg overwrite */	\
226 	.valid_rx_ant = ANT_BC,		/* .cfg overwrite */	\
227 	.nvm_ver = EEPROM_6000_EEPROM_VERSION,		\
228 	.nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,	\
229 	.eeprom_params = &iwl6000_eeprom_params,		\
230 	.led_mode = IWL_LED_BLINK
231 
232 const struct iwl_cfg iwl6000i_2agn_cfg = {
233 	IWL_DEVICE_6000i,
234 	.ht_params = &iwl6000_ht_params,
235 };
236 
237 const char iwl6000i_2agn_name[] = "Intel(R) Centrino(R) Advanced-N 6200 AGN";
238 
239 const struct iwl_cfg iwl6000i_non_n_cfg = {
240 	IWL_DEVICE_6000i,
241 };
242 
243 const char iwl6000i_2abg_name[] = "Intel(R) Centrino(R) Advanced-N 6200 ABG";
244 const char iwl6000i_2bg_name[] = "Intel(R) Centrino(R) Advanced-N 6200 BG";
245 
246 const struct iwl_cfg_trans_params iwl6050_trans_cfg = {
247 	.device_family = IWL_DEVICE_FAMILY_6050,
248 	.base_params = &iwl6050_base_params,
249 };
250 
251 #define IWL_DEVICE_6050						\
252 	.fw_name_pre = IWL6050_FW_PRE,				\
253 	.ucode_api_max = IWL6050_UCODE_API_MAX,			\
254 	.ucode_api_min = IWL6050_UCODE_API_MIN,			\
255 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
256 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
257 	.valid_tx_ant = ANT_AB,		/* .cfg overwrite */	\
258 	.valid_rx_ant = ANT_AB,		/* .cfg overwrite */	\
259 	.nvm_ver = EEPROM_6050_EEPROM_VERSION,		\
260 	.nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION,	\
261 	.eeprom_params = &iwl6000_eeprom_params,		\
262 	.led_mode = IWL_LED_BLINK,				\
263 	.internal_wimax_coex = true
264 
265 const struct iwl_cfg iwl6050_2agn_cfg = {
266 	IWL_DEVICE_6050,
267 	.ht_params = &iwl6000_ht_params,
268 };
269 
270 const char iwl6050_2agn_name[] = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN";
271 
272 const struct iwl_cfg iwl6050_2abg_cfg = {
273 	IWL_DEVICE_6050,
274 };
275 
276 const char iwl6050_2abg_name[] = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG";
277 
278 const struct iwl_cfg_trans_params iwl6150_trans_cfg = {
279 	.device_family = IWL_DEVICE_FAMILY_6150,
280 	.base_params = &iwl6050_base_params,
281 };
282 
283 #define IWL_DEVICE_6150						\
284 	.fw_name_pre = IWL6050_FW_PRE,				\
285 	.ucode_api_max = IWL6050_UCODE_API_MAX,			\
286 	.ucode_api_min = IWL6050_UCODE_API_MIN,			\
287 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
288 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
289 	.nvm_ver = EEPROM_6150_EEPROM_VERSION,		\
290 	.nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION,	\
291 	.eeprom_params = &iwl6000_eeprom_params,		\
292 	.led_mode = IWL_LED_BLINK,				\
293 	.internal_wimax_coex = true
294 
295 const struct iwl_cfg iwl6150_bgn_cfg = {
296 	IWL_DEVICE_6150,
297 	.ht_params = &iwl6000_ht_params,
298 };
299 
300 const char iwl6150_bgn_name[] = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN";
301 
302 const struct iwl_cfg iwl6150_bg_cfg = {
303 	IWL_DEVICE_6150,
304 };
305 
306 const char iwl6150_bg_name[] = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG";
307 
308 const struct iwl_cfg_trans_params iwl6000_trans_cfg = {
309 	.device_family = IWL_DEVICE_FAMILY_6000,
310 	.base_params = &iwl6000_base_params,
311 };
312 
313 const struct iwl_cfg iwl6000_3agn_cfg = {
314 	.fw_name_pre = IWL6000_FW_PRE,
315 	.ucode_api_max = IWL6000_UCODE_API_MAX,
316 	.ucode_api_min = IWL6000_UCODE_API_MIN,
317 	.max_inst_size = IWL60_RTC_INST_SIZE,
318 	.max_data_size = IWL60_RTC_DATA_SIZE,
319 	.nvm_ver = EEPROM_6000_EEPROM_VERSION,
320 	.nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
321 	.eeprom_params = &iwl6000_eeprom_params,
322 	.ht_params = &iwl6000_ht_params,
323 	.led_mode = IWL_LED_BLINK,
324 };
325 
326 const char iwl6000_3agn_name[] = "Intel(R) Centrino(R) Ultimate-N 6300 AGN";
327 
328 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
329 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
330 MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
331 MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
332