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