18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: ISC */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2005-2011 Atheros Communications Inc.
48c2ecf20Sopenharmony_ci * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
58c2ecf20Sopenharmony_ci * Copyright (c) 2018 The Linux Foundation. All rights reserved.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef _HW_H_
98c2ecf20Sopenharmony_ci#define _HW_H_
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include "targaddrs.h"
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cienum ath10k_bus {
148c2ecf20Sopenharmony_ci	ATH10K_BUS_PCI,
158c2ecf20Sopenharmony_ci	ATH10K_BUS_AHB,
168c2ecf20Sopenharmony_ci	ATH10K_BUS_SDIO,
178c2ecf20Sopenharmony_ci	ATH10K_BUS_USB,
188c2ecf20Sopenharmony_ci	ATH10K_BUS_SNOC,
198c2ecf20Sopenharmony_ci};
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define ATH10K_FW_DIR			"ath10k"
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define QCA988X_2_0_DEVICE_ID_UBNT   (0x11ac)
248c2ecf20Sopenharmony_ci#define QCA988X_2_0_DEVICE_ID   (0x003c)
258c2ecf20Sopenharmony_ci#define QCA6164_2_1_DEVICE_ID   (0x0041)
268c2ecf20Sopenharmony_ci#define QCA6174_2_1_DEVICE_ID   (0x003e)
278c2ecf20Sopenharmony_ci#define QCA6174_3_2_DEVICE_ID   (0x0042)
288c2ecf20Sopenharmony_ci#define QCA99X0_2_0_DEVICE_ID   (0x0040)
298c2ecf20Sopenharmony_ci#define QCA9888_2_0_DEVICE_ID	(0x0056)
308c2ecf20Sopenharmony_ci#define QCA9984_1_0_DEVICE_ID	(0x0046)
318c2ecf20Sopenharmony_ci#define QCA9377_1_0_DEVICE_ID   (0x0042)
328c2ecf20Sopenharmony_ci#define QCA9887_1_0_DEVICE_ID   (0x0050)
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/* QCA988X 1.0 definitions (unsupported) */
358c2ecf20Sopenharmony_ci#define QCA988X_HW_1_0_CHIP_ID_REV	0x0
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* QCA988X 2.0 definitions */
388c2ecf20Sopenharmony_ci#define QCA988X_HW_2_0_VERSION		0x4100016c
398c2ecf20Sopenharmony_ci#define QCA988X_HW_2_0_CHIP_ID_REV	0x2
408c2ecf20Sopenharmony_ci#define QCA988X_HW_2_0_FW_DIR		ATH10K_FW_DIR "/QCA988X/hw2.0"
418c2ecf20Sopenharmony_ci#define QCA988X_HW_2_0_BOARD_DATA_FILE	"board.bin"
428c2ecf20Sopenharmony_ci#define QCA988X_HW_2_0_PATCH_LOAD_ADDR	0x1234
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/* QCA9887 1.0 definitions */
458c2ecf20Sopenharmony_ci#define QCA9887_HW_1_0_VERSION		0x4100016d
468c2ecf20Sopenharmony_ci#define QCA9887_HW_1_0_CHIP_ID_REV	0
478c2ecf20Sopenharmony_ci#define QCA9887_HW_1_0_FW_DIR		ATH10K_FW_DIR "/QCA9887/hw1.0"
488c2ecf20Sopenharmony_ci#define QCA9887_HW_1_0_BOARD_DATA_FILE	"board.bin"
498c2ecf20Sopenharmony_ci#define QCA9887_HW_1_0_PATCH_LOAD_ADDR	0x1234
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci/* QCA6174 target BMI version signatures */
528c2ecf20Sopenharmony_ci#define QCA6174_HW_1_0_VERSION		0x05000000
538c2ecf20Sopenharmony_ci#define QCA6174_HW_1_1_VERSION		0x05000001
548c2ecf20Sopenharmony_ci#define QCA6174_HW_1_3_VERSION		0x05000003
558c2ecf20Sopenharmony_ci#define QCA6174_HW_2_1_VERSION		0x05010000
568c2ecf20Sopenharmony_ci#define QCA6174_HW_3_0_VERSION		0x05020000
578c2ecf20Sopenharmony_ci#define QCA6174_HW_3_2_VERSION		0x05030000
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci/* QCA9377 target BMI version signatures */
608c2ecf20Sopenharmony_ci#define QCA9377_HW_1_0_DEV_VERSION	0x05020000
618c2ecf20Sopenharmony_ci#define QCA9377_HW_1_1_DEV_VERSION	0x05020001
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_cienum qca6174_pci_rev {
648c2ecf20Sopenharmony_ci	QCA6174_PCI_REV_1_1 = 0x11,
658c2ecf20Sopenharmony_ci	QCA6174_PCI_REV_1_3 = 0x13,
668c2ecf20Sopenharmony_ci	QCA6174_PCI_REV_2_0 = 0x20,
678c2ecf20Sopenharmony_ci	QCA6174_PCI_REV_3_0 = 0x30,
688c2ecf20Sopenharmony_ci};
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_cienum qca6174_chip_id_rev {
718c2ecf20Sopenharmony_ci	QCA6174_HW_1_0_CHIP_ID_REV = 0,
728c2ecf20Sopenharmony_ci	QCA6174_HW_1_1_CHIP_ID_REV = 1,
738c2ecf20Sopenharmony_ci	QCA6174_HW_1_3_CHIP_ID_REV = 2,
748c2ecf20Sopenharmony_ci	QCA6174_HW_2_1_CHIP_ID_REV = 4,
758c2ecf20Sopenharmony_ci	QCA6174_HW_2_2_CHIP_ID_REV = 5,
768c2ecf20Sopenharmony_ci	QCA6174_HW_3_0_CHIP_ID_REV = 8,
778c2ecf20Sopenharmony_ci	QCA6174_HW_3_1_CHIP_ID_REV = 9,
788c2ecf20Sopenharmony_ci	QCA6174_HW_3_2_CHIP_ID_REV = 10,
798c2ecf20Sopenharmony_ci};
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_cienum qca9377_chip_id_rev {
828c2ecf20Sopenharmony_ci	QCA9377_HW_1_0_CHIP_ID_REV = 0x0,
838c2ecf20Sopenharmony_ci	QCA9377_HW_1_1_CHIP_ID_REV = 0x1,
848c2ecf20Sopenharmony_ci};
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define QCA6174_HW_2_1_FW_DIR		ATH10K_FW_DIR "/QCA6174/hw2.1"
878c2ecf20Sopenharmony_ci#define QCA6174_HW_2_1_BOARD_DATA_FILE	"board.bin"
888c2ecf20Sopenharmony_ci#define QCA6174_HW_2_1_PATCH_LOAD_ADDR	0x1234
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#define QCA6174_HW_3_0_FW_DIR		ATH10K_FW_DIR "/QCA6174/hw3.0"
918c2ecf20Sopenharmony_ci#define QCA6174_HW_3_0_BOARD_DATA_FILE	"board.bin"
928c2ecf20Sopenharmony_ci#define QCA6174_HW_3_0_PATCH_LOAD_ADDR	0x1234
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci/* QCA99X0 1.0 definitions (unsupported) */
958c2ecf20Sopenharmony_ci#define QCA99X0_HW_1_0_CHIP_ID_REV     0x0
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci/* QCA99X0 2.0 definitions */
988c2ecf20Sopenharmony_ci#define QCA99X0_HW_2_0_DEV_VERSION     0x01000000
998c2ecf20Sopenharmony_ci#define QCA99X0_HW_2_0_CHIP_ID_REV     0x1
1008c2ecf20Sopenharmony_ci#define QCA99X0_HW_2_0_FW_DIR          ATH10K_FW_DIR "/QCA99X0/hw2.0"
1018c2ecf20Sopenharmony_ci#define QCA99X0_HW_2_0_BOARD_DATA_FILE "board.bin"
1028c2ecf20Sopenharmony_ci#define QCA99X0_HW_2_0_PATCH_LOAD_ADDR	0x1234
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/* QCA9984 1.0 defines */
1058c2ecf20Sopenharmony_ci#define QCA9984_HW_1_0_DEV_VERSION	0x1000000
1068c2ecf20Sopenharmony_ci#define QCA9984_HW_DEV_TYPE		0xa
1078c2ecf20Sopenharmony_ci#define QCA9984_HW_1_0_CHIP_ID_REV	0x0
1088c2ecf20Sopenharmony_ci#define QCA9984_HW_1_0_FW_DIR		ATH10K_FW_DIR "/QCA9984/hw1.0"
1098c2ecf20Sopenharmony_ci#define QCA9984_HW_1_0_BOARD_DATA_FILE "board.bin"
1108c2ecf20Sopenharmony_ci#define QCA9984_HW_1_0_EBOARD_DATA_FILE "eboard.bin"
1118c2ecf20Sopenharmony_ci#define QCA9984_HW_1_0_PATCH_LOAD_ADDR	0x1234
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci/* QCA9888 2.0 defines */
1148c2ecf20Sopenharmony_ci#define QCA9888_HW_2_0_DEV_VERSION	0x1000000
1158c2ecf20Sopenharmony_ci#define QCA9888_HW_DEV_TYPE		0xc
1168c2ecf20Sopenharmony_ci#define QCA9888_HW_2_0_CHIP_ID_REV	0x0
1178c2ecf20Sopenharmony_ci#define QCA9888_HW_2_0_FW_DIR		ATH10K_FW_DIR "/QCA9888/hw2.0"
1188c2ecf20Sopenharmony_ci#define QCA9888_HW_2_0_BOARD_DATA_FILE "board.bin"
1198c2ecf20Sopenharmony_ci#define QCA9888_HW_2_0_PATCH_LOAD_ADDR	0x1234
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci/* QCA9377 1.0 definitions */
1228c2ecf20Sopenharmony_ci#define QCA9377_HW_1_0_FW_DIR          ATH10K_FW_DIR "/QCA9377/hw1.0"
1238c2ecf20Sopenharmony_ci#define QCA9377_HW_1_0_BOARD_DATA_FILE "board.bin"
1248c2ecf20Sopenharmony_ci#define QCA9377_HW_1_0_PATCH_LOAD_ADDR	0x1234
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci/* QCA4019 1.0 definitions */
1278c2ecf20Sopenharmony_ci#define QCA4019_HW_1_0_DEV_VERSION     0x01000000
1288c2ecf20Sopenharmony_ci#define QCA4019_HW_1_0_FW_DIR          ATH10K_FW_DIR "/QCA4019/hw1.0"
1298c2ecf20Sopenharmony_ci#define QCA4019_HW_1_0_BOARD_DATA_FILE "board.bin"
1308c2ecf20Sopenharmony_ci#define QCA4019_HW_1_0_PATCH_LOAD_ADDR  0x1234
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci/* WCN3990 1.0 definitions */
1338c2ecf20Sopenharmony_ci#define WCN3990_HW_1_0_DEV_VERSION	ATH10K_HW_WCN3990
1348c2ecf20Sopenharmony_ci#define WCN3990_HW_1_0_FW_DIR		ATH10K_FW_DIR "/WCN3990/hw1.0"
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define ATH10K_FW_FILE_BASE		"firmware"
1378c2ecf20Sopenharmony_ci#define ATH10K_FW_API_MAX		6
1388c2ecf20Sopenharmony_ci#define ATH10K_FW_API_MIN		2
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci#define ATH10K_FW_API2_FILE		"firmware-2.bin"
1418c2ecf20Sopenharmony_ci#define ATH10K_FW_API3_FILE		"firmware-3.bin"
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci/* added support for ATH10K_FW_IE_WMI_OP_VERSION */
1448c2ecf20Sopenharmony_ci#define ATH10K_FW_API4_FILE		"firmware-4.bin"
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci/* HTT id conflict fix for management frames over HTT */
1478c2ecf20Sopenharmony_ci#define ATH10K_FW_API5_FILE		"firmware-5.bin"
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci/* the firmware-6.bin blob */
1508c2ecf20Sopenharmony_ci#define ATH10K_FW_API6_FILE		"firmware-6.bin"
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#define ATH10K_FW_UTF_FILE		"utf.bin"
1538c2ecf20Sopenharmony_ci#define ATH10K_FW_UTF_API2_FILE		"utf-2.bin"
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci#define ATH10K_FW_UTF_FILE_BASE		"utf"
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/* includes also the null byte */
1588c2ecf20Sopenharmony_ci#define ATH10K_FIRMWARE_MAGIC               "QCA-ATH10K"
1598c2ecf20Sopenharmony_ci#define ATH10K_BOARD_MAGIC                  "QCA-ATH10K-BOARD"
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci#define ATH10K_BOARD_API2_FILE         "board-2.bin"
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci#define REG_DUMP_COUNT_QCA988X 60
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_cistruct ath10k_fw_ie {
1668c2ecf20Sopenharmony_ci	__le32 id;
1678c2ecf20Sopenharmony_ci	__le32 len;
1688c2ecf20Sopenharmony_ci	u8 data[];
1698c2ecf20Sopenharmony_ci};
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_cienum ath10k_fw_ie_type {
1728c2ecf20Sopenharmony_ci	ATH10K_FW_IE_FW_VERSION = 0,
1738c2ecf20Sopenharmony_ci	ATH10K_FW_IE_TIMESTAMP = 1,
1748c2ecf20Sopenharmony_ci	ATH10K_FW_IE_FEATURES = 2,
1758c2ecf20Sopenharmony_ci	ATH10K_FW_IE_FW_IMAGE = 3,
1768c2ecf20Sopenharmony_ci	ATH10K_FW_IE_OTP_IMAGE = 4,
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci	/* WMI "operations" interface version, 32 bit value. Supported from
1798c2ecf20Sopenharmony_ci	 * FW API 4 and above.
1808c2ecf20Sopenharmony_ci	 */
1818c2ecf20Sopenharmony_ci	ATH10K_FW_IE_WMI_OP_VERSION = 5,
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci	/* HTT "operations" interface version, 32 bit value. Supported from
1848c2ecf20Sopenharmony_ci	 * FW API 5 and above.
1858c2ecf20Sopenharmony_ci	 */
1868c2ecf20Sopenharmony_ci	ATH10K_FW_IE_HTT_OP_VERSION = 6,
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci	/* Code swap image for firmware binary */
1898c2ecf20Sopenharmony_ci	ATH10K_FW_IE_FW_CODE_SWAP_IMAGE = 7,
1908c2ecf20Sopenharmony_ci};
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_cienum ath10k_fw_wmi_op_version {
1938c2ecf20Sopenharmony_ci	ATH10K_FW_WMI_OP_VERSION_UNSET = 0,
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci	ATH10K_FW_WMI_OP_VERSION_MAIN = 1,
1968c2ecf20Sopenharmony_ci	ATH10K_FW_WMI_OP_VERSION_10_1 = 2,
1978c2ecf20Sopenharmony_ci	ATH10K_FW_WMI_OP_VERSION_10_2 = 3,
1988c2ecf20Sopenharmony_ci	ATH10K_FW_WMI_OP_VERSION_TLV = 4,
1998c2ecf20Sopenharmony_ci	ATH10K_FW_WMI_OP_VERSION_10_2_4 = 5,
2008c2ecf20Sopenharmony_ci	ATH10K_FW_WMI_OP_VERSION_10_4 = 6,
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci	/* keep last */
2038c2ecf20Sopenharmony_ci	ATH10K_FW_WMI_OP_VERSION_MAX,
2048c2ecf20Sopenharmony_ci};
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_cienum ath10k_fw_htt_op_version {
2078c2ecf20Sopenharmony_ci	ATH10K_FW_HTT_OP_VERSION_UNSET = 0,
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci	ATH10K_FW_HTT_OP_VERSION_MAIN = 1,
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci	/* also used in 10.2 and 10.2.4 branches */
2128c2ecf20Sopenharmony_ci	ATH10K_FW_HTT_OP_VERSION_10_1 = 2,
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci	ATH10K_FW_HTT_OP_VERSION_TLV = 3,
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci	ATH10K_FW_HTT_OP_VERSION_10_4 = 4,
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci	/* keep last */
2198c2ecf20Sopenharmony_ci	ATH10K_FW_HTT_OP_VERSION_MAX,
2208c2ecf20Sopenharmony_ci};
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_cienum ath10k_bd_ie_type {
2238c2ecf20Sopenharmony_ci	/* contains sub IEs of enum ath10k_bd_ie_board_type */
2248c2ecf20Sopenharmony_ci	ATH10K_BD_IE_BOARD = 0,
2258c2ecf20Sopenharmony_ci	ATH10K_BD_IE_BOARD_EXT = 1,
2268c2ecf20Sopenharmony_ci};
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_cienum ath10k_bd_ie_board_type {
2298c2ecf20Sopenharmony_ci	ATH10K_BD_IE_BOARD_NAME = 0,
2308c2ecf20Sopenharmony_ci	ATH10K_BD_IE_BOARD_DATA = 1,
2318c2ecf20Sopenharmony_ci};
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_cienum ath10k_hw_rev {
2348c2ecf20Sopenharmony_ci	ATH10K_HW_QCA988X,
2358c2ecf20Sopenharmony_ci	ATH10K_HW_QCA6174,
2368c2ecf20Sopenharmony_ci	ATH10K_HW_QCA99X0,
2378c2ecf20Sopenharmony_ci	ATH10K_HW_QCA9888,
2388c2ecf20Sopenharmony_ci	ATH10K_HW_QCA9984,
2398c2ecf20Sopenharmony_ci	ATH10K_HW_QCA9377,
2408c2ecf20Sopenharmony_ci	ATH10K_HW_QCA4019,
2418c2ecf20Sopenharmony_ci	ATH10K_HW_QCA9887,
2428c2ecf20Sopenharmony_ci	ATH10K_HW_WCN3990,
2438c2ecf20Sopenharmony_ci};
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_cistruct ath10k_hw_regs {
2468c2ecf20Sopenharmony_ci	u32 rtc_soc_base_address;
2478c2ecf20Sopenharmony_ci	u32 rtc_wmac_base_address;
2488c2ecf20Sopenharmony_ci	u32 soc_core_base_address;
2498c2ecf20Sopenharmony_ci	u32 wlan_mac_base_address;
2508c2ecf20Sopenharmony_ci	u32 ce_wrapper_base_address;
2518c2ecf20Sopenharmony_ci	u32 ce0_base_address;
2528c2ecf20Sopenharmony_ci	u32 ce1_base_address;
2538c2ecf20Sopenharmony_ci	u32 ce2_base_address;
2548c2ecf20Sopenharmony_ci	u32 ce3_base_address;
2558c2ecf20Sopenharmony_ci	u32 ce4_base_address;
2568c2ecf20Sopenharmony_ci	u32 ce5_base_address;
2578c2ecf20Sopenharmony_ci	u32 ce6_base_address;
2588c2ecf20Sopenharmony_ci	u32 ce7_base_address;
2598c2ecf20Sopenharmony_ci	u32 ce8_base_address;
2608c2ecf20Sopenharmony_ci	u32 ce9_base_address;
2618c2ecf20Sopenharmony_ci	u32 ce10_base_address;
2628c2ecf20Sopenharmony_ci	u32 ce11_base_address;
2638c2ecf20Sopenharmony_ci	u32 soc_reset_control_si0_rst_mask;
2648c2ecf20Sopenharmony_ci	u32 soc_reset_control_ce_rst_mask;
2658c2ecf20Sopenharmony_ci	u32 soc_chip_id_address;
2668c2ecf20Sopenharmony_ci	u32 scratch_3_address;
2678c2ecf20Sopenharmony_ci	u32 fw_indicator_address;
2688c2ecf20Sopenharmony_ci	u32 pcie_local_base_address;
2698c2ecf20Sopenharmony_ci	u32 ce_wrap_intr_sum_host_msi_lsb;
2708c2ecf20Sopenharmony_ci	u32 ce_wrap_intr_sum_host_msi_mask;
2718c2ecf20Sopenharmony_ci	u32 pcie_intr_fw_mask;
2728c2ecf20Sopenharmony_ci	u32 pcie_intr_ce_mask_all;
2738c2ecf20Sopenharmony_ci	u32 pcie_intr_clr_address;
2748c2ecf20Sopenharmony_ci	u32 cpu_pll_init_address;
2758c2ecf20Sopenharmony_ci	u32 cpu_speed_address;
2768c2ecf20Sopenharmony_ci	u32 core_clk_div_address;
2778c2ecf20Sopenharmony_ci};
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ciextern const struct ath10k_hw_regs qca988x_regs;
2808c2ecf20Sopenharmony_ciextern const struct ath10k_hw_regs qca6174_regs;
2818c2ecf20Sopenharmony_ciextern const struct ath10k_hw_regs qca99x0_regs;
2828c2ecf20Sopenharmony_ciextern const struct ath10k_hw_regs qca4019_regs;
2838c2ecf20Sopenharmony_ciextern const struct ath10k_hw_regs wcn3990_regs;
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_cistruct ath10k_hw_ce_regs_addr_map {
2868c2ecf20Sopenharmony_ci	u32 msb;
2878c2ecf20Sopenharmony_ci	u32 lsb;
2888c2ecf20Sopenharmony_ci	u32 mask;
2898c2ecf20Sopenharmony_ci};
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_cistruct ath10k_hw_ce_ctrl1 {
2928c2ecf20Sopenharmony_ci	u32 addr;
2938c2ecf20Sopenharmony_ci	u32 hw_mask;
2948c2ecf20Sopenharmony_ci	u32 sw_mask;
2958c2ecf20Sopenharmony_ci	u32 hw_wr_mask;
2968c2ecf20Sopenharmony_ci	u32 sw_wr_mask;
2978c2ecf20Sopenharmony_ci	u32 reset_mask;
2988c2ecf20Sopenharmony_ci	u32 reset;
2998c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_regs_addr_map *src_ring;
3008c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_regs_addr_map *dst_ring;
3018c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_regs_addr_map *dmax; };
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_cistruct ath10k_hw_ce_cmd_halt {
3048c2ecf20Sopenharmony_ci	u32 status_reset;
3058c2ecf20Sopenharmony_ci	u32 msb;
3068c2ecf20Sopenharmony_ci	u32 mask;
3078c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_regs_addr_map *status; };
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_cistruct ath10k_hw_ce_host_ie {
3108c2ecf20Sopenharmony_ci	u32 copy_complete_reset;
3118c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_regs_addr_map *copy_complete; };
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_cistruct ath10k_hw_ce_host_wm_regs {
3148c2ecf20Sopenharmony_ci	u32 dstr_lmask;
3158c2ecf20Sopenharmony_ci	u32 dstr_hmask;
3168c2ecf20Sopenharmony_ci	u32 srcr_lmask;
3178c2ecf20Sopenharmony_ci	u32 srcr_hmask;
3188c2ecf20Sopenharmony_ci	u32 cc_mask;
3198c2ecf20Sopenharmony_ci	u32 wm_mask;
3208c2ecf20Sopenharmony_ci	u32 addr;
3218c2ecf20Sopenharmony_ci};
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_cistruct ath10k_hw_ce_misc_regs {
3248c2ecf20Sopenharmony_ci	u32 axi_err;
3258c2ecf20Sopenharmony_ci	u32 dstr_add_err;
3268c2ecf20Sopenharmony_ci	u32 srcr_len_err;
3278c2ecf20Sopenharmony_ci	u32 dstr_mlen_vio;
3288c2ecf20Sopenharmony_ci	u32 dstr_overflow;
3298c2ecf20Sopenharmony_ci	u32 srcr_overflow;
3308c2ecf20Sopenharmony_ci	u32 err_mask;
3318c2ecf20Sopenharmony_ci	u32 addr;
3328c2ecf20Sopenharmony_ci};
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_cistruct ath10k_hw_ce_dst_src_wm_regs {
3358c2ecf20Sopenharmony_ci	u32 addr;
3368c2ecf20Sopenharmony_ci	u32 low_rst;
3378c2ecf20Sopenharmony_ci	u32 high_rst;
3388c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_regs_addr_map *wm_low;
3398c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_regs_addr_map *wm_high; };
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_cistruct ath10k_hw_ce_ctrl1_upd {
3428c2ecf20Sopenharmony_ci	u32 shift;
3438c2ecf20Sopenharmony_ci	u32 mask;
3448c2ecf20Sopenharmony_ci	u32 enable;
3458c2ecf20Sopenharmony_ci};
3468c2ecf20Sopenharmony_ci
3478c2ecf20Sopenharmony_cistruct ath10k_hw_ce_regs {
3488c2ecf20Sopenharmony_ci	u32 sr_base_addr_lo;
3498c2ecf20Sopenharmony_ci	u32 sr_base_addr_hi;
3508c2ecf20Sopenharmony_ci	u32 sr_size_addr;
3518c2ecf20Sopenharmony_ci	u32 dr_base_addr_lo;
3528c2ecf20Sopenharmony_ci	u32 dr_base_addr_hi;
3538c2ecf20Sopenharmony_ci	u32 dr_size_addr;
3548c2ecf20Sopenharmony_ci	u32 ce_cmd_addr;
3558c2ecf20Sopenharmony_ci	u32 misc_ie_addr;
3568c2ecf20Sopenharmony_ci	u32 sr_wr_index_addr;
3578c2ecf20Sopenharmony_ci	u32 dst_wr_index_addr;
3588c2ecf20Sopenharmony_ci	u32 current_srri_addr;
3598c2ecf20Sopenharmony_ci	u32 current_drri_addr;
3608c2ecf20Sopenharmony_ci	u32 ddr_addr_for_rri_low;
3618c2ecf20Sopenharmony_ci	u32 ddr_addr_for_rri_high;
3628c2ecf20Sopenharmony_ci	u32 ce_rri_low;
3638c2ecf20Sopenharmony_ci	u32 ce_rri_high;
3648c2ecf20Sopenharmony_ci	u32 host_ie_addr;
3658c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_host_wm_regs *wm_regs;
3668c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_misc_regs *misc_regs;
3678c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_ctrl1 *ctrl1_regs;
3688c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_cmd_halt *cmd_halt;
3698c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_host_ie *host_ie;
3708c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_dst_src_wm_regs *wm_srcr;
3718c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_dst_src_wm_regs *wm_dstr;
3728c2ecf20Sopenharmony_ci	struct ath10k_hw_ce_ctrl1_upd *upd;
3738c2ecf20Sopenharmony_ci};
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_cistruct ath10k_hw_values {
3768c2ecf20Sopenharmony_ci	u32 rtc_state_val_on;
3778c2ecf20Sopenharmony_ci	u8 ce_count;
3788c2ecf20Sopenharmony_ci	u8 msi_assign_ce_max;
3798c2ecf20Sopenharmony_ci	u8 num_target_ce_config_wlan;
3808c2ecf20Sopenharmony_ci	u16 ce_desc_meta_data_mask;
3818c2ecf20Sopenharmony_ci	u8 ce_desc_meta_data_lsb;
3828c2ecf20Sopenharmony_ci	u32 rfkill_pin;
3838c2ecf20Sopenharmony_ci	u32 rfkill_cfg;
3848c2ecf20Sopenharmony_ci	bool rfkill_on_level;
3858c2ecf20Sopenharmony_ci};
3868c2ecf20Sopenharmony_ci
3878c2ecf20Sopenharmony_ciextern const struct ath10k_hw_values qca988x_values;
3888c2ecf20Sopenharmony_ciextern const struct ath10k_hw_values qca6174_values;
3898c2ecf20Sopenharmony_ciextern const struct ath10k_hw_values qca99x0_values;
3908c2ecf20Sopenharmony_ciextern const struct ath10k_hw_values qca9888_values;
3918c2ecf20Sopenharmony_ciextern const struct ath10k_hw_values qca4019_values;
3928c2ecf20Sopenharmony_ciextern const struct ath10k_hw_values wcn3990_values;
3938c2ecf20Sopenharmony_ciextern const struct ath10k_hw_ce_regs wcn3990_ce_regs;
3948c2ecf20Sopenharmony_ciextern const struct ath10k_hw_ce_regs qcax_ce_regs;
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_civoid ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
3978c2ecf20Sopenharmony_ci				u32 cc, u32 rcc, u32 cc_prev, u32 rcc_prev);
3988c2ecf20Sopenharmony_ci
3998c2ecf20Sopenharmony_ciint ath10k_hw_diag_fast_download(struct ath10k *ar,
4008c2ecf20Sopenharmony_ci				 u32 address,
4018c2ecf20Sopenharmony_ci				 const void *buffer,
4028c2ecf20Sopenharmony_ci				 u32 length);
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_ci#define QCA_REV_988X(ar) ((ar)->hw_rev == ATH10K_HW_QCA988X)
4058c2ecf20Sopenharmony_ci#define QCA_REV_9887(ar) ((ar)->hw_rev == ATH10K_HW_QCA9887)
4068c2ecf20Sopenharmony_ci#define QCA_REV_6174(ar) ((ar)->hw_rev == ATH10K_HW_QCA6174)
4078c2ecf20Sopenharmony_ci#define QCA_REV_99X0(ar) ((ar)->hw_rev == ATH10K_HW_QCA99X0)
4088c2ecf20Sopenharmony_ci#define QCA_REV_9888(ar) ((ar)->hw_rev == ATH10K_HW_QCA9888)
4098c2ecf20Sopenharmony_ci#define QCA_REV_9984(ar) ((ar)->hw_rev == ATH10K_HW_QCA9984)
4108c2ecf20Sopenharmony_ci#define QCA_REV_9377(ar) ((ar)->hw_rev == ATH10K_HW_QCA9377)
4118c2ecf20Sopenharmony_ci#define QCA_REV_40XX(ar) ((ar)->hw_rev == ATH10K_HW_QCA4019)
4128c2ecf20Sopenharmony_ci#define QCA_REV_WCN3990(ar) ((ar)->hw_rev == ATH10K_HW_WCN3990)
4138c2ecf20Sopenharmony_ci
4148c2ecf20Sopenharmony_ci/* Known peculiarities:
4158c2ecf20Sopenharmony_ci *  - raw appears in nwifi decap, raw and nwifi appear in ethernet decap
4168c2ecf20Sopenharmony_ci *  - raw have FCS, nwifi doesn't
4178c2ecf20Sopenharmony_ci *  - ethernet frames have 802.11 header decapped and parts (base hdr, cipher
4188c2ecf20Sopenharmony_ci *    param, llc/snap) are aligned to 4byte boundaries each
4198c2ecf20Sopenharmony_ci */
4208c2ecf20Sopenharmony_cienum ath10k_hw_txrx_mode {
4218c2ecf20Sopenharmony_ci	ATH10K_HW_TXRX_RAW = 0,
4228c2ecf20Sopenharmony_ci
4238c2ecf20Sopenharmony_ci	/* Native Wifi decap mode is used to align IP frames to 4-byte
4248c2ecf20Sopenharmony_ci	 * boundaries and avoid a very expensive re-alignment in mac80211.
4258c2ecf20Sopenharmony_ci	 */
4268c2ecf20Sopenharmony_ci	ATH10K_HW_TXRX_NATIVE_WIFI = 1,
4278c2ecf20Sopenharmony_ci	ATH10K_HW_TXRX_ETHERNET = 2,
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_ci	/* Valid for HTT >= 3.0. Used for management frames in TX_FRM. */
4308c2ecf20Sopenharmony_ci	ATH10K_HW_TXRX_MGMT = 3,
4318c2ecf20Sopenharmony_ci};
4328c2ecf20Sopenharmony_ci
4338c2ecf20Sopenharmony_cienum ath10k_mcast2ucast_mode {
4348c2ecf20Sopenharmony_ci	ATH10K_MCAST2UCAST_DISABLED = 0,
4358c2ecf20Sopenharmony_ci	ATH10K_MCAST2UCAST_ENABLED = 1,
4368c2ecf20Sopenharmony_ci};
4378c2ecf20Sopenharmony_ci
4388c2ecf20Sopenharmony_cienum ath10k_hw_rate_ofdm {
4398c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_OFDM_48M = 0,
4408c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_OFDM_24M,
4418c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_OFDM_12M,
4428c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_OFDM_6M,
4438c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_OFDM_54M,
4448c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_OFDM_36M,
4458c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_OFDM_18M,
4468c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_OFDM_9M,
4478c2ecf20Sopenharmony_ci};
4488c2ecf20Sopenharmony_ci
4498c2ecf20Sopenharmony_cienum ath10k_hw_rate_cck {
4508c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_CCK_LP_11M = 0,
4518c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_CCK_LP_5_5M,
4528c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_CCK_LP_2M,
4538c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_CCK_LP_1M,
4548c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_CCK_SP_11M,
4558c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_CCK_SP_5_5M,
4568c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_CCK_SP_2M,
4578c2ecf20Sopenharmony_ci};
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_cienum ath10k_hw_rate_rev2_cck {
4608c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_REV2_CCK_LP_1M = 1,
4618c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_REV2_CCK_LP_2M,
4628c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_REV2_CCK_LP_5_5M,
4638c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_REV2_CCK_LP_11M,
4648c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_REV2_CCK_SP_2M,
4658c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_REV2_CCK_SP_5_5M,
4668c2ecf20Sopenharmony_ci	ATH10K_HW_RATE_REV2_CCK_SP_11M,
4678c2ecf20Sopenharmony_ci};
4688c2ecf20Sopenharmony_ci
4698c2ecf20Sopenharmony_cienum ath10k_hw_cc_wraparound_type {
4708c2ecf20Sopenharmony_ci	ATH10K_HW_CC_WRAP_DISABLED = 0,
4718c2ecf20Sopenharmony_ci
4728c2ecf20Sopenharmony_ci	/* This type is when the HW chip has a quirky Cycle Counter
4738c2ecf20Sopenharmony_ci	 * wraparound which resets to 0x7fffffff instead of 0. All
4748c2ecf20Sopenharmony_ci	 * other CC related counters (e.g. Rx Clear Count) are divided
4758c2ecf20Sopenharmony_ci	 * by 2 so they never wraparound themselves.
4768c2ecf20Sopenharmony_ci	 */
4778c2ecf20Sopenharmony_ci	ATH10K_HW_CC_WRAP_SHIFTED_ALL = 1,
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci	/* Each hw counter wrapsaround independently. When the
4808c2ecf20Sopenharmony_ci	 * counter overflows the repestive counter is right shifted
4818c2ecf20Sopenharmony_ci	 * by 1, i.e reset to 0x7fffffff, and other counters will be
4828c2ecf20Sopenharmony_ci	 * running unaffected. In this type of wraparound, it should
4838c2ecf20Sopenharmony_ci	 * be possible to report accurate Rx busy time unlike the
4848c2ecf20Sopenharmony_ci	 * first type.
4858c2ecf20Sopenharmony_ci	 */
4868c2ecf20Sopenharmony_ci	ATH10K_HW_CC_WRAP_SHIFTED_EACH = 2,
4878c2ecf20Sopenharmony_ci};
4888c2ecf20Sopenharmony_ci
4898c2ecf20Sopenharmony_cienum ath10k_hw_refclk_speed {
4908c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_UNKNOWN = -1,
4918c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_48_MHZ = 0,
4928c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_19_2_MHZ = 1,
4938c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_24_MHZ = 2,
4948c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_26_MHZ = 3,
4958c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_37_4_MHZ = 4,
4968c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_38_4_MHZ = 5,
4978c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_40_MHZ = 6,
4988c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_52_MHZ = 7,
4998c2ecf20Sopenharmony_ci
5008c2ecf20Sopenharmony_ci	/* must be the last one */
5018c2ecf20Sopenharmony_ci	ATH10K_HW_REFCLK_COUNT,
5028c2ecf20Sopenharmony_ci};
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_cistruct ath10k_hw_clk_params {
5058c2ecf20Sopenharmony_ci	u32 refclk;
5068c2ecf20Sopenharmony_ci	u32 div;
5078c2ecf20Sopenharmony_ci	u32 rnfrac;
5088c2ecf20Sopenharmony_ci	u32 settle_time;
5098c2ecf20Sopenharmony_ci	u32 refdiv;
5108c2ecf20Sopenharmony_ci	u32 outdiv;
5118c2ecf20Sopenharmony_ci};
5128c2ecf20Sopenharmony_ci
5138c2ecf20Sopenharmony_cistruct ath10k_hw_params {
5148c2ecf20Sopenharmony_ci	u32 id;
5158c2ecf20Sopenharmony_ci	u16 dev_id;
5168c2ecf20Sopenharmony_ci	enum ath10k_bus bus;
5178c2ecf20Sopenharmony_ci	const char *name;
5188c2ecf20Sopenharmony_ci	u32 patch_load_addr;
5198c2ecf20Sopenharmony_ci	int uart_pin;
5208c2ecf20Sopenharmony_ci	u32 otp_exe_param;
5218c2ecf20Sopenharmony_ci
5228c2ecf20Sopenharmony_ci	/* Type of hw cycle counter wraparound logic, for more info
5238c2ecf20Sopenharmony_ci	 * refer enum ath10k_hw_cc_wraparound_type.
5248c2ecf20Sopenharmony_ci	 */
5258c2ecf20Sopenharmony_ci	enum ath10k_hw_cc_wraparound_type cc_wraparound_type;
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci	/* Some of chip expects fragment descriptor to be continuous
5288c2ecf20Sopenharmony_ci	 * memory for any TX operation. Set continuous_frag_desc flag
5298c2ecf20Sopenharmony_ci	 * for the hardware which have such requirement.
5308c2ecf20Sopenharmony_ci	 */
5318c2ecf20Sopenharmony_ci	bool continuous_frag_desc;
5328c2ecf20Sopenharmony_ci
5338c2ecf20Sopenharmony_ci	/* CCK hardware rate table mapping for the newer chipsets
5348c2ecf20Sopenharmony_ci	 * like QCA99X0, QCA4019 got revised. The CCK h/w rate values
5358c2ecf20Sopenharmony_ci	 * are in a proper order with respect to the rate/preamble
5368c2ecf20Sopenharmony_ci	 */
5378c2ecf20Sopenharmony_ci	bool cck_rate_map_rev2;
5388c2ecf20Sopenharmony_ci
5398c2ecf20Sopenharmony_ci	u32 channel_counters_freq_hz;
5408c2ecf20Sopenharmony_ci
5418c2ecf20Sopenharmony_ci	/* Mgmt tx descriptors threshold for limiting probe response
5428c2ecf20Sopenharmony_ci	 * frames.
5438c2ecf20Sopenharmony_ci	 */
5448c2ecf20Sopenharmony_ci	u32 max_probe_resp_desc_thres;
5458c2ecf20Sopenharmony_ci
5468c2ecf20Sopenharmony_ci	u32 tx_chain_mask;
5478c2ecf20Sopenharmony_ci	u32 rx_chain_mask;
5488c2ecf20Sopenharmony_ci	u32 max_spatial_stream;
5498c2ecf20Sopenharmony_ci	u32 cal_data_len;
5508c2ecf20Sopenharmony_ci
5518c2ecf20Sopenharmony_ci	struct ath10k_hw_params_fw {
5528c2ecf20Sopenharmony_ci		const char *dir;
5538c2ecf20Sopenharmony_ci		const char *board;
5548c2ecf20Sopenharmony_ci		size_t board_size;
5558c2ecf20Sopenharmony_ci		const char *eboard;
5568c2ecf20Sopenharmony_ci		size_t ext_board_size;
5578c2ecf20Sopenharmony_ci		size_t board_ext_size;
5588c2ecf20Sopenharmony_ci	} fw;
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_ci	/* qca99x0 family chips deliver broadcast/multicast management
5618c2ecf20Sopenharmony_ci	 * frames encrypted and expect software do decryption.
5628c2ecf20Sopenharmony_ci	 */
5638c2ecf20Sopenharmony_ci	bool sw_decrypt_mcast_mgmt;
5648c2ecf20Sopenharmony_ci
5658c2ecf20Sopenharmony_ci	const struct ath10k_hw_ops *hw_ops;
5668c2ecf20Sopenharmony_ci
5678c2ecf20Sopenharmony_ci	/* Number of bytes used for alignment in rx_hdr_status of rx desc. */
5688c2ecf20Sopenharmony_ci	int decap_align_bytes;
5698c2ecf20Sopenharmony_ci
5708c2ecf20Sopenharmony_ci	/* hw specific clock control parameters */
5718c2ecf20Sopenharmony_ci	const struct ath10k_hw_clk_params *hw_clk;
5728c2ecf20Sopenharmony_ci	int target_cpu_freq;
5738c2ecf20Sopenharmony_ci
5748c2ecf20Sopenharmony_ci	/* Number of bytes to be discarded for each FFT sample */
5758c2ecf20Sopenharmony_ci	int spectral_bin_discard;
5768c2ecf20Sopenharmony_ci
5778c2ecf20Sopenharmony_ci	/* The board may have a restricted NSS for 160 or 80+80 vs what it
5788c2ecf20Sopenharmony_ci	 * can do for 80Mhz.
5798c2ecf20Sopenharmony_ci	 */
5808c2ecf20Sopenharmony_ci	int vht160_mcs_rx_highest;
5818c2ecf20Sopenharmony_ci	int vht160_mcs_tx_highest;
5828c2ecf20Sopenharmony_ci
5838c2ecf20Sopenharmony_ci	/* Number of ciphers supported (i.e First N) in cipher_suites array */
5848c2ecf20Sopenharmony_ci	int n_cipher_suites;
5858c2ecf20Sopenharmony_ci
5868c2ecf20Sopenharmony_ci	u32 num_peers;
5878c2ecf20Sopenharmony_ci	u32 ast_skid_limit;
5888c2ecf20Sopenharmony_ci	u32 num_wds_entries;
5898c2ecf20Sopenharmony_ci
5908c2ecf20Sopenharmony_ci	/* Targets supporting physical addressing capability above 32-bits */
5918c2ecf20Sopenharmony_ci	bool target_64bit;
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_ci	/* Target rx ring fill level */
5948c2ecf20Sopenharmony_ci	u32 rx_ring_fill_level;
5958c2ecf20Sopenharmony_ci
5968c2ecf20Sopenharmony_ci	/* target supporting shadow register for ce write */
5978c2ecf20Sopenharmony_ci	bool shadow_reg_support;
5988c2ecf20Sopenharmony_ci
5998c2ecf20Sopenharmony_ci	/* target supporting retention restore on ddr */
6008c2ecf20Sopenharmony_ci	bool rri_on_ddr;
6018c2ecf20Sopenharmony_ci
6028c2ecf20Sopenharmony_ci	/* Number of bytes to be the offset for each FFT sample */
6038c2ecf20Sopenharmony_ci	int spectral_bin_offset;
6048c2ecf20Sopenharmony_ci
6058c2ecf20Sopenharmony_ci	/* targets which require hw filter reset during boot up,
6068c2ecf20Sopenharmony_ci	 * to avoid it sending spurious acks.
6078c2ecf20Sopenharmony_ci	 */
6088c2ecf20Sopenharmony_ci	bool hw_filter_reset_required;
6098c2ecf20Sopenharmony_ci
6108c2ecf20Sopenharmony_ci	/* target supporting fw download via diag ce */
6118c2ecf20Sopenharmony_ci	bool fw_diag_ce_download;
6128c2ecf20Sopenharmony_ci
6138c2ecf20Sopenharmony_ci	/* target supporting fw download via large size BMI */
6148c2ecf20Sopenharmony_ci	bool bmi_large_size_download;
6158c2ecf20Sopenharmony_ci
6168c2ecf20Sopenharmony_ci	/* need to set uart pin if disable uart print, workaround for a
6178c2ecf20Sopenharmony_ci	 * firmware bug
6188c2ecf20Sopenharmony_ci	 */
6198c2ecf20Sopenharmony_ci	bool uart_pin_workaround;
6208c2ecf20Sopenharmony_ci
6218c2ecf20Sopenharmony_ci	/* Workaround for the credit size calculation */
6228c2ecf20Sopenharmony_ci	bool credit_size_workaround;
6238c2ecf20Sopenharmony_ci
6248c2ecf20Sopenharmony_ci	/* tx stats support over pktlog */
6258c2ecf20Sopenharmony_ci	bool tx_stats_over_pktlog;
6268c2ecf20Sopenharmony_ci
6278c2ecf20Sopenharmony_ci	/* provides bitrates for sta_statistics using WMI_TLV_PEER_STATS_INFO_EVENTID */
6288c2ecf20Sopenharmony_ci	bool supports_peer_stats_info;
6298c2ecf20Sopenharmony_ci};
6308c2ecf20Sopenharmony_ci
6318c2ecf20Sopenharmony_cistruct htt_rx_desc;
6328c2ecf20Sopenharmony_cistruct htt_resp;
6338c2ecf20Sopenharmony_cistruct htt_data_tx_completion_ext;
6348c2ecf20Sopenharmony_ci
6358c2ecf20Sopenharmony_ci/* Defines needed for Rx descriptor abstraction */
6368c2ecf20Sopenharmony_cistruct ath10k_hw_ops {
6378c2ecf20Sopenharmony_ci	int (*rx_desc_get_l3_pad_bytes)(struct htt_rx_desc *rxd);
6388c2ecf20Sopenharmony_ci	void (*set_coverage_class)(struct ath10k *ar, s16 value);
6398c2ecf20Sopenharmony_ci	int (*enable_pll_clk)(struct ath10k *ar);
6408c2ecf20Sopenharmony_ci	bool (*rx_desc_get_msdu_limit_error)(struct htt_rx_desc *rxd);
6418c2ecf20Sopenharmony_ci	int (*tx_data_rssi_pad_bytes)(struct htt_resp *htt);
6428c2ecf20Sopenharmony_ci	int (*is_rssi_enable)(struct htt_resp *resp);
6438c2ecf20Sopenharmony_ci};
6448c2ecf20Sopenharmony_ci
6458c2ecf20Sopenharmony_ciextern const struct ath10k_hw_ops qca988x_ops;
6468c2ecf20Sopenharmony_ciextern const struct ath10k_hw_ops qca99x0_ops;
6478c2ecf20Sopenharmony_ciextern const struct ath10k_hw_ops qca6174_ops;
6488c2ecf20Sopenharmony_ciextern const struct ath10k_hw_ops qca6174_sdio_ops;
6498c2ecf20Sopenharmony_ciextern const struct ath10k_hw_ops wcn3990_ops;
6508c2ecf20Sopenharmony_ci
6518c2ecf20Sopenharmony_ciextern const struct ath10k_hw_clk_params qca6174_clk[];
6528c2ecf20Sopenharmony_ci
6538c2ecf20Sopenharmony_cistatic inline int
6548c2ecf20Sopenharmony_ciath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw,
6558c2ecf20Sopenharmony_ci				struct htt_rx_desc *rxd)
6568c2ecf20Sopenharmony_ci{
6578c2ecf20Sopenharmony_ci	if (hw->hw_ops->rx_desc_get_l3_pad_bytes)
6588c2ecf20Sopenharmony_ci		return hw->hw_ops->rx_desc_get_l3_pad_bytes(rxd);
6598c2ecf20Sopenharmony_ci	return 0;
6608c2ecf20Sopenharmony_ci}
6618c2ecf20Sopenharmony_ci
6628c2ecf20Sopenharmony_cistatic inline bool
6638c2ecf20Sopenharmony_ciath10k_rx_desc_msdu_limit_error(struct ath10k_hw_params *hw,
6648c2ecf20Sopenharmony_ci				struct htt_rx_desc *rxd)
6658c2ecf20Sopenharmony_ci{
6668c2ecf20Sopenharmony_ci	if (hw->hw_ops->rx_desc_get_msdu_limit_error)
6678c2ecf20Sopenharmony_ci		return hw->hw_ops->rx_desc_get_msdu_limit_error(rxd);
6688c2ecf20Sopenharmony_ci	return false;
6698c2ecf20Sopenharmony_ci}
6708c2ecf20Sopenharmony_ci
6718c2ecf20Sopenharmony_cistatic inline int
6728c2ecf20Sopenharmony_ciath10k_tx_data_rssi_get_pad_bytes(struct ath10k_hw_params *hw,
6738c2ecf20Sopenharmony_ci				  struct htt_resp *htt)
6748c2ecf20Sopenharmony_ci{
6758c2ecf20Sopenharmony_ci	if (hw->hw_ops->tx_data_rssi_pad_bytes)
6768c2ecf20Sopenharmony_ci		return hw->hw_ops->tx_data_rssi_pad_bytes(htt);
6778c2ecf20Sopenharmony_ci	return 0;
6788c2ecf20Sopenharmony_ci}
6798c2ecf20Sopenharmony_ci
6808c2ecf20Sopenharmony_cistatic inline int
6818c2ecf20Sopenharmony_ciath10k_is_rssi_enable(struct ath10k_hw_params *hw,
6828c2ecf20Sopenharmony_ci		      struct htt_resp *resp)
6838c2ecf20Sopenharmony_ci{
6848c2ecf20Sopenharmony_ci	if (hw->hw_ops->is_rssi_enable)
6858c2ecf20Sopenharmony_ci		return hw->hw_ops->is_rssi_enable(resp);
6868c2ecf20Sopenharmony_ci	return 0;
6878c2ecf20Sopenharmony_ci}
6888c2ecf20Sopenharmony_ci
6898c2ecf20Sopenharmony_ci/* Target specific defines for MAIN firmware */
6908c2ecf20Sopenharmony_ci#define TARGET_NUM_VDEVS			8
6918c2ecf20Sopenharmony_ci#define TARGET_NUM_PEER_AST			2
6928c2ecf20Sopenharmony_ci#define TARGET_NUM_WDS_ENTRIES			32
6938c2ecf20Sopenharmony_ci#define TARGET_DMA_BURST_SIZE			0
6948c2ecf20Sopenharmony_ci#define TARGET_MAC_AGGR_DELIM			0
6958c2ecf20Sopenharmony_ci#define TARGET_AST_SKID_LIMIT			16
6968c2ecf20Sopenharmony_ci#define TARGET_NUM_STATIONS			16
6978c2ecf20Sopenharmony_ci#define TARGET_NUM_PEERS			((TARGET_NUM_STATIONS) + \
6988c2ecf20Sopenharmony_ci						 (TARGET_NUM_VDEVS))
6998c2ecf20Sopenharmony_ci#define TARGET_NUM_OFFLOAD_PEERS		0
7008c2ecf20Sopenharmony_ci#define TARGET_NUM_OFFLOAD_REORDER_BUFS         0
7018c2ecf20Sopenharmony_ci#define TARGET_NUM_PEER_KEYS			2
7028c2ecf20Sopenharmony_ci#define TARGET_NUM_TIDS				((TARGET_NUM_PEERS) * 2)
7038c2ecf20Sopenharmony_ci#define TARGET_TX_CHAIN_MASK			(BIT(0) | BIT(1) | BIT(2))
7048c2ecf20Sopenharmony_ci#define TARGET_RX_CHAIN_MASK			(BIT(0) | BIT(1) | BIT(2))
7058c2ecf20Sopenharmony_ci#define TARGET_RX_TIMEOUT_LO_PRI		100
7068c2ecf20Sopenharmony_ci#define TARGET_RX_TIMEOUT_HI_PRI		40
7078c2ecf20Sopenharmony_ci
7088c2ecf20Sopenharmony_ci#define TARGET_SCAN_MAX_PENDING_REQS		4
7098c2ecf20Sopenharmony_ci#define TARGET_BMISS_OFFLOAD_MAX_VDEV		3
7108c2ecf20Sopenharmony_ci#define TARGET_ROAM_OFFLOAD_MAX_VDEV		3
7118c2ecf20Sopenharmony_ci#define TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES	8
7128c2ecf20Sopenharmony_ci#define TARGET_GTK_OFFLOAD_MAX_VDEV		3
7138c2ecf20Sopenharmony_ci#define TARGET_NUM_MCAST_GROUPS			0
7148c2ecf20Sopenharmony_ci#define TARGET_NUM_MCAST_TABLE_ELEMS		0
7158c2ecf20Sopenharmony_ci#define TARGET_MCAST2UCAST_MODE			ATH10K_MCAST2UCAST_DISABLED
7168c2ecf20Sopenharmony_ci#define TARGET_TX_DBG_LOG_SIZE			1024
7178c2ecf20Sopenharmony_ci#define TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 0
7188c2ecf20Sopenharmony_ci#define TARGET_VOW_CONFIG			0
7198c2ecf20Sopenharmony_ci#define TARGET_NUM_MSDU_DESC			(1024 + 400)
7208c2ecf20Sopenharmony_ci#define TARGET_MAX_FRAG_ENTRIES			0
7218c2ecf20Sopenharmony_ci
7228c2ecf20Sopenharmony_ci/* Target specific defines for 10.X firmware */
7238c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_VDEVS			16
7248c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_PEER_AST			2
7258c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_WDS_ENTRIES		32
7268c2ecf20Sopenharmony_ci#define TARGET_10X_DMA_BURST_SIZE		0
7278c2ecf20Sopenharmony_ci#define TARGET_10X_MAC_AGGR_DELIM		0
7288c2ecf20Sopenharmony_ci#define TARGET_10X_AST_SKID_LIMIT		128
7298c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_STATIONS			128
7308c2ecf20Sopenharmony_ci#define TARGET_10X_TX_STATS_NUM_STATIONS	118
7318c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_PEERS			((TARGET_10X_NUM_STATIONS) + \
7328c2ecf20Sopenharmony_ci						 (TARGET_10X_NUM_VDEVS))
7338c2ecf20Sopenharmony_ci#define TARGET_10X_TX_STATS_NUM_PEERS		((TARGET_10X_TX_STATS_NUM_STATIONS) + \
7348c2ecf20Sopenharmony_ci						 (TARGET_10X_NUM_VDEVS))
7358c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_OFFLOAD_PEERS		0
7368c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_OFFLOAD_REORDER_BUFS	0
7378c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_PEER_KEYS		2
7388c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_TIDS_MAX			256
7398c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_TIDS			min((TARGET_10X_NUM_TIDS_MAX), \
7408c2ecf20Sopenharmony_ci						    (TARGET_10X_NUM_PEERS) * 2)
7418c2ecf20Sopenharmony_ci#define TARGET_10X_TX_STATS_NUM_TIDS		min((TARGET_10X_NUM_TIDS_MAX), \
7428c2ecf20Sopenharmony_ci						    (TARGET_10X_TX_STATS_NUM_PEERS) * 2)
7438c2ecf20Sopenharmony_ci#define TARGET_10X_TX_CHAIN_MASK		(BIT(0) | BIT(1) | BIT(2))
7448c2ecf20Sopenharmony_ci#define TARGET_10X_RX_CHAIN_MASK		(BIT(0) | BIT(1) | BIT(2))
7458c2ecf20Sopenharmony_ci#define TARGET_10X_RX_TIMEOUT_LO_PRI		100
7468c2ecf20Sopenharmony_ci#define TARGET_10X_RX_TIMEOUT_HI_PRI		40
7478c2ecf20Sopenharmony_ci#define TARGET_10X_SCAN_MAX_PENDING_REQS	4
7488c2ecf20Sopenharmony_ci#define TARGET_10X_BMISS_OFFLOAD_MAX_VDEV	2
7498c2ecf20Sopenharmony_ci#define TARGET_10X_ROAM_OFFLOAD_MAX_VDEV	2
7508c2ecf20Sopenharmony_ci#define TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES	8
7518c2ecf20Sopenharmony_ci#define TARGET_10X_GTK_OFFLOAD_MAX_VDEV		3
7528c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_MCAST_GROUPS		0
7538c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_MCAST_TABLE_ELEMS	0
7548c2ecf20Sopenharmony_ci#define TARGET_10X_MCAST2UCAST_MODE		ATH10K_MCAST2UCAST_DISABLED
7558c2ecf20Sopenharmony_ci#define TARGET_10X_TX_DBG_LOG_SIZE		1024
7568c2ecf20Sopenharmony_ci#define TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
7578c2ecf20Sopenharmony_ci#define TARGET_10X_VOW_CONFIG			0
7588c2ecf20Sopenharmony_ci#define TARGET_10X_NUM_MSDU_DESC		(1024 + 400)
7598c2ecf20Sopenharmony_ci#define TARGET_10X_MAX_FRAG_ENTRIES		0
7608c2ecf20Sopenharmony_ci
7618c2ecf20Sopenharmony_ci/* 10.2 parameters */
7628c2ecf20Sopenharmony_ci#define TARGET_10_2_DMA_BURST_SIZE		0
7638c2ecf20Sopenharmony_ci
7648c2ecf20Sopenharmony_ci/* Target specific defines for WMI-TLV firmware */
7658c2ecf20Sopenharmony_ci#define TARGET_TLV_NUM_VDEVS			4
7668c2ecf20Sopenharmony_ci#define TARGET_TLV_NUM_STATIONS			32
7678c2ecf20Sopenharmony_ci#define TARGET_TLV_NUM_PEERS			33
7688c2ecf20Sopenharmony_ci#define TARGET_TLV_NUM_TDLS_VDEVS		1
7698c2ecf20Sopenharmony_ci#define TARGET_TLV_NUM_TIDS			((TARGET_TLV_NUM_PEERS) * 2)
7708c2ecf20Sopenharmony_ci#define TARGET_TLV_NUM_MSDU_DESC		(1024 + 32)
7718c2ecf20Sopenharmony_ci#define TARGET_TLV_NUM_MSDU_DESC_HL		1024
7728c2ecf20Sopenharmony_ci#define TARGET_TLV_NUM_WOW_PATTERNS		22
7738c2ecf20Sopenharmony_ci#define TARGET_TLV_MGMT_NUM_MSDU_DESC		(50)
7748c2ecf20Sopenharmony_ci
7758c2ecf20Sopenharmony_ci/* Target specific defines for WMI-HL-1.0 firmware */
7768c2ecf20Sopenharmony_ci#define TARGET_HL_TLV_NUM_PEERS			33
7778c2ecf20Sopenharmony_ci#define TARGET_HL_TLV_AST_SKID_LIMIT		16
7788c2ecf20Sopenharmony_ci#define TARGET_HL_TLV_NUM_WDS_ENTRIES		2
7798c2ecf20Sopenharmony_ci
7808c2ecf20Sopenharmony_ci/* Target specific defines for QCA9377 high latency firmware */
7818c2ecf20Sopenharmony_ci#define TARGET_QCA9377_HL_NUM_PEERS		15
7828c2ecf20Sopenharmony_ci
7838c2ecf20Sopenharmony_ci/* Diagnostic Window */
7848c2ecf20Sopenharmony_ci#define CE_DIAG_PIPE	7
7858c2ecf20Sopenharmony_ci
7868c2ecf20Sopenharmony_ci#define NUM_TARGET_CE_CONFIG_WLAN ar->hw_values->num_target_ce_config_wlan
7878c2ecf20Sopenharmony_ci
7888c2ecf20Sopenharmony_ci/* Target specific defines for 10.4 firmware */
7898c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_VDEVS			16
7908c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_STATIONS		32
7918c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_PEERS			((TARGET_10_4_NUM_STATIONS) + \
7928c2ecf20Sopenharmony_ci						 (TARGET_10_4_NUM_VDEVS))
7938c2ecf20Sopenharmony_ci#define TARGET_10_4_ACTIVE_PEERS		0
7948c2ecf20Sopenharmony_ci
7958c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_QCACHE_PEERS_MAX	512
7968c2ecf20Sopenharmony_ci#define TARGET_10_4_QCACHE_ACTIVE_PEERS		50
7978c2ecf20Sopenharmony_ci#define TARGET_10_4_QCACHE_ACTIVE_PEERS_PFC	35
7988c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_OFFLOAD_PEERS		0
7998c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_OFFLOAD_REORDER_BUFFS	0
8008c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_PEER_KEYS		2
8018c2ecf20Sopenharmony_ci#define TARGET_10_4_TGT_NUM_TIDS		((TARGET_10_4_NUM_PEERS) * 2)
8028c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_MSDU_DESC		(1024 + 400)
8038c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_MSDU_DESC_PFC		2500
8048c2ecf20Sopenharmony_ci#define TARGET_10_4_AST_SKID_LIMIT		32
8058c2ecf20Sopenharmony_ci
8068c2ecf20Sopenharmony_ci/* 100 ms for video, best-effort, and background */
8078c2ecf20Sopenharmony_ci#define TARGET_10_4_RX_TIMEOUT_LO_PRI		100
8088c2ecf20Sopenharmony_ci
8098c2ecf20Sopenharmony_ci/* 40 ms for voice */
8108c2ecf20Sopenharmony_ci#define TARGET_10_4_RX_TIMEOUT_HI_PRI		40
8118c2ecf20Sopenharmony_ci
8128c2ecf20Sopenharmony_ci#define TARGET_10_4_RX_DECAP_MODE		ATH10K_HW_TXRX_NATIVE_WIFI
8138c2ecf20Sopenharmony_ci#define TARGET_10_4_SCAN_MAX_REQS		4
8148c2ecf20Sopenharmony_ci#define TARGET_10_4_BMISS_OFFLOAD_MAX_VDEV	3
8158c2ecf20Sopenharmony_ci#define TARGET_10_4_ROAM_OFFLOAD_MAX_VDEV	3
8168c2ecf20Sopenharmony_ci#define TARGET_10_4_ROAM_OFFLOAD_MAX_PROFILES   8
8178c2ecf20Sopenharmony_ci
8188c2ecf20Sopenharmony_ci/* Note: mcast to ucast is disabled by default */
8198c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_MCAST_GROUPS		0
8208c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_MCAST_TABLE_ELEMS	0
8218c2ecf20Sopenharmony_ci#define TARGET_10_4_MCAST2UCAST_MODE		0
8228c2ecf20Sopenharmony_ci
8238c2ecf20Sopenharmony_ci#define TARGET_10_4_TX_DBG_LOG_SIZE		1024
8248c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_WDS_ENTRIES		32
8258c2ecf20Sopenharmony_ci#define TARGET_10_4_DMA_BURST_SIZE		1
8268c2ecf20Sopenharmony_ci#define TARGET_10_4_MAC_AGGR_DELIM		0
8278c2ecf20Sopenharmony_ci#define TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
8288c2ecf20Sopenharmony_ci#define TARGET_10_4_VOW_CONFIG			0
8298c2ecf20Sopenharmony_ci#define TARGET_10_4_GTK_OFFLOAD_MAX_VDEV	3
8308c2ecf20Sopenharmony_ci#define TARGET_10_4_11AC_TX_MAX_FRAGS		2
8318c2ecf20Sopenharmony_ci#define TARGET_10_4_MAX_PEER_EXT_STATS		16
8328c2ecf20Sopenharmony_ci#define TARGET_10_4_SMART_ANT_CAP		0
8338c2ecf20Sopenharmony_ci#define TARGET_10_4_BK_MIN_FREE			0
8348c2ecf20Sopenharmony_ci#define TARGET_10_4_BE_MIN_FREE			0
8358c2ecf20Sopenharmony_ci#define TARGET_10_4_VI_MIN_FREE			0
8368c2ecf20Sopenharmony_ci#define TARGET_10_4_VO_MIN_FREE			0
8378c2ecf20Sopenharmony_ci#define TARGET_10_4_RX_BATCH_MODE		1
8388c2ecf20Sopenharmony_ci#define TARGET_10_4_THERMAL_THROTTLING_CONFIG	0
8398c2ecf20Sopenharmony_ci#define TARGET_10_4_ATF_CONFIG			0
8408c2ecf20Sopenharmony_ci#define TARGET_10_4_IPHDR_PAD_CONFIG		1
8418c2ecf20Sopenharmony_ci#define TARGET_10_4_QWRAP_CONFIG		0
8428c2ecf20Sopenharmony_ci
8438c2ecf20Sopenharmony_ci/* TDLS config */
8448c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_TDLS_VDEVS		1
8458c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_TDLS_BUFFER_STA		1
8468c2ecf20Sopenharmony_ci#define TARGET_10_4_NUM_TDLS_SLEEP_STA		1
8478c2ecf20Sopenharmony_ci
8488c2ecf20Sopenharmony_ci/* Maximum number of Copy Engine's supported */
8498c2ecf20Sopenharmony_ci#define CE_COUNT_MAX 12
8508c2ecf20Sopenharmony_ci
8518c2ecf20Sopenharmony_ci/* Number of Copy Engines supported */
8528c2ecf20Sopenharmony_ci#define CE_COUNT ar->hw_values->ce_count
8538c2ecf20Sopenharmony_ci
8548c2ecf20Sopenharmony_ci/*
8558c2ecf20Sopenharmony_ci * Granted MSIs are assigned as follows:
8568c2ecf20Sopenharmony_ci * Firmware uses the first
8578c2ecf20Sopenharmony_ci * Remaining MSIs, if any, are used by Copy Engines
8588c2ecf20Sopenharmony_ci * This mapping is known to both Target firmware and Host software.
8598c2ecf20Sopenharmony_ci * It may be changed as long as Host and Target are kept in sync.
8608c2ecf20Sopenharmony_ci */
8618c2ecf20Sopenharmony_ci/* MSI for firmware (errors, etc.) */
8628c2ecf20Sopenharmony_ci#define MSI_ASSIGN_FW		0
8638c2ecf20Sopenharmony_ci
8648c2ecf20Sopenharmony_ci/* MSIs for Copy Engines */
8658c2ecf20Sopenharmony_ci#define MSI_ASSIGN_CE_INITIAL	1
8668c2ecf20Sopenharmony_ci#define MSI_ASSIGN_CE_MAX	ar->hw_values->msi_assign_ce_max
8678c2ecf20Sopenharmony_ci
8688c2ecf20Sopenharmony_ci/* as of IP3.7.1 */
8698c2ecf20Sopenharmony_ci#define RTC_STATE_V_ON				ar->hw_values->rtc_state_val_on
8708c2ecf20Sopenharmony_ci
8718c2ecf20Sopenharmony_ci#define RTC_STATE_V_LSB				0
8728c2ecf20Sopenharmony_ci#define RTC_STATE_V_MASK			0x00000007
8738c2ecf20Sopenharmony_ci#define RTC_STATE_ADDRESS			0x0000
8748c2ecf20Sopenharmony_ci#define PCIE_SOC_WAKE_V_MASK			0x00000001
8758c2ecf20Sopenharmony_ci#define PCIE_SOC_WAKE_ADDRESS			0x0004
8768c2ecf20Sopenharmony_ci#define PCIE_SOC_WAKE_RESET			0x00000000
8778c2ecf20Sopenharmony_ci#define SOC_GLOBAL_RESET_ADDRESS		0x0008
8788c2ecf20Sopenharmony_ci
8798c2ecf20Sopenharmony_ci#define RTC_SOC_BASE_ADDRESS			ar->regs->rtc_soc_base_address
8808c2ecf20Sopenharmony_ci#define RTC_WMAC_BASE_ADDRESS			ar->regs->rtc_wmac_base_address
8818c2ecf20Sopenharmony_ci#define MAC_COEX_BASE_ADDRESS			0x00006000
8828c2ecf20Sopenharmony_ci#define BT_COEX_BASE_ADDRESS			0x00007000
8838c2ecf20Sopenharmony_ci#define SOC_PCIE_BASE_ADDRESS			0x00008000
8848c2ecf20Sopenharmony_ci#define SOC_CORE_BASE_ADDRESS			ar->regs->soc_core_base_address
8858c2ecf20Sopenharmony_ci#define WLAN_UART_BASE_ADDRESS			0x0000c000
8868c2ecf20Sopenharmony_ci#define WLAN_SI_BASE_ADDRESS			0x00010000
8878c2ecf20Sopenharmony_ci#define WLAN_GPIO_BASE_ADDRESS			0x00014000
8888c2ecf20Sopenharmony_ci#define WLAN_ANALOG_INTF_BASE_ADDRESS		0x0001c000
8898c2ecf20Sopenharmony_ci#define WLAN_MAC_BASE_ADDRESS			ar->regs->wlan_mac_base_address
8908c2ecf20Sopenharmony_ci#define EFUSE_BASE_ADDRESS			0x00030000
8918c2ecf20Sopenharmony_ci#define FPGA_REG_BASE_ADDRESS			0x00039000
8928c2ecf20Sopenharmony_ci#define WLAN_UART2_BASE_ADDRESS			0x00054c00
8938c2ecf20Sopenharmony_ci#define CE_WRAPPER_BASE_ADDRESS			ar->regs->ce_wrapper_base_address
8948c2ecf20Sopenharmony_ci#define CE0_BASE_ADDRESS			ar->regs->ce0_base_address
8958c2ecf20Sopenharmony_ci#define CE1_BASE_ADDRESS			ar->regs->ce1_base_address
8968c2ecf20Sopenharmony_ci#define CE2_BASE_ADDRESS			ar->regs->ce2_base_address
8978c2ecf20Sopenharmony_ci#define CE3_BASE_ADDRESS			ar->regs->ce3_base_address
8988c2ecf20Sopenharmony_ci#define CE4_BASE_ADDRESS			ar->regs->ce4_base_address
8998c2ecf20Sopenharmony_ci#define CE5_BASE_ADDRESS			ar->regs->ce5_base_address
9008c2ecf20Sopenharmony_ci#define CE6_BASE_ADDRESS			ar->regs->ce6_base_address
9018c2ecf20Sopenharmony_ci#define CE7_BASE_ADDRESS			ar->regs->ce7_base_address
9028c2ecf20Sopenharmony_ci#define DBI_BASE_ADDRESS			0x00060000
9038c2ecf20Sopenharmony_ci#define WLAN_ANALOG_INTF_PCIE_BASE_ADDRESS	0x0006c000
9048c2ecf20Sopenharmony_ci#define PCIE_LOCAL_BASE_ADDRESS		ar->regs->pcie_local_base_address
9058c2ecf20Sopenharmony_ci
9068c2ecf20Sopenharmony_ci#define SOC_RESET_CONTROL_ADDRESS		0x00000000
9078c2ecf20Sopenharmony_ci#define SOC_RESET_CONTROL_OFFSET		0x00000000
9088c2ecf20Sopenharmony_ci#define SOC_RESET_CONTROL_SI0_RST_MASK		ar->regs->soc_reset_control_si0_rst_mask
9098c2ecf20Sopenharmony_ci#define SOC_RESET_CONTROL_CE_RST_MASK		ar->regs->soc_reset_control_ce_rst_mask
9108c2ecf20Sopenharmony_ci#define SOC_RESET_CONTROL_CPU_WARM_RST_MASK	0x00000040
9118c2ecf20Sopenharmony_ci#define SOC_CPU_CLOCK_OFFSET			0x00000020
9128c2ecf20Sopenharmony_ci#define SOC_CPU_CLOCK_STANDARD_LSB		0
9138c2ecf20Sopenharmony_ci#define SOC_CPU_CLOCK_STANDARD_MASK		0x00000003
9148c2ecf20Sopenharmony_ci#define SOC_CLOCK_CONTROL_OFFSET		0x00000028
9158c2ecf20Sopenharmony_ci#define SOC_CLOCK_CONTROL_SI0_CLK_MASK		0x00000001
9168c2ecf20Sopenharmony_ci#define SOC_SYSTEM_SLEEP_OFFSET			0x000000c4
9178c2ecf20Sopenharmony_ci#define SOC_LPO_CAL_OFFSET			0x000000e0
9188c2ecf20Sopenharmony_ci#define SOC_LPO_CAL_ENABLE_LSB			20
9198c2ecf20Sopenharmony_ci#define SOC_LPO_CAL_ENABLE_MASK			0x00100000
9208c2ecf20Sopenharmony_ci#define SOC_LF_TIMER_CONTROL0_ADDRESS		0x00000050
9218c2ecf20Sopenharmony_ci#define SOC_LF_TIMER_CONTROL0_ENABLE_MASK	0x00000004
9228c2ecf20Sopenharmony_ci
9238c2ecf20Sopenharmony_ci#define SOC_CHIP_ID_ADDRESS			ar->regs->soc_chip_id_address
9248c2ecf20Sopenharmony_ci#define SOC_CHIP_ID_REV_LSB			8
9258c2ecf20Sopenharmony_ci#define SOC_CHIP_ID_REV_MASK			0x00000f00
9268c2ecf20Sopenharmony_ci
9278c2ecf20Sopenharmony_ci#define WLAN_RESET_CONTROL_COLD_RST_MASK	0x00000008
9288c2ecf20Sopenharmony_ci#define WLAN_RESET_CONTROL_WARM_RST_MASK	0x00000004
9298c2ecf20Sopenharmony_ci#define WLAN_SYSTEM_SLEEP_DISABLE_LSB		0
9308c2ecf20Sopenharmony_ci#define WLAN_SYSTEM_SLEEP_DISABLE_MASK		0x00000001
9318c2ecf20Sopenharmony_ci
9328c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN0_ADDRESS			0x00000028
9338c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN0_CONFIG_LSB		11
9348c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN0_CONFIG_MASK		0x00007800
9358c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN0_PAD_PULL_LSB		5
9368c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN0_PAD_PULL_MASK		0x00000060
9378c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN1_ADDRESS			0x0000002c
9388c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN1_CONFIG_MASK		0x00007800
9398c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN10_ADDRESS			0x00000050
9408c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN11_ADDRESS			0x00000054
9418c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN12_ADDRESS			0x00000058
9428c2ecf20Sopenharmony_ci#define WLAN_GPIO_PIN13_ADDRESS			0x0000005c
9438c2ecf20Sopenharmony_ci
9448c2ecf20Sopenharmony_ci#define CLOCK_GPIO_OFFSET			0xffffffff
9458c2ecf20Sopenharmony_ci#define CLOCK_GPIO_BT_CLK_OUT_EN_LSB		0
9468c2ecf20Sopenharmony_ci#define CLOCK_GPIO_BT_CLK_OUT_EN_MASK		0
9478c2ecf20Sopenharmony_ci
9488c2ecf20Sopenharmony_ci#define SI_CONFIG_OFFSET			0x00000000
9498c2ecf20Sopenharmony_ci#define SI_CONFIG_ERR_INT_LSB			19
9508c2ecf20Sopenharmony_ci#define SI_CONFIG_ERR_INT_MASK			0x00080000
9518c2ecf20Sopenharmony_ci#define SI_CONFIG_BIDIR_OD_DATA_LSB		18
9528c2ecf20Sopenharmony_ci#define SI_CONFIG_BIDIR_OD_DATA_MASK		0x00040000
9538c2ecf20Sopenharmony_ci#define SI_CONFIG_I2C_LSB			16
9548c2ecf20Sopenharmony_ci#define SI_CONFIG_I2C_MASK			0x00010000
9558c2ecf20Sopenharmony_ci#define SI_CONFIG_POS_SAMPLE_LSB		7
9568c2ecf20Sopenharmony_ci#define SI_CONFIG_POS_SAMPLE_MASK		0x00000080
9578c2ecf20Sopenharmony_ci#define SI_CONFIG_INACTIVE_DATA_LSB		5
9588c2ecf20Sopenharmony_ci#define SI_CONFIG_INACTIVE_DATA_MASK		0x00000020
9598c2ecf20Sopenharmony_ci#define SI_CONFIG_INACTIVE_CLK_LSB		4
9608c2ecf20Sopenharmony_ci#define SI_CONFIG_INACTIVE_CLK_MASK		0x00000010
9618c2ecf20Sopenharmony_ci#define SI_CONFIG_DIVIDER_LSB			0
9628c2ecf20Sopenharmony_ci#define SI_CONFIG_DIVIDER_MASK			0x0000000f
9638c2ecf20Sopenharmony_ci#define SI_CS_OFFSET				0x00000004
9648c2ecf20Sopenharmony_ci#define SI_CS_DONE_ERR_LSB			10
9658c2ecf20Sopenharmony_ci#define SI_CS_DONE_ERR_MASK			0x00000400
9668c2ecf20Sopenharmony_ci#define SI_CS_DONE_INT_LSB			9
9678c2ecf20Sopenharmony_ci#define SI_CS_DONE_INT_MASK			0x00000200
9688c2ecf20Sopenharmony_ci#define SI_CS_START_LSB				8
9698c2ecf20Sopenharmony_ci#define SI_CS_START_MASK			0x00000100
9708c2ecf20Sopenharmony_ci#define SI_CS_RX_CNT_LSB			4
9718c2ecf20Sopenharmony_ci#define SI_CS_RX_CNT_MASK			0x000000f0
9728c2ecf20Sopenharmony_ci#define SI_CS_TX_CNT_LSB			0
9738c2ecf20Sopenharmony_ci#define SI_CS_TX_CNT_MASK			0x0000000f
9748c2ecf20Sopenharmony_ci
9758c2ecf20Sopenharmony_ci#define SI_TX_DATA0_OFFSET			0x00000008
9768c2ecf20Sopenharmony_ci#define SI_TX_DATA1_OFFSET			0x0000000c
9778c2ecf20Sopenharmony_ci#define SI_RX_DATA0_OFFSET			0x00000010
9788c2ecf20Sopenharmony_ci#define SI_RX_DATA1_OFFSET			0x00000014
9798c2ecf20Sopenharmony_ci
9808c2ecf20Sopenharmony_ci#define CORE_CTRL_CPU_INTR_MASK			0x00002000
9818c2ecf20Sopenharmony_ci#define CORE_CTRL_PCIE_REG_31_MASK		0x00000800
9828c2ecf20Sopenharmony_ci#define CORE_CTRL_ADDRESS			0x0000
9838c2ecf20Sopenharmony_ci#define PCIE_INTR_ENABLE_ADDRESS		0x0008
9848c2ecf20Sopenharmony_ci#define PCIE_INTR_CAUSE_ADDRESS			0x000c
9858c2ecf20Sopenharmony_ci#define PCIE_INTR_CLR_ADDRESS			ar->regs->pcie_intr_clr_address
9868c2ecf20Sopenharmony_ci#define SCRATCH_3_ADDRESS			ar->regs->scratch_3_address
9878c2ecf20Sopenharmony_ci#define CPU_INTR_ADDRESS			0x0010
9888c2ecf20Sopenharmony_ci#define FW_RAM_CONFIG_ADDRESS			0x0018
9898c2ecf20Sopenharmony_ci
9908c2ecf20Sopenharmony_ci#define CCNT_TO_MSEC(ar, x) ((x) / ar->hw_params.channel_counters_freq_hz)
9918c2ecf20Sopenharmony_ci
9928c2ecf20Sopenharmony_ci/* Firmware indications to the Host via SCRATCH_3 register. */
9938c2ecf20Sopenharmony_ci#define FW_INDICATOR_ADDRESS			ar->regs->fw_indicator_address
9948c2ecf20Sopenharmony_ci#define FW_IND_EVENT_PENDING			1
9958c2ecf20Sopenharmony_ci#define FW_IND_INITIALIZED			2
9968c2ecf20Sopenharmony_ci#define FW_IND_HOST_READY			0x80000000
9978c2ecf20Sopenharmony_ci
9988c2ecf20Sopenharmony_ci/* HOST_REG interrupt from firmware */
9998c2ecf20Sopenharmony_ci#define PCIE_INTR_FIRMWARE_MASK			ar->regs->pcie_intr_fw_mask
10008c2ecf20Sopenharmony_ci#define PCIE_INTR_CE_MASK_ALL			ar->regs->pcie_intr_ce_mask_all
10018c2ecf20Sopenharmony_ci
10028c2ecf20Sopenharmony_ci#define DRAM_BASE_ADDRESS			0x00400000
10038c2ecf20Sopenharmony_ci
10048c2ecf20Sopenharmony_ci#define PCIE_BAR_REG_ADDRESS			0x40030
10058c2ecf20Sopenharmony_ci
10068c2ecf20Sopenharmony_ci#define MISSING 0
10078c2ecf20Sopenharmony_ci
10088c2ecf20Sopenharmony_ci#define SYSTEM_SLEEP_OFFSET			SOC_SYSTEM_SLEEP_OFFSET
10098c2ecf20Sopenharmony_ci#define WLAN_SYSTEM_SLEEP_OFFSET		SOC_SYSTEM_SLEEP_OFFSET
10108c2ecf20Sopenharmony_ci#define WLAN_RESET_CONTROL_OFFSET		SOC_RESET_CONTROL_OFFSET
10118c2ecf20Sopenharmony_ci#define CLOCK_CONTROL_OFFSET			SOC_CLOCK_CONTROL_OFFSET
10128c2ecf20Sopenharmony_ci#define CLOCK_CONTROL_SI0_CLK_MASK		SOC_CLOCK_CONTROL_SI0_CLK_MASK
10138c2ecf20Sopenharmony_ci#define RESET_CONTROL_MBOX_RST_MASK		MISSING
10148c2ecf20Sopenharmony_ci#define RESET_CONTROL_SI0_RST_MASK		SOC_RESET_CONTROL_SI0_RST_MASK
10158c2ecf20Sopenharmony_ci#define GPIO_BASE_ADDRESS			WLAN_GPIO_BASE_ADDRESS
10168c2ecf20Sopenharmony_ci#define GPIO_PIN0_OFFSET			WLAN_GPIO_PIN0_ADDRESS
10178c2ecf20Sopenharmony_ci#define GPIO_PIN1_OFFSET			WLAN_GPIO_PIN1_ADDRESS
10188c2ecf20Sopenharmony_ci#define GPIO_PIN0_CONFIG_LSB			WLAN_GPIO_PIN0_CONFIG_LSB
10198c2ecf20Sopenharmony_ci#define GPIO_PIN0_CONFIG_MASK			WLAN_GPIO_PIN0_CONFIG_MASK
10208c2ecf20Sopenharmony_ci#define GPIO_PIN0_PAD_PULL_LSB			WLAN_GPIO_PIN0_PAD_PULL_LSB
10218c2ecf20Sopenharmony_ci#define GPIO_PIN0_PAD_PULL_MASK			WLAN_GPIO_PIN0_PAD_PULL_MASK
10228c2ecf20Sopenharmony_ci#define GPIO_PIN1_CONFIG_MASK			WLAN_GPIO_PIN1_CONFIG_MASK
10238c2ecf20Sopenharmony_ci#define SI_BASE_ADDRESS				WLAN_SI_BASE_ADDRESS
10248c2ecf20Sopenharmony_ci#define SCRATCH_BASE_ADDRESS			SOC_CORE_BASE_ADDRESS
10258c2ecf20Sopenharmony_ci#define LOCAL_SCRATCH_OFFSET			0x18
10268c2ecf20Sopenharmony_ci#define CPU_CLOCK_OFFSET			SOC_CPU_CLOCK_OFFSET
10278c2ecf20Sopenharmony_ci#define LPO_CAL_OFFSET				SOC_LPO_CAL_OFFSET
10288c2ecf20Sopenharmony_ci#define GPIO_PIN10_OFFSET			WLAN_GPIO_PIN10_ADDRESS
10298c2ecf20Sopenharmony_ci#define GPIO_PIN11_OFFSET			WLAN_GPIO_PIN11_ADDRESS
10308c2ecf20Sopenharmony_ci#define GPIO_PIN12_OFFSET			WLAN_GPIO_PIN12_ADDRESS
10318c2ecf20Sopenharmony_ci#define GPIO_PIN13_OFFSET			WLAN_GPIO_PIN13_ADDRESS
10328c2ecf20Sopenharmony_ci#define CPU_CLOCK_STANDARD_LSB			SOC_CPU_CLOCK_STANDARD_LSB
10338c2ecf20Sopenharmony_ci#define CPU_CLOCK_STANDARD_MASK			SOC_CPU_CLOCK_STANDARD_MASK
10348c2ecf20Sopenharmony_ci#define LPO_CAL_ENABLE_LSB			SOC_LPO_CAL_ENABLE_LSB
10358c2ecf20Sopenharmony_ci#define LPO_CAL_ENABLE_MASK			SOC_LPO_CAL_ENABLE_MASK
10368c2ecf20Sopenharmony_ci#define ANALOG_INTF_BASE_ADDRESS		WLAN_ANALOG_INTF_BASE_ADDRESS
10378c2ecf20Sopenharmony_ci#define MBOX_BASE_ADDRESS			MISSING
10388c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_ERROR_LSB		MISSING
10398c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_ERROR_MASK		MISSING
10408c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_CPU_LSB		MISSING
10418c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_CPU_MASK		MISSING
10428c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_COUNTER_LSB		MISSING
10438c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_COUNTER_MASK		MISSING
10448c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_MBOX_DATA_LSB		MISSING
10458c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_MBOX_DATA_MASK	MISSING
10468c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB	MISSING
10478c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK	MISSING
10488c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB	MISSING
10498c2ecf20Sopenharmony_ci#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK	MISSING
10508c2ecf20Sopenharmony_ci#define COUNTER_INT_STATUS_ENABLE_BIT_LSB	MISSING
10518c2ecf20Sopenharmony_ci#define COUNTER_INT_STATUS_ENABLE_BIT_MASK	MISSING
10528c2ecf20Sopenharmony_ci#define INT_STATUS_ENABLE_ADDRESS		MISSING
10538c2ecf20Sopenharmony_ci#define CPU_INT_STATUS_ENABLE_BIT_LSB		MISSING
10548c2ecf20Sopenharmony_ci#define CPU_INT_STATUS_ENABLE_BIT_MASK		MISSING
10558c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_ADDRESS			MISSING
10568c2ecf20Sopenharmony_ci#define CPU_INT_STATUS_ADDRESS			MISSING
10578c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_ADDRESS		MISSING
10588c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_WAKEUP_MASK		MISSING
10598c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_WAKEUP_LSB		MISSING
10608c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK	MISSING
10618c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB	MISSING
10628c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_TX_OVERFLOW_MASK	MISSING
10638c2ecf20Sopenharmony_ci#define ERROR_INT_STATUS_TX_OVERFLOW_LSB	MISSING
10648c2ecf20Sopenharmony_ci#define COUNT_DEC_ADDRESS			MISSING
10658c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_CPU_MASK		MISSING
10668c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_CPU_LSB			MISSING
10678c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_ERROR_MASK		MISSING
10688c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_ERROR_LSB		MISSING
10698c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_COUNTER_MASK		MISSING
10708c2ecf20Sopenharmony_ci#define HOST_INT_STATUS_COUNTER_LSB		MISSING
10718c2ecf20Sopenharmony_ci#define RX_LOOKAHEAD_VALID_ADDRESS		MISSING
10728c2ecf20Sopenharmony_ci#define WINDOW_DATA_ADDRESS			MISSING
10738c2ecf20Sopenharmony_ci#define WINDOW_READ_ADDR_ADDRESS		MISSING
10748c2ecf20Sopenharmony_ci#define WINDOW_WRITE_ADDR_ADDRESS		MISSING
10758c2ecf20Sopenharmony_ci
10768c2ecf20Sopenharmony_ci#define QCA9887_1_0_I2C_SDA_GPIO_PIN		5
10778c2ecf20Sopenharmony_ci#define QCA9887_1_0_I2C_SDA_PIN_CONFIG		3
10788c2ecf20Sopenharmony_ci#define QCA9887_1_0_SI_CLK_GPIO_PIN		17
10798c2ecf20Sopenharmony_ci#define QCA9887_1_0_SI_CLK_PIN_CONFIG		3
10808c2ecf20Sopenharmony_ci#define QCA9887_1_0_GPIO_ENABLE_W1TS_LOW_ADDRESS 0x00000010
10818c2ecf20Sopenharmony_ci
10828c2ecf20Sopenharmony_ci#define QCA9887_EEPROM_SELECT_READ		0xa10000a0
10838c2ecf20Sopenharmony_ci#define QCA9887_EEPROM_ADDR_HI_MASK		0x0000ff00
10848c2ecf20Sopenharmony_ci#define QCA9887_EEPROM_ADDR_HI_LSB		8
10858c2ecf20Sopenharmony_ci#define QCA9887_EEPROM_ADDR_LO_MASK		0x00ff0000
10868c2ecf20Sopenharmony_ci#define QCA9887_EEPROM_ADDR_LO_LSB		16
10878c2ecf20Sopenharmony_ci
10888c2ecf20Sopenharmony_ci#define MBOX_RESET_CONTROL_ADDRESS		0x00000000
10898c2ecf20Sopenharmony_ci#define MBOX_HOST_INT_STATUS_ADDRESS		0x00000800
10908c2ecf20Sopenharmony_ci#define MBOX_HOST_INT_STATUS_ERROR_LSB		7
10918c2ecf20Sopenharmony_ci#define MBOX_HOST_INT_STATUS_ERROR_MASK		0x00000080
10928c2ecf20Sopenharmony_ci#define MBOX_HOST_INT_STATUS_CPU_LSB		6
10938c2ecf20Sopenharmony_ci#define MBOX_HOST_INT_STATUS_CPU_MASK		0x00000040
10948c2ecf20Sopenharmony_ci#define MBOX_HOST_INT_STATUS_COUNTER_LSB	4
10958c2ecf20Sopenharmony_ci#define MBOX_HOST_INT_STATUS_COUNTER_MASK	0x00000010
10968c2ecf20Sopenharmony_ci#define MBOX_CPU_INT_STATUS_ADDRESS		0x00000801
10978c2ecf20Sopenharmony_ci#define MBOX_ERROR_INT_STATUS_ADDRESS		0x00000802
10988c2ecf20Sopenharmony_ci#define MBOX_ERROR_INT_STATUS_WAKEUP_LSB	2
10998c2ecf20Sopenharmony_ci#define MBOX_ERROR_INT_STATUS_WAKEUP_MASK	0x00000004
11008c2ecf20Sopenharmony_ci#define MBOX_ERROR_INT_STATUS_RX_UNDERFLOW_LSB	1
11018c2ecf20Sopenharmony_ci#define MBOX_ERROR_INT_STATUS_RX_UNDERFLOW_MASK	0x00000002
11028c2ecf20Sopenharmony_ci#define MBOX_ERROR_INT_STATUS_TX_OVERFLOW_LSB	0
11038c2ecf20Sopenharmony_ci#define MBOX_ERROR_INT_STATUS_TX_OVERFLOW_MASK	0x00000001
11048c2ecf20Sopenharmony_ci#define MBOX_COUNTER_INT_STATUS_ADDRESS		0x00000803
11058c2ecf20Sopenharmony_ci#define MBOX_COUNTER_INT_STATUS_COUNTER_LSB	0
11068c2ecf20Sopenharmony_ci#define MBOX_COUNTER_INT_STATUS_COUNTER_MASK	0x000000ff
11078c2ecf20Sopenharmony_ci#define MBOX_RX_LOOKAHEAD_VALID_ADDRESS		0x00000805
11088c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_ADDRESS		0x00000828
11098c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_ERROR_LSB	7
11108c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_ERROR_MASK	0x00000080
11118c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_CPU_LSB		6
11128c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_CPU_MASK		0x00000040
11138c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_INT_LSB		5
11148c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_INT_MASK		0x00000020
11158c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_COUNTER_LSB	4
11168c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_COUNTER_MASK	0x00000010
11178c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_MBOX_DATA_LSB	0
11188c2ecf20Sopenharmony_ci#define MBOX_INT_STATUS_ENABLE_MBOX_DATA_MASK	0x0000000f
11198c2ecf20Sopenharmony_ci#define MBOX_CPU_INT_STATUS_ENABLE_ADDRESS	0x00000819
11208c2ecf20Sopenharmony_ci#define MBOX_CPU_INT_STATUS_ENABLE_BIT_LSB	0
11218c2ecf20Sopenharmony_ci#define MBOX_CPU_INT_STATUS_ENABLE_BIT_MASK	0x000000ff
11228c2ecf20Sopenharmony_ci#define MBOX_CPU_STATUS_ENABLE_ASSERT_MASK 0x00000001
11238c2ecf20Sopenharmony_ci#define MBOX_ERROR_STATUS_ENABLE_ADDRESS	0x0000081a
11248c2ecf20Sopenharmony_ci#define MBOX_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB  1
11258c2ecf20Sopenharmony_ci#define MBOX_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 0x00000002
11268c2ecf20Sopenharmony_ci#define MBOX_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB   0
11278c2ecf20Sopenharmony_ci#define MBOX_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK  0x00000001
11288c2ecf20Sopenharmony_ci#define MBOX_COUNTER_INT_STATUS_ENABLE_ADDRESS	0x0000081b
11298c2ecf20Sopenharmony_ci#define MBOX_COUNTER_INT_STATUS_ENABLE_BIT_LSB	0
11308c2ecf20Sopenharmony_ci#define MBOX_COUNTER_INT_STATUS_ENABLE_BIT_MASK	0x000000ff
11318c2ecf20Sopenharmony_ci#define MBOX_COUNT_ADDRESS			0x00000820
11328c2ecf20Sopenharmony_ci#define MBOX_COUNT_DEC_ADDRESS			0x00000840
11338c2ecf20Sopenharmony_ci#define MBOX_WINDOW_DATA_ADDRESS		0x00000874
11348c2ecf20Sopenharmony_ci#define MBOX_WINDOW_WRITE_ADDR_ADDRESS		0x00000878
11358c2ecf20Sopenharmony_ci#define MBOX_WINDOW_READ_ADDR_ADDRESS		0x0000087c
11368c2ecf20Sopenharmony_ci#define MBOX_CPU_DBG_SEL_ADDRESS		0x00000883
11378c2ecf20Sopenharmony_ci#define MBOX_CPU_DBG_ADDRESS			0x00000884
11388c2ecf20Sopenharmony_ci#define MBOX_RTC_BASE_ADDRESS			0x00000000
11398c2ecf20Sopenharmony_ci#define MBOX_GPIO_BASE_ADDRESS			0x00005000
11408c2ecf20Sopenharmony_ci#define MBOX_MBOX_BASE_ADDRESS			0x00008000
11418c2ecf20Sopenharmony_ci
11428c2ecf20Sopenharmony_ci#define RTC_STATE_V_GET(x) (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)
11438c2ecf20Sopenharmony_ci
11448c2ecf20Sopenharmony_ci/* Register definitions for first generation ath10k cards. These cards include
11458c2ecf20Sopenharmony_ci * a mac thich has a register allocation similar to ath9k and at least some
11468c2ecf20Sopenharmony_ci * registers including the ones relevant for modifying the coverage class are
11478c2ecf20Sopenharmony_ci * identical to the ath9k definitions.
11488c2ecf20Sopenharmony_ci * These registers are usually managed by the ath10k firmware. However by
11498c2ecf20Sopenharmony_ci * overriding them it is possible to support coverage class modifications.
11508c2ecf20Sopenharmony_ci */
11518c2ecf20Sopenharmony_ci#define WAVE1_PCU_ACK_CTS_TIMEOUT		0x8014
11528c2ecf20Sopenharmony_ci#define WAVE1_PCU_ACK_CTS_TIMEOUT_MAX		0x00003FFF
11538c2ecf20Sopenharmony_ci#define WAVE1_PCU_ACK_CTS_TIMEOUT_ACK_MASK	0x00003FFF
11548c2ecf20Sopenharmony_ci#define WAVE1_PCU_ACK_CTS_TIMEOUT_ACK_LSB	0
11558c2ecf20Sopenharmony_ci#define WAVE1_PCU_ACK_CTS_TIMEOUT_CTS_MASK	0x3FFF0000
11568c2ecf20Sopenharmony_ci#define WAVE1_PCU_ACK_CTS_TIMEOUT_CTS_LSB	16
11578c2ecf20Sopenharmony_ci
11588c2ecf20Sopenharmony_ci#define WAVE1_PCU_GBL_IFS_SLOT			0x1070
11598c2ecf20Sopenharmony_ci#define WAVE1_PCU_GBL_IFS_SLOT_MASK		0x0000FFFF
11608c2ecf20Sopenharmony_ci#define WAVE1_PCU_GBL_IFS_SLOT_MAX		0x0000FFFF
11618c2ecf20Sopenharmony_ci#define WAVE1_PCU_GBL_IFS_SLOT_LSB		0
11628c2ecf20Sopenharmony_ci#define WAVE1_PCU_GBL_IFS_SLOT_RESV0		0xFFFF0000
11638c2ecf20Sopenharmony_ci
11648c2ecf20Sopenharmony_ci#define WAVE1_PHYCLK				0x801C
11658c2ecf20Sopenharmony_ci#define WAVE1_PHYCLK_USEC_MASK			0x0000007F
11668c2ecf20Sopenharmony_ci#define WAVE1_PHYCLK_USEC_LSB			0
11678c2ecf20Sopenharmony_ci
11688c2ecf20Sopenharmony_ci/* qca6174 PLL offset/mask */
11698c2ecf20Sopenharmony_ci#define SOC_CORE_CLK_CTRL_OFFSET		0x00000114
11708c2ecf20Sopenharmony_ci#define SOC_CORE_CLK_CTRL_DIV_LSB		0
11718c2ecf20Sopenharmony_ci#define SOC_CORE_CLK_CTRL_DIV_MASK		0x00000007
11728c2ecf20Sopenharmony_ci
11738c2ecf20Sopenharmony_ci#define EFUSE_OFFSET				0x0000032c
11748c2ecf20Sopenharmony_ci#define EFUSE_XTAL_SEL_LSB			8
11758c2ecf20Sopenharmony_ci#define EFUSE_XTAL_SEL_MASK			0x00000700
11768c2ecf20Sopenharmony_ci
11778c2ecf20Sopenharmony_ci#define BB_PLL_CONFIG_OFFSET			0x000002f4
11788c2ecf20Sopenharmony_ci#define BB_PLL_CONFIG_FRAC_LSB			0
11798c2ecf20Sopenharmony_ci#define BB_PLL_CONFIG_FRAC_MASK			0x0003ffff
11808c2ecf20Sopenharmony_ci#define BB_PLL_CONFIG_OUTDIV_LSB		18
11818c2ecf20Sopenharmony_ci#define BB_PLL_CONFIG_OUTDIV_MASK		0x001c0000
11828c2ecf20Sopenharmony_ci
11838c2ecf20Sopenharmony_ci#define WLAN_PLL_SETTLE_OFFSET			0x0018
11848c2ecf20Sopenharmony_ci#define WLAN_PLL_SETTLE_TIME_LSB		0
11858c2ecf20Sopenharmony_ci#define WLAN_PLL_SETTLE_TIME_MASK		0x000007ff
11868c2ecf20Sopenharmony_ci
11878c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_OFFSET			0x0014
11888c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_DIV_LSB		0
11898c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_DIV_MASK		0x000003ff
11908c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_REFDIV_LSB		10
11918c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_REFDIV_MASK		0x00003c00
11928c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_BYPASS_LSB		16
11938c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_BYPASS_MASK		0x00010000
11948c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_NOPWD_LSB		18
11958c2ecf20Sopenharmony_ci#define WLAN_PLL_CONTROL_NOPWD_MASK		0x00040000
11968c2ecf20Sopenharmony_ci
11978c2ecf20Sopenharmony_ci#define RTC_SYNC_STATUS_OFFSET			0x0244
11988c2ecf20Sopenharmony_ci#define RTC_SYNC_STATUS_PLL_CHANGING_LSB	5
11998c2ecf20Sopenharmony_ci#define RTC_SYNC_STATUS_PLL_CHANGING_MASK	0x00000020
12008c2ecf20Sopenharmony_ci/* qca6174 PLL offset/mask end */
12018c2ecf20Sopenharmony_ci
12028c2ecf20Sopenharmony_ci/* CPU_ADDR_MSB is a register, bit[3:0] is to specify which memory
12038c2ecf20Sopenharmony_ci * region is accessed. The memory region size is 1M.
12048c2ecf20Sopenharmony_ci * If host wants to access 0xX12345 at target, then CPU_ADDR_MSB[3:0]
12058c2ecf20Sopenharmony_ci * is 0xX.
12068c2ecf20Sopenharmony_ci * The following MACROs are defined to get the 0xX and the size limit.
12078c2ecf20Sopenharmony_ci */
12088c2ecf20Sopenharmony_ci#define CPU_ADDR_MSB_REGION_MASK	GENMASK(23, 20)
12098c2ecf20Sopenharmony_ci#define CPU_ADDR_MSB_REGION_VAL(X)	FIELD_GET(CPU_ADDR_MSB_REGION_MASK, X)
12108c2ecf20Sopenharmony_ci#define REGION_ACCESS_SIZE_LIMIT	0x100000
12118c2ecf20Sopenharmony_ci#define REGION_ACCESS_SIZE_MASK		(REGION_ACCESS_SIZE_LIMIT - 1)
12128c2ecf20Sopenharmony_ci
12138c2ecf20Sopenharmony_ci#endif /* _HW_H_ */
1214