22000.c 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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 39
  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_A_F0_FW_PRE "iwlwifi-QuQnj-f0-hr-a0-"
  74. #define IWL_22000_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0-"
  75. #define IWL_22000_JF_B0_FW_PRE "iwlwifi-QuQnj-a0-jf-b0-"
  76. #define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-"
  77. #define IWL_22000_SU_Z0_FW_PRE "iwlwifi-su-z0-"
  78. #define IWL_22000_HR_MODULE_FIRMWARE(api) \
  79. IWL_22000_HR_FW_PRE __stringify(api) ".ucode"
  80. #define IWL_22000_JF_MODULE_FIRMWARE(api) \
  81. IWL_22000_JF_FW_PRE __stringify(api) ".ucode"
  82. #define IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(api) \
  83. IWL_22000_HR_A_F0_FW_PRE __stringify(api) ".ucode"
  84. #define IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(api) \
  85. IWL_22000_HR_B_FW_PRE __stringify(api) ".ucode"
  86. #define IWL_22000_JF_B0_QNJ_MODULE_FIRMWARE(api) \
  87. IWL_22000_JF_B0_FW_PRE __stringify(api) ".ucode"
  88. #define IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(api) \
  89. IWL_22000_HR_A0_FW_PRE __stringify(api) ".ucode"
  90. #define IWL_22000_SU_Z0_MODULE_FIRMWARE(api) \
  91. IWL_22000_SU_Z0_FW_PRE __stringify(api) ".ucode"
  92. #define NVM_HW_SECTION_NUM_FAMILY_22000 10
  93. static const struct iwl_base_params iwl_22000_base_params = {
  94. .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_22000,
  95. .num_of_queues = 512,
  96. .max_tfd_queue_size = 256,
  97. .shadow_ram_support = true,
  98. .led_compensation = 57,
  99. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  100. .max_event_log_size = 512,
  101. .shadow_reg_enable = true,
  102. .pcie_l1_allowed = true,
  103. };
  104. static const struct iwl_base_params iwl_22560_base_params = {
  105. .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_22000,
  106. .num_of_queues = 512,
  107. .max_tfd_queue_size = 65536,
  108. .shadow_ram_support = true,
  109. .led_compensation = 57,
  110. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  111. .max_event_log_size = 512,
  112. .shadow_reg_enable = true,
  113. .pcie_l1_allowed = true,
  114. };
  115. static const struct iwl_ht_params iwl_22000_ht_params = {
  116. .stbc = true,
  117. .ldpc = true,
  118. .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
  119. };
  120. #define IWL_DEVICE_22000_COMMON \
  121. .ucode_api_max = IWL_22000_UCODE_API_MAX, \
  122. .ucode_api_min = IWL_22000_UCODE_API_MIN, \
  123. .led_mode = IWL_LED_RF_STATE, \
  124. .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_22000, \
  125. .non_shared_ant = ANT_A, \
  126. .dccm_offset = IWL_22000_DCCM_OFFSET, \
  127. .dccm_len = IWL_22000_DCCM_LEN, \
  128. .dccm2_offset = IWL_22000_DCCM2_OFFSET, \
  129. .dccm2_len = IWL_22000_DCCM2_LEN, \
  130. .smem_offset = IWL_22000_SMEM_OFFSET, \
  131. .smem_len = IWL_22000_SMEM_LEN, \
  132. .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, \
  133. .apmg_not_supported = true, \
  134. .mq_rx_supported = true, \
  135. .vht_mu_mimo_supported = true, \
  136. .mac_addr_from_csr = true, \
  137. .ht_params = &iwl_22000_ht_params, \
  138. .nvm_ver = IWL_22000_NVM_VERSION, \
  139. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION, \
  140. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  141. .use_tfh = true, \
  142. .rf_id = true, \
  143. .gen2 = true, \
  144. .nvm_type = IWL_NVM_EXT, \
  145. .dbgc_supported = true, \
  146. .min_umac_error_event_table = 0x400000
  147. #define IWL_DEVICE_22500 \
  148. IWL_DEVICE_22000_COMMON, \
  149. .device_family = IWL_DEVICE_FAMILY_22000, \
  150. .base_params = &iwl_22000_base_params, \
  151. .csr = &iwl_csr_v1
  152. #define IWL_DEVICE_22560 \
  153. IWL_DEVICE_22000_COMMON, \
  154. .device_family = IWL_DEVICE_FAMILY_22560, \
  155. .base_params = &iwl_22560_base_params, \
  156. .csr = &iwl_csr_v2
  157. const struct iwl_cfg iwl22000_2ac_cfg_hr = {
  158. .name = "Intel(R) Dual Band Wireless AC 22000",
  159. .fw_name_pre = IWL_22000_HR_FW_PRE,
  160. IWL_DEVICE_22500,
  161. };
  162. const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb = {
  163. .name = "Intel(R) Dual Band Wireless AC 22000",
  164. .fw_name_pre = IWL_22000_HR_CDB_FW_PRE,
  165. IWL_DEVICE_22500,
  166. .cdb = true,
  167. };
  168. const struct iwl_cfg iwl22000_2ac_cfg_jf = {
  169. .name = "Intel(R) Dual Band Wireless AC 22000",
  170. .fw_name_pre = IWL_22000_JF_FW_PRE,
  171. IWL_DEVICE_22500,
  172. };
  173. const struct iwl_cfg iwl22000_2ax_cfg_hr = {
  174. .name = "Intel(R) Dual Band Wireless AX 22000",
  175. .fw_name_pre = IWL_22000_HR_FW_PRE,
  176. IWL_DEVICE_22500,
  177. /*
  178. * This device doesn't support receiving BlockAck with a large bitmap
  179. * so we need to restrict the size of transmitted aggregation to the
  180. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  181. */
  182. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  183. };
  184. const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0_f0 = {
  185. .name = "Intel(R) Dual Band Wireless AX 22000",
  186. .fw_name_pre = IWL_22000_HR_A_F0_FW_PRE,
  187. IWL_DEVICE_22500,
  188. /*
  189. * This device doesn't support receiving BlockAck with a large bitmap
  190. * so we need to restrict the size of transmitted aggregation to the
  191. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  192. */
  193. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  194. };
  195. const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0 = {
  196. .name = "Intel(R) Dual Band Wireless AX 22000",
  197. .fw_name_pre = IWL_22000_HR_B_FW_PRE,
  198. IWL_DEVICE_22500,
  199. /*
  200. * This device doesn't support receiving BlockAck with a large bitmap
  201. * so we need to restrict the size of transmitted aggregation to the
  202. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  203. */
  204. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  205. };
  206. const struct iwl_cfg iwl22000_2ax_cfg_qnj_jf_b0 = {
  207. .name = "Intel(R) Dual Band Wireless AX 22000",
  208. .fw_name_pre = IWL_22000_JF_B0_FW_PRE,
  209. IWL_DEVICE_22500,
  210. /*
  211. * This device doesn't support receiving BlockAck with a large bitmap
  212. * so we need to restrict the size of transmitted aggregation to the
  213. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  214. */
  215. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  216. };
  217. const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0 = {
  218. .name = "Intel(R) Dual Band Wireless AX 22000",
  219. .fw_name_pre = IWL_22000_HR_A0_FW_PRE,
  220. IWL_DEVICE_22500,
  221. /*
  222. * This device doesn't support receiving BlockAck with a large bitmap
  223. * so we need to restrict the size of transmitted aggregation to the
  224. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  225. */
  226. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  227. };
  228. const struct iwl_cfg iwl22560_2ax_cfg_su_cdb = {
  229. .name = "Intel(R) Dual Band Wireless AX 22560",
  230. .fw_name_pre = IWL_22000_SU_Z0_FW_PRE,
  231. IWL_DEVICE_22560,
  232. .cdb = true,
  233. /*
  234. * This device doesn't support receiving BlockAck with a large bitmap
  235. * so we need to restrict the size of transmitted aggregation to the
  236. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  237. */
  238. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  239. };
  240. MODULE_FIRMWARE(IWL_22000_HR_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  241. MODULE_FIRMWARE(IWL_22000_JF_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  242. MODULE_FIRMWARE(IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  243. MODULE_FIRMWARE(IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  244. MODULE_FIRMWARE(IWL_22000_JF_B0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  245. MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  246. MODULE_FIRMWARE(IWL_22000_SU_Z0_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));