blob: d6bff166b269c5dd1cccd11748941d6ffcab6108 [file] [log] [blame]
Eran Harary503ab8c2013-11-20 07:28:58 +02001/******************************************************************************
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) 2014 Intel Corporation. All rights reserved.
Eran Harary4fb06282015-04-19 10:05:18 +03009 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
Oren Givon7e502e52016-01-25 12:00:42 +020010 * Copyright(c) 2016 Intel Deutschland GmbH
Eran Harary503ab8c2013-11-20 07:28:58 +020011 *
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
14 * published by the Free Software Foundation.
15 *
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.
20 *
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
25 *
26 * The full GNU General Public License is included in this distribution
27 * in the file called COPYING.
28 *
29 * Contact Information:
Emmanuel Grumbachcb2f8272015-11-17 15:39:56 +020030 * Intel Linux Wireless <linuxwifi@intel.com>
Eran Harary503ab8c2013-11-20 07:28:58 +020031 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 *
33 * BSD LICENSE
34 *
35 * Copyright(c) 2014 Intel Corporation. All rights reserved.
Eran Harary4fb06282015-04-19 10:05:18 +030036 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
Eran Harary503ab8c2013-11-20 07:28:58 +020037 * All rights reserved.
38 *
39 * Redistribution and use in source and binary forms, with or without
40 * modification, are permitted provided that the following conditions
41 * are met:
42 *
43 * * Redistributions of source code must retain the above copyright
44 * notice, this list of conditions and the following disclaimer.
45 * * Redistributions in binary form must reproduce the above copyright
46 * notice, this list of conditions and the following disclaimer in
47 * the documentation and/or other materials provided with the
48 * distribution.
49 * * Neither the name Intel Corporation nor the names of its
50 * contributors may be used to endorse or promote products derived
51 * from this software without specific prior written permission.
52 *
53 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
54 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
55 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
56 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
57 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
58 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
59 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
60 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
61 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
62 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
63 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64 *
65 *****************************************************************************/
66
67#include <linux/module.h>
68#include <linux/stringify.h>
69#include "iwl-config.h"
70#include "iwl-agn-hw.h"
71
72/* Highest firmware API version supported */
Emmanuel Grumbach5a51c032016-02-23 21:53:12 +020073#define IWL8000_UCODE_API_MAX 21
74#define IWL8265_UCODE_API_MAX 21
Eran Harary503ab8c2013-11-20 07:28:58 +020075
Eran Harary503ab8c2013-11-20 07:28:58 +020076/* Lowest firmware API version supported */
Sara Sharon97f95c92016-03-07 16:55:20 +020077#define IWL8000_UCODE_API_MIN 16
Oren Givon7e502e52016-01-25 12:00:42 +020078#define IWL8265_UCODE_API_MIN 20
Eran Harary503ab8c2013-11-20 07:28:58 +020079
80/* NVM versions */
81#define IWL8000_NVM_VERSION 0x0a1d
82#define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */
83
Liad Kaufmanaddfaad2014-12-02 11:16:04 +020084/* Memory offsets and lengths */
Liad Kaufmanf53bf4c2014-12-01 10:44:18 +020085#define IWL8260_DCCM_OFFSET 0x800000
86#define IWL8260_DCCM_LEN 0x18000
Ido Yariv86138322014-12-10 12:39:27 -050087#define IWL8260_DCCM2_OFFSET 0x880000
88#define IWL8260_DCCM2_LEN 0x8000
Liad Kaufmanaddfaad2014-12-02 11:16:04 +020089#define IWL8260_SMEM_OFFSET 0x400000
90#define IWL8260_SMEM_LEN 0x68000
Liad Kaufmanf53bf4c2014-12-01 10:44:18 +020091
Sara Sharone1ba6842016-04-11 15:01:46 +030092#define IWL8000_FW_PRE "iwlwifi-8000C-"
Liad Kaufman405b7332014-09-23 15:15:17 +030093#define IWL8000_MODULE_FIRMWARE(api) \
94 IWL8000_FW_PRE "-" __stringify(api) ".ucode"
Eran Harary503ab8c2013-11-20 07:28:58 +020095
Oren Givon7e502e52016-01-25 12:00:42 +020096#define IWL8265_FW_PRE "iwlwifi-8265-"
97#define IWL8265_MODULE_FIRMWARE(api) \
98 IWL8265_FW_PRE __stringify(api) ".ucode"
99
Eran Hararyae2b21b2014-01-09 08:08:24 +0200100#define NVM_HW_SECTION_NUM_FAMILY_8000 10
Eran Hararyd383c742015-03-24 10:59:46 +0200101#define DEFAULT_NVM_FILE_FAMILY_8000B "nvmData-8000B"
102#define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C"
Eran Hararyae2b21b2014-01-09 08:08:24 +0200103
Alexander Bondar9d012d02015-06-04 10:32:43 +0300104/* Max SDIO RX/TX aggregation sizes of the ADDBA request/response */
105#define MAX_RX_AGG_SIZE_8260_SDIO 21
106#define MAX_TX_AGG_SIZE_8260_SDIO 40
Oren Givon745160e2014-06-16 10:54:52 +0300107
Eran Hararyc064ddf2014-09-30 06:42:06 +0200108/* Max A-MPDU exponent for HT and VHT */
109#define MAX_HT_AMPDU_EXPONENT_8260_SDIO IEEE80211_HT_MAX_AMPDU_32K
110#define MAX_VHT_AMPDU_EXPONENT_8260_SDIO IEEE80211_VHT_MAX_AMPDU_32K
111
Eran Harary503ab8c2013-11-20 07:28:58 +0200112static const struct iwl_base_params iwl8000_base_params = {
Eran Harary30085542014-04-22 10:47:48 +0300113 .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000,
Liad Kaufman79f68282015-08-24 16:23:58 +0300114 .num_of_queues = 31,
Eran Harary503ab8c2013-11-20 07:28:58 +0200115 .pll_cfg_val = 0,
116 .shadow_ram_support = true,
117 .led_compensation = 57,
118 .wd_timeout = IWL_LONG_WD_TIMEOUT,
119 .max_event_log_size = 512,
120 .shadow_reg_enable = true,
121 .pcie_l1_allowed = true,
122};
123
124static const struct iwl_ht_params iwl8000_ht_params = {
Eyal Shapirab2603622014-10-23 15:30:47 +0300125 .stbc = true,
Eyal Shapira099d8082014-08-28 02:33:05 +0300126 .ldpc = true,
Johannes Berg57fbcce2016-04-12 15:56:15 +0200127 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
Eran Harary503ab8c2013-11-20 07:28:58 +0200128};
129
Ido Yariv8ce7db42015-05-04 23:01:46 -0400130static const struct iwl_tt_params iwl8000_tt_params = {
131 .ct_kill_entry = 115,
132 .ct_kill_exit = 93,
133 .ct_kill_duration = 5,
134 .dynamic_smps_entry = 111,
135 .dynamic_smps_exit = 107,
136 .tx_protection_entry = 112,
137 .tx_protection_exit = 105,
138 .tx_backoff = {
139 {.temperature = 110, .backoff = 200},
140 {.temperature = 111, .backoff = 600},
141 {.temperature = 112, .backoff = 1200},
142 {.temperature = 113, .backoff = 2000},
143 {.temperature = 114, .backoff = 4000},
144 },
145 .support_ct_kill = true,
146 .support_dynamic_smps = true,
147 .support_tx_protection = true,
148 .support_tx_backoff = true,
149};
150
Oren Givon7e502e52016-01-25 12:00:42 +0200151#define IWL_DEVICE_8000_COMMON \
Eran Harary4fb06282015-04-19 10:05:18 +0300152 .device_family = IWL_DEVICE_FAMILY_8000, \
153 .max_inst_size = IWL60_RTC_INST_SIZE, \
154 .max_data_size = IWL60_RTC_DATA_SIZE, \
155 .base_params = &iwl8000_base_params, \
156 .led_mode = IWL_LED_RF_STATE, \
157 .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_8000, \
Avri Altman93190fb2014-12-27 09:09:47 +0200158 .features = NETIF_F_RXCSUM, \
Eran Harary4fb06282015-04-19 10:05:18 +0300159 .non_shared_ant = ANT_A, \
160 .dccm_offset = IWL8260_DCCM_OFFSET, \
161 .dccm_len = IWL8260_DCCM_LEN, \
162 .dccm2_offset = IWL8260_DCCM2_OFFSET, \
163 .dccm2_len = IWL8260_DCCM2_LEN, \
164 .smem_offset = IWL8260_SMEM_OFFSET, \
165 .smem_len = IWL8260_SMEM_LEN, \
166 .default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B, \
Ido Yariv8ce7db42015-05-04 23:01:46 -0400167 .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, \
Avri Altman95411d02015-05-11 11:04:34 +0300168 .thermal_params = &iwl8000_tt_params, \
169 .apmg_not_supported = true
Eran Harary503ab8c2013-11-20 07:28:58 +0200170
Oren Givon7e502e52016-01-25 12:00:42 +0200171#define IWL_DEVICE_8000 \
172 IWL_DEVICE_8000_COMMON, \
173 .ucode_api_max = IWL8000_UCODE_API_MAX, \
Oren Givon7e502e52016-01-25 12:00:42 +0200174 .ucode_api_min = IWL8000_UCODE_API_MIN \
175
176#define IWL_DEVICE_8260 \
177 IWL_DEVICE_8000_COMMON, \
178 .ucode_api_max = IWL8000_UCODE_API_MAX, \
Oren Givon7e502e52016-01-25 12:00:42 +0200179 .ucode_api_min = IWL8000_UCODE_API_MIN \
180
181#define IWL_DEVICE_8265 \
182 IWL_DEVICE_8000_COMMON, \
183 .ucode_api_max = IWL8265_UCODE_API_MAX, \
Oren Givon7e502e52016-01-25 12:00:42 +0200184 .ucode_api_min = IWL8265_UCODE_API_MIN \
185
Oren Givond4200cb2014-09-04 09:16:49 +0200186const struct iwl_cfg iwl8260_2n_cfg = {
187 .name = "Intel(R) Dual Band Wireless N 8260",
188 .fw_name_pre = IWL8000_FW_PRE,
Oren Givon7e502e52016-01-25 12:00:42 +0200189 IWL_DEVICE_8260,
Oren Givond4200cb2014-09-04 09:16:49 +0200190 .ht_params = &iwl8000_ht_params,
191 .nvm_ver = IWL8000_NVM_VERSION,
192 .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
193};
194
Eran Harary503ab8c2013-11-20 07:28:58 +0200195const struct iwl_cfg iwl8260_2ac_cfg = {
196 .name = "Intel(R) Dual Band Wireless AC 8260",
197 .fw_name_pre = IWL8000_FW_PRE,
Oren Givon7e502e52016-01-25 12:00:42 +0200198 IWL_DEVICE_8260,
Eran Harary503ab8c2013-11-20 07:28:58 +0200199 .ht_params = &iwl8000_ht_params,
200 .nvm_ver = IWL8000_NVM_VERSION,
201 .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
Eran Hararyc064ddf2014-09-30 06:42:06 +0200202 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
Eran Harary503ab8c2013-11-20 07:28:58 +0200203};
204
Oren Givonabf10f82015-11-01 15:27:58 +0200205const struct iwl_cfg iwl8265_2ac_cfg = {
206 .name = "Intel(R) Dual Band Wireless AC 8265",
Oren Givon7e502e52016-01-25 12:00:42 +0200207 .fw_name_pre = IWL8265_FW_PRE,
208 IWL_DEVICE_8265,
Oren Givonabf10f82015-11-01 15:27:58 +0200209 .ht_params = &iwl8000_ht_params,
210 .nvm_ver = IWL8000_NVM_VERSION,
211 .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
212 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
Sara Sharone48c9472016-01-27 18:59:48 +0200213 .vht_mu_mimo_supported = true,
Oren Givonabf10f82015-11-01 15:27:58 +0200214};
215
Oren Givon9b8a7a92014-12-23 10:39:48 +0200216const struct iwl_cfg iwl4165_2ac_cfg = {
217 .name = "Intel(R) Dual Band Wireless AC 4165",
218 .fw_name_pre = IWL8000_FW_PRE,
219 IWL_DEVICE_8000,
220 .ht_params = &iwl8000_ht_params,
221 .nvm_ver = IWL8000_NVM_VERSION,
222 .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
223 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
224};
225
Eran Harary52ab4c82014-06-01 14:55:21 +0300226const struct iwl_cfg iwl8260_2ac_sdio_cfg = {
Ariej Marjieh9d913562014-02-03 23:34:47 +0200227 .name = "Intel(R) Dual Band Wireless-AC 8260",
228 .fw_name_pre = IWL8000_FW_PRE,
Oren Givon7e502e52016-01-25 12:00:42 +0200229 IWL_DEVICE_8260,
Ariej Marjieh9d913562014-02-03 23:34:47 +0200230 .ht_params = &iwl8000_ht_params,
231 .nvm_ver = IWL8000_NVM_VERSION,
232 .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
Oren Givon745160e2014-06-16 10:54:52 +0300233 .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
Alexander Bondar9d012d02015-06-04 10:32:43 +0300234 .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
Eran Harary161bdb72014-07-27 08:03:06 +0300235 .disable_dummy_notification = true,
Eran Hararyc064ddf2014-09-30 06:42:06 +0200236 .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
237 .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
Ariej Marjieh9d913562014-02-03 23:34:47 +0200238};
239
Mordechai Goodsteine5ed1792016-03-29 14:41:49 +0300240const struct iwl_cfg iwl8265_2ac_sdio_cfg = {
241 .name = "Intel(R) Dual Band Wireless-AC 8265",
242 .fw_name_pre = IWL8265_FW_PRE,
243 IWL_DEVICE_8265,
244 .ht_params = &iwl8000_ht_params,
245 .nvm_ver = IWL8000_NVM_VERSION,
246 .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
247 .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
248 .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
249 .disable_dummy_notification = true,
250 .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
251 .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
252};
253
Oren Givon773cb0252014-12-01 11:40:46 +0200254const struct iwl_cfg iwl4165_2ac_sdio_cfg = {
255 .name = "Intel(R) Dual Band Wireless-AC 4165",
Oren Givon3c4e2992014-10-14 11:26:52 +0300256 .fw_name_pre = IWL8000_FW_PRE,
257 IWL_DEVICE_8000,
258 .ht_params = &iwl8000_ht_params,
259 .nvm_ver = IWL8000_NVM_VERSION,
260 .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
Oren Givon3c4e2992014-10-14 11:26:52 +0300261 .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
Alexander Bondar9d012d02015-06-04 10:32:43 +0300262 .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
Oren Givon3c4e2992014-10-14 11:26:52 +0300263 .bt_shared_single_ant = true,
264 .disable_dummy_notification = true,
265 .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
266 .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
267};
268
Emmanuel Grumbach9d9b21d2016-03-24 08:44:57 +0200269MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_MAX));
270MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_MAX));