]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - drivers/net/wireless/intel/iwlwifi/cfg/7000.c
Input: wm97xx: add new AC97 bus support
[mirror_ubuntu-focal-kernel.git] / drivers / net / wireless / intel / iwlwifi / cfg / 7000.c
CommitLineData
99cd4714
JB
1/******************************************************************************
2 *
410dc5aa
EG
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.
99cd4714 5 *
410dc5aa
EG
6 * GPL LICENSE SUMMARY
7 *
51368bf7 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
8b4139dc 9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
c4836b05 10 * Copyright(c) 2015 Intel Deutschland GmbH
410dc5aa
EG
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
99cd4714
JB
14 * published by the Free Software Foundation.
15 *
410dc5aa
EG
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
99cd4714 20 *
410dc5aa
EG
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * USA
99cd4714 25 *
410dc5aa
EG
26 * The full GNU General Public License is included in this distribution
27 * in the file called COPYING.
99cd4714
JB
28 *
29 * Contact Information:
cb2f8277 30 * Intel Linux Wireless <linuxwifi@intel.com>
99cd4714
JB
31 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 *
410dc5aa
EG
33 * BSD LICENSE
34 *
51368bf7 35 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
8b4139dc 36 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
c4836b05 37 * Copyright(c) 2015 Intel Deutschland GmbH
410dc5aa
EG
38 * All rights reserved.
39 *
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
42 * are met:
43 *
44 * * Redistributions of source code must retain the above copyright
45 * notice, this list of conditions and the following disclaimer.
46 * * Redistributions in binary form must reproduce the above copyright
47 * notice, this list of conditions and the following disclaimer in
48 * the documentation and/or other materials provided with the
49 * distribution.
50 * * Neither the name Intel Corporation nor the names of its
51 * contributors may be used to endorse or promote products derived
52 * from this software without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
56 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
64 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 *
99cd4714
JB
66 *****************************************************************************/
67
68#include <linux/module.h>
69#include <linux/stringify.h>
70#include "iwl-config.h"
71#include "iwl-agn-hw.h"
99cd4714
JB
72
73/* Highest firmware API version supported */
628a2918 74#define IWL7260_UCODE_API_MAX 17
ed0450ce 75#define IWL7265_UCODE_API_MAX 17
5311a247
DS
76#define IWL7265D_UCODE_API_MAX 29
77#define IWL3168_UCODE_API_MAX 29
99cd4714 78
99cd4714 79/* Lowest firmware API version supported */
4b87e5af
LC
80#define IWL7260_UCODE_API_MIN 17
81#define IWL7265_UCODE_API_MIN 17
15098803
LC
82#define IWL7265D_UCODE_API_MIN 22
83#define IWL3168_UCODE_API_MIN 22
99cd4714
JB
84
85/* NVM versions */
86#define IWL7260_NVM_VERSION 0x0a1d
87#define IWL7260_TX_POWER_VERSION 0xffff /* meaningless */
88#define IWL3160_NVM_VERSION 0x709
89#define IWL3160_TX_POWER_VERSION 0xffff /* meaningless */
498abba6
OG
90#define IWL3165_NVM_VERSION 0x709
91#define IWL3165_TX_POWER_VERSION 0xffff /* meaningless */
ca296c57
OG
92#define IWL3168_NVM_VERSION 0xd01
93#define IWL3168_TX_POWER_VERSION 0xffff /* meaningless */
c4aee085
EH
94#define IWL7265_NVM_VERSION 0x0a1d
95#define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */
e70af8e0
EG
96#define IWL7265D_NVM_VERSION 0x0c11
97#define IWL7265_TX_POWER_VERSION 0xffff /* meaningless */
99cd4714 98
f53bf4c7
LK
99/* DCCM offsets and lengths */
100#define IWL7000_DCCM_OFFSET 0x800000
101#define IWL7260_DCCM_LEN 0x14000
102#define IWL3160_DCCM_LEN 0x10000
103#define IWL7265_DCCM_LEN 0x17A00
104
99cd4714
JB
105#define IWL7260_FW_PRE "iwlwifi-7260-"
106#define IWL7260_MODULE_FIRMWARE(api) IWL7260_FW_PRE __stringify(api) ".ucode"
107
108#define IWL3160_FW_PRE "iwlwifi-3160-"
109#define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE __stringify(api) ".ucode"
110
ca296c57
OG
111#define IWL3168_FW_PRE "iwlwifi-3168-"
112#define IWL3168_MODULE_FIRMWARE(api) IWL3168_FW_PRE __stringify(api) ".ucode"
113
c4aee085
EH
114#define IWL7265_FW_PRE "iwlwifi-7265-"
115#define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode"
116
3fd0d3c1 117#define IWL7265D_FW_PRE "iwlwifi-7265D-"
a443f5e1 118#define IWL7265D_MODULE_FIRMWARE(api) IWL7265D_FW_PRE __stringify(api) ".ucode"
3fd0d3c1 119
ae2b21b0
EH
120#define NVM_HW_SECTION_NUM_FAMILY_7000 0
121
99cd4714 122static const struct iwl_base_params iwl7000_base_params = {
30085544 123 .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_7000,
79f68280 124 .num_of_queues = 31,
99cd4714
JB
125 .shadow_ram_support = true,
126 .led_compensation = 57,
99cd4714
JB
127 .wd_timeout = IWL_LONG_WD_TIMEOUT,
128 .max_event_log_size = 512,
b415210b 129 .shadow_reg_enable = true,
f2532b04 130 .pcie_l1_allowed = true,
e7f76340 131 .apmg_wake_up_wa = true,
99cd4714
JB
132};
133
3444682a
CRI
134static const struct iwl_tt_params iwl7000_high_temp_tt_params = {
135 .ct_kill_entry = 118,
136 .ct_kill_exit = 96,
137 .ct_kill_duration = 5,
138 .dynamic_smps_entry = 114,
139 .dynamic_smps_exit = 110,
140 .tx_protection_entry = 114,
141 .tx_protection_exit = 108,
142 .tx_backoff = {
143 {.temperature = 112, .backoff = 300},
144 {.temperature = 113, .backoff = 800},
145 {.temperature = 114, .backoff = 1500},
146 {.temperature = 115, .backoff = 3000},
147 {.temperature = 116, .backoff = 5000},
148 {.temperature = 117, .backoff = 10000},
149 },
150 .support_ct_kill = true,
151 .support_dynamic_smps = true,
152 .support_tx_protection = true,
153 .support_tx_backoff = true,
154};
155
99cd4714 156static const struct iwl_ht_params iwl7000_ht_params = {
183d281d 157 .stbc = true,
57fbcce3 158 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
99cd4714
JB
159};
160
628a2918 161#define IWL_DEVICE_7000_COMMON \
99cd4714
JB
162 .device_family = IWL_DEVICE_FAMILY_7000, \
163 .max_inst_size = IWL60_RTC_INST_SIZE, \
164 .max_data_size = IWL60_RTC_DATA_SIZE, \
165 .base_params = &iwl7000_base_params, \
ae2b21b0 166 .led_mode = IWL_LED_RF_STATE, \
bbab7582 167 .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_7000, \
c064ddf3 168 .non_shared_ant = ANT_A, \
f53bf4c7
LK
169 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
170 .dccm_offset = IWL7000_DCCM_OFFSET
99cd4714 171
628a2918
JB
172#define IWL_DEVICE_7000 \
173 IWL_DEVICE_7000_COMMON, \
174 .ucode_api_max = IWL7260_UCODE_API_MAX, \
628a2918
JB
175 .ucode_api_min = IWL7260_UCODE_API_MIN
176
177#define IWL_DEVICE_7005 \
178 IWL_DEVICE_7000_COMMON, \
179 .ucode_api_max = IWL7265_UCODE_API_MAX, \
628a2918
JB
180 .ucode_api_min = IWL7265_UCODE_API_MIN
181
ca296c57
OG
182#define IWL_DEVICE_3008 \
183 IWL_DEVICE_7000_COMMON, \
184 .ucode_api_max = IWL3168_UCODE_API_MAX, \
ca296c57
OG
185 .ucode_api_min = IWL3168_UCODE_API_MIN
186
628a2918
JB
187#define IWL_DEVICE_7005D \
188 IWL_DEVICE_7000_COMMON, \
189 .ucode_api_max = IWL7265D_UCODE_API_MAX, \
628a2918
JB
190 .ucode_api_min = IWL7265D_UCODE_API_MIN
191
99cd4714 192const struct iwl_cfg iwl7260_2ac_cfg = {
93fc6411 193 .name = "Intel(R) Dual Band Wireless AC 7260",
99cd4714
JB
194 .fw_name_pre = IWL7260_FW_PRE,
195 IWL_DEVICE_7000,
196 .ht_params = &iwl7000_ht_params,
197 .nvm_ver = IWL7260_NVM_VERSION,
198 .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
6960a059 199 .host_interrupt_operation_mode = true,
a812cba9 200 .lp_xtal_workaround = true,
f53bf4c7 201 .dccm_len = IWL7260_DCCM_LEN,
99cd4714
JB
202};
203
6be497f2
EL
204const struct iwl_cfg iwl7260_2ac_cfg_high_temp = {
205 .name = "Intel(R) Dual Band Wireless AC 7260",
206 .fw_name_pre = IWL7260_FW_PRE,
207 IWL_DEVICE_7000,
208 .ht_params = &iwl7000_ht_params,
209 .nvm_ver = IWL7260_NVM_VERSION,
210 .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
211 .high_temp = true,
6960a059 212 .host_interrupt_operation_mode = true,
a812cba9 213 .lp_xtal_workaround = true,
f53bf4c7 214 .dccm_len = IWL7260_DCCM_LEN,
3444682a 215 .thermal_params = &iwl7000_high_temp_tt_params,
6be497f2
EL
216};
217
93fc6411
OG
218const struct iwl_cfg iwl7260_2n_cfg = {
219 .name = "Intel(R) Dual Band Wireless N 7260",
220 .fw_name_pre = IWL7260_FW_PRE,
221 IWL_DEVICE_7000,
222 .ht_params = &iwl7000_ht_params,
223 .nvm_ver = IWL7260_NVM_VERSION,
224 .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
6960a059 225 .host_interrupt_operation_mode = true,
a812cba9 226 .lp_xtal_workaround = true,
f53bf4c7 227 .dccm_len = IWL7260_DCCM_LEN,
93fc6411
OG
228};
229
230const struct iwl_cfg iwl7260_n_cfg = {
231 .name = "Intel(R) Wireless N 7260",
232 .fw_name_pre = IWL7260_FW_PRE,
233 IWL_DEVICE_7000,
234 .ht_params = &iwl7000_ht_params,
235 .nvm_ver = IWL7260_NVM_VERSION,
236 .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
6960a059 237 .host_interrupt_operation_mode = true,
a812cba9 238 .lp_xtal_workaround = true,
f53bf4c7 239 .dccm_len = IWL7260_DCCM_LEN,
93fc6411
OG
240};
241
242const struct iwl_cfg iwl3160_2ac_cfg = {
243 .name = "Intel(R) Dual Band Wireless AC 3160",
244 .fw_name_pre = IWL3160_FW_PRE,
245 IWL_DEVICE_7000,
246 .ht_params = &iwl7000_ht_params,
247 .nvm_ver = IWL3160_NVM_VERSION,
248 .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
6960a059 249 .host_interrupt_operation_mode = true,
f53bf4c7 250 .dccm_len = IWL3160_DCCM_LEN,
93fc6411
OG
251};
252
253const struct iwl_cfg iwl3160_2n_cfg = {
254 .name = "Intel(R) Dual Band Wireless N 3160",
255 .fw_name_pre = IWL3160_FW_PRE,
256 IWL_DEVICE_7000,
257 .ht_params = &iwl7000_ht_params,
258 .nvm_ver = IWL3160_NVM_VERSION,
259 .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
6960a059 260 .host_interrupt_operation_mode = true,
f53bf4c7 261 .dccm_len = IWL3160_DCCM_LEN,
93fc6411
OG
262};
263
264const struct iwl_cfg iwl3160_n_cfg = {
265 .name = "Intel(R) Wireless N 3160",
99cd4714
JB
266 .fw_name_pre = IWL3160_FW_PRE,
267 IWL_DEVICE_7000,
268 .ht_params = &iwl7000_ht_params,
269 .nvm_ver = IWL3160_NVM_VERSION,
270 .nvm_calib_ver = IWL3160_TX_POWER_VERSION,
6960a059 271 .host_interrupt_operation_mode = true,
f53bf4c7 272 .dccm_len = IWL3160_DCCM_LEN,
99cd4714
JB
273};
274
8e0dc206
IY
275static const struct iwl_pwr_tx_backoff iwl7265_pwr_tx_backoffs[] = {
276 {.pwr = 1600, .backoff = 0},
277 {.pwr = 1300, .backoff = 467},
278 {.pwr = 900, .backoff = 1900},
279 {.pwr = 800, .backoff = 2630},
280 {.pwr = 700, .backoff = 3720},
281 {.pwr = 600, .backoff = 5550},
282 {.pwr = 500, .backoff = 9350},
283 {0},
284};
285
a3576ff2
ES
286static const struct iwl_ht_params iwl7265_ht_params = {
287 .stbc = true,
288 .ldpc = true,
57fbcce3 289 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
a3576ff2
ES
290};
291
498abba6
OG
292const struct iwl_cfg iwl3165_2ac_cfg = {
293 .name = "Intel(R) Dual Band Wireless AC 3165",
ed659187 294 .fw_name_pre = IWL7265D_FW_PRE,
628a2918 295 IWL_DEVICE_7005D,
498abba6
OG
296 .ht_params = &iwl7000_ht_params,
297 .nvm_ver = IWL3165_NVM_VERSION,
298 .nvm_calib_ver = IWL3165_TX_POWER_VERSION,
299 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
f53bf4c7 300 .dccm_len = IWL7265_DCCM_LEN,
498abba6
OG
301};
302
c4836b05
OG
303const struct iwl_cfg iwl3168_2ac_cfg = {
304 .name = "Intel(R) Dual Band Wireless AC 3168",
ca296c57
OG
305 .fw_name_pre = IWL3168_FW_PRE,
306 IWL_DEVICE_3008,
c4836b05 307 .ht_params = &iwl7000_ht_params,
ca296c57
OG
308 .nvm_ver = IWL3168_NVM_VERSION,
309 .nvm_calib_ver = IWL3168_TX_POWER_VERSION,
c4836b05
OG
310 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
311 .dccm_len = IWL7265_DCCM_LEN,
312};
313
c4aee085
EH
314const struct iwl_cfg iwl7265_2ac_cfg = {
315 .name = "Intel(R) Dual Band Wireless AC 7265",
316 .fw_name_pre = IWL7265_FW_PRE,
628a2918 317 IWL_DEVICE_7005,
a3576ff2 318 .ht_params = &iwl7265_ht_params,
c4aee085
EH
319 .nvm_ver = IWL7265_NVM_VERSION,
320 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
8e0dc206 321 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
f53bf4c7 322 .dccm_len = IWL7265_DCCM_LEN,
c4aee085
EH
323};
324
53e88cb1
OG
325const struct iwl_cfg iwl7265_2n_cfg = {
326 .name = "Intel(R) Dual Band Wireless N 7265",
327 .fw_name_pre = IWL7265_FW_PRE,
628a2918 328 IWL_DEVICE_7005,
a3576ff2 329 .ht_params = &iwl7265_ht_params,
53e88cb1
OG
330 .nvm_ver = IWL7265_NVM_VERSION,
331 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
8e0dc206 332 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
f53bf4c7 333 .dccm_len = IWL7265_DCCM_LEN,
53e88cb1
OG
334};
335
336const struct iwl_cfg iwl7265_n_cfg = {
337 .name = "Intel(R) Wireless N 7265",
338 .fw_name_pre = IWL7265_FW_PRE,
628a2918 339 IWL_DEVICE_7005,
a3576ff2 340 .ht_params = &iwl7265_ht_params,
53e88cb1
OG
341 .nvm_ver = IWL7265_NVM_VERSION,
342 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
8e0dc206 343 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
f53bf4c7 344 .dccm_len = IWL7265_DCCM_LEN,
53e88cb1
OG
345};
346
3fd0d3c1
JB
347const struct iwl_cfg iwl7265d_2ac_cfg = {
348 .name = "Intel(R) Dual Band Wireless AC 7265",
349 .fw_name_pre = IWL7265D_FW_PRE,
628a2918 350 IWL_DEVICE_7005D,
3fd0d3c1 351 .ht_params = &iwl7265_ht_params,
e70af8e0 352 .nvm_ver = IWL7265D_NVM_VERSION,
3fd0d3c1
JB
353 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
354 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
f53bf4c7 355 .dccm_len = IWL7265_DCCM_LEN,
3fd0d3c1
JB
356};
357
358const struct iwl_cfg iwl7265d_2n_cfg = {
359 .name = "Intel(R) Dual Band Wireless N 7265",
360 .fw_name_pre = IWL7265D_FW_PRE,
628a2918 361 IWL_DEVICE_7005D,
3fd0d3c1 362 .ht_params = &iwl7265_ht_params,
e70af8e0 363 .nvm_ver = IWL7265D_NVM_VERSION,
3fd0d3c1
JB
364 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
365 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
f53bf4c7 366 .dccm_len = IWL7265_DCCM_LEN,
3fd0d3c1
JB
367};
368
369const struct iwl_cfg iwl7265d_n_cfg = {
370 .name = "Intel(R) Wireless N 7265",
371 .fw_name_pre = IWL7265D_FW_PRE,
628a2918 372 IWL_DEVICE_7005D,
3fd0d3c1 373 .ht_params = &iwl7265_ht_params,
e70af8e0 374 .nvm_ver = IWL7265D_NVM_VERSION,
3fd0d3c1
JB
375 .nvm_calib_ver = IWL7265_TX_POWER_VERSION,
376 .pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
f53bf4c7 377 .dccm_len = IWL7265_DCCM_LEN,
3fd0d3c1
JB
378};
379
9d9b21d1
EG
380MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_MAX));
381MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_MAX));
382MODULE_FIRMWARE(IWL3168_MODULE_FIRMWARE(IWL3168_UCODE_API_MAX));
383MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_MAX));
384MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_MAX));