162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2014, 2018-2020, 2023 Intel Corporation
462306a36Sopenharmony_ci * Copyright (C) 2014-2015 Intel Mobile Communications GmbH
562306a36Sopenharmony_ci * Copyright (C) 2016 Intel Deutschland GmbH
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci#include <linux/module.h>
862306a36Sopenharmony_ci#include <linux/stringify.h>
962306a36Sopenharmony_ci#include "iwl-config.h"
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci/* Highest firmware API version supported */
1262306a36Sopenharmony_ci#define IWL8000_UCODE_API_MAX	36
1362306a36Sopenharmony_ci#define IWL8265_UCODE_API_MAX	36
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/* Lowest firmware API version supported */
1662306a36Sopenharmony_ci#define IWL8000_UCODE_API_MIN	22
1762306a36Sopenharmony_ci#define IWL8265_UCODE_API_MIN	22
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* NVM versions */
2062306a36Sopenharmony_ci#define IWL8000_NVM_VERSION		0x0a1d
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci/* Memory offsets and lengths */
2362306a36Sopenharmony_ci#define IWL8260_DCCM_OFFSET		0x800000
2462306a36Sopenharmony_ci#define IWL8260_DCCM_LEN		0x18000
2562306a36Sopenharmony_ci#define IWL8260_DCCM2_OFFSET		0x880000
2662306a36Sopenharmony_ci#define IWL8260_DCCM2_LEN		0x8000
2762306a36Sopenharmony_ci#define IWL8260_SMEM_OFFSET		0x400000
2862306a36Sopenharmony_ci#define IWL8260_SMEM_LEN		0x68000
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci#define IWL8000_FW_PRE "iwlwifi-8000C"
3162306a36Sopenharmony_ci#define IWL8000_MODULE_FIRMWARE(api) \
3262306a36Sopenharmony_ci	IWL8000_FW_PRE "-" __stringify(api) ".ucode"
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define IWL8265_FW_PRE "iwlwifi-8265"
3562306a36Sopenharmony_ci#define IWL8265_MODULE_FIRMWARE(api) \
3662306a36Sopenharmony_ci	IWL8265_FW_PRE "-" __stringify(api) ".ucode"
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci#define DEFAULT_NVM_FILE_FAMILY_8000C		"nvmData-8000C"
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_cistatic const struct iwl_base_params iwl8000_base_params = {
4162306a36Sopenharmony_ci	.eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
4262306a36Sopenharmony_ci	.num_of_queues = 31,
4362306a36Sopenharmony_ci	.max_tfd_queue_size = 256,
4462306a36Sopenharmony_ci	.shadow_ram_support = true,
4562306a36Sopenharmony_ci	.led_compensation = 57,
4662306a36Sopenharmony_ci	.wd_timeout = IWL_LONG_WD_TIMEOUT,
4762306a36Sopenharmony_ci	.max_event_log_size = 512,
4862306a36Sopenharmony_ci	.shadow_reg_enable = true,
4962306a36Sopenharmony_ci	.pcie_l1_allowed = true,
5062306a36Sopenharmony_ci};
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_cistatic const struct iwl_ht_params iwl8000_ht_params = {
5362306a36Sopenharmony_ci	.stbc = true,
5462306a36Sopenharmony_ci	.ldpc = true,
5562306a36Sopenharmony_ci	.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
5662306a36Sopenharmony_ci};
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_cistatic const struct iwl_tt_params iwl8000_tt_params = {
5962306a36Sopenharmony_ci	.ct_kill_entry = 115,
6062306a36Sopenharmony_ci	.ct_kill_exit = 93,
6162306a36Sopenharmony_ci	.ct_kill_duration = 5,
6262306a36Sopenharmony_ci	.dynamic_smps_entry = 111,
6362306a36Sopenharmony_ci	.dynamic_smps_exit = 107,
6462306a36Sopenharmony_ci	.tx_protection_entry = 112,
6562306a36Sopenharmony_ci	.tx_protection_exit = 105,
6662306a36Sopenharmony_ci	.tx_backoff = {
6762306a36Sopenharmony_ci		{.temperature = 110, .backoff = 200},
6862306a36Sopenharmony_ci		{.temperature = 111, .backoff = 600},
6962306a36Sopenharmony_ci		{.temperature = 112, .backoff = 1200},
7062306a36Sopenharmony_ci		{.temperature = 113, .backoff = 2000},
7162306a36Sopenharmony_ci		{.temperature = 114, .backoff = 4000},
7262306a36Sopenharmony_ci	},
7362306a36Sopenharmony_ci	.support_ct_kill = true,
7462306a36Sopenharmony_ci	.support_dynamic_smps = true,
7562306a36Sopenharmony_ci	.support_tx_protection = true,
7662306a36Sopenharmony_ci	.support_tx_backoff = true,
7762306a36Sopenharmony_ci};
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci#define IWL_DEVICE_8000_COMMON						\
8062306a36Sopenharmony_ci	.trans.device_family = IWL_DEVICE_FAMILY_8000,			\
8162306a36Sopenharmony_ci	.trans.base_params = &iwl8000_base_params,			\
8262306a36Sopenharmony_ci	.led_mode = IWL_LED_RF_STATE,					\
8362306a36Sopenharmony_ci	.nvm_hw_section_num = 10,					\
8462306a36Sopenharmony_ci	.features = NETIF_F_RXCSUM,					\
8562306a36Sopenharmony_ci	.non_shared_ant = ANT_A,					\
8662306a36Sopenharmony_ci	.dccm_offset = IWL8260_DCCM_OFFSET,				\
8762306a36Sopenharmony_ci	.dccm_len = IWL8260_DCCM_LEN,					\
8862306a36Sopenharmony_ci	.dccm2_offset = IWL8260_DCCM2_OFFSET,				\
8962306a36Sopenharmony_ci	.dccm2_len = IWL8260_DCCM2_LEN,					\
9062306a36Sopenharmony_ci	.smem_offset = IWL8260_SMEM_OFFSET,				\
9162306a36Sopenharmony_ci	.smem_len = IWL8260_SMEM_LEN,					\
9262306a36Sopenharmony_ci	.default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C,	\
9362306a36Sopenharmony_ci	.thermal_params = &iwl8000_tt_params,				\
9462306a36Sopenharmony_ci	.apmg_not_supported = true,					\
9562306a36Sopenharmony_ci	.nvm_type = IWL_NVM_EXT,					\
9662306a36Sopenharmony_ci	.dbgc_supported = true,						\
9762306a36Sopenharmony_ci	.min_umac_error_event_table = 0x800000
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci#define IWL_DEVICE_8000							\
10062306a36Sopenharmony_ci	IWL_DEVICE_8000_COMMON,						\
10162306a36Sopenharmony_ci	.ucode_api_max = IWL8000_UCODE_API_MAX,				\
10262306a36Sopenharmony_ci	.ucode_api_min = IWL8000_UCODE_API_MIN				\
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#define IWL_DEVICE_8260							\
10562306a36Sopenharmony_ci	IWL_DEVICE_8000_COMMON,						\
10662306a36Sopenharmony_ci	.ucode_api_max = IWL8000_UCODE_API_MAX,				\
10762306a36Sopenharmony_ci	.ucode_api_min = IWL8000_UCODE_API_MIN				\
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci#define IWL_DEVICE_8265							\
11062306a36Sopenharmony_ci	IWL_DEVICE_8000_COMMON,						\
11162306a36Sopenharmony_ci	.ucode_api_max = IWL8265_UCODE_API_MAX,				\
11262306a36Sopenharmony_ci	.ucode_api_min = IWL8265_UCODE_API_MIN				\
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ciconst struct iwl_cfg iwl8260_2n_cfg = {
11562306a36Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless N 8260",
11662306a36Sopenharmony_ci	.fw_name_pre = IWL8000_FW_PRE,
11762306a36Sopenharmony_ci	IWL_DEVICE_8260,
11862306a36Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
11962306a36Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
12062306a36Sopenharmony_ci};
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ciconst struct iwl_cfg iwl8260_2ac_cfg = {
12362306a36Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless AC 8260",
12462306a36Sopenharmony_ci	.fw_name_pre = IWL8000_FW_PRE,
12562306a36Sopenharmony_ci	IWL_DEVICE_8260,
12662306a36Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
12762306a36Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
12862306a36Sopenharmony_ci};
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ciconst struct iwl_cfg iwl8265_2ac_cfg = {
13162306a36Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless AC 8265",
13262306a36Sopenharmony_ci	.fw_name_pre = IWL8265_FW_PRE,
13362306a36Sopenharmony_ci	IWL_DEVICE_8265,
13462306a36Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
13562306a36Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
13662306a36Sopenharmony_ci	.vht_mu_mimo_supported = true,
13762306a36Sopenharmony_ci};
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ciconst struct iwl_cfg iwl8275_2ac_cfg = {
14062306a36Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless AC 8275",
14162306a36Sopenharmony_ci	.fw_name_pre = IWL8265_FW_PRE,
14262306a36Sopenharmony_ci	IWL_DEVICE_8265,
14362306a36Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
14462306a36Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
14562306a36Sopenharmony_ci	.vht_mu_mimo_supported = true,
14662306a36Sopenharmony_ci};
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ciconst struct iwl_cfg iwl4165_2ac_cfg = {
14962306a36Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless AC 4165",
15062306a36Sopenharmony_ci	.fw_name_pre = IWL8000_FW_PRE,
15162306a36Sopenharmony_ci	IWL_DEVICE_8000,
15262306a36Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
15362306a36Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
15462306a36Sopenharmony_ci};
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ciMODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_MAX));
15762306a36Sopenharmony_ciMODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_MAX));
158