1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 /* 3 * Copyright (C) 2015-2017 Intel Deutschland GmbH 4 * Copyright (C) 2018-2023 Intel Corporation 5 */ 6 #include <linux/module.h> 7 #include <linux/stringify.h> 8 #include "iwl-config.h" 9 #include "iwl-prph.h" 10 #include "fw/api/txq.h" 11 12 /* Highest firmware API version supported */ 13 #define IWL_22000_UCODE_API_MAX 77 14 15 /* Lowest firmware API version supported */ 16 #define IWL_22000_UCODE_API_MIN 50 17 18 /* NVM versions */ 19 #define IWL_22000_NVM_VERSION 0x0a1d 20 21 /* Memory offsets and lengths */ 22 #define IWL_22000_DCCM_OFFSET 0x800000 /* LMAC1 */ 23 #define IWL_22000_DCCM_LEN 0x10000 /* LMAC1 */ 24 #define IWL_22000_DCCM2_OFFSET 0x880000 25 #define IWL_22000_DCCM2_LEN 0x8000 26 #define IWL_22000_SMEM_OFFSET 0x400000 27 #define IWL_22000_SMEM_LEN 0xD0000 28 29 #define IWL_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0" 30 #define IWL_QU_C_HR_B_FW_PRE "iwlwifi-Qu-c0-hr-b0" 31 #define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0" 32 #define IWL_QU_C_JF_B_FW_PRE "iwlwifi-Qu-c0-jf-b0" 33 #define IWL_QUZ_A_HR_B_FW_PRE "iwlwifi-QuZ-a0-hr-b0" 34 #define IWL_QUZ_A_JF_B_FW_PRE "iwlwifi-QuZ-a0-jf-b0" 35 #define IWL_CC_A_FW_PRE "iwlwifi-cc-a0" 36 37 #define IWL_QU_B_HR_B_MODULE_FIRMWARE(api) \ 38 IWL_QU_B_HR_B_FW_PRE "-" __stringify(api) ".ucode" 39 #define IWL_QUZ_A_HR_B_MODULE_FIRMWARE(api) \ 40 IWL_QUZ_A_HR_B_FW_PRE "-" __stringify(api) ".ucode" 41 #define IWL_QUZ_A_JF_B_MODULE_FIRMWARE(api) \ 42 IWL_QUZ_A_JF_B_FW_PRE "-" __stringify(api) ".ucode" 43 #define IWL_QU_C_HR_B_MODULE_FIRMWARE(api) \ 44 IWL_QU_C_HR_B_FW_PRE "-" __stringify(api) ".ucode" 45 #define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \ 46 IWL_QU_B_JF_B_FW_PRE "-" __stringify(api) ".ucode" 47 #define IWL_QU_C_JF_B_MODULE_FIRMWARE(api) \ 48 IWL_QU_C_JF_B_FW_PRE "-" __stringify(api) ".ucode" 49 #define IWL_CC_A_MODULE_FIRMWARE(api) \ 50 IWL_CC_A_FW_PRE "-" __stringify(api) ".ucode" 51 52 static const struct iwl_base_params iwl_22000_base_params = { 53 .eeprom_size = OTP_LOW_IMAGE_SIZE_32K, 54 .num_of_queues = 512, 55 .max_tfd_queue_size = 256, 56 .shadow_ram_support = true, 57 .led_compensation = 57, 58 .wd_timeout = IWL_LONG_WD_TIMEOUT, 59 .max_event_log_size = 512, 60 .shadow_reg_enable = true, 61 .pcie_l1_allowed = true, 62 }; 63 64 const struct iwl_ht_params iwl_22000_ht_params = { 65 .stbc = true, 66 .ldpc = true, 67 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ) | 68 BIT(NL80211_BAND_6GHZ), 69 }; 70 71 #define IWL_DEVICE_22000_COMMON \ 72 .ucode_api_min = IWL_22000_UCODE_API_MIN, \ 73 .led_mode = IWL_LED_RF_STATE, \ 74 .nvm_hw_section_num = 10, \ 75 .non_shared_ant = ANT_B, \ 76 .dccm_offset = IWL_22000_DCCM_OFFSET, \ 77 .dccm_len = IWL_22000_DCCM_LEN, \ 78 .dccm2_offset = IWL_22000_DCCM2_OFFSET, \ 79 .dccm2_len = IWL_22000_DCCM2_LEN, \ 80 .smem_offset = IWL_22000_SMEM_OFFSET, \ 81 .smem_len = IWL_22000_SMEM_LEN, \ 82 .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, \ 83 .apmg_not_supported = true, \ 84 .trans.mq_rx_supported = true, \ 85 .vht_mu_mimo_supported = true, \ 86 .mac_addr_from_csr = 0x380, \ 87 .ht_params = &iwl_22000_ht_params, \ 88 .nvm_ver = IWL_22000_NVM_VERSION, \ 89 .trans.rf_id = true, \ 90 .trans.gen2 = true, \ 91 .nvm_type = IWL_NVM_EXT, \ 92 .dbgc_supported = true, \ 93 .min_umac_error_event_table = 0x400000, \ 94 .d3_debug_data_base_addr = 0x401000, \ 95 .d3_debug_data_length = 60 * 1024, \ 96 .mon_smem_regs = { \ 97 .write_ptr = { \ 98 .addr = LDBG_M2S_BUF_WPTR, \ 99 .mask = LDBG_M2S_BUF_WPTR_VAL_MSK, \ 100 }, \ 101 .cycle_cnt = { \ 102 .addr = LDBG_M2S_BUF_WRAP_CNT, \ 103 .mask = LDBG_M2S_BUF_WRAP_CNT_VAL_MSK, \ 104 }, \ 105 } 106 107 #define IWL_DEVICE_22500 \ 108 IWL_DEVICE_22000_COMMON, \ 109 .ucode_api_max = IWL_22000_UCODE_API_MAX, \ 110 .trans.device_family = IWL_DEVICE_FAMILY_22000, \ 111 .trans.base_params = &iwl_22000_base_params, \ 112 .gp2_reg_addr = 0xa02c68, \ 113 .mon_dram_regs = { \ 114 .write_ptr = { \ 115 .addr = MON_BUFF_WRPTR_VER2, \ 116 .mask = 0xffffffff, \ 117 }, \ 118 .cycle_cnt = { \ 119 .addr = MON_BUFF_CYCLE_CNT_VER2, \ 120 .mask = 0xffffffff, \ 121 }, \ 122 } 123 124 const struct iwl_cfg_trans_params iwl_qu_trans_cfg = { 125 .mq_rx_supported = true, 126 .rf_id = true, 127 .gen2 = true, 128 .device_family = IWL_DEVICE_FAMILY_22000, 129 .base_params = &iwl_22000_base_params, 130 .integrated = true, 131 .xtal_latency = 500, 132 .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_200US, 133 }; 134 135 const struct iwl_cfg_trans_params iwl_qu_medium_latency_trans_cfg = { 136 .mq_rx_supported = true, 137 .rf_id = true, 138 .gen2 = true, 139 .device_family = IWL_DEVICE_FAMILY_22000, 140 .base_params = &iwl_22000_base_params, 141 .integrated = true, 142 .xtal_latency = 1820, 143 .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_1820US, 144 }; 145 146 const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg = { 147 .mq_rx_supported = true, 148 .rf_id = true, 149 .gen2 = true, 150 .device_family = IWL_DEVICE_FAMILY_22000, 151 .base_params = &iwl_22000_base_params, 152 .integrated = true, 153 .xtal_latency = 12000, 154 .low_latency_xtal = true, 155 .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US, 156 }; 157 158 /* 159 * If the device doesn't support HE, no need to have that many buffers. 160 * 22000 devices can split multiple frames into a single RB, so fewer are 161 * needed; AX210 cannot (but use smaller RBs by default) - these sizes 162 * were picked according to 8 MSDUs inside 256 A-MSDUs in an A-MPDU, with 163 * additional overhead to account for processing time. 164 */ 165 #define IWL_NUM_RBDS_NON_HE 512 166 #define IWL_NUM_RBDS_22000_HE 2048 167 168 /* 169 * All JF radio modules are part of the 9000 series, but the MAC part 170 * looks more like 22000. That's why this device is here, but called 171 * 9560 nevertheless. 172 */ 173 const struct iwl_cfg iwl9560_qu_b0_jf_b0_cfg = { 174 .fw_name_pre = IWL_QU_B_JF_B_FW_PRE, 175 IWL_DEVICE_22500, 176 .num_rbds = IWL_NUM_RBDS_NON_HE, 177 }; 178 179 const struct iwl_cfg iwl9560_qu_c0_jf_b0_cfg = { 180 .fw_name_pre = IWL_QU_C_JF_B_FW_PRE, 181 IWL_DEVICE_22500, 182 .num_rbds = IWL_NUM_RBDS_NON_HE, 183 }; 184 185 const struct iwl_cfg iwl9560_quz_a0_jf_b0_cfg = { 186 .fw_name_pre = IWL_QUZ_A_JF_B_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 .num_rbds = IWL_NUM_RBDS_NON_HE, 195 }; 196 197 const struct iwl_cfg_trans_params iwl_ax200_trans_cfg = { 198 .device_family = IWL_DEVICE_FAMILY_22000, 199 .base_params = &iwl_22000_base_params, 200 .mq_rx_supported = true, 201 .rf_id = true, 202 .gen2 = true, 203 .bisr_workaround = 1, 204 }; 205 206 const char iwl_ax101_name[] = "Intel(R) Wi-Fi 6 AX101"; 207 const char iwl_ax200_name[] = "Intel(R) Wi-Fi 6 AX200 160MHz"; 208 const char iwl_ax201_name[] = "Intel(R) Wi-Fi 6 AX201 160MHz"; 209 const char iwl_ax203_name[] = "Intel(R) Wi-Fi 6 AX203"; 210 const char iwl_ax204_name[] = "Intel(R) Wi-Fi 6 AX204 160MHz"; 211 212 const char iwl_ax200_killer_1650w_name[] = 213 "Killer(R) Wi-Fi 6 AX1650w 160MHz Wireless Network Adapter (200D2W)"; 214 const char iwl_ax200_killer_1650x_name[] = 215 "Killer(R) Wi-Fi 6 AX1650x 160MHz Wireless Network Adapter (200NGW)"; 216 const char iwl_ax201_killer_1650s_name[] = 217 "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201D2W)"; 218 const char iwl_ax201_killer_1650i_name[] = 219 "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)"; 220 221 const struct iwl_cfg iwl_qu_b0_hr1_b0 = { 222 .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 223 IWL_DEVICE_22500, 224 /* 225 * This device doesn't support receiving BlockAck with a large bitmap 226 * so we need to restrict the size of transmitted aggregation to the 227 * HT size; mac80211 would otherwise pick the HE max (256) by default. 228 */ 229 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 230 .tx_with_siso_diversity = true, 231 .num_rbds = IWL_NUM_RBDS_22000_HE, 232 }; 233 234 const struct iwl_cfg iwl_qu_b0_hr_b0 = { 235 .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 236 IWL_DEVICE_22500, 237 /* 238 * This device doesn't support receiving BlockAck with a large bitmap 239 * so we need to restrict the size of transmitted aggregation to the 240 * HT size; mac80211 would otherwise pick the HE max (256) by default. 241 */ 242 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 243 .num_rbds = IWL_NUM_RBDS_22000_HE, 244 }; 245 246 const struct iwl_cfg iwl_ax201_cfg_qu_hr = { 247 .name = "Intel(R) Wi-Fi 6 AX201 160MHz", 248 .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 249 IWL_DEVICE_22500, 250 /* 251 * This device doesn't support receiving BlockAck with a large bitmap 252 * so we need to restrict the size of transmitted aggregation to the 253 * HT size; mac80211 would otherwise pick the HE max (256) by default. 254 */ 255 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 256 .num_rbds = IWL_NUM_RBDS_22000_HE, 257 }; 258 259 const struct iwl_cfg iwl_qu_c0_hr1_b0 = { 260 .fw_name_pre = IWL_QU_C_HR_B_FW_PRE, 261 IWL_DEVICE_22500, 262 /* 263 * This device doesn't support receiving BlockAck with a large bitmap 264 * so we need to restrict the size of transmitted aggregation to the 265 * HT size; mac80211 would otherwise pick the HE max (256) by default. 266 */ 267 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 268 .tx_with_siso_diversity = true, 269 .num_rbds = IWL_NUM_RBDS_22000_HE, 270 }; 271 272 const struct iwl_cfg iwl_qu_c0_hr_b0 = { 273 .fw_name_pre = IWL_QU_C_HR_B_FW_PRE, 274 IWL_DEVICE_22500, 275 /* 276 * This device doesn't support receiving BlockAck with a large bitmap 277 * so we need to restrict the size of transmitted aggregation to the 278 * HT size; mac80211 would otherwise pick the HE max (256) by default. 279 */ 280 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 281 .num_rbds = IWL_NUM_RBDS_22000_HE, 282 }; 283 284 const struct iwl_cfg iwl_ax201_cfg_qu_c0_hr_b0 = { 285 .name = "Intel(R) Wi-Fi 6 AX201 160MHz", 286 .fw_name_pre = IWL_QU_C_HR_B_FW_PRE, 287 IWL_DEVICE_22500, 288 /* 289 * This device doesn't support receiving BlockAck with a large bitmap 290 * so we need to restrict the size of transmitted aggregation to the 291 * HT size; mac80211 would otherwise pick the HE max (256) by default. 292 */ 293 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 294 .num_rbds = IWL_NUM_RBDS_22000_HE, 295 }; 296 297 const struct iwl_cfg iwl_quz_a0_hr1_b0 = { 298 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE, 299 IWL_DEVICE_22500, 300 /* 301 * This device doesn't support receiving BlockAck with a large bitmap 302 * so we need to restrict the size of transmitted aggregation to the 303 * HT size; mac80211 would otherwise pick the HE max (256) by default. 304 */ 305 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 306 .tx_with_siso_diversity = true, 307 .num_rbds = IWL_NUM_RBDS_22000_HE, 308 }; 309 310 const struct iwl_cfg iwl_ax201_cfg_quz_hr = { 311 .name = "Intel(R) Wi-Fi 6 AX201 160MHz", 312 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE, 313 IWL_DEVICE_22500, 314 /* 315 * This device doesn't support receiving BlockAck with a large bitmap 316 * so we need to restrict the size of transmitted aggregation to the 317 * HT size; mac80211 would otherwise pick the HE max (256) by default. 318 */ 319 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 320 .num_rbds = IWL_NUM_RBDS_22000_HE, 321 }; 322 323 const struct iwl_cfg iwl_ax1650s_cfg_quz_hr = { 324 .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201D2W)", 325 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE, 326 IWL_DEVICE_22500, 327 /* 328 * This device doesn't support receiving BlockAck with a large bitmap 329 * so we need to restrict the size of transmitted aggregation to the 330 * HT size; mac80211 would otherwise pick the HE max (256) by default. 331 */ 332 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 333 .num_rbds = IWL_NUM_RBDS_22000_HE, 334 }; 335 336 const struct iwl_cfg iwl_ax1650i_cfg_quz_hr = { 337 .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)", 338 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE, 339 IWL_DEVICE_22500, 340 /* 341 * This device doesn't support receiving BlockAck with a large bitmap 342 * so we need to restrict the size of transmitted aggregation to the 343 * HT size; mac80211 would otherwise pick the HE max (256) by default. 344 */ 345 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 346 .num_rbds = IWL_NUM_RBDS_22000_HE, 347 }; 348 349 const struct iwl_cfg iwl_ax200_cfg_cc = { 350 .fw_name_pre = IWL_CC_A_FW_PRE, 351 IWL_DEVICE_22500, 352 /* 353 * This device doesn't support receiving BlockAck with a large bitmap 354 * so we need to restrict the size of transmitted aggregation to the 355 * HT size; mac80211 would otherwise pick the HE max (256) by default. 356 */ 357 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 358 .num_rbds = IWL_NUM_RBDS_22000_HE, 359 }; 360 361 const struct iwl_cfg killer1650s_2ax_cfg_qu_b0_hr_b0 = { 362 .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201NGW)", 363 .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 364 IWL_DEVICE_22500, 365 /* 366 * This device doesn't support receiving BlockAck with a large bitmap 367 * so we need to restrict the size of transmitted aggregation to the 368 * HT size; mac80211 would otherwise pick the HE max (256) by default. 369 */ 370 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 371 .num_rbds = IWL_NUM_RBDS_22000_HE, 372 }; 373 374 const struct iwl_cfg killer1650i_2ax_cfg_qu_b0_hr_b0 = { 375 .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201D2W)", 376 .fw_name_pre = IWL_QU_B_HR_B_FW_PRE, 377 IWL_DEVICE_22500, 378 /* 379 * This device doesn't support receiving BlockAck with a large bitmap 380 * so we need to restrict the size of transmitted aggregation to the 381 * HT size; mac80211 would otherwise pick the HE max (256) by default. 382 */ 383 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 384 .num_rbds = IWL_NUM_RBDS_22000_HE, 385 }; 386 387 const struct iwl_cfg killer1650s_2ax_cfg_qu_c0_hr_b0 = { 388 .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201NGW)", 389 .fw_name_pre = IWL_QU_C_HR_B_FW_PRE, 390 IWL_DEVICE_22500, 391 /* 392 * This device doesn't support receiving BlockAck with a large bitmap 393 * so we need to restrict the size of transmitted aggregation to the 394 * HT size; mac80211 would otherwise pick the HE max (256) by default. 395 */ 396 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 397 .num_rbds = IWL_NUM_RBDS_22000_HE, 398 }; 399 400 const struct iwl_cfg killer1650i_2ax_cfg_qu_c0_hr_b0 = { 401 .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201D2W)", 402 .fw_name_pre = IWL_QU_C_HR_B_FW_PRE, 403 IWL_DEVICE_22500, 404 /* 405 * This device doesn't support receiving BlockAck with a large bitmap 406 * so we need to restrict the size of transmitted aggregation to the 407 * HT size; mac80211 would otherwise pick the HE max (256) by default. 408 */ 409 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 410 .num_rbds = IWL_NUM_RBDS_22000_HE, 411 }; 412 413 const struct iwl_cfg iwl_cfg_quz_a0_hr_b0 = { 414 .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE, 415 IWL_DEVICE_22500, 416 /* 417 * This device doesn't support receiving BlockAck with a large bitmap 418 * so we need to restrict the size of transmitted aggregation to the 419 * HT size; mac80211 would otherwise pick the HE max (256) by default. 420 */ 421 .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 422 .num_rbds = IWL_NUM_RBDS_22000_HE, 423 }; 424 425 MODULE_FIRMWARE(IWL_QU_B_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 426 MODULE_FIRMWARE(IWL_QU_C_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 427 MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 428 MODULE_FIRMWARE(IWL_QU_C_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 429 MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 430 MODULE_FIRMWARE(IWL_QUZ_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 431 MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 432