8000.c 8.0 KB

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