xref: /linux/drivers/net/wireless/intel/iwlwifi/cfg/6000.c (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
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_family_base_params iwl6000_base = {
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_family_base_params iwl6050_base = {
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_family_base_params iwl6000_g2_base = {
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_eeprom_params iwl6000_eeprom_params = {
92 	.regulatory_bands = {
93 		EEPROM_REG_BAND_1_CHANNELS,
94 		EEPROM_REG_BAND_2_CHANNELS,
95 		EEPROM_REG_BAND_3_CHANNELS,
96 		EEPROM_REG_BAND_4_CHANNELS,
97 		EEPROM_REG_BAND_5_CHANNELS,
98 		EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
99 		EEPROM_REG_BAND_52_HT40_CHANNELS
100 	},
101 	.enhanced_txpower = true,
102 };
103 
104 const struct iwl_mac_cfg iwl6005_mac_cfg = {
105 	.device_family = IWL_DEVICE_FAMILY_6005,
106 	.base = &iwl6000_g2_base,
107 };
108 
109 #define IWL_DEVICE_6005						\
110 	.fw_name_pre = IWL6005_FW_PRE,				\
111 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
112 	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
113 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
114 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
115 	.nvm_ver = EEPROM_6005_EEPROM_VERSION,		\
116 	.nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION,	\
117 	.eeprom_params = &iwl6000_eeprom_params,		\
118 	.led_mode = IWL_LED_RF_STATE
119 
120 const struct iwl_rf_cfg iwl6005_n_cfg = {
121 	IWL_DEVICE_6005,
122 	.ht_params = {
123 		.ht_greenfield_support = true,
124 		.use_rts_for_aggregation = true, /* use rts/cts protection */
125 		.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
126 	},
127 };
128 
129 const char iwl6005_2agn_name[] = "Intel(R) Centrino(R) Advanced-N 6205 AGN";
130 const char iwl6005_2agn_sff_name[] = "Intel(R) Centrino(R) Advanced-N 6205S AGN";
131 const char iwl6005_2agn_d_name[] = "Intel(R) Centrino(R) Advanced-N 6205D AGN";
132 const char iwl6005_2agn_mow1_name[] = "Intel(R) Centrino(R) Advanced-N 6206 AGN";
133 const char iwl6005_2agn_mow2_name[] = "Intel(R) Centrino(R) Advanced-N 6207 AGN";
134 
135 const struct iwl_rf_cfg iwl6005_non_n_cfg = {
136 	IWL_DEVICE_6005,
137 };
138 
139 const char iwl6005_2abg_name[] = "Intel(R) Centrino(R) Advanced-N 6205 ABG";
140 const char iwl6005_2bg_name[] = "Intel(R) Centrino(R) Advanced-N 6205 BG";
141 
142 const struct iwl_mac_cfg iwl6030_mac_cfg = {
143 	.device_family = IWL_DEVICE_FAMILY_6030,
144 	.base = &iwl6000_g2_base,
145 };
146 
147 #define IWL_DEVICE_6030						\
148 	.fw_name_pre = IWL6030_FW_PRE,				\
149 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,		\
150 	.ucode_api_min = IWL6000G2_UCODE_API_MIN,		\
151 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
152 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
153 	.nvm_ver = EEPROM_6030_EEPROM_VERSION,		\
154 	.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION,	\
155 	.eeprom_params = &iwl6000_eeprom_params,		\
156 	.led_mode = IWL_LED_RF_STATE
157 
158 const struct iwl_rf_cfg iwl6030_n_cfg = {
159 	IWL_DEVICE_6030,
160 	.ht_params = {
161 		.ht_greenfield_support = true,
162 		.use_rts_for_aggregation = true, /* use rts/cts protection */
163 		.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
164 	},
165 };
166 
167 const char iwl6030_2agn_name[] = "Intel(R) Centrino(R) Advanced-N 6230 AGN";
168 const char iwl6030_2bgn_name[] = "Intel(R) Centrino(R) Advanced-N 6230 BGN";
169 const char iwl1030_bgn_name[] = "Intel(R) Centrino(R) Wireless-N 1030 BGN";
170 const char iwl1030_bg_name[] = "Intel(R) Centrino(R) Wireless-N 1030 BG";
171 
172 const struct iwl_rf_cfg iwl6030_non_n_cfg = {
173 	IWL_DEVICE_6030,
174 };
175 
176 const char iwl6030_2abg_name[] = "Intel(R) Centrino(R) Advanced-N 6230 ABG";
177 const char iwl6030_2bg_name[] = "Intel(R) Centrino(R) Advanced-N 6230 BG";
178 
179 #define IWL_DEVICE_6035						\
180 	.fw_name_pre = IWL6030_FW_PRE,				\
181 	.ucode_api_max = IWL6035_UCODE_API_MAX,			\
182 	.ucode_api_min = IWL6035_UCODE_API_MIN,			\
183 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
184 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
185 	.nvm_ver = EEPROM_6030_EEPROM_VERSION,		\
186 	.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION,	\
187 	.eeprom_params = &iwl6000_eeprom_params,		\
188 	.led_mode = IWL_LED_RF_STATE
189 
190 const struct iwl_rf_cfg iwl6035_2agn_cfg = {
191 	IWL_DEVICE_6035,
192 	.ht_params = {
193 		.ht_greenfield_support = true,
194 		.use_rts_for_aggregation = true, /* use rts/cts protection */
195 		.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
196 	},
197 };
198 
199 const char iwl6035_2agn_name[] = "Intel(R) Centrino(R) Advanced-N 6235 AGN";
200 const char iwl6035_2agn_sff_name[] = "Intel(R) Centrino(R) Ultimate-N 6235 AGN";
201 
202 const struct iwl_rf_cfg iwl130_bgn_cfg = {
203 	IWL_DEVICE_6030,
204 	.ht_params = {
205 		.ht_greenfield_support = true,
206 		.use_rts_for_aggregation = true, /* use rts/cts protection */
207 		.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
208 	},
209 	.rx_with_siso_diversity = true,
210 };
211 
212 const char iwl130_bgn_name[] = "Intel(R) Centrino(R) Wireless-N 130 BGN";
213 
214 const struct iwl_rf_cfg iwl130_bg_cfg = {
215 	IWL_DEVICE_6030,
216 	.rx_with_siso_diversity = true,
217 };
218 
219 const char iwl130_bg_name[] = "Intel(R) Centrino(R) Wireless-N 130 BG";
220 
221 const struct iwl_mac_cfg iwl6000i_mac_cfg = {
222 	.device_family = IWL_DEVICE_FAMILY_6000i,
223 	.base = &iwl6000_base,
224 };
225 
226 /*
227  * "i": Internal configuration, use internal Power Amplifier
228  */
229 #define IWL_DEVICE_6000i					\
230 	.fw_name_pre = IWL6000_FW_PRE,				\
231 	.ucode_api_max = IWL6000_UCODE_API_MAX,			\
232 	.ucode_api_min = IWL6000_UCODE_API_MIN,			\
233 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
234 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
235 	.valid_tx_ant = ANT_BC,		/* .cfg overwrite */	\
236 	.valid_rx_ant = ANT_BC,		/* .cfg overwrite */	\
237 	.nvm_ver = EEPROM_6000_EEPROM_VERSION,		\
238 	.nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,	\
239 	.eeprom_params = &iwl6000_eeprom_params,		\
240 	.led_mode = IWL_LED_BLINK
241 
242 const struct iwl_rf_cfg iwl6000i_2agn_cfg = {
243 	IWL_DEVICE_6000i,
244 	.ht_params = {
245 		.ht_greenfield_support = true,
246 		.use_rts_for_aggregation = true, /* use rts/cts protection */
247 		.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
248 	},
249 };
250 
251 const char iwl6000i_2agn_name[] = "Intel(R) Centrino(R) Advanced-N 6200 AGN";
252 
253 const struct iwl_rf_cfg iwl6000i_non_n_cfg = {
254 	IWL_DEVICE_6000i,
255 };
256 
257 const char iwl6000i_2abg_name[] = "Intel(R) Centrino(R) Advanced-N 6200 ABG";
258 const char iwl6000i_2bg_name[] = "Intel(R) Centrino(R) Advanced-N 6200 BG";
259 
260 const struct iwl_mac_cfg iwl6050_mac_cfg = {
261 	.device_family = IWL_DEVICE_FAMILY_6050,
262 	.base = &iwl6050_base,
263 };
264 
265 #define IWL_DEVICE_6050						\
266 	.fw_name_pre = IWL6050_FW_PRE,				\
267 	.ucode_api_max = IWL6050_UCODE_API_MAX,			\
268 	.ucode_api_min = IWL6050_UCODE_API_MIN,			\
269 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
270 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
271 	.valid_tx_ant = ANT_AB,		/* .cfg overwrite */	\
272 	.valid_rx_ant = ANT_AB,		/* .cfg overwrite */	\
273 	.nvm_ver = EEPROM_6050_EEPROM_VERSION,		\
274 	.nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION,	\
275 	.eeprom_params = &iwl6000_eeprom_params,		\
276 	.led_mode = IWL_LED_BLINK,				\
277 	.internal_wimax_coex = true
278 
279 const struct iwl_rf_cfg iwl6050_2agn_cfg = {
280 	IWL_DEVICE_6050,
281 	.ht_params = {
282 		.ht_greenfield_support = true,
283 		.use_rts_for_aggregation = true, /* use rts/cts protection */
284 		.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
285 	},
286 };
287 
288 const char iwl6050_2agn_name[] = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN";
289 
290 const struct iwl_rf_cfg iwl6050_2abg_cfg = {
291 	IWL_DEVICE_6050,
292 };
293 
294 const char iwl6050_2abg_name[] = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG";
295 
296 const struct iwl_mac_cfg iwl6150_mac_cfg = {
297 	.device_family = IWL_DEVICE_FAMILY_6150,
298 	.base = &iwl6050_base,
299 };
300 
301 #define IWL_DEVICE_6150						\
302 	.fw_name_pre = IWL6050_FW_PRE,				\
303 	.ucode_api_max = IWL6050_UCODE_API_MAX,			\
304 	.ucode_api_min = IWL6050_UCODE_API_MIN,			\
305 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
306 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
307 	.nvm_ver = EEPROM_6150_EEPROM_VERSION,		\
308 	.nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION,	\
309 	.eeprom_params = &iwl6000_eeprom_params,		\
310 	.led_mode = IWL_LED_BLINK,				\
311 	.internal_wimax_coex = true
312 
313 const struct iwl_rf_cfg iwl6150_bgn_cfg = {
314 	IWL_DEVICE_6150,
315 	.ht_params = {
316 		.ht_greenfield_support = true,
317 		.use_rts_for_aggregation = true, /* use rts/cts protection */
318 		.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
319 	},
320 };
321 
322 const char iwl6150_bgn_name[] = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN";
323 
324 const struct iwl_rf_cfg iwl6150_bg_cfg = {
325 	IWL_DEVICE_6150,
326 };
327 
328 const char iwl6150_bg_name[] = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG";
329 
330 const struct iwl_mac_cfg iwl6000_mac_cfg = {
331 	.device_family = IWL_DEVICE_FAMILY_6000,
332 	.base = &iwl6000_base,
333 };
334 
335 const struct iwl_rf_cfg iwl6000_3agn_cfg = {
336 	.fw_name_pre = IWL6000_FW_PRE,
337 	.ucode_api_max = IWL6000_UCODE_API_MAX,
338 	.ucode_api_min = IWL6000_UCODE_API_MIN,
339 	.max_inst_size = IWL60_RTC_INST_SIZE,
340 	.max_data_size = IWL60_RTC_DATA_SIZE,
341 	.nvm_ver = EEPROM_6000_EEPROM_VERSION,
342 	.nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
343 	.eeprom_params = &iwl6000_eeprom_params,
344 	.ht_params = {
345 		.ht_greenfield_support = true,
346 		.use_rts_for_aggregation = true, /* use rts/cts protection */
347 		.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
348 	},
349 	.led_mode = IWL_LED_BLINK,
350 };
351 
352 const char iwl6000_3agn_name[] = "Intel(R) Centrino(R) Ultimate-N 6300 AGN";
353 
354 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
355 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
356 MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
357 MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
358