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 * Copyright(c) 2018 Intel Corporation 12 * 13 * This program is free software; you can redistribute it and/or modify 14 * it under the terms of version 2 of the GNU General Public License as 15 * published by the Free Software Foundation. 16 * 17 * This program is distributed in the hope that it will be useful, but 18 * WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * General Public License for more details. 21 * 22 * The full GNU General Public License is included in this distribution 23 * in the file called COPYING. 24 * 25 * Contact Information: 26 * Intel Linux Wireless <linuxwifi@intel.com> 27 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 28 * 29 * BSD LICENSE 30 * 31 * Copyright(c) 2014 Intel Corporation. All rights reserved. 32 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH 33 * Copyright(c) 2018 Intel Corporation 34 * All rights reserved. 35 * 36 * Redistribution and use in source and binary forms, with or without 37 * modification, are permitted provided that the following conditions 38 * are met: 39 * 40 * * Redistributions of source code must retain the above copyright 41 * notice, this list of conditions and the following disclaimer. 42 * * Redistributions in binary form must reproduce the above copyright 43 * notice, this list of conditions and the following disclaimer in 44 * the documentation and/or other materials provided with the 45 * distribution. 46 * * Neither the name Intel Corporation nor the names of its 47 * contributors may be used to endorse or promote products derived 48 * from this software without specific prior written permission. 49 * 50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61 * 62 *****************************************************************************/ 63 64 #include <linux/module.h> 65 #include <linux/stringify.h> 66 #include "iwl-config.h" 67 68 /* Highest firmware API version supported */ 69 #define IWL8000_UCODE_API_MAX 36 70 #define IWL8265_UCODE_API_MAX 36 71 72 /* Lowest firmware API version supported */ 73 #define IWL8000_UCODE_API_MIN 22 74 #define IWL8265_UCODE_API_MIN 22 75 76 /* NVM versions */ 77 #define IWL8000_NVM_VERSION 0x0a1d 78 #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */ 79 80 /* Memory offsets and lengths */ 81 #define IWL8260_DCCM_OFFSET 0x800000 82 #define IWL8260_DCCM_LEN 0x18000 83 #define IWL8260_DCCM2_OFFSET 0x880000 84 #define IWL8260_DCCM2_LEN 0x8000 85 #define IWL8260_SMEM_OFFSET 0x400000 86 #define IWL8260_SMEM_LEN 0x68000 87 88 #define IWL8000_FW_PRE "iwlwifi-8000C-" 89 #define IWL8000_MODULE_FIRMWARE(api) \ 90 IWL8000_FW_PRE __stringify(api) ".ucode" 91 92 #define IWL8265_FW_PRE "iwlwifi-8265-" 93 #define IWL8265_MODULE_FIRMWARE(api) \ 94 IWL8265_FW_PRE __stringify(api) ".ucode" 95 96 #define NVM_HW_SECTION_NUM_FAMILY_8000 10 97 #define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C" 98 99 static const struct iwl_base_params iwl8000_base_params = { 100 .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000, 101 .num_of_queues = 31, 102 .max_tfd_queue_size = 256, 103 .shadow_ram_support = true, 104 .led_compensation = 57, 105 .wd_timeout = IWL_LONG_WD_TIMEOUT, 106 .max_event_log_size = 512, 107 .shadow_reg_enable = true, 108 .pcie_l1_allowed = true, 109 }; 110 111 static const struct iwl_ht_params iwl8000_ht_params = { 112 .stbc = true, 113 .ldpc = true, 114 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ), 115 }; 116 117 static const struct iwl_tt_params iwl8000_tt_params = { 118 .ct_kill_entry = 115, 119 .ct_kill_exit = 93, 120 .ct_kill_duration = 5, 121 .dynamic_smps_entry = 111, 122 .dynamic_smps_exit = 107, 123 .tx_protection_entry = 112, 124 .tx_protection_exit = 105, 125 .tx_backoff = { 126 {.temperature = 110, .backoff = 200}, 127 {.temperature = 111, .backoff = 600}, 128 {.temperature = 112, .backoff = 1200}, 129 {.temperature = 113, .backoff = 2000}, 130 {.temperature = 114, .backoff = 4000}, 131 }, 132 .support_ct_kill = true, 133 .support_dynamic_smps = true, 134 .support_tx_protection = true, 135 .support_tx_backoff = true, 136 }; 137 138 #define IWL_DEVICE_8000_COMMON \ 139 .device_family = IWL_DEVICE_FAMILY_8000, \ 140 .base_params = &iwl8000_base_params, \ 141 .led_mode = IWL_LED_RF_STATE, \ 142 .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_8000, \ 143 .features = NETIF_F_RXCSUM, \ 144 .non_shared_ant = ANT_A, \ 145 .dccm_offset = IWL8260_DCCM_OFFSET, \ 146 .dccm_len = IWL8260_DCCM_LEN, \ 147 .dccm2_offset = IWL8260_DCCM2_OFFSET, \ 148 .dccm2_len = IWL8260_DCCM2_LEN, \ 149 .smem_offset = IWL8260_SMEM_OFFSET, \ 150 .smem_len = IWL8260_SMEM_LEN, \ 151 .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, \ 152 .thermal_params = &iwl8000_tt_params, \ 153 .apmg_not_supported = true, \ 154 .nvm_type = IWL_NVM_EXT, \ 155 .dbgc_supported = true, \ 156 .min_umac_error_event_table = 0x800000, \ 157 .csr = &iwl_csr_v1 158 159 #define IWL_DEVICE_8000 \ 160 IWL_DEVICE_8000_COMMON, \ 161 .ucode_api_max = IWL8000_UCODE_API_MAX, \ 162 .ucode_api_min = IWL8000_UCODE_API_MIN \ 163 164 #define IWL_DEVICE_8260 \ 165 IWL_DEVICE_8000_COMMON, \ 166 .ucode_api_max = IWL8000_UCODE_API_MAX, \ 167 .ucode_api_min = IWL8000_UCODE_API_MIN \ 168 169 #define IWL_DEVICE_8265 \ 170 IWL_DEVICE_8000_COMMON, \ 171 .ucode_api_max = IWL8265_UCODE_API_MAX, \ 172 .ucode_api_min = IWL8265_UCODE_API_MIN \ 173 174 const struct iwl_cfg iwl8260_2n_cfg = { 175 .name = "Intel(R) Dual Band Wireless N 8260", 176 .fw_name_pre = IWL8000_FW_PRE, 177 IWL_DEVICE_8260, 178 .ht_params = &iwl8000_ht_params, 179 .nvm_ver = IWL8000_NVM_VERSION, 180 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 181 }; 182 183 const struct iwl_cfg iwl8260_2ac_cfg = { 184 .name = "Intel(R) Dual Band Wireless AC 8260", 185 .fw_name_pre = IWL8000_FW_PRE, 186 IWL_DEVICE_8260, 187 .ht_params = &iwl8000_ht_params, 188 .nvm_ver = IWL8000_NVM_VERSION, 189 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 190 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, 191 }; 192 193 const struct iwl_cfg iwl8265_2ac_cfg = { 194 .name = "Intel(R) Dual Band Wireless AC 8265", 195 .fw_name_pre = IWL8265_FW_PRE, 196 IWL_DEVICE_8265, 197 .ht_params = &iwl8000_ht_params, 198 .nvm_ver = IWL8000_NVM_VERSION, 199 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 200 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, 201 .vht_mu_mimo_supported = true, 202 }; 203 204 const struct iwl_cfg iwl8275_2ac_cfg = { 205 .name = "Intel(R) Dual Band Wireless AC 8275", 206 .fw_name_pre = IWL8265_FW_PRE, 207 IWL_DEVICE_8265, 208 .ht_params = &iwl8000_ht_params, 209 .nvm_ver = IWL8000_NVM_VERSION, 210 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 211 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, 212 .vht_mu_mimo_supported = true, 213 }; 214 215 const struct iwl_cfg iwl4165_2ac_cfg = { 216 .name = "Intel(R) Dual Band Wireless AC 4165", 217 .fw_name_pre = IWL8000_FW_PRE, 218 IWL_DEVICE_8000, 219 .ht_params = &iwl8000_ht_params, 220 .nvm_ver = IWL8000_NVM_VERSION, 221 .nvm_calib_ver = IWL8000_TX_POWER_VERSION, 222 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, 223 }; 224 225 MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_MAX)); 226 MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_MAX)); 227