22000.c 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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) 2015-2017 Intel Deutschland GmbH
  9. * Copyright (C) 2018 Intel Corporation
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of version 2 of the GNU General Public License as
  13. * published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * BSD LICENSE
  21. *
  22. * Copyright(c) 2015-2017 Intel Deutschland GmbH
  23. * Copyright (C) 2018 Intel Corporation
  24. * All rights reserved.
  25. *
  26. * Redistribution and use in source and binary forms, with or without
  27. * modification, are permitted provided that the following conditions
  28. * are met:
  29. *
  30. * * Redistributions of source code must retain the above copyright
  31. * notice, this list of conditions and the following disclaimer.
  32. * * Redistributions in binary form must reproduce the above copyright
  33. * notice, this list of conditions and the following disclaimer in
  34. * the documentation and/or other materials provided with the
  35. * distribution.
  36. * * Neither the name Intel Corporation nor the names of its
  37. * contributors may be used to endorse or promote products derived
  38. * from this software without specific prior written permission.
  39. *
  40. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  41. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  42. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  43. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  44. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  45. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  46. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  47. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  48. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  49. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  50. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  51. *
  52. *****************************************************************************/
  53. #include <linux/module.h>
  54. #include <linux/stringify.h>
  55. #include "iwl-config.h"
  56. /* Highest firmware API version supported */
  57. #define IWL_22000_UCODE_API_MAX 38
  58. /* Lowest firmware API version supported */
  59. #define IWL_22000_UCODE_API_MIN 24
  60. /* NVM versions */
  61. #define IWL_22000_NVM_VERSION 0x0a1d
  62. #define IWL_22000_TX_POWER_VERSION 0xffff /* meaningless */
  63. /* Memory offsets and lengths */
  64. #define IWL_22000_DCCM_OFFSET 0x800000 /* LMAC1 */
  65. #define IWL_22000_DCCM_LEN 0x10000 /* LMAC1 */
  66. #define IWL_22000_DCCM2_OFFSET 0x880000
  67. #define IWL_22000_DCCM2_LEN 0x8000
  68. #define IWL_22000_SMEM_OFFSET 0x400000
  69. #define IWL_22000_SMEM_LEN 0xD0000
  70. #define IWL_22000_JF_FW_PRE "iwlwifi-Qu-a0-jf-b0-"
  71. #define IWL_22000_HR_FW_PRE "iwlwifi-Qu-a0-hr-a0-"
  72. #define IWL_22000_HR_CDB_FW_PRE "iwlwifi-QuIcp-z0-hrcdb-a0-"
  73. #define IWL_22000_HR_F0_FW_PRE "iwlwifi-QuQnj-f0-hr-a0-"
  74. #define IWL_22000_JF_B0_FW_PRE "iwlwifi-QuQnj-a0-jf-b0-"
  75. #define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-"
  76. #define IWL_22000_HR_MODULE_FIRMWARE(api) \
  77. IWL_22000_HR_FW_PRE __stringify(api) ".ucode"
  78. #define IWL_22000_JF_MODULE_FIRMWARE(api) \
  79. IWL_22000_JF_FW_PRE __stringify(api) ".ucode"
  80. #define IWL_22000_HR_F0_QNJ_MODULE_FIRMWARE(api) \
  81. IWL_22000_HR_F0_FW_PRE __stringify(api) ".ucode"
  82. #define IWL_22000_JF_B0_QNJ_MODULE_FIRMWARE(api) \
  83. IWL_22000_JF_B0_FW_PRE __stringify(api) ".ucode"
  84. #define IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(api) \
  85. IWL_22000_HR_A0_FW_PRE __stringify(api) ".ucode"
  86. #define NVM_HW_SECTION_NUM_FAMILY_22000 10
  87. static const struct iwl_base_params iwl_22000_base_params = {
  88. .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_22000,
  89. .num_of_queues = 512,
  90. .shadow_ram_support = true,
  91. .led_compensation = 57,
  92. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  93. .max_event_log_size = 512,
  94. .shadow_reg_enable = true,
  95. .pcie_l1_allowed = true,
  96. };
  97. static const struct iwl_ht_params iwl_22000_ht_params = {
  98. .stbc = true,
  99. .ldpc = true,
  100. .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
  101. };
  102. #define IWL_DEVICE_22000 \
  103. .ucode_api_max = IWL_22000_UCODE_API_MAX, \
  104. .ucode_api_min = IWL_22000_UCODE_API_MIN, \
  105. .device_family = IWL_DEVICE_FAMILY_22000, \
  106. .base_params = &iwl_22000_base_params, \
  107. .led_mode = IWL_LED_RF_STATE, \
  108. .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_22000, \
  109. .non_shared_ant = ANT_A, \
  110. .dccm_offset = IWL_22000_DCCM_OFFSET, \
  111. .dccm_len = IWL_22000_DCCM_LEN, \
  112. .dccm2_offset = IWL_22000_DCCM2_OFFSET, \
  113. .dccm2_len = IWL_22000_DCCM2_LEN, \
  114. .smem_offset = IWL_22000_SMEM_OFFSET, \
  115. .smem_len = IWL_22000_SMEM_LEN, \
  116. .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, \
  117. .apmg_not_supported = true, \
  118. .mq_rx_supported = true, \
  119. .vht_mu_mimo_supported = true, \
  120. .mac_addr_from_csr = true, \
  121. .use_tfh = true, \
  122. .rf_id = true, \
  123. .gen2 = true, \
  124. .nvm_type = IWL_NVM_EXT, \
  125. .dbgc_supported = true, \
  126. .min_umac_error_event_table = 0x400000
  127. const struct iwl_cfg iwl22000_2ac_cfg_hr = {
  128. .name = "Intel(R) Dual Band Wireless AC 22000",
  129. .fw_name_pre = IWL_22000_HR_FW_PRE,
  130. IWL_DEVICE_22000,
  131. .csr = &iwl_csr_v1,
  132. .ht_params = &iwl_22000_ht_params,
  133. .nvm_ver = IWL_22000_NVM_VERSION,
  134. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
  135. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  136. };
  137. const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb = {
  138. .name = "Intel(R) Dual Band Wireless AC 22000",
  139. .fw_name_pre = IWL_22000_HR_CDB_FW_PRE,
  140. IWL_DEVICE_22000,
  141. .csr = &iwl_csr_v1,
  142. .ht_params = &iwl_22000_ht_params,
  143. .nvm_ver = IWL_22000_NVM_VERSION,
  144. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
  145. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  146. .cdb = true,
  147. };
  148. const struct iwl_cfg iwl22000_2ac_cfg_jf = {
  149. .name = "Intel(R) Dual Band Wireless AC 22000",
  150. .fw_name_pre = IWL_22000_JF_FW_PRE,
  151. IWL_DEVICE_22000,
  152. .csr = &iwl_csr_v1,
  153. .ht_params = &iwl_22000_ht_params,
  154. .nvm_ver = IWL_22000_NVM_VERSION,
  155. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
  156. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  157. };
  158. const struct iwl_cfg iwl22000_2ax_cfg_hr = {
  159. .name = "Intel(R) Dual Band Wireless AX 22000",
  160. .fw_name_pre = IWL_22000_HR_FW_PRE,
  161. IWL_DEVICE_22000,
  162. .csr = &iwl_csr_v1,
  163. .ht_params = &iwl_22000_ht_params,
  164. .nvm_ver = IWL_22000_NVM_VERSION,
  165. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
  166. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  167. };
  168. const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_f0 = {
  169. .name = "Intel(R) Dual Band Wireless AX 22000",
  170. .fw_name_pre = IWL_22000_HR_F0_FW_PRE,
  171. IWL_DEVICE_22000,
  172. .csr = &iwl_csr_v1,
  173. .ht_params = &iwl_22000_ht_params,
  174. .nvm_ver = IWL_22000_NVM_VERSION,
  175. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
  176. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  177. };
  178. const struct iwl_cfg iwl22000_2ax_cfg_qnj_jf_b0 = {
  179. .name = "Intel(R) Dual Band Wireless AX 22000",
  180. .fw_name_pre = IWL_22000_JF_B0_FW_PRE,
  181. IWL_DEVICE_22000,
  182. .csr = &iwl_csr_v1,
  183. .ht_params = &iwl_22000_ht_params,
  184. .nvm_ver = IWL_22000_NVM_VERSION,
  185. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
  186. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  187. };
  188. const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0 = {
  189. .name = "Intel(R) Dual Band Wireless AX 22000",
  190. .fw_name_pre = IWL_22000_HR_A0_FW_PRE,
  191. IWL_DEVICE_22000,
  192. .csr = &iwl_csr_v1,
  193. .ht_params = &iwl_22000_ht_params,
  194. .nvm_ver = IWL_22000_NVM_VERSION,
  195. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION,
  196. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  197. };
  198. MODULE_FIRMWARE(IWL_22000_HR_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  199. MODULE_FIRMWARE(IWL_22000_JF_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  200. MODULE_FIRMWARE(IWL_22000_HR_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  201. MODULE_FIRMWARE(IWL_22000_JF_B0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  202. MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));