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) 2014 Intel Corporation. All rights reserved. 9 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 10 * Copyright(c) 2016 Intel Deutschland GmbH 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 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: 30 * Intel Linux Wireless <linuxwifi@intel.com> 31 * 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. 36 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 37 * 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 */ 73 #define IWL8000_UCODE_API_MAX 34 74 #define IWL8265_UCODE_API_MAX 34 75 76 /* Lowest firmware API version supported */ 77 #define IWL8000_UCODE_API_MIN 22 78 #define IWL8265_UCODE_API_MIN 22 79 80 /* NVM versions */ 81 #define IWL8000_NVM_VERSION 0x0a1d 82 #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */ 83 84 /* Memory offsets and lengths */ 85 #define IWL8260_DCCM_OFFSET 0x800000 86 #define IWL8260_DCCM_LEN 0x18000 87 #define IWL8260_DCCM2_OFFSET 0x880000 88 #define IWL8260_DCCM2_LEN 0x8000 89 #define IWL8260_SMEM_OFFSET 0x400000 90 #define IWL8260_SMEM_LEN 0x68000 91 92 #define IWL8000_FW_PRE "iwlwifi-8000C-" 93 #define IWL8000_MODULE_FIRMWARE(api) \ 94 IWL8000_FW_PRE __stringify(api) ".ucode" 95 96 #define IWL8265_FW_PRE "iwlwifi-8265-" 97 #define IWL8265_MODULE_FIRMWARE(api) \ 98 IWL8265_FW_PRE __stringify(api) ".ucode" 99 100 #define NVM_HW_SECTION_NUM_FAMILY_8000 10 101 #define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C" 102 103 /* Max SDIO RX/TX aggregation sizes of the ADDBA request/response */ 104 #define MAX_RX_AGG_SIZE_8260_SDIO 21 105 #define MAX_TX_AGG_SIZE_8260_SDIO 40 106 107 /* Max A-MPDU exponent for HT and VHT */ 108 #define MAX_HT_AMPDU_EXPONENT_8260_SDIO IEEE80211_HT_MAX_AMPDU_32K 109 #define MAX_VHT_AMPDU_EXPONENT_8260_SDIO IEEE80211_VHT_MAX_AMPDU_32K 110 111 static const struct iwl_base_params iwl8000_base_params = { 112 .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000, 113 .num_of_queues = 31, 114 .shadow_ram_support = true, 115 .led_compensation = 57, 116 .wd_timeout = IWL_LONG_WD_TIMEOUT, 117 .max_event_log_size = 512, 118 .shadow_reg_enable = true, 119 .pcie_l1_allowed = true, 120 }; 121 122 static const struct iwl_ht_params iwl8000_ht_params = { 123 .stbc = true, 124 .ldpc = true, 125 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ), 126 }; 127 128 static const struct iwl_tt_params iwl8000_tt_params = { 129 .ct_kill_entry = 115, 130 .ct_kill_exit = 93, 131 .ct_kill_duration = 5, 132 .dynamic_smps_entry = 111, 133 .dynamic_smps_exit = 107, 134 .tx_protection_entry = 112, 135 .tx_protection_exit = 105, 136 .tx_backoff = { 137 {.temperature = 110, .backoff = 200}, 138 {.temperature = 111, .backoff = 600}, 139 {.temperature = 112, .backoff = 1200}, 140 {.temperature = 113, .backoff = 2000}, 141 {.temperature = 114, .backoff = 4000}, 142 }, 143 .support_ct_kill = true, 144 .support_dynamic_smps = true, 145 .support_tx_protection = true, 146 .support_tx_backoff = true, 147 }; 148 149 #define IWL_DEVICE_8000_COMMON \ 150 .device_family = IWL_DEVICE_FAMILY_8000, \ 151 .max_inst_size = IWL60_RTC_INST_SIZE, \ 152 .max_data_size = IWL60_RTC_DATA_SIZE, \ 153 .base_params = &iwl8000_base_params, \ 154 .led_mode = IWL_LED_RF_STATE, \ 155 .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_8000, \ 156 .features = NETIF_F_RXCSUM, \ 157 .non_shared_ant = ANT_A, \ 158 .dccm_offset = IWL8260_DCCM_OFFSET, \ 159 .dccm_len = IWL8260_DCCM_LEN, \ 160 .dccm2_offset = IWL8260_DCCM2_OFFSET, \ 161 .dccm2_len = IWL8260_DCCM2_LEN, \ 162 .smem_offset = IWL8260_SMEM_OFFSET, \ 163 .smem_len = IWL8260_SMEM_LEN, \ 164 .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, \ 165 .thermal_params = &iwl8000_tt_params, \ 166 .apmg_not_supported = true, \ 167 .nvm_type = IWL_NVM_EXT, \ 168 .dbgc_supported = true, \ 169 .min_umac_error_event_table = 0x800000 170 171 #define IWL_DEVICE_8000 \ 172 IWL_DEVICE_8000_COMMON, \ 173 .ucode_api_max = IWL8000_UCODE_API_MAX, \ 174 .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, \ 179 .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, \ 184 .ucode_api_min = IWL8265_UCODE_API_MIN \ 185 186 const struct iwl_cfg iwl8260_2n_cfg = { 187 .name = "Intel(R) Dual Band Wireless N 8260", 188 .fw_name_pre = IWL8000_FW_PRE, 189 IWL_DEVICE_8260, 190 .ht_params = &iwl8000_ht_params, 191 .nvm_ver = IWL8000_NVM_VERSION, 192 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 193 }; 194 195 const struct iwl_cfg iwl8260_2ac_cfg = { 196 .name = "Intel(R) Dual Band Wireless AC 8260", 197 .fw_name_pre = IWL8000_FW_PRE, 198 IWL_DEVICE_8260, 199 .ht_params = &iwl8000_ht_params, 200 .nvm_ver = IWL8000_NVM_VERSION, 201 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 202 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, 203 }; 204 205 const struct iwl_cfg iwl8265_2ac_cfg = { 206 .name = "Intel(R) Dual Band Wireless AC 8265", 207 .fw_name_pre = IWL8265_FW_PRE, 208 IWL_DEVICE_8265, 209 .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, 213 .vht_mu_mimo_supported = true, 214 }; 215 216 const struct iwl_cfg iwl8275_2ac_cfg = { 217 .name = "Intel(R) Dual Band Wireless AC 8275", 218 .fw_name_pre = IWL8265_FW_PRE, 219 IWL_DEVICE_8265, 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 .vht_mu_mimo_supported = true, 225 }; 226 227 const struct iwl_cfg iwl4165_2ac_cfg = { 228 .name = "Intel(R) Dual Band Wireless AC 4165", 229 .fw_name_pre = IWL8000_FW_PRE, 230 IWL_DEVICE_8000, 231 .ht_params = &iwl8000_ht_params, 232 .nvm_ver = IWL8000_NVM_VERSION, 233 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 234 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, 235 }; 236 237 const struct iwl_cfg iwl8260_2ac_sdio_cfg = { 238 .name = "Intel(R) Dual Band Wireless-AC 8260", 239 .fw_name_pre = IWL8000_FW_PRE, 240 IWL_DEVICE_8260, 241 .ht_params = &iwl8000_ht_params, 242 .nvm_ver = IWL8000_NVM_VERSION, 243 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 244 .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, 245 .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO, 246 .disable_dummy_notification = true, 247 .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, 248 .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO, 249 }; 250 251 const struct iwl_cfg iwl8265_2ac_sdio_cfg = { 252 .name = "Intel(R) Dual Band Wireless-AC 8265", 253 .fw_name_pre = IWL8265_FW_PRE, 254 IWL_DEVICE_8265, 255 .ht_params = &iwl8000_ht_params, 256 .nvm_ver = IWL8000_NVM_VERSION, 257 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 258 .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, 259 .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO, 260 .disable_dummy_notification = true, 261 .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, 262 .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO, 263 }; 264 265 const struct iwl_cfg iwl4165_2ac_sdio_cfg = { 266 .name = "Intel(R) Dual Band Wireless-AC 4165", 267 .fw_name_pre = IWL8000_FW_PRE, 268 IWL_DEVICE_8000, 269 .ht_params = &iwl8000_ht_params, 270 .nvm_ver = IWL8000_NVM_VERSION, 271 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 272 .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, 273 .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO, 274 .bt_shared_single_ant = true, 275 .disable_dummy_notification = true, 276 .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, 277 .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO, 278 }; 279 280 MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_MAX)); 281 MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_MAX)); 282