xref: /linux/drivers/net/wireless/intel/iwlwifi/cfg/7000.c (revision 0b897fbd900e12a08baa3d1a0457944046a882ea)
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2 /*
3  * Copyright (C) 2012-2014, 2018-2020, 2023, 2025 Intel Corporation
4  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
5  * Copyright (C) 2015 Intel Deutschland GmbH
6  */
7 #include <linux/module.h>
8 #include <linux/stringify.h>
9 #include "iwl-config.h"
10 
11 /* Highest firmware API version supported */
12 #define IWL7260_UCODE_API_MAX	17
13 #define IWL7265_UCODE_API_MAX	17
14 #define IWL7265D_UCODE_API_MAX	29
15 #define IWL3168_UCODE_API_MAX	29
16 
17 /* Lowest firmware API version supported */
18 #define IWL7260_UCODE_API_MIN	17
19 #define IWL7265_UCODE_API_MIN	17
20 #define IWL7265D_UCODE_API_MIN	22
21 #define IWL3168_UCODE_API_MIN	22
22 
23 /* NVM versions */
24 #define IWL7260_NVM_VERSION		0x0a1d
25 #define IWL3160_NVM_VERSION		0x709
26 #define IWL3165_NVM_VERSION		0x709
27 #define IWL3168_NVM_VERSION		0xd01
28 #define IWL7265_NVM_VERSION		0x0a1d
29 #define IWL7265D_NVM_VERSION		0x0c11
30 
31 /* DCCM offsets and lengths */
32 #define IWL7000_DCCM_OFFSET		0x800000
33 #define IWL7260_DCCM_LEN		0x14000
34 #define IWL3160_DCCM_LEN		0x10000
35 #define IWL7265_DCCM_LEN		0x17A00
36 
37 #define IWL7260_FW_PRE "iwlwifi-7260"
38 #define IWL7260_MODULE_FIRMWARE(api) IWL7260_FW_PRE "-" __stringify(api) ".ucode"
39 
40 #define IWL3160_FW_PRE "iwlwifi-3160"
41 #define IWL3160_MODULE_FIRMWARE(api) IWL3160_FW_PRE "-" __stringify(api) ".ucode"
42 
43 #define IWL3168_FW_PRE "iwlwifi-3168"
44 #define IWL3168_MODULE_FIRMWARE(api) IWL3168_FW_PRE "-" __stringify(api) ".ucode"
45 
46 #define IWL7265_FW_PRE "iwlwifi-7265"
47 #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE "-" __stringify(api) ".ucode"
48 
49 #define IWL7265D_FW_PRE "iwlwifi-7265D"
50 #define IWL7265D_MODULE_FIRMWARE(api) IWL7265D_FW_PRE "-" __stringify(api) ".ucode"
51 
52 static const struct iwl_base_params iwl7000_base_params = {
53 	.eeprom_size = OTP_LOW_IMAGE_SIZE_16K,
54 	.num_of_queues = 31,
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 	.apmg_wake_up_wa = true,
63 };
64 
65 static const struct iwl_tt_params iwl7000_high_temp_tt_params = {
66 	.ct_kill_entry = 118,
67 	.ct_kill_exit = 96,
68 	.ct_kill_duration = 5,
69 	.dynamic_smps_entry = 114,
70 	.dynamic_smps_exit = 110,
71 	.tx_protection_entry = 114,
72 	.tx_protection_exit = 108,
73 	.tx_backoff = {
74 		{.temperature = 112, .backoff = 300},
75 		{.temperature = 113, .backoff = 800},
76 		{.temperature = 114, .backoff = 1500},
77 		{.temperature = 115, .backoff = 3000},
78 		{.temperature = 116, .backoff = 5000},
79 		{.temperature = 117, .backoff = 10000},
80 	},
81 	.support_ct_kill = true,
82 	.support_dynamic_smps = true,
83 	.support_tx_protection = true,
84 	.support_tx_backoff = true,
85 };
86 
87 static const struct iwl_ht_params iwl7000_ht_params = {
88 	.stbc = true,
89 	.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
90 };
91 
92 const struct iwl_cfg_trans_params iwl7000_trans_cfg = {
93 	.device_family = IWL_DEVICE_FAMILY_7000,
94 	.base_params = &iwl7000_base_params,
95 };
96 
97 #define IWL_DEVICE_7000_COMMON					\
98 	.led_mode = IWL_LED_RF_STATE,				\
99 	.nvm_hw_section_num = 0,				\
100 	.non_shared_ant = ANT_A,				\
101 	.dccm_offset = IWL7000_DCCM_OFFSET
102 
103 #define IWL_DEVICE_7000						\
104 	IWL_DEVICE_7000_COMMON,					\
105 	.ucode_api_max = IWL7260_UCODE_API_MAX,			\
106 	.ucode_api_min = IWL7260_UCODE_API_MIN
107 
108 #define IWL_DEVICE_7005						\
109 	IWL_DEVICE_7000_COMMON,					\
110 	.ucode_api_max = IWL7265_UCODE_API_MAX,			\
111 	.ucode_api_min = IWL7265_UCODE_API_MIN
112 
113 #define IWL_DEVICE_3008						\
114 	IWL_DEVICE_7000_COMMON,					\
115 	.ucode_api_max = IWL3168_UCODE_API_MAX,			\
116 	.ucode_api_min = IWL3168_UCODE_API_MIN
117 
118 #define IWL_DEVICE_7005D					\
119 	IWL_DEVICE_7000_COMMON,					\
120 	.ucode_api_max = IWL7265D_UCODE_API_MAX,		\
121 	.ucode_api_min = IWL7265D_UCODE_API_MIN
122 
123 const char iwl7260_2ac_name[] = "Intel(R) Dual Band Wireless AC 7260";
124 const char iwl7260_2n_name[] = "Intel(R) Dual Band Wireless N 7260";
125 const char iwl7260_n_name[] = "Intel(R) Wireless N 7260";
126 const char iwl3160_2ac_name[] = "Intel(R) Dual Band Wireless AC 3160";
127 const char iwl3160_2n_name[] = "Intel(R) Dual Band Wireless N 3160";
128 const char iwl3160_n_name[] = "Intel(R) Wireless N 3160";
129 const char iwl3165_2ac_name[] = "Intel(R) Dual Band Wireless AC 3165";
130 const char iwl3168_2ac_name[] = "Intel(R) Dual Band Wireless AC 3168";
131 const char iwl7265_2ac_name[] = "Intel(R) Dual Band Wireless AC 7265";
132 const char iwl7265_2n_name[] = "Intel(R) Dual Band Wireless N 7265";
133 const char iwl7265_n_name[] = "Intel(R) Wireless N 7265";
134 const char iwl7265d_2ac_name[] = "Intel(R) Dual Band Wireless AC 7265";
135 const char iwl7265d_2n_name[] = "Intel(R) Dual Band Wireless N 7265";
136 const char iwl7265d_n_name[] = "Intel(R) Wireless N 7265";
137 
138 const struct iwl_cfg iwl7260_cfg = {
139 	.fw_name_pre = IWL7260_FW_PRE,
140 	IWL_DEVICE_7000,
141 	.ht_params = &iwl7000_ht_params,
142 	.nvm_ver = IWL7260_NVM_VERSION,
143 	.host_interrupt_operation_mode = true,
144 	.lp_xtal_workaround = true,
145 	.dccm_len = IWL7260_DCCM_LEN,
146 };
147 
148 const struct iwl_cfg iwl7260_high_temp_cfg = {
149 	.fw_name_pre = IWL7260_FW_PRE,
150 	IWL_DEVICE_7000,
151 	.ht_params = &iwl7000_ht_params,
152 	.nvm_ver = IWL7260_NVM_VERSION,
153 	.high_temp = true,
154 	.host_interrupt_operation_mode = true,
155 	.lp_xtal_workaround = true,
156 	.dccm_len = IWL7260_DCCM_LEN,
157 	.thermal_params = &iwl7000_high_temp_tt_params,
158 };
159 
160 const struct iwl_cfg iwl3160_cfg = {
161 	.fw_name_pre = IWL3160_FW_PRE,
162 	IWL_DEVICE_7000,
163 	.ht_params = &iwl7000_ht_params,
164 	.nvm_ver = IWL3160_NVM_VERSION,
165 	.host_interrupt_operation_mode = true,
166 	.dccm_len = IWL3160_DCCM_LEN,
167 };
168 
169 static const struct iwl_pwr_tx_backoff iwl7265_pwr_tx_backoffs[] = {
170 	{.pwr = 1600, .backoff = 0},
171 	{.pwr = 1300, .backoff = 467},
172 	{.pwr = 900,  .backoff = 1900},
173 	{.pwr = 800, .backoff = 2630},
174 	{.pwr = 700, .backoff = 3720},
175 	{.pwr = 600, .backoff = 5550},
176 	{.pwr = 500, .backoff = 9350},
177 	{0},
178 };
179 
180 static const struct iwl_ht_params iwl7265_ht_params = {
181 	.stbc = true,
182 	.ldpc = true,
183 	.ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
184 };
185 
186 const struct iwl_cfg iwl3165_2ac_cfg = {
187 	.fw_name_pre = IWL7265D_FW_PRE,
188 	IWL_DEVICE_7005D,
189 	.ht_params = &iwl7000_ht_params,
190 	.nvm_ver = IWL3165_NVM_VERSION,
191 	.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
192 	.dccm_len = IWL7265_DCCM_LEN,
193 };
194 
195 const struct iwl_cfg iwl3168_2ac_cfg = {
196 	.fw_name_pre = IWL3168_FW_PRE,
197 	IWL_DEVICE_3008,
198 	.ht_params = &iwl7000_ht_params,
199 	.nvm_ver = IWL3168_NVM_VERSION,
200 	.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
201 	.dccm_len = IWL7265_DCCM_LEN,
202 	.nvm_type = IWL_NVM_SDP,
203 };
204 
205 const struct iwl_cfg iwl7265_cfg = {
206 	.fw_name_pre = IWL7265_FW_PRE,
207 	IWL_DEVICE_7005,
208 	.ht_params = &iwl7265_ht_params,
209 	.nvm_ver = IWL7265_NVM_VERSION,
210 	.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
211 	.dccm_len = IWL7265_DCCM_LEN,
212 };
213 
214 const struct iwl_cfg iwl7265d_cfg = {
215 	.fw_name_pre = IWL7265D_FW_PRE,
216 	IWL_DEVICE_7005D,
217 	.ht_params = &iwl7265_ht_params,
218 	.nvm_ver = IWL7265D_NVM_VERSION,
219 	.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
220 	.dccm_len = IWL7265_DCCM_LEN,
221 };
222 
223 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_MAX));
224 MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_MAX));
225 MODULE_FIRMWARE(IWL3168_MODULE_FIRMWARE(IWL3168_UCODE_API_MAX));
226 MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_MAX));
227 MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_MAX));
228