18c2ecf20Sopenharmony_ci/******************************************************************************
28c2ecf20Sopenharmony_ci *
38c2ecf20Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license.  When using or
48c2ecf20Sopenharmony_ci * redistributing this file, you may do so under either license.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * GPL LICENSE SUMMARY
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright(c) 2014 Intel Corporation. All rights reserved.
98c2ecf20Sopenharmony_ci * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
108c2ecf20Sopenharmony_ci * Copyright(c) 2016        Intel Deutschland GmbH
118c2ecf20Sopenharmony_ci * Copyright(c) 2018 - 2019 Intel Corporation
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
148c2ecf20Sopenharmony_ci * it under the terms of version 2 of the GNU General Public License as
158c2ecf20Sopenharmony_ci * published by the Free Software Foundation.
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci * This program is distributed in the hope that it will be useful, but
188c2ecf20Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of
198c2ecf20Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
208c2ecf20Sopenharmony_ci * General Public License for more details.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * The full GNU General Public License is included in this distribution
238c2ecf20Sopenharmony_ci * in the file called COPYING.
248c2ecf20Sopenharmony_ci *
258c2ecf20Sopenharmony_ci * Contact Information:
268c2ecf20Sopenharmony_ci *  Intel Linux Wireless <linuxwifi@intel.com>
278c2ecf20Sopenharmony_ci * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
288c2ecf20Sopenharmony_ci *
298c2ecf20Sopenharmony_ci * BSD LICENSE
308c2ecf20Sopenharmony_ci *
318c2ecf20Sopenharmony_ci * Copyright(c) 2014 Intel Corporation. All rights reserved.
328c2ecf20Sopenharmony_ci * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
338c2ecf20Sopenharmony_ci * Copyright(c) 2018 - 2019 Intel Corporation
348c2ecf20Sopenharmony_ci * All rights reserved.
358c2ecf20Sopenharmony_ci *
368c2ecf20Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
378c2ecf20Sopenharmony_ci * modification, are permitted provided that the following conditions
388c2ecf20Sopenharmony_ci * are met:
398c2ecf20Sopenharmony_ci *
408c2ecf20Sopenharmony_ci *  * Redistributions of source code must retain the above copyright
418c2ecf20Sopenharmony_ci *    notice, this list of conditions and the following disclaimer.
428c2ecf20Sopenharmony_ci *  * Redistributions in binary form must reproduce the above copyright
438c2ecf20Sopenharmony_ci *    notice, this list of conditions and the following disclaimer in
448c2ecf20Sopenharmony_ci *    the documentation and/or other materials provided with the
458c2ecf20Sopenharmony_ci *    distribution.
468c2ecf20Sopenharmony_ci *  * Neither the name Intel Corporation nor the names of its
478c2ecf20Sopenharmony_ci *    contributors may be used to endorse or promote products derived
488c2ecf20Sopenharmony_ci *    from this software without specific prior written permission.
498c2ecf20Sopenharmony_ci *
508c2ecf20Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
518c2ecf20Sopenharmony_ci * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
528c2ecf20Sopenharmony_ci * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
538c2ecf20Sopenharmony_ci * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
548c2ecf20Sopenharmony_ci * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
558c2ecf20Sopenharmony_ci * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
568c2ecf20Sopenharmony_ci * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
578c2ecf20Sopenharmony_ci * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
588c2ecf20Sopenharmony_ci * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
598c2ecf20Sopenharmony_ci * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
608c2ecf20Sopenharmony_ci * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
618c2ecf20Sopenharmony_ci *
628c2ecf20Sopenharmony_ci *****************************************************************************/
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#include <linux/module.h>
658c2ecf20Sopenharmony_ci#include <linux/stringify.h>
668c2ecf20Sopenharmony_ci#include "iwl-config.h"
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci/* Highest firmware API version supported */
698c2ecf20Sopenharmony_ci#define IWL8000_UCODE_API_MAX	36
708c2ecf20Sopenharmony_ci#define IWL8265_UCODE_API_MAX	36
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci/* Lowest firmware API version supported */
738c2ecf20Sopenharmony_ci#define IWL8000_UCODE_API_MIN	22
748c2ecf20Sopenharmony_ci#define IWL8265_UCODE_API_MIN	22
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci/* NVM versions */
778c2ecf20Sopenharmony_ci#define IWL8000_NVM_VERSION		0x0a1d
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci/* Memory offsets and lengths */
808c2ecf20Sopenharmony_ci#define IWL8260_DCCM_OFFSET		0x800000
818c2ecf20Sopenharmony_ci#define IWL8260_DCCM_LEN		0x18000
828c2ecf20Sopenharmony_ci#define IWL8260_DCCM2_OFFSET		0x880000
838c2ecf20Sopenharmony_ci#define IWL8260_DCCM2_LEN		0x8000
848c2ecf20Sopenharmony_ci#define IWL8260_SMEM_OFFSET		0x400000
858c2ecf20Sopenharmony_ci#define IWL8260_SMEM_LEN		0x68000
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci#define IWL8000_FW_PRE "iwlwifi-8000C-"
888c2ecf20Sopenharmony_ci#define IWL8000_MODULE_FIRMWARE(api) \
898c2ecf20Sopenharmony_ci	IWL8000_FW_PRE __stringify(api) ".ucode"
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define IWL8265_FW_PRE "iwlwifi-8265-"
928c2ecf20Sopenharmony_ci#define IWL8265_MODULE_FIRMWARE(api) \
938c2ecf20Sopenharmony_ci	IWL8265_FW_PRE __stringify(api) ".ucode"
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define DEFAULT_NVM_FILE_FAMILY_8000C		"nvmData-8000C"
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_cistatic const struct iwl_base_params iwl8000_base_params = {
988c2ecf20Sopenharmony_ci	.eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
998c2ecf20Sopenharmony_ci	.num_of_queues = 31,
1008c2ecf20Sopenharmony_ci	.max_tfd_queue_size = 256,
1018c2ecf20Sopenharmony_ci	.shadow_ram_support = true,
1028c2ecf20Sopenharmony_ci	.led_compensation = 57,
1038c2ecf20Sopenharmony_ci	.wd_timeout = IWL_LONG_WD_TIMEOUT,
1048c2ecf20Sopenharmony_ci	.max_event_log_size = 512,
1058c2ecf20Sopenharmony_ci	.shadow_reg_enable = true,
1068c2ecf20Sopenharmony_ci	.pcie_l1_allowed = true,
1078c2ecf20Sopenharmony_ci};
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_cistatic const struct iwl_ht_params iwl8000_ht_params = {
1108c2ecf20Sopenharmony_ci	.stbc = true,
1118c2ecf20Sopenharmony_ci	.ldpc = true,
1128c2ecf20Sopenharmony_ci	.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
1138c2ecf20Sopenharmony_ci};
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_cistatic const struct iwl_tt_params iwl8000_tt_params = {
1168c2ecf20Sopenharmony_ci	.ct_kill_entry = 115,
1178c2ecf20Sopenharmony_ci	.ct_kill_exit = 93,
1188c2ecf20Sopenharmony_ci	.ct_kill_duration = 5,
1198c2ecf20Sopenharmony_ci	.dynamic_smps_entry = 111,
1208c2ecf20Sopenharmony_ci	.dynamic_smps_exit = 107,
1218c2ecf20Sopenharmony_ci	.tx_protection_entry = 112,
1228c2ecf20Sopenharmony_ci	.tx_protection_exit = 105,
1238c2ecf20Sopenharmony_ci	.tx_backoff = {
1248c2ecf20Sopenharmony_ci		{.temperature = 110, .backoff = 200},
1258c2ecf20Sopenharmony_ci		{.temperature = 111, .backoff = 600},
1268c2ecf20Sopenharmony_ci		{.temperature = 112, .backoff = 1200},
1278c2ecf20Sopenharmony_ci		{.temperature = 113, .backoff = 2000},
1288c2ecf20Sopenharmony_ci		{.temperature = 114, .backoff = 4000},
1298c2ecf20Sopenharmony_ci	},
1308c2ecf20Sopenharmony_ci	.support_ct_kill = true,
1318c2ecf20Sopenharmony_ci	.support_dynamic_smps = true,
1328c2ecf20Sopenharmony_ci	.support_tx_protection = true,
1338c2ecf20Sopenharmony_ci	.support_tx_backoff = true,
1348c2ecf20Sopenharmony_ci};
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define IWL_DEVICE_8000_COMMON						\
1378c2ecf20Sopenharmony_ci	.trans.device_family = IWL_DEVICE_FAMILY_8000,			\
1388c2ecf20Sopenharmony_ci	.trans.base_params = &iwl8000_base_params,			\
1398c2ecf20Sopenharmony_ci	.led_mode = IWL_LED_RF_STATE,					\
1408c2ecf20Sopenharmony_ci	.nvm_hw_section_num = 10,					\
1418c2ecf20Sopenharmony_ci	.features = NETIF_F_RXCSUM,					\
1428c2ecf20Sopenharmony_ci	.non_shared_ant = ANT_A,					\
1438c2ecf20Sopenharmony_ci	.dccm_offset = IWL8260_DCCM_OFFSET,				\
1448c2ecf20Sopenharmony_ci	.dccm_len = IWL8260_DCCM_LEN,					\
1458c2ecf20Sopenharmony_ci	.dccm2_offset = IWL8260_DCCM2_OFFSET,				\
1468c2ecf20Sopenharmony_ci	.dccm2_len = IWL8260_DCCM2_LEN,					\
1478c2ecf20Sopenharmony_ci	.smem_offset = IWL8260_SMEM_OFFSET,				\
1488c2ecf20Sopenharmony_ci	.smem_len = IWL8260_SMEM_LEN,					\
1498c2ecf20Sopenharmony_ci	.default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C,	\
1508c2ecf20Sopenharmony_ci	.thermal_params = &iwl8000_tt_params,				\
1518c2ecf20Sopenharmony_ci	.apmg_not_supported = true,					\
1528c2ecf20Sopenharmony_ci	.nvm_type = IWL_NVM_EXT,					\
1538c2ecf20Sopenharmony_ci	.dbgc_supported = true,						\
1548c2ecf20Sopenharmony_ci	.min_umac_error_event_table = 0x800000
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci#define IWL_DEVICE_8000							\
1578c2ecf20Sopenharmony_ci	IWL_DEVICE_8000_COMMON,						\
1588c2ecf20Sopenharmony_ci	.ucode_api_max = IWL8000_UCODE_API_MAX,				\
1598c2ecf20Sopenharmony_ci	.ucode_api_min = IWL8000_UCODE_API_MIN				\
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci#define IWL_DEVICE_8260							\
1628c2ecf20Sopenharmony_ci	IWL_DEVICE_8000_COMMON,						\
1638c2ecf20Sopenharmony_ci	.ucode_api_max = IWL8000_UCODE_API_MAX,				\
1648c2ecf20Sopenharmony_ci	.ucode_api_min = IWL8000_UCODE_API_MIN				\
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci#define IWL_DEVICE_8265							\
1678c2ecf20Sopenharmony_ci	IWL_DEVICE_8000_COMMON,						\
1688c2ecf20Sopenharmony_ci	.ucode_api_max = IWL8265_UCODE_API_MAX,				\
1698c2ecf20Sopenharmony_ci	.ucode_api_min = IWL8265_UCODE_API_MIN				\
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ciconst struct iwl_cfg iwl8260_2n_cfg = {
1728c2ecf20Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless N 8260",
1738c2ecf20Sopenharmony_ci	.fw_name_pre = IWL8000_FW_PRE,
1748c2ecf20Sopenharmony_ci	IWL_DEVICE_8260,
1758c2ecf20Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
1768c2ecf20Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
1778c2ecf20Sopenharmony_ci};
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ciconst struct iwl_cfg iwl8260_2ac_cfg = {
1808c2ecf20Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless AC 8260",
1818c2ecf20Sopenharmony_ci	.fw_name_pre = IWL8000_FW_PRE,
1828c2ecf20Sopenharmony_ci	IWL_DEVICE_8260,
1838c2ecf20Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
1848c2ecf20Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
1858c2ecf20Sopenharmony_ci	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
1868c2ecf20Sopenharmony_ci};
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ciconst struct iwl_cfg iwl8265_2ac_cfg = {
1898c2ecf20Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless AC 8265",
1908c2ecf20Sopenharmony_ci	.fw_name_pre = IWL8265_FW_PRE,
1918c2ecf20Sopenharmony_ci	IWL_DEVICE_8265,
1928c2ecf20Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
1938c2ecf20Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
1948c2ecf20Sopenharmony_ci	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
1958c2ecf20Sopenharmony_ci	.vht_mu_mimo_supported = true,
1968c2ecf20Sopenharmony_ci};
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ciconst struct iwl_cfg iwl8275_2ac_cfg = {
1998c2ecf20Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless AC 8275",
2008c2ecf20Sopenharmony_ci	.fw_name_pre = IWL8265_FW_PRE,
2018c2ecf20Sopenharmony_ci	IWL_DEVICE_8265,
2028c2ecf20Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
2038c2ecf20Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
2048c2ecf20Sopenharmony_ci	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
2058c2ecf20Sopenharmony_ci	.vht_mu_mimo_supported = true,
2068c2ecf20Sopenharmony_ci};
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ciconst struct iwl_cfg iwl4165_2ac_cfg = {
2098c2ecf20Sopenharmony_ci	.name = "Intel(R) Dual Band Wireless AC 4165",
2108c2ecf20Sopenharmony_ci	.fw_name_pre = IWL8000_FW_PRE,
2118c2ecf20Sopenharmony_ci	IWL_DEVICE_8000,
2128c2ecf20Sopenharmony_ci	.ht_params = &iwl8000_ht_params,
2138c2ecf20Sopenharmony_ci	.nvm_ver = IWL8000_NVM_VERSION,
2148c2ecf20Sopenharmony_ci	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
2158c2ecf20Sopenharmony_ci};
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ciMODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_MAX));
2188c2ecf20Sopenharmony_ciMODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_MAX));
219