xref: /openbmc/linux/drivers/net/wireless/intel/iwlwifi/cfg/9000.c (revision 5ef12cb4a3a78ffb331c03a795a15eea4ae35155)
1 /******************************************************************************
2  *
3  * This file is provided under a dual BSD/GPLv2 license.  When using or
4  * redistributing this file, you may do so under either license.
5  *
6  * GPL LICENSE SUMMARY
7  *
8  * Copyright(c) 2015-2017 Intel Deutschland GmbH
9  * Copyright (C) 2018 Intel Corporation
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of version 2 of the GNU General Public License as
13  * published by the Free Software Foundation.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * General Public License for more details.
19  *
20  * BSD LICENSE
21  *
22  * Copyright(c) 2015-2017 Intel Deutschland GmbH
23  * Copyright (C) 2018 Intel Corporation
24  * All rights reserved.
25  *
26  * Redistribution and use in source and binary forms, with or without
27  * modification, are permitted provided that the following conditions
28  * are met:
29  *
30  *  * Redistributions of source code must retain the above copyright
31  *    notice, this list of conditions and the following disclaimer.
32  *  * Redistributions in binary form must reproduce the above copyright
33  *    notice, this list of conditions and the following disclaimer in
34  *    the documentation and/or other materials provided with the
35  *    distribution.
36  *  * Neither the name Intel Corporation nor the names of its
37  *    contributors may be used to endorse or promote products derived
38  *    from this software without specific prior written permission.
39  *
40  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51  *
52  *****************************************************************************/
53 
54 #include <linux/module.h>
55 #include <linux/stringify.h>
56 #include "iwl-config.h"
57 #include "iwl-agn-hw.h"
58 #include "fw/file.h"
59 
60 /* Highest firmware API version supported */
61 #define IWL9000_UCODE_API_MAX	38
62 
63 /* Lowest firmware API version supported */
64 #define IWL9000_UCODE_API_MIN	30
65 
66 /* NVM versions */
67 #define IWL9000_NVM_VERSION		0x0a1d
68 #define IWL9000_TX_POWER_VERSION	0xffff /* meaningless */
69 
70 /* Memory offsets and lengths */
71 #define IWL9000_DCCM_OFFSET		0x800000
72 #define IWL9000_DCCM_LEN		0x18000
73 #define IWL9000_DCCM2_OFFSET		0x880000
74 #define IWL9000_DCCM2_LEN		0x8000
75 #define IWL9000_SMEM_OFFSET		0x400000
76 #define IWL9000_SMEM_LEN		0x68000
77 
78 #define  IWL9000A_FW_PRE "iwlwifi-9000-pu-a0-jf-a0-"
79 #define  IWL9000B_FW_PRE "iwlwifi-9000-pu-b0-jf-b0-"
80 #define  IWL9000RFB_FW_PRE "iwlwifi-9000-pu-a0-jf-b0-"
81 #define  IWL9260A_FW_PRE "iwlwifi-9260-th-a0-jf-a0-"
82 #define  IWL9260B_FW_PRE "iwlwifi-9260-th-b0-jf-b0-"
83 #define IWL9000A_MODULE_FIRMWARE(api) \
84 	IWL9000A_FW_PRE __stringify(api) ".ucode"
85 #define IWL9000B_MODULE_FIRMWARE(api) \
86 	IWL9000B_FW_PRE __stringify(api) ".ucode"
87 #define IWL9000RFB_MODULE_FIRMWARE(api) \
88 	IWL9000RFB_FW_PRE __stringify(api) ".ucode"
89 #define IWL9260A_MODULE_FIRMWARE(api) \
90 	IWL9260A_FW_PRE __stringify(api) ".ucode"
91 #define IWL9260B_MODULE_FIRMWARE(api) \
92 	IWL9260B_FW_PRE __stringify(api) ".ucode"
93 
94 #define NVM_HW_SECTION_NUM_FAMILY_9000		10
95 
96 static const struct iwl_base_params iwl9000_base_params = {
97 	.eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_9000,
98 	.num_of_queues = 31,
99 	.shadow_ram_support = true,
100 	.led_compensation = 57,
101 	.wd_timeout = IWL_LONG_WD_TIMEOUT,
102 	.max_event_log_size = 512,
103 	.shadow_reg_enable = true,
104 	.pcie_l1_allowed = true,
105 };
106 
107 static const struct iwl_ht_params iwl9000_ht_params = {
108 	.stbc = true,
109 	.ldpc = true,
110 	.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
111 };
112 
113 static const struct iwl_tt_params iwl9000_tt_params = {
114 	.ct_kill_entry = 115,
115 	.ct_kill_exit = 93,
116 	.ct_kill_duration = 5,
117 	.dynamic_smps_entry = 111,
118 	.dynamic_smps_exit = 107,
119 	.tx_protection_entry = 112,
120 	.tx_protection_exit = 105,
121 	.tx_backoff = {
122 		{.temperature = 110, .backoff = 200},
123 		{.temperature = 111, .backoff = 600},
124 		{.temperature = 112, .backoff = 1200},
125 		{.temperature = 113, .backoff = 2000},
126 		{.temperature = 114, .backoff = 4000},
127 	},
128 	.support_ct_kill = true,
129 	.support_dynamic_smps = true,
130 	.support_tx_protection = true,
131 	.support_tx_backoff = true,
132 };
133 
134 #define IWL_DEVICE_9000							\
135 	.ucode_api_max = IWL9000_UCODE_API_MAX,				\
136 	.ucode_api_min = IWL9000_UCODE_API_MIN,				\
137 	.device_family = IWL_DEVICE_FAMILY_9000,			\
138 	.max_inst_size = IWL60_RTC_INST_SIZE,				\
139 	.max_data_size = IWL60_RTC_DATA_SIZE,				\
140 	.base_params = &iwl9000_base_params,				\
141 	.led_mode = IWL_LED_RF_STATE,					\
142 	.nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_9000,		\
143 	.non_shared_ant = ANT_A,					\
144 	.dccm_offset = IWL9000_DCCM_OFFSET,				\
145 	.dccm_len = IWL9000_DCCM_LEN,					\
146 	.dccm2_offset = IWL9000_DCCM2_OFFSET,				\
147 	.dccm2_len = IWL9000_DCCM2_LEN,					\
148 	.smem_offset = IWL9000_SMEM_OFFSET,				\
149 	.smem_len = IWL9000_SMEM_LEN,					\
150 	.features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM,		\
151 	.thermal_params = &iwl9000_tt_params,				\
152 	.apmg_not_supported = true,					\
153 	.mq_rx_supported = true,					\
154 	.vht_mu_mimo_supported = true,					\
155 	.mac_addr_from_csr = true,					\
156 	.rf_id = true,							\
157 	.nvm_type = IWL_NVM_EXT,					\
158 	.dbgc_supported = true,						\
159 	.min_umac_error_event_table = 0x800000
160 
161 const struct iwl_cfg iwl9160_2ac_cfg = {
162 	.name = "Intel(R) Dual Band Wireless AC 9160",
163 	.fw_name_pre = IWL9260A_FW_PRE,
164 	.fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
165 	IWL_DEVICE_9000,
166 	.ht_params = &iwl9000_ht_params,
167 	.nvm_ver = IWL9000_NVM_VERSION,
168 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
169 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
170 };
171 
172 const struct iwl_cfg iwl9260_2ac_cfg = {
173 	.name = "Intel(R) Dual Band Wireless AC 9260",
174 	.fw_name_pre = IWL9260A_FW_PRE,
175 	.fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
176 	IWL_DEVICE_9000,
177 	.ht_params = &iwl9000_ht_params,
178 	.nvm_ver = IWL9000_NVM_VERSION,
179 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
180 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
181 };
182 
183 const struct iwl_cfg iwl9270_2ac_cfg = {
184 	.name = "Intel(R) Dual Band Wireless AC 9270",
185 	.fw_name_pre = IWL9260A_FW_PRE,
186 	.fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
187 	IWL_DEVICE_9000,
188 	.ht_params = &iwl9000_ht_params,
189 	.nvm_ver = IWL9000_NVM_VERSION,
190 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
191 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
192 };
193 
194 const struct iwl_cfg iwl9460_2ac_cfg = {
195 	.name = "Intel(R) Dual Band Wireless AC 9460",
196 	.fw_name_pre = IWL9260A_FW_PRE,
197 	.fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
198 	IWL_DEVICE_9000,
199 	.ht_params = &iwl9000_ht_params,
200 	.nvm_ver = IWL9000_NVM_VERSION,
201 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
202 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
203 };
204 
205 const struct iwl_cfg iwl9460_2ac_cfg_soc = {
206 	.name = "Intel(R) Dual Band Wireless AC 9460",
207 	.fw_name_pre = IWL9000A_FW_PRE,
208 	.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
209 	.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
210 	IWL_DEVICE_9000,
211 	.ht_params = &iwl9000_ht_params,
212 	.nvm_ver = IWL9000_NVM_VERSION,
213 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
214 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
215 	.integrated = true,
216 	.soc_latency = 5000,
217 };
218 
219 const struct iwl_cfg iwl9461_2ac_cfg_soc = {
220 		.name = "Intel(R) Dual Band Wireless AC 9461",
221 		.fw_name_pre = IWL9000A_FW_PRE,
222 		.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
223 		.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
224 		IWL_DEVICE_9000,
225 		.ht_params = &iwl9000_ht_params,
226 		.nvm_ver = IWL9000_NVM_VERSION,
227 		.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
228 		.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
229 		.integrated = true,
230 		.soc_latency = 5000,
231 };
232 
233 const struct iwl_cfg iwl9462_2ac_cfg_soc = {
234 		.name = "Intel(R) Dual Band Wireless AC 9462",
235 		.fw_name_pre = IWL9000A_FW_PRE,
236 		.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
237 		.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
238 		IWL_DEVICE_9000,
239 		.ht_params = &iwl9000_ht_params,
240 		.nvm_ver = IWL9000_NVM_VERSION,
241 		.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
242 		.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
243 		.integrated = true,
244 		.soc_latency = 5000,
245 };
246 
247 const struct iwl_cfg iwl9560_2ac_cfg = {
248 	.name = "Intel(R) Dual Band Wireless AC 9560",
249 	.fw_name_pre = IWL9260A_FW_PRE,
250 	.fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
251 	IWL_DEVICE_9000,
252 	.ht_params = &iwl9000_ht_params,
253 	.nvm_ver = IWL9000_NVM_VERSION,
254 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
255 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
256 };
257 
258 const struct iwl_cfg iwl9560_2ac_cfg_soc = {
259 	.name = "Intel(R) Dual Band Wireless AC 9560",
260 	.fw_name_pre = IWL9000A_FW_PRE,
261 	.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
262 	.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
263 	IWL_DEVICE_9000,
264 	.ht_params = &iwl9000_ht_params,
265 	.nvm_ver = IWL9000_NVM_VERSION,
266 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
267 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
268 	.integrated = true,
269 	.soc_latency = 5000,
270 };
271 
272 const struct iwl_cfg iwl9460_2ac_cfg_shared_clk = {
273 	.name = "Intel(R) Dual Band Wireless AC 9460",
274 	.fw_name_pre = IWL9000A_FW_PRE,
275 	.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
276 	.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
277 	IWL_DEVICE_9000,
278 	.ht_params = &iwl9000_ht_params,
279 	.nvm_ver = IWL9000_NVM_VERSION,
280 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
281 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
282 	.integrated = true,
283 	.soc_latency = 5000,
284 	.extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK
285 };
286 
287 const struct iwl_cfg iwl9461_2ac_cfg_shared_clk = {
288 	.name = "Intel(R) Dual Band Wireless AC 9461",
289 	.fw_name_pre = IWL9000A_FW_PRE,
290 	.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
291 	.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
292 	IWL_DEVICE_9000,
293 	.ht_params = &iwl9000_ht_params,
294 	.nvm_ver = IWL9000_NVM_VERSION,
295 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
296 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
297 	.integrated = true,
298 	.soc_latency = 5000,
299 	.extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK
300 };
301 
302 const struct iwl_cfg iwl9462_2ac_cfg_shared_clk = {
303 	.name = "Intel(R) Dual Band Wireless AC 9462",
304 	.fw_name_pre = IWL9000A_FW_PRE,
305 	.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
306 	.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
307 	IWL_DEVICE_9000,
308 	.ht_params = &iwl9000_ht_params,
309 	.nvm_ver = IWL9000_NVM_VERSION,
310 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
311 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
312 	.integrated = true,
313 	.soc_latency = 5000,
314 	.extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK
315 };
316 
317 const struct iwl_cfg iwl9560_2ac_cfg_shared_clk = {
318 	.name = "Intel(R) Dual Band Wireless AC 9560",
319 	.fw_name_pre = IWL9000A_FW_PRE,
320 	.fw_name_pre_b_or_c_step = IWL9000B_FW_PRE,
321 	.fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE,
322 	IWL_DEVICE_9000,
323 	.ht_params = &iwl9000_ht_params,
324 	.nvm_ver = IWL9000_NVM_VERSION,
325 	.nvm_calib_ver = IWL9000_TX_POWER_VERSION,
326 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
327 	.integrated = true,
328 	.soc_latency = 5000,
329 	.extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK
330 };
331 
332 MODULE_FIRMWARE(IWL9000A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
333 MODULE_FIRMWARE(IWL9000B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
334 MODULE_FIRMWARE(IWL9000RFB_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
335 MODULE_FIRMWARE(IWL9260A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
336 MODULE_FIRMWARE(IWL9260B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
337