22000.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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_F0_FW_PRE "iwlwifi-Qu-b0-hr-b0-"
  75. #define IWL_22000_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0-"
  76. #define IWL_22000_HR_B_FW_PRE "iwlwifi-QuQnj-b0-hr-b0-"
  77. #define IWL_22000_JF_B0_FW_PRE "iwlwifi-QuQnj-a0-jf-b0-"
  78. #define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-"
  79. #define IWL_22000_SU_Z0_FW_PRE "iwlwifi-su-z0-"
  80. #define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-"
  81. #define IWL_22000_HR_MODULE_FIRMWARE(api) \
  82. IWL_22000_HR_FW_PRE __stringify(api) ".ucode"
  83. #define IWL_22000_JF_MODULE_FIRMWARE(api) \
  84. IWL_22000_JF_FW_PRE __stringify(api) ".ucode"
  85. #define IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(api) \
  86. IWL_22000_HR_A_F0_FW_PRE __stringify(api) ".ucode"
  87. #define IWL_22000_HR_B_F0_QNJ_MODULE_FIRMWARE(api) \
  88. IWL_22000_HR_B_F0_FW_PRE __stringify(api) ".ucode"
  89. #define IWL_22000_QU_B_HR_B_MODULE_FIRMWARE(api) \
  90. IWL_22000_QU_B_HR_B_FW_PRE __stringify(api) ".ucode"
  91. #define IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(api) \
  92. IWL_22000_HR_B_FW_PRE __stringify(api) ".ucode"
  93. #define IWL_22000_JF_B0_QNJ_MODULE_FIRMWARE(api) \
  94. IWL_22000_JF_B0_FW_PRE __stringify(api) ".ucode"
  95. #define IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(api) \
  96. IWL_22000_HR_A0_FW_PRE __stringify(api) ".ucode"
  97. #define IWL_22000_SU_Z0_MODULE_FIRMWARE(api) \
  98. IWL_22000_SU_Z0_FW_PRE __stringify(api) ".ucode"
  99. #define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \
  100. IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode"
  101. #define NVM_HW_SECTION_NUM_FAMILY_22000 10
  102. static const struct iwl_base_params iwl_22000_base_params = {
  103. .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_22000,
  104. .num_of_queues = 512,
  105. .max_tfd_queue_size = 256,
  106. .shadow_ram_support = true,
  107. .led_compensation = 57,
  108. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  109. .max_event_log_size = 512,
  110. .shadow_reg_enable = true,
  111. .pcie_l1_allowed = true,
  112. };
  113. static const struct iwl_base_params iwl_22560_base_params = {
  114. .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_22000,
  115. .num_of_queues = 512,
  116. .max_tfd_queue_size = 65536,
  117. .shadow_ram_support = true,
  118. .led_compensation = 57,
  119. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  120. .max_event_log_size = 512,
  121. .shadow_reg_enable = true,
  122. .pcie_l1_allowed = true,
  123. };
  124. static const struct iwl_ht_params iwl_22000_ht_params = {
  125. .stbc = true,
  126. .ldpc = true,
  127. .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
  128. };
  129. #define IWL_DEVICE_22000_COMMON \
  130. .ucode_api_max = IWL_22000_UCODE_API_MAX, \
  131. .ucode_api_min = IWL_22000_UCODE_API_MIN, \
  132. .led_mode = IWL_LED_RF_STATE, \
  133. .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_22000, \
  134. .non_shared_ant = ANT_B, \
  135. .dccm_offset = IWL_22000_DCCM_OFFSET, \
  136. .dccm_len = IWL_22000_DCCM_LEN, \
  137. .dccm2_offset = IWL_22000_DCCM2_OFFSET, \
  138. .dccm2_len = IWL_22000_DCCM2_LEN, \
  139. .smem_offset = IWL_22000_SMEM_OFFSET, \
  140. .smem_len = IWL_22000_SMEM_LEN, \
  141. .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, \
  142. .apmg_not_supported = true, \
  143. .mq_rx_supported = true, \
  144. .vht_mu_mimo_supported = true, \
  145. .mac_addr_from_csr = true, \
  146. .ht_params = &iwl_22000_ht_params, \
  147. .nvm_ver = IWL_22000_NVM_VERSION, \
  148. .nvm_calib_ver = IWL_22000_TX_POWER_VERSION, \
  149. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  150. .use_tfh = true, \
  151. .rf_id = true, \
  152. .gen2 = true, \
  153. .nvm_type = IWL_NVM_EXT, \
  154. .dbgc_supported = true, \
  155. .min_umac_error_event_table = 0x400000
  156. #define IWL_DEVICE_22500 \
  157. IWL_DEVICE_22000_COMMON, \
  158. .device_family = IWL_DEVICE_FAMILY_22000, \
  159. .base_params = &iwl_22000_base_params, \
  160. .csr = &iwl_csr_v1
  161. #define IWL_DEVICE_22560 \
  162. IWL_DEVICE_22000_COMMON, \
  163. .device_family = IWL_DEVICE_FAMILY_22560, \
  164. .base_params = &iwl_22560_base_params, \
  165. .csr = &iwl_csr_v2
  166. const struct iwl_cfg iwl22000_2ac_cfg_hr = {
  167. .name = "Intel(R) Dual Band Wireless AC 22000",
  168. .fw_name_pre = IWL_22000_HR_FW_PRE,
  169. IWL_DEVICE_22500,
  170. };
  171. const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb = {
  172. .name = "Intel(R) Dual Band Wireless AC 22000",
  173. .fw_name_pre = IWL_22000_HR_CDB_FW_PRE,
  174. IWL_DEVICE_22500,
  175. .cdb = true,
  176. };
  177. const struct iwl_cfg iwl22000_2ac_cfg_jf = {
  178. .name = "Intel(R) Dual Band Wireless AC 22000",
  179. .fw_name_pre = IWL_22000_JF_FW_PRE,
  180. IWL_DEVICE_22500,
  181. };
  182. const struct iwl_cfg iwl22000_2ax_cfg_hr = {
  183. .name = "Intel(R) Dual Band Wireless AX 22000",
  184. .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE,
  185. IWL_DEVICE_22500,
  186. /*
  187. * This device doesn't support receiving BlockAck with a large bitmap
  188. * so we need to restrict the size of transmitted aggregation to the
  189. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  190. */
  191. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  192. };
  193. /*
  194. * All JF radio modules are part of the 9000 series, but the MAC part
  195. * looks more like 22000. That's why this device is here, but called
  196. * 9560 nevertheless.
  197. */
  198. const struct iwl_cfg iwl9461_2ac_cfg_qu_b0_jf_b0 = {
  199. .name = "Intel(R) Wireless-AC 9461",
  200. .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
  201. IWL_DEVICE_22500,
  202. };
  203. const struct iwl_cfg iwl9462_2ac_cfg_qu_b0_jf_b0 = {
  204. .name = "Intel(R) Wireless-AC 9462",
  205. .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
  206. IWL_DEVICE_22500,
  207. };
  208. const struct iwl_cfg iwl9560_2ac_cfg_qu_b0_jf_b0 = {
  209. .name = "Intel(R) Wireless-AC 9560",
  210. .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
  211. IWL_DEVICE_22500,
  212. };
  213. const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0 = {
  214. .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)",
  215. .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
  216. IWL_DEVICE_22500,
  217. };
  218. const struct iwl_cfg killer1550s_2ac_cfg_qu_b0_jf_b0 = {
  219. .name = "Killer (R) Wireless-AC 1550s Wireless Network Adapter (9560NGW)",
  220. .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
  221. IWL_DEVICE_22500,
  222. };
  223. const struct iwl_cfg iwl22000_2ax_cfg_jf = {
  224. .name = "Intel(R) Dual Band Wireless AX 22000",
  225. .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
  226. IWL_DEVICE_22500,
  227. /*
  228. * This device doesn't support receiving BlockAck with a large bitmap
  229. * so we need to restrict the size of transmitted aggregation to the
  230. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  231. */
  232. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  233. };
  234. const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0_f0 = {
  235. .name = "Intel(R) Dual Band Wireless AX 22000",
  236. .fw_name_pre = IWL_22000_HR_A_F0_FW_PRE,
  237. IWL_DEVICE_22500,
  238. /*
  239. * This device doesn't support receiving BlockAck with a large bitmap
  240. * so we need to restrict the size of transmitted aggregation to the
  241. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  242. */
  243. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  244. };
  245. const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0 = {
  246. .name = "Intel(R) Dual Band Wireless AX 22000",
  247. .fw_name_pre = IWL_22000_HR_B_FW_PRE,
  248. IWL_DEVICE_22500,
  249. /*
  250. * This device doesn't support receiving BlockAck with a large bitmap
  251. * so we need to restrict the size of transmitted aggregation to the
  252. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  253. */
  254. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  255. };
  256. const struct iwl_cfg iwl22000_2ax_cfg_qnj_jf_b0 = {
  257. .name = "Intel(R) Dual Band Wireless AX 22000",
  258. .fw_name_pre = IWL_22000_JF_B0_FW_PRE,
  259. IWL_DEVICE_22500,
  260. /*
  261. * This device doesn't support receiving BlockAck with a large bitmap
  262. * so we need to restrict the size of transmitted aggregation to the
  263. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  264. */
  265. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  266. };
  267. const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0 = {
  268. .name = "Intel(R) Dual Band Wireless AX 22000",
  269. .fw_name_pre = IWL_22000_HR_A0_FW_PRE,
  270. IWL_DEVICE_22500,
  271. /*
  272. * This device doesn't support receiving BlockAck with a large bitmap
  273. * so we need to restrict the size of transmitted aggregation to the
  274. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  275. */
  276. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  277. };
  278. const struct iwl_cfg iwl22560_2ax_cfg_su_cdb = {
  279. .name = "Intel(R) Dual Band Wireless AX 22560",
  280. .fw_name_pre = IWL_22000_SU_Z0_FW_PRE,
  281. IWL_DEVICE_22560,
  282. .cdb = true,
  283. /*
  284. * This device doesn't support receiving BlockAck with a large bitmap
  285. * so we need to restrict the size of transmitted aggregation to the
  286. * HT size; mac80211 would otherwise pick the HE max (256) by default.
  287. */
  288. .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
  289. };
  290. MODULE_FIRMWARE(IWL_22000_HR_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  291. MODULE_FIRMWARE(IWL_22000_JF_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  292. MODULE_FIRMWARE(IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  293. MODULE_FIRMWARE(IWL_22000_HR_B_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  294. MODULE_FIRMWARE(IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  295. MODULE_FIRMWARE(IWL_22000_JF_B0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  296. MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  297. MODULE_FIRMWARE(IWL_22000_SU_Z0_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
  298. MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));