xref: /freebsd/sys/contrib/dev/iwlwifi/cfg/sc.c (revision a4128aad8503277614f2d214011ef60a19447b83)
19af1bba4SBjoern A. Zeeb // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
29af1bba4SBjoern A. Zeeb /*
39af1bba4SBjoern A. Zeeb  * Copyright (C) 2015-2017 Intel Deutschland GmbH
4*a4128aadSBjoern A. Zeeb  * Copyright (C) 2018-2024 Intel Corporation
59af1bba4SBjoern A. Zeeb  */
69af1bba4SBjoern A. Zeeb #include <linux/module.h>
79af1bba4SBjoern A. Zeeb #include <linux/stringify.h>
89af1bba4SBjoern A. Zeeb #include "iwl-config.h"
99af1bba4SBjoern A. Zeeb #include "iwl-prph.h"
109af1bba4SBjoern A. Zeeb #include "fw/api/txq.h"
119af1bba4SBjoern A. Zeeb 
129af1bba4SBjoern A. Zeeb /* Highest firmware API version supported */
13*a4128aadSBjoern A. Zeeb #define IWL_SC_UCODE_API_MAX	92
149af1bba4SBjoern A. Zeeb 
159af1bba4SBjoern A. Zeeb /* Lowest firmware API version supported */
16*a4128aadSBjoern A. Zeeb #define IWL_SC_UCODE_API_MIN	90
179af1bba4SBjoern A. Zeeb 
189af1bba4SBjoern A. Zeeb /* NVM versions */
199af1bba4SBjoern A. Zeeb #define IWL_SC_NVM_VERSION		0x0a1d
209af1bba4SBjoern A. Zeeb 
219af1bba4SBjoern A. Zeeb /* Memory offsets and lengths */
229af1bba4SBjoern A. Zeeb #define IWL_SC_DCCM_OFFSET		0x800000 /* LMAC1 */
239af1bba4SBjoern A. Zeeb #define IWL_SC_DCCM_LEN			0x10000 /* LMAC1 */
249af1bba4SBjoern A. Zeeb #define IWL_SC_DCCM2_OFFSET		0x880000
259af1bba4SBjoern A. Zeeb #define IWL_SC_DCCM2_LEN		0x8000
269af1bba4SBjoern A. Zeeb #define IWL_SC_SMEM_OFFSET		0x400000
279af1bba4SBjoern A. Zeeb #define IWL_SC_SMEM_LEN			0xD0000
289af1bba4SBjoern A. Zeeb 
299af1bba4SBjoern A. Zeeb #define IWL_SC_A_FM_B_FW_PRE		"iwlwifi-sc-a0-fm-b0"
309af1bba4SBjoern A. Zeeb #define IWL_SC_A_FM_C_FW_PRE		"iwlwifi-sc-a0-fm-c0"
319af1bba4SBjoern A. Zeeb #define IWL_SC_A_HR_A_FW_PRE		"iwlwifi-sc-a0-hr-b0"
329af1bba4SBjoern A. Zeeb #define IWL_SC_A_HR_B_FW_PRE		"iwlwifi-sc-a0-hr-b0"
339af1bba4SBjoern A. Zeeb #define IWL_SC_A_GF_A_FW_PRE		"iwlwifi-sc-a0-gf-a0"
349af1bba4SBjoern A. Zeeb #define IWL_SC_A_GF4_A_FW_PRE		"iwlwifi-sc-a0-gf4-a0"
359af1bba4SBjoern A. Zeeb #define IWL_SC_A_WH_A_FW_PRE		"iwlwifi-sc-a0-wh-a0"
36*a4128aadSBjoern A. Zeeb #define IWL_SC2_A_FM_C_FW_PRE		"iwlwifi-sc2-a0-fm-c0"
37*a4128aadSBjoern A. Zeeb #define IWL_SC2_A_WH_A_FW_PRE		"iwlwifi-sc2-a0-wh-a0"
38*a4128aadSBjoern A. Zeeb #define IWL_SC2F_A_FM_C_FW_PRE		"iwlwifi-sc2f-a0-fm-c0"
39*a4128aadSBjoern A. Zeeb #define IWL_SC2F_A_WH_A_FW_PRE		"iwlwifi-sc2f-a0-wh-a0"
409af1bba4SBjoern A. Zeeb 
419af1bba4SBjoern A. Zeeb #define IWL_SC_A_FM_B_FW_MODULE_FIRMWARE(api) \
429af1bba4SBjoern A. Zeeb 	IWL_SC_A_FM_B_FW_PRE "-" __stringify(api) ".ucode"
439af1bba4SBjoern A. Zeeb #define IWL_SC_A_FM_C_FW_MODULE_FIRMWARE(api) \
449af1bba4SBjoern A. Zeeb 	IWL_SC_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
459af1bba4SBjoern A. Zeeb #define IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(api) \
469af1bba4SBjoern A. Zeeb 	IWL_SC_A_HR_A_FW_PRE "-" __stringify(api) ".ucode"
479af1bba4SBjoern A. Zeeb #define IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(api) \
489af1bba4SBjoern A. Zeeb 	IWL_SC_A_HR_B_FW_PRE "-" __stringify(api) ".ucode"
499af1bba4SBjoern A. Zeeb #define IWL_SC_A_GF_A_FW_MODULE_FIRMWARE(api) \
509af1bba4SBjoern A. Zeeb 	IWL_SC_A_GF_A_FW_PRE "-" __stringify(api) ".ucode"
519af1bba4SBjoern A. Zeeb #define IWL_SC_A_GF4_A_FW_MODULE_FIRMWARE(api) \
529af1bba4SBjoern A. Zeeb 	IWL_SC_A_GF4_A_FW_PRE "-" __stringify(api) ".ucode"
539af1bba4SBjoern A. Zeeb #define IWL_SC_A_WH_A_FW_MODULE_FIRMWARE(api) \
549af1bba4SBjoern A. Zeeb 	IWL_SC_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
55*a4128aadSBjoern A. Zeeb #define IWL_SC2_A_FM_C_FW_MODULE_FIRMWARE(api) \
56*a4128aadSBjoern A. Zeeb 	IWL_SC2_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
57*a4128aadSBjoern A. Zeeb #define IWL_SC2_A_WH_A_FW_MODULE_FIRMWARE(api) \
58*a4128aadSBjoern A. Zeeb 	IWL_SC2_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
59*a4128aadSBjoern A. Zeeb #define IWL_SC2F_A_FM_C_FW_MODULE_FIRMWARE(api) \
60*a4128aadSBjoern A. Zeeb 	IWL_SC2F_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
61*a4128aadSBjoern A. Zeeb #define IWL_SC2F_A_WH_A_FW_MODULE_FIRMWARE(api) \
62*a4128aadSBjoern A. Zeeb 	IWL_SC2F_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
639af1bba4SBjoern A. Zeeb 
649af1bba4SBjoern A. Zeeb static const struct iwl_base_params iwl_sc_base_params = {
659af1bba4SBjoern A. Zeeb 	.eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
669af1bba4SBjoern A. Zeeb 	.num_of_queues = 512,
679af1bba4SBjoern A. Zeeb 	.max_tfd_queue_size = 65536,
689af1bba4SBjoern A. Zeeb 	.shadow_ram_support = true,
699af1bba4SBjoern A. Zeeb 	.led_compensation = 57,
709af1bba4SBjoern A. Zeeb 	.wd_timeout = IWL_LONG_WD_TIMEOUT,
719af1bba4SBjoern A. Zeeb 	.max_event_log_size = 512,
729af1bba4SBjoern A. Zeeb 	.shadow_reg_enable = true,
739af1bba4SBjoern A. Zeeb 	.pcie_l1_allowed = true,
749af1bba4SBjoern A. Zeeb };
759af1bba4SBjoern A. Zeeb 
769af1bba4SBjoern A. Zeeb #define IWL_DEVICE_BZ_COMMON						\
779af1bba4SBjoern A. Zeeb 	.ucode_api_max = IWL_SC_UCODE_API_MAX,			\
789af1bba4SBjoern A. Zeeb 	.ucode_api_min = IWL_SC_UCODE_API_MIN,			\
799af1bba4SBjoern A. Zeeb 	.led_mode = IWL_LED_RF_STATE,					\
809af1bba4SBjoern A. Zeeb 	.nvm_hw_section_num = 10,					\
819af1bba4SBjoern A. Zeeb 	.non_shared_ant = ANT_B,					\
829af1bba4SBjoern A. Zeeb 	.dccm_offset = IWL_SC_DCCM_OFFSET,				\
839af1bba4SBjoern A. Zeeb 	.dccm_len = IWL_SC_DCCM_LEN,					\
849af1bba4SBjoern A. Zeeb 	.dccm2_offset = IWL_SC_DCCM2_OFFSET,				\
859af1bba4SBjoern A. Zeeb 	.dccm2_len = IWL_SC_DCCM2_LEN,				\
869af1bba4SBjoern A. Zeeb 	.smem_offset = IWL_SC_SMEM_OFFSET,				\
879af1bba4SBjoern A. Zeeb 	.smem_len = IWL_SC_SMEM_LEN,					\
889af1bba4SBjoern A. Zeeb 	.apmg_not_supported = true,					\
899af1bba4SBjoern A. Zeeb 	.trans.mq_rx_supported = true,					\
909af1bba4SBjoern A. Zeeb 	.vht_mu_mimo_supported = true,					\
919af1bba4SBjoern A. Zeeb 	.mac_addr_from_csr = 0x30,					\
929af1bba4SBjoern A. Zeeb 	.nvm_ver = IWL_SC_NVM_VERSION,				\
939af1bba4SBjoern A. Zeeb 	.trans.rf_id = true,						\
949af1bba4SBjoern A. Zeeb 	.trans.gen2 = true,						\
959af1bba4SBjoern A. Zeeb 	.nvm_type = IWL_NVM_EXT,					\
969af1bba4SBjoern A. Zeeb 	.dbgc_supported = true,						\
979af1bba4SBjoern A. Zeeb 	.min_umac_error_event_table = 0xD0000,				\
989af1bba4SBjoern A. Zeeb 	.d3_debug_data_base_addr = 0x401000,				\
999af1bba4SBjoern A. Zeeb 	.d3_debug_data_length = 60 * 1024,				\
1009af1bba4SBjoern A. Zeeb 	.mon_smem_regs = {						\
1019af1bba4SBjoern A. Zeeb 		.write_ptr = {						\
1029af1bba4SBjoern A. Zeeb 			.addr = LDBG_M2S_BUF_WPTR,			\
1039af1bba4SBjoern A. Zeeb 			.mask = LDBG_M2S_BUF_WPTR_VAL_MSK,		\
1049af1bba4SBjoern A. Zeeb 	},								\
1059af1bba4SBjoern A. Zeeb 		.cycle_cnt = {						\
1069af1bba4SBjoern A. Zeeb 			.addr = LDBG_M2S_BUF_WRAP_CNT,			\
1079af1bba4SBjoern A. Zeeb 			.mask = LDBG_M2S_BUF_WRAP_CNT_VAL_MSK,		\
1089af1bba4SBjoern A. Zeeb 		},							\
1099af1bba4SBjoern A. Zeeb 	},								\
1109af1bba4SBjoern A. Zeeb 	.trans.umac_prph_offset = 0x300000,				\
1119af1bba4SBjoern A. Zeeb 	.trans.device_family = IWL_DEVICE_FAMILY_SC,			\
1129af1bba4SBjoern A. Zeeb 	.trans.base_params = &iwl_sc_base_params,			\
1139af1bba4SBjoern A. Zeeb 	.min_txq_size = 128,						\
1149af1bba4SBjoern A. Zeeb 	.gp2_reg_addr = 0xd02c68,					\
1159af1bba4SBjoern A. Zeeb 	.min_ba_txq_size = IWL_DEFAULT_QUEUE_SIZE_EHT,			\
1169af1bba4SBjoern A. Zeeb 	.mon_dram_regs = {						\
1179af1bba4SBjoern A. Zeeb 		.write_ptr = {						\
1189af1bba4SBjoern A. Zeeb 			.addr = DBGC_CUR_DBGBUF_STATUS,			\
1199af1bba4SBjoern A. Zeeb 			.mask = DBGC_CUR_DBGBUF_STATUS_OFFSET_MSK,	\
1209af1bba4SBjoern A. Zeeb 		},							\
1219af1bba4SBjoern A. Zeeb 		.cycle_cnt = {						\
1229af1bba4SBjoern A. Zeeb 			.addr = DBGC_DBGBUF_WRAP_AROUND,		\
1239af1bba4SBjoern A. Zeeb 			.mask = 0xffffffff,				\
1249af1bba4SBjoern A. Zeeb 		},							\
1259af1bba4SBjoern A. Zeeb 		.cur_frag = {						\
1269af1bba4SBjoern A. Zeeb 			.addr = DBGC_CUR_DBGBUF_STATUS,			\
1279af1bba4SBjoern A. Zeeb 			.mask = DBGC_CUR_DBGBUF_STATUS_IDX_MSK,		\
1289af1bba4SBjoern A. Zeeb 		},							\
1299af1bba4SBjoern A. Zeeb 	},								\
1309af1bba4SBjoern A. Zeeb 	.mon_dbgi_regs = {						\
1319af1bba4SBjoern A. Zeeb 		.write_ptr = {						\
1329af1bba4SBjoern A. Zeeb 			.addr = DBGI_SRAM_FIFO_POINTERS,		\
1339af1bba4SBjoern A. Zeeb 			.mask = DBGI_SRAM_FIFO_POINTERS_WR_PTR_MSK,	\
1349af1bba4SBjoern A. Zeeb 		},							\
1359af1bba4SBjoern A. Zeeb 	}
1369af1bba4SBjoern A. Zeeb 
1379af1bba4SBjoern A. Zeeb #define IWL_DEVICE_SC							\
1389af1bba4SBjoern A. Zeeb 	IWL_DEVICE_BZ_COMMON,						\
139*a4128aadSBjoern A. Zeeb 	.uhb_supported = true,						\
140*a4128aadSBjoern A. Zeeb 	.features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM,		\
141*a4128aadSBjoern A. Zeeb 	.num_rbds = IWL_NUM_RBDS_SC_EHT,				\
1429af1bba4SBjoern A. Zeeb 	.ht_params = &iwl_22000_ht_params
1439af1bba4SBjoern A. Zeeb 
1449af1bba4SBjoern A. Zeeb /*
145*a4128aadSBjoern A. Zeeb  * This size was picked according to 8 MSDUs inside 512 A-MSDUs in an
1469af1bba4SBjoern A. Zeeb  * A-MPDU, with additional overhead to account for processing time.
1479af1bba4SBjoern A. Zeeb  */
148*a4128aadSBjoern A. Zeeb #define IWL_NUM_RBDS_SC_EHT		(512 * 16)
1499af1bba4SBjoern A. Zeeb 
1509af1bba4SBjoern A. Zeeb const struct iwl_cfg_trans_params iwl_sc_trans_cfg = {
1519af1bba4SBjoern A. Zeeb 	.device_family = IWL_DEVICE_FAMILY_SC,
1529af1bba4SBjoern A. Zeeb 	.base_params = &iwl_sc_base_params,
1539af1bba4SBjoern A. Zeeb 	.mq_rx_supported = true,
1549af1bba4SBjoern A. Zeeb 	.rf_id = true,
1559af1bba4SBjoern A. Zeeb 	.gen2 = true,
1569af1bba4SBjoern A. Zeeb 	.integrated = true,
1579af1bba4SBjoern A. Zeeb 	.umac_prph_offset = 0x300000,
1589af1bba4SBjoern A. Zeeb 	.xtal_latency = 12000,
1599af1bba4SBjoern A. Zeeb 	.low_latency_xtal = true,
1609af1bba4SBjoern A. Zeeb 	.ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US,
1619af1bba4SBjoern A. Zeeb };
1629af1bba4SBjoern A. Zeeb 
1639af1bba4SBjoern A. Zeeb const char iwl_sc_name[] = "Intel(R) TBD Sc device";
1649af1bba4SBjoern A. Zeeb 
1659af1bba4SBjoern A. Zeeb const struct iwl_cfg iwl_cfg_sc = {
1669af1bba4SBjoern A. Zeeb 	.fw_name_mac = "sc",
1679af1bba4SBjoern A. Zeeb 	IWL_DEVICE_SC,
168*a4128aadSBjoern A. Zeeb };
169*a4128aadSBjoern A. Zeeb 
170*a4128aadSBjoern A. Zeeb const char iwl_sc2_name[] = "Intel(R) TBD Sc2 device";
171*a4128aadSBjoern A. Zeeb 
172*a4128aadSBjoern A. Zeeb const struct iwl_cfg iwl_cfg_sc2 = {
173*a4128aadSBjoern A. Zeeb 	.fw_name_mac = "sc2",
174*a4128aadSBjoern A. Zeeb 	IWL_DEVICE_SC,
175*a4128aadSBjoern A. Zeeb };
176*a4128aadSBjoern A. Zeeb 
177*a4128aadSBjoern A. Zeeb const char iwl_sc2f_name[] = "Intel(R) TBD Sc2f device";
178*a4128aadSBjoern A. Zeeb 
179*a4128aadSBjoern A. Zeeb const struct iwl_cfg iwl_cfg_sc2f = {
180*a4128aadSBjoern A. Zeeb 	.fw_name_mac = "sc2f",
181*a4128aadSBjoern A. Zeeb 	IWL_DEVICE_SC,
1829af1bba4SBjoern A. Zeeb };
1839af1bba4SBjoern A. Zeeb 
1849af1bba4SBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC_A_FM_B_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
1859af1bba4SBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC_A_FM_C_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
1869af1bba4SBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
1879af1bba4SBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
1889af1bba4SBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC_A_GF_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
1899af1bba4SBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC_A_GF4_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
1909af1bba4SBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
191*a4128aadSBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC2_A_FM_C_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
192*a4128aadSBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC2_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
193*a4128aadSBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC2F_A_FM_C_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
194*a4128aadSBjoern A. Zeeb MODULE_FIRMWARE(IWL_SC2F_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
195