18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci	Copyright (C) 2004 - 2010 Ivo van Doorn <IvDoorn@gmail.com>
48c2ecf20Sopenharmony_ci	Copyright (C) 2010 Willow Garage <http://www.willowgarage.com>
58c2ecf20Sopenharmony_ci	Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
68c2ecf20Sopenharmony_ci	Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
78c2ecf20Sopenharmony_ci	Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com>
88c2ecf20Sopenharmony_ci	Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de>
98c2ecf20Sopenharmony_ci	Copyright (C) 2009 Mark Asselstine <asselsm@gmail.com>
108c2ecf20Sopenharmony_ci	Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com>
118c2ecf20Sopenharmony_ci	Copyright (C) 2009 Bart Zolnierkiewicz <bzolnier@gmail.com>
128c2ecf20Sopenharmony_ci	<http://rt2x00.serialmonkey.com>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/*
178c2ecf20Sopenharmony_ci	Module: rt2800
188c2ecf20Sopenharmony_ci	Abstract: Data structures and registers for the rt2800 modules.
198c2ecf20Sopenharmony_ci	Supported chipsets: RT2800E, RT2800ED & RT2800U.
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#ifndef RT2800_H
238c2ecf20Sopenharmony_ci#define RT2800_H
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/*
268c2ecf20Sopenharmony_ci * RF chip defines.
278c2ecf20Sopenharmony_ci *
288c2ecf20Sopenharmony_ci * RF2820 2.4G 2T3R
298c2ecf20Sopenharmony_ci * RF2850 2.4G/5G 2T3R
308c2ecf20Sopenharmony_ci * RF2720 2.4G 1T2R
318c2ecf20Sopenharmony_ci * RF2750 2.4G/5G 1T2R
328c2ecf20Sopenharmony_ci * RF3020 2.4G 1T1R
338c2ecf20Sopenharmony_ci * RF2020 2.4G B/G
348c2ecf20Sopenharmony_ci * RF3021 2.4G 1T2R
358c2ecf20Sopenharmony_ci * RF3022 2.4G 2T2R
368c2ecf20Sopenharmony_ci * RF3052 2.4G/5G 2T2R
378c2ecf20Sopenharmony_ci * RF2853 2.4G/5G 3T3R
388c2ecf20Sopenharmony_ci * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390)
398c2ecf20Sopenharmony_ci * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392)
408c2ecf20Sopenharmony_ci * RF3053 2.4G/5G 3T3R(RT3563/RT3573/RT3593)
418c2ecf20Sopenharmony_ci * RF3853 2.4G/5G 3T3R(RT3883/RT3662)
428c2ecf20Sopenharmony_ci * RF5592 2.4G/5G 2T2R
438c2ecf20Sopenharmony_ci * RF3070 2.4G 1T1R
448c2ecf20Sopenharmony_ci * RF5360 2.4G 1T1R
458c2ecf20Sopenharmony_ci * RF5362 2.4G 1T1R
468c2ecf20Sopenharmony_ci * RF5370 2.4G 1T1R
478c2ecf20Sopenharmony_ci * RF5390 2.4G 1T1R
488c2ecf20Sopenharmony_ci */
498c2ecf20Sopenharmony_ci#define RF2820				0x0001
508c2ecf20Sopenharmony_ci#define RF2850				0x0002
518c2ecf20Sopenharmony_ci#define RF2720				0x0003
528c2ecf20Sopenharmony_ci#define RF2750				0x0004
538c2ecf20Sopenharmony_ci#define RF3020				0x0005
548c2ecf20Sopenharmony_ci#define RF2020				0x0006
558c2ecf20Sopenharmony_ci#define RF3021				0x0007
568c2ecf20Sopenharmony_ci#define RF3022				0x0008
578c2ecf20Sopenharmony_ci#define RF3052				0x0009
588c2ecf20Sopenharmony_ci#define RF2853				0x000a
598c2ecf20Sopenharmony_ci#define RF3320				0x000b
608c2ecf20Sopenharmony_ci#define RF3322				0x000c
618c2ecf20Sopenharmony_ci#define RF3053				0x000d
628c2ecf20Sopenharmony_ci#define RF5592				0x000f
638c2ecf20Sopenharmony_ci#define RF3070				0x3070
648c2ecf20Sopenharmony_ci#define RF3290				0x3290
658c2ecf20Sopenharmony_ci#define RF3853				0x3853
668c2ecf20Sopenharmony_ci#define RF5350				0x5350
678c2ecf20Sopenharmony_ci#define RF5360				0x5360
688c2ecf20Sopenharmony_ci#define RF5362				0x5362
698c2ecf20Sopenharmony_ci#define RF5370				0x5370
708c2ecf20Sopenharmony_ci#define RF5372				0x5372
718c2ecf20Sopenharmony_ci#define RF5390				0x5390
728c2ecf20Sopenharmony_ci#define RF5392				0x5392
738c2ecf20Sopenharmony_ci#define RF7620				0x7620
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci/*
768c2ecf20Sopenharmony_ci * Chipset revisions.
778c2ecf20Sopenharmony_ci */
788c2ecf20Sopenharmony_ci#define REV_RT2860C			0x0100
798c2ecf20Sopenharmony_ci#define REV_RT2860D			0x0101
808c2ecf20Sopenharmony_ci#define REV_RT2872E			0x0200
818c2ecf20Sopenharmony_ci#define REV_RT3070E			0x0200
828c2ecf20Sopenharmony_ci#define REV_RT3070F			0x0201
838c2ecf20Sopenharmony_ci#define REV_RT3071E			0x0211
848c2ecf20Sopenharmony_ci#define REV_RT3090E			0x0211
858c2ecf20Sopenharmony_ci#define REV_RT3390E			0x0211
868c2ecf20Sopenharmony_ci#define REV_RT3593E			0x0211
878c2ecf20Sopenharmony_ci#define REV_RT5390F			0x0502
888c2ecf20Sopenharmony_ci#define REV_RT5370G			0x0503
898c2ecf20Sopenharmony_ci#define REV_RT5390R			0x1502
908c2ecf20Sopenharmony_ci#define REV_RT5592C			0x0221
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define DEFAULT_RSSI_OFFSET		120
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci/*
958c2ecf20Sopenharmony_ci * Register layout information.
968c2ecf20Sopenharmony_ci */
978c2ecf20Sopenharmony_ci#define CSR_REG_BASE			0x1000
988c2ecf20Sopenharmony_ci#define CSR_REG_SIZE			0x0800
998c2ecf20Sopenharmony_ci#define EEPROM_BASE			0x0000
1008c2ecf20Sopenharmony_ci#define EEPROM_SIZE			0x0200
1018c2ecf20Sopenharmony_ci#define BBP_BASE			0x0000
1028c2ecf20Sopenharmony_ci#define BBP_SIZE			0x00ff
1038c2ecf20Sopenharmony_ci#define RF_BASE				0x0004
1048c2ecf20Sopenharmony_ci#define RF_SIZE				0x0010
1058c2ecf20Sopenharmony_ci#define RFCSR_BASE			0x0000
1068c2ecf20Sopenharmony_ci#define RFCSR_SIZE			0x0040
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/*
1098c2ecf20Sopenharmony_ci * Number of TX queues.
1108c2ecf20Sopenharmony_ci */
1118c2ecf20Sopenharmony_ci#define NUM_TX_QUEUES			4
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci/*
1148c2ecf20Sopenharmony_ci * Registers.
1158c2ecf20Sopenharmony_ci */
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci/*
1198c2ecf20Sopenharmony_ci * MAC_CSR0_3290: MAC_CSR0 for RT3290 to identity MAC version number.
1208c2ecf20Sopenharmony_ci */
1218c2ecf20Sopenharmony_ci#define MAC_CSR0_3290			0x0000
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci/*
1248c2ecf20Sopenharmony_ci * E2PROM_CSR: PCI EEPROM control register.
1258c2ecf20Sopenharmony_ci * RELOAD: Write 1 to reload eeprom content.
1268c2ecf20Sopenharmony_ci * TYPE: 0: 93c46, 1:93c66.
1278c2ecf20Sopenharmony_ci * LOAD_STATUS: 1:loading, 0:done.
1288c2ecf20Sopenharmony_ci */
1298c2ecf20Sopenharmony_ci#define E2PROM_CSR			0x0004
1308c2ecf20Sopenharmony_ci#define E2PROM_CSR_DATA_CLOCK		FIELD32(0x00000001)
1318c2ecf20Sopenharmony_ci#define E2PROM_CSR_CHIP_SELECT		FIELD32(0x00000002)
1328c2ecf20Sopenharmony_ci#define E2PROM_CSR_DATA_IN		FIELD32(0x00000004)
1338c2ecf20Sopenharmony_ci#define E2PROM_CSR_DATA_OUT		FIELD32(0x00000008)
1348c2ecf20Sopenharmony_ci#define E2PROM_CSR_TYPE			FIELD32(0x00000030)
1358c2ecf20Sopenharmony_ci#define E2PROM_CSR_LOAD_STATUS		FIELD32(0x00000040)
1368c2ecf20Sopenharmony_ci#define E2PROM_CSR_RELOAD		FIELD32(0x00000080)
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci/*
1398c2ecf20Sopenharmony_ci * CMB_CTRL_CFG
1408c2ecf20Sopenharmony_ci */
1418c2ecf20Sopenharmony_ci#define CMB_CTRL		0x0020
1428c2ecf20Sopenharmony_ci#define AUX_OPT_BIT0		FIELD32(0x00000001)
1438c2ecf20Sopenharmony_ci#define AUX_OPT_BIT1		FIELD32(0x00000002)
1448c2ecf20Sopenharmony_ci#define AUX_OPT_BIT2		FIELD32(0x00000004)
1458c2ecf20Sopenharmony_ci#define AUX_OPT_BIT3		FIELD32(0x00000008)
1468c2ecf20Sopenharmony_ci#define AUX_OPT_BIT4		FIELD32(0x00000010)
1478c2ecf20Sopenharmony_ci#define AUX_OPT_BIT5		FIELD32(0x00000020)
1488c2ecf20Sopenharmony_ci#define AUX_OPT_BIT6		FIELD32(0x00000040)
1498c2ecf20Sopenharmony_ci#define AUX_OPT_BIT7		FIELD32(0x00000080)
1508c2ecf20Sopenharmony_ci#define AUX_OPT_BIT8		FIELD32(0x00000100)
1518c2ecf20Sopenharmony_ci#define AUX_OPT_BIT9		FIELD32(0x00000200)
1528c2ecf20Sopenharmony_ci#define AUX_OPT_BIT10		FIELD32(0x00000400)
1538c2ecf20Sopenharmony_ci#define AUX_OPT_BIT11		FIELD32(0x00000800)
1548c2ecf20Sopenharmony_ci#define AUX_OPT_BIT12		FIELD32(0x00001000)
1558c2ecf20Sopenharmony_ci#define AUX_OPT_BIT13		FIELD32(0x00002000)
1568c2ecf20Sopenharmony_ci#define AUX_OPT_BIT14		FIELD32(0x00004000)
1578c2ecf20Sopenharmony_ci#define AUX_OPT_BIT15		FIELD32(0x00008000)
1588c2ecf20Sopenharmony_ci#define LDO25_LEVEL		FIELD32(0x00030000)
1598c2ecf20Sopenharmony_ci#define LDO25_LARGEA		FIELD32(0x00040000)
1608c2ecf20Sopenharmony_ci#define LDO25_FRC_ON		FIELD32(0x00080000)
1618c2ecf20Sopenharmony_ci#define CMB_RSV			FIELD32(0x00300000)
1628c2ecf20Sopenharmony_ci#define XTAL_RDY		FIELD32(0x00400000)
1638c2ecf20Sopenharmony_ci#define PLL_LD			FIELD32(0x00800000)
1648c2ecf20Sopenharmony_ci#define LDO_CORE_LEVEL		FIELD32(0x0F000000)
1658c2ecf20Sopenharmony_ci#define LDO_BGSEL		FIELD32(0x30000000)
1668c2ecf20Sopenharmony_ci#define LDO3_EN			FIELD32(0x40000000)
1678c2ecf20Sopenharmony_ci#define LDO0_EN			FIELD32(0x80000000)
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci/*
1708c2ecf20Sopenharmony_ci * EFUSE_CSR_3290: RT3290 EEPROM
1718c2ecf20Sopenharmony_ci */
1728c2ecf20Sopenharmony_ci#define EFUSE_CTRL_3290			0x0024
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci/*
1758c2ecf20Sopenharmony_ci * EFUSE_DATA3 of 3290
1768c2ecf20Sopenharmony_ci */
1778c2ecf20Sopenharmony_ci#define EFUSE_DATA3_3290		0x0028
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci/*
1808c2ecf20Sopenharmony_ci * EFUSE_DATA2 of 3290
1818c2ecf20Sopenharmony_ci */
1828c2ecf20Sopenharmony_ci#define EFUSE_DATA2_3290		0x002c
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci/*
1858c2ecf20Sopenharmony_ci * EFUSE_DATA1 of 3290
1868c2ecf20Sopenharmony_ci */
1878c2ecf20Sopenharmony_ci#define EFUSE_DATA1_3290		0x0030
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci/*
1908c2ecf20Sopenharmony_ci * EFUSE_DATA0 of 3290
1918c2ecf20Sopenharmony_ci */
1928c2ecf20Sopenharmony_ci#define EFUSE_DATA0_3290		0x0034
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci/*
1958c2ecf20Sopenharmony_ci * OSC_CTRL_CFG
1968c2ecf20Sopenharmony_ci * Ring oscillator configuration
1978c2ecf20Sopenharmony_ci */
1988c2ecf20Sopenharmony_ci#define OSC_CTRL		0x0038
1998c2ecf20Sopenharmony_ci#define OSC_REF_CYCLE		FIELD32(0x00001fff)
2008c2ecf20Sopenharmony_ci#define OSC_RSV			FIELD32(0x0000e000)
2018c2ecf20Sopenharmony_ci#define OSC_CAL_CNT		FIELD32(0x0fff0000)
2028c2ecf20Sopenharmony_ci#define OSC_CAL_ACK		FIELD32(0x10000000)
2038c2ecf20Sopenharmony_ci#define OSC_CLK_32K_VLD		FIELD32(0x20000000)
2048c2ecf20Sopenharmony_ci#define OSC_CAL_REQ		FIELD32(0x40000000)
2058c2ecf20Sopenharmony_ci#define OSC_ROSC_EN		FIELD32(0x80000000)
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/*
2088c2ecf20Sopenharmony_ci * COEX_CFG_0
2098c2ecf20Sopenharmony_ci */
2108c2ecf20Sopenharmony_ci#define COEX_CFG0		0x0040
2118c2ecf20Sopenharmony_ci#define COEX_CFG_ANT		FIELD32(0xff000000)
2128c2ecf20Sopenharmony_ci/*
2138c2ecf20Sopenharmony_ci * COEX_CFG_1
2148c2ecf20Sopenharmony_ci */
2158c2ecf20Sopenharmony_ci#define COEX_CFG1		0x0044
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci/*
2188c2ecf20Sopenharmony_ci * COEX_CFG_2
2198c2ecf20Sopenharmony_ci */
2208c2ecf20Sopenharmony_ci#define COEX_CFG2		0x0048
2218c2ecf20Sopenharmony_ci#define BT_COEX_CFG1		FIELD32(0xff000000)
2228c2ecf20Sopenharmony_ci#define BT_COEX_CFG0		FIELD32(0x00ff0000)
2238c2ecf20Sopenharmony_ci#define WL_COEX_CFG1		FIELD32(0x0000ff00)
2248c2ecf20Sopenharmony_ci#define WL_COEX_CFG0		FIELD32(0x000000ff)
2258c2ecf20Sopenharmony_ci/*
2268c2ecf20Sopenharmony_ci * PLL_CTRL_CFG
2278c2ecf20Sopenharmony_ci * PLL configuration register
2288c2ecf20Sopenharmony_ci */
2298c2ecf20Sopenharmony_ci#define PLL_CTRL		0x0050
2308c2ecf20Sopenharmony_ci#define PLL_RESERVED_INPUT1	FIELD32(0x000000ff)
2318c2ecf20Sopenharmony_ci#define PLL_RESERVED_INPUT2	FIELD32(0x0000ff00)
2328c2ecf20Sopenharmony_ci#define PLL_CONTROL		FIELD32(0x00070000)
2338c2ecf20Sopenharmony_ci#define PLL_LPF_R1		FIELD32(0x00080000)
2348c2ecf20Sopenharmony_ci#define PLL_LPF_C1_CTRL		FIELD32(0x00300000)
2358c2ecf20Sopenharmony_ci#define PLL_LPF_C2_CTRL		FIELD32(0x00c00000)
2368c2ecf20Sopenharmony_ci#define PLL_CP_CURRENT_CTRL	FIELD32(0x03000000)
2378c2ecf20Sopenharmony_ci#define PLL_PFD_DELAY_CTRL	FIELD32(0x0c000000)
2388c2ecf20Sopenharmony_ci#define PLL_LOCK_CTRL		FIELD32(0x70000000)
2398c2ecf20Sopenharmony_ci#define PLL_VBGBK_EN		FIELD32(0x80000000)
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci/*
2438c2ecf20Sopenharmony_ci * WLAN_CTRL_CFG
2448c2ecf20Sopenharmony_ci * RT3290 wlan configuration
2458c2ecf20Sopenharmony_ci */
2468c2ecf20Sopenharmony_ci#define WLAN_FUN_CTRL			0x0080
2478c2ecf20Sopenharmony_ci#define WLAN_EN				FIELD32(0x00000001)
2488c2ecf20Sopenharmony_ci#define WLAN_CLK_EN			FIELD32(0x00000002)
2498c2ecf20Sopenharmony_ci#define WLAN_RSV1			FIELD32(0x00000004)
2508c2ecf20Sopenharmony_ci#define WLAN_RESET			FIELD32(0x00000008)
2518c2ecf20Sopenharmony_ci#define PCIE_APP0_CLK_REQ		FIELD32(0x00000010)
2528c2ecf20Sopenharmony_ci#define FRC_WL_ANT_SET			FIELD32(0x00000020)
2538c2ecf20Sopenharmony_ci#define INV_TR_SW0			FIELD32(0x00000040)
2548c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT0		FIELD32(0x00000100)
2558c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT1		FIELD32(0x00000200)
2568c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT2		FIELD32(0x00000400)
2578c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT3		FIELD32(0x00000800)
2588c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT4		FIELD32(0x00001000)
2598c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT5		FIELD32(0x00002000)
2608c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT6		FIELD32(0x00004000)
2618c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT7		FIELD32(0x00008000)
2628c2ecf20Sopenharmony_ci#define WLAN_GPIO_IN_BIT_ALL		FIELD32(0x0000ff00)
2638c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT0		FIELD32(0x00010000)
2648c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT1		FIELD32(0x00020000)
2658c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT2		FIELD32(0x00040000)
2668c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT3		FIELD32(0x00050000)
2678c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT4		FIELD32(0x00100000)
2688c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT5		FIELD32(0x00200000)
2698c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT6		FIELD32(0x00400000)
2708c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT7		FIELD32(0x00800000)
2718c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_BIT_ALL		FIELD32(0x00ff0000)
2728c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT0		FIELD32(0x01000000)
2738c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT1		FIELD32(0x02000000)
2748c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT2		FIELD32(0x04000000)
2758c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT3		FIELD32(0x08000000)
2768c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT4		FIELD32(0x10000000)
2778c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT5		FIELD32(0x20000000)
2788c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT6		FIELD32(0x40000000)
2798c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT7		FIELD32(0x80000000)
2808c2ecf20Sopenharmony_ci#define WLAN_GPIO_OUT_OE_BIT_ALL	FIELD32(0xff000000)
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci/*
2838c2ecf20Sopenharmony_ci * AUX_CTRL: Aux/PCI-E related configuration
2848c2ecf20Sopenharmony_ci */
2858c2ecf20Sopenharmony_ci#define AUX_CTRL			0x10c
2868c2ecf20Sopenharmony_ci#define AUX_CTRL_WAKE_PCIE_EN		FIELD32(0x00000002)
2878c2ecf20Sopenharmony_ci#define AUX_CTRL_FORCE_PCIE_CLK		FIELD32(0x00000400)
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci/*
2908c2ecf20Sopenharmony_ci * OPT_14: Unknown register used by rt3xxx devices.
2918c2ecf20Sopenharmony_ci */
2928c2ecf20Sopenharmony_ci#define OPT_14_CSR			0x0114
2938c2ecf20Sopenharmony_ci#define OPT_14_CSR_BIT0			FIELD32(0x00000001)
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci/*
2968c2ecf20Sopenharmony_ci * INT_SOURCE_CSR: Interrupt source register.
2978c2ecf20Sopenharmony_ci * Write one to clear corresponding bit.
2988c2ecf20Sopenharmony_ci * TX_FIFO_STATUS: FIFO Statistics is full, sw should read TX_STA_FIFO
2998c2ecf20Sopenharmony_ci */
3008c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR			0x0200
3018c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_RXDELAYINT	FIELD32(0x00000001)
3028c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_TXDELAYINT	FIELD32(0x00000002)
3038c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_RX_DONE		FIELD32(0x00000004)
3048c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AC0_DMA_DONE	FIELD32(0x00000008)
3058c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AC1_DMA_DONE	FIELD32(0x00000010)
3068c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AC2_DMA_DONE	FIELD32(0x00000020)
3078c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AC3_DMA_DONE	FIELD32(0x00000040)
3088c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_HCCA_DMA_DONE	FIELD32(0x00000080)
3098c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_MGMT_DMA_DONE	FIELD32(0x00000100)
3108c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_MCU_COMMAND	FIELD32(0x00000200)
3118c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_RXTX_COHERENT	FIELD32(0x00000400)
3128c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_TBTT		FIELD32(0x00000800)
3138c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_PRE_TBTT		FIELD32(0x00001000)
3148c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_TX_FIFO_STATUS	FIELD32(0x00002000)
3158c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AUTO_WAKEUP	FIELD32(0x00004000)
3168c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_GPTIMER		FIELD32(0x00008000)
3178c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_RX_COHERENT	FIELD32(0x00010000)
3188c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_TX_COHERENT	FIELD32(0x00020000)
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ci/*
3218c2ecf20Sopenharmony_ci * INT_MASK_CSR: Interrupt MASK register. 1: the interrupt is mask OFF.
3228c2ecf20Sopenharmony_ci */
3238c2ecf20Sopenharmony_ci#define INT_MASK_CSR			0x0204
3248c2ecf20Sopenharmony_ci#define INT_MASK_CSR_RXDELAYINT		FIELD32(0x00000001)
3258c2ecf20Sopenharmony_ci#define INT_MASK_CSR_TXDELAYINT		FIELD32(0x00000002)
3268c2ecf20Sopenharmony_ci#define INT_MASK_CSR_RX_DONE		FIELD32(0x00000004)
3278c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AC0_DMA_DONE	FIELD32(0x00000008)
3288c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AC1_DMA_DONE	FIELD32(0x00000010)
3298c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AC2_DMA_DONE	FIELD32(0x00000020)
3308c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AC3_DMA_DONE	FIELD32(0x00000040)
3318c2ecf20Sopenharmony_ci#define INT_MASK_CSR_HCCA_DMA_DONE	FIELD32(0x00000080)
3328c2ecf20Sopenharmony_ci#define INT_MASK_CSR_MGMT_DMA_DONE	FIELD32(0x00000100)
3338c2ecf20Sopenharmony_ci#define INT_MASK_CSR_MCU_COMMAND	FIELD32(0x00000200)
3348c2ecf20Sopenharmony_ci#define INT_MASK_CSR_RXTX_COHERENT	FIELD32(0x00000400)
3358c2ecf20Sopenharmony_ci#define INT_MASK_CSR_TBTT		FIELD32(0x00000800)
3368c2ecf20Sopenharmony_ci#define INT_MASK_CSR_PRE_TBTT		FIELD32(0x00001000)
3378c2ecf20Sopenharmony_ci#define INT_MASK_CSR_TX_FIFO_STATUS	FIELD32(0x00002000)
3388c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AUTO_WAKEUP	FIELD32(0x00004000)
3398c2ecf20Sopenharmony_ci#define INT_MASK_CSR_GPTIMER		FIELD32(0x00008000)
3408c2ecf20Sopenharmony_ci#define INT_MASK_CSR_RX_COHERENT	FIELD32(0x00010000)
3418c2ecf20Sopenharmony_ci#define INT_MASK_CSR_TX_COHERENT	FIELD32(0x00020000)
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci/*
3448c2ecf20Sopenharmony_ci * WPDMA_GLO_CFG
3458c2ecf20Sopenharmony_ci */
3468c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG 			0x0208
3478c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_ENABLE_TX_DMA	FIELD32(0x00000001)
3488c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_TX_DMA_BUSY    	FIELD32(0x00000002)
3498c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_ENABLE_RX_DMA	FIELD32(0x00000004)
3508c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_RX_DMA_BUSY	FIELD32(0x00000008)
3518c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_WP_DMA_BURST_SIZE	FIELD32(0x00000030)
3528c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_TX_WRITEBACK_DONE	FIELD32(0x00000040)
3538c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_BIG_ENDIAN	FIELD32(0x00000080)
3548c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_RX_HDR_SCATTER	FIELD32(0x0000ff00)
3558c2ecf20Sopenharmony_ci#define WPDMA_GLO_CFG_HDR_SEG_LEN	FIELD32(0xffff0000)
3568c2ecf20Sopenharmony_ci
3578c2ecf20Sopenharmony_ci/*
3588c2ecf20Sopenharmony_ci * WPDMA_RST_IDX
3598c2ecf20Sopenharmony_ci */
3608c2ecf20Sopenharmony_ci#define WPDMA_RST_IDX 			0x020c
3618c2ecf20Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX0		FIELD32(0x00000001)
3628c2ecf20Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX1		FIELD32(0x00000002)
3638c2ecf20Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX2		FIELD32(0x00000004)
3648c2ecf20Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX3		FIELD32(0x00000008)
3658c2ecf20Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX4		FIELD32(0x00000010)
3668c2ecf20Sopenharmony_ci#define WPDMA_RST_IDX_DTX_IDX5		FIELD32(0x00000020)
3678c2ecf20Sopenharmony_ci#define WPDMA_RST_IDX_DRX_IDX0		FIELD32(0x00010000)
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_ci/*
3708c2ecf20Sopenharmony_ci * DELAY_INT_CFG
3718c2ecf20Sopenharmony_ci */
3728c2ecf20Sopenharmony_ci#define DELAY_INT_CFG			0x0210
3738c2ecf20Sopenharmony_ci#define DELAY_INT_CFG_RXMAX_PTIME	FIELD32(0x000000ff)
3748c2ecf20Sopenharmony_ci#define DELAY_INT_CFG_RXMAX_PINT	FIELD32(0x00007f00)
3758c2ecf20Sopenharmony_ci#define DELAY_INT_CFG_RXDLY_INT_EN	FIELD32(0x00008000)
3768c2ecf20Sopenharmony_ci#define DELAY_INT_CFG_TXMAX_PTIME	FIELD32(0x00ff0000)
3778c2ecf20Sopenharmony_ci#define DELAY_INT_CFG_TXMAX_PINT	FIELD32(0x7f000000)
3788c2ecf20Sopenharmony_ci#define DELAY_INT_CFG_TXDLY_INT_EN	FIELD32(0x80000000)
3798c2ecf20Sopenharmony_ci
3808c2ecf20Sopenharmony_ci/*
3818c2ecf20Sopenharmony_ci * WMM_AIFSN_CFG: Aifsn for each EDCA AC
3828c2ecf20Sopenharmony_ci * AIFSN0: AC_VO
3838c2ecf20Sopenharmony_ci * AIFSN1: AC_VI
3848c2ecf20Sopenharmony_ci * AIFSN2: AC_BE
3858c2ecf20Sopenharmony_ci * AIFSN3: AC_BK
3868c2ecf20Sopenharmony_ci */
3878c2ecf20Sopenharmony_ci#define WMM_AIFSN_CFG			0x0214
3888c2ecf20Sopenharmony_ci#define WMM_AIFSN_CFG_AIFSN0		FIELD32(0x0000000f)
3898c2ecf20Sopenharmony_ci#define WMM_AIFSN_CFG_AIFSN1		FIELD32(0x000000f0)
3908c2ecf20Sopenharmony_ci#define WMM_AIFSN_CFG_AIFSN2		FIELD32(0x00000f00)
3918c2ecf20Sopenharmony_ci#define WMM_AIFSN_CFG_AIFSN3		FIELD32(0x0000f000)
3928c2ecf20Sopenharmony_ci
3938c2ecf20Sopenharmony_ci/*
3948c2ecf20Sopenharmony_ci * WMM_CWMIN_CSR: CWmin for each EDCA AC
3958c2ecf20Sopenharmony_ci * CWMIN0: AC_VO
3968c2ecf20Sopenharmony_ci * CWMIN1: AC_VI
3978c2ecf20Sopenharmony_ci * CWMIN2: AC_BE
3988c2ecf20Sopenharmony_ci * CWMIN3: AC_BK
3998c2ecf20Sopenharmony_ci */
4008c2ecf20Sopenharmony_ci#define WMM_CWMIN_CFG			0x0218
4018c2ecf20Sopenharmony_ci#define WMM_CWMIN_CFG_CWMIN0		FIELD32(0x0000000f)
4028c2ecf20Sopenharmony_ci#define WMM_CWMIN_CFG_CWMIN1		FIELD32(0x000000f0)
4038c2ecf20Sopenharmony_ci#define WMM_CWMIN_CFG_CWMIN2		FIELD32(0x00000f00)
4048c2ecf20Sopenharmony_ci#define WMM_CWMIN_CFG_CWMIN3		FIELD32(0x0000f000)
4058c2ecf20Sopenharmony_ci
4068c2ecf20Sopenharmony_ci/*
4078c2ecf20Sopenharmony_ci * WMM_CWMAX_CSR: CWmax for each EDCA AC
4088c2ecf20Sopenharmony_ci * CWMAX0: AC_VO
4098c2ecf20Sopenharmony_ci * CWMAX1: AC_VI
4108c2ecf20Sopenharmony_ci * CWMAX2: AC_BE
4118c2ecf20Sopenharmony_ci * CWMAX3: AC_BK
4128c2ecf20Sopenharmony_ci */
4138c2ecf20Sopenharmony_ci#define WMM_CWMAX_CFG			0x021c
4148c2ecf20Sopenharmony_ci#define WMM_CWMAX_CFG_CWMAX0		FIELD32(0x0000000f)
4158c2ecf20Sopenharmony_ci#define WMM_CWMAX_CFG_CWMAX1		FIELD32(0x000000f0)
4168c2ecf20Sopenharmony_ci#define WMM_CWMAX_CFG_CWMAX2		FIELD32(0x00000f00)
4178c2ecf20Sopenharmony_ci#define WMM_CWMAX_CFG_CWMAX3		FIELD32(0x0000f000)
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_ci/*
4208c2ecf20Sopenharmony_ci * AC_TXOP0: AC_VO/AC_VI TXOP register
4218c2ecf20Sopenharmony_ci * AC0TXOP: AC_VO in unit of 32us
4228c2ecf20Sopenharmony_ci * AC1TXOP: AC_VI in unit of 32us
4238c2ecf20Sopenharmony_ci */
4248c2ecf20Sopenharmony_ci#define WMM_TXOP0_CFG			0x0220
4258c2ecf20Sopenharmony_ci#define WMM_TXOP0_CFG_AC0TXOP		FIELD32(0x0000ffff)
4268c2ecf20Sopenharmony_ci#define WMM_TXOP0_CFG_AC1TXOP		FIELD32(0xffff0000)
4278c2ecf20Sopenharmony_ci
4288c2ecf20Sopenharmony_ci/*
4298c2ecf20Sopenharmony_ci * AC_TXOP1: AC_BE/AC_BK TXOP register
4308c2ecf20Sopenharmony_ci * AC2TXOP: AC_BE in unit of 32us
4318c2ecf20Sopenharmony_ci * AC3TXOP: AC_BK in unit of 32us
4328c2ecf20Sopenharmony_ci */
4338c2ecf20Sopenharmony_ci#define WMM_TXOP1_CFG			0x0224
4348c2ecf20Sopenharmony_ci#define WMM_TXOP1_CFG_AC2TXOP		FIELD32(0x0000ffff)
4358c2ecf20Sopenharmony_ci#define WMM_TXOP1_CFG_AC3TXOP		FIELD32(0xffff0000)
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_ci/*
4388c2ecf20Sopenharmony_ci * GPIO_CTRL:
4398c2ecf20Sopenharmony_ci *	GPIO_CTRL_VALx: GPIO value
4408c2ecf20Sopenharmony_ci *	GPIO_CTRL_DIRx: GPIO direction: 0 = output; 1 = input
4418c2ecf20Sopenharmony_ci */
4428c2ecf20Sopenharmony_ci#define GPIO_CTRL			0x0228
4438c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL0			FIELD32(0x00000001)
4448c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL1			FIELD32(0x00000002)
4458c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL2			FIELD32(0x00000004)
4468c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL3			FIELD32(0x00000008)
4478c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL4			FIELD32(0x00000010)
4488c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL5			FIELD32(0x00000020)
4498c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL6			FIELD32(0x00000040)
4508c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL7			FIELD32(0x00000080)
4518c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR0			FIELD32(0x00000100)
4528c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR1			FIELD32(0x00000200)
4538c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR2			FIELD32(0x00000400)
4548c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR3			FIELD32(0x00000800)
4558c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR4			FIELD32(0x00001000)
4568c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR5			FIELD32(0x00002000)
4578c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR6			FIELD32(0x00004000)
4588c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR7			FIELD32(0x00008000)
4598c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL8			FIELD32(0x00010000)
4608c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL9			FIELD32(0x00020000)
4618c2ecf20Sopenharmony_ci#define GPIO_CTRL_VAL10			FIELD32(0x00040000)
4628c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR8			FIELD32(0x01000000)
4638c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR9			FIELD32(0x02000000)
4648c2ecf20Sopenharmony_ci#define GPIO_CTRL_DIR10			FIELD32(0x04000000)
4658c2ecf20Sopenharmony_ci
4668c2ecf20Sopenharmony_ci/*
4678c2ecf20Sopenharmony_ci * MCU_CMD_CFG
4688c2ecf20Sopenharmony_ci */
4698c2ecf20Sopenharmony_ci#define MCU_CMD_CFG			0x022c
4708c2ecf20Sopenharmony_ci
4718c2ecf20Sopenharmony_ci/*
4728c2ecf20Sopenharmony_ci * AC_VO register offsets
4738c2ecf20Sopenharmony_ci */
4748c2ecf20Sopenharmony_ci#define TX_BASE_PTR0			0x0230
4758c2ecf20Sopenharmony_ci#define TX_MAX_CNT0			0x0234
4768c2ecf20Sopenharmony_ci#define TX_CTX_IDX0			0x0238
4778c2ecf20Sopenharmony_ci#define TX_DTX_IDX0			0x023c
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci/*
4808c2ecf20Sopenharmony_ci * AC_VI register offsets
4818c2ecf20Sopenharmony_ci */
4828c2ecf20Sopenharmony_ci#define TX_BASE_PTR1			0x0240
4838c2ecf20Sopenharmony_ci#define TX_MAX_CNT1			0x0244
4848c2ecf20Sopenharmony_ci#define TX_CTX_IDX1			0x0248
4858c2ecf20Sopenharmony_ci#define TX_DTX_IDX1			0x024c
4868c2ecf20Sopenharmony_ci
4878c2ecf20Sopenharmony_ci/*
4888c2ecf20Sopenharmony_ci * AC_BE register offsets
4898c2ecf20Sopenharmony_ci */
4908c2ecf20Sopenharmony_ci#define TX_BASE_PTR2			0x0250
4918c2ecf20Sopenharmony_ci#define TX_MAX_CNT2			0x0254
4928c2ecf20Sopenharmony_ci#define TX_CTX_IDX2			0x0258
4938c2ecf20Sopenharmony_ci#define TX_DTX_IDX2			0x025c
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci/*
4968c2ecf20Sopenharmony_ci * AC_BK register offsets
4978c2ecf20Sopenharmony_ci */
4988c2ecf20Sopenharmony_ci#define TX_BASE_PTR3			0x0260
4998c2ecf20Sopenharmony_ci#define TX_MAX_CNT3			0x0264
5008c2ecf20Sopenharmony_ci#define TX_CTX_IDX3			0x0268
5018c2ecf20Sopenharmony_ci#define TX_DTX_IDX3			0x026c
5028c2ecf20Sopenharmony_ci
5038c2ecf20Sopenharmony_ci/*
5048c2ecf20Sopenharmony_ci * HCCA register offsets
5058c2ecf20Sopenharmony_ci */
5068c2ecf20Sopenharmony_ci#define TX_BASE_PTR4			0x0270
5078c2ecf20Sopenharmony_ci#define TX_MAX_CNT4			0x0274
5088c2ecf20Sopenharmony_ci#define TX_CTX_IDX4			0x0278
5098c2ecf20Sopenharmony_ci#define TX_DTX_IDX4			0x027c
5108c2ecf20Sopenharmony_ci
5118c2ecf20Sopenharmony_ci/*
5128c2ecf20Sopenharmony_ci * MGMT register offsets
5138c2ecf20Sopenharmony_ci */
5148c2ecf20Sopenharmony_ci#define TX_BASE_PTR5			0x0280
5158c2ecf20Sopenharmony_ci#define TX_MAX_CNT5			0x0284
5168c2ecf20Sopenharmony_ci#define TX_CTX_IDX5			0x0288
5178c2ecf20Sopenharmony_ci#define TX_DTX_IDX5			0x028c
5188c2ecf20Sopenharmony_ci
5198c2ecf20Sopenharmony_ci/*
5208c2ecf20Sopenharmony_ci * RX register offsets
5218c2ecf20Sopenharmony_ci */
5228c2ecf20Sopenharmony_ci#define RX_BASE_PTR			0x0290
5238c2ecf20Sopenharmony_ci#define RX_MAX_CNT			0x0294
5248c2ecf20Sopenharmony_ci#define RX_CRX_IDX			0x0298
5258c2ecf20Sopenharmony_ci#define RX_DRX_IDX			0x029c
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci/*
5288c2ecf20Sopenharmony_ci * USB_DMA_CFG
5298c2ecf20Sopenharmony_ci * RX_BULK_AGG_TIMEOUT: Rx Bulk Aggregation TimeOut in unit of 33ns.
5308c2ecf20Sopenharmony_ci * RX_BULK_AGG_LIMIT: Rx Bulk Aggregation Limit in unit of 256 bytes.
5318c2ecf20Sopenharmony_ci * PHY_CLEAR: phy watch dog enable.
5328c2ecf20Sopenharmony_ci * TX_CLEAR: Clear USB DMA TX path.
5338c2ecf20Sopenharmony_ci * TXOP_HALT: Halt TXOP count down when TX buffer is full.
5348c2ecf20Sopenharmony_ci * RX_BULK_AGG_EN: Enable Rx Bulk Aggregation.
5358c2ecf20Sopenharmony_ci * RX_BULK_EN: Enable USB DMA Rx.
5368c2ecf20Sopenharmony_ci * TX_BULK_EN: Enable USB DMA Tx.
5378c2ecf20Sopenharmony_ci * EP_OUT_VALID: OUT endpoint data valid.
5388c2ecf20Sopenharmony_ci * RX_BUSY: USB DMA RX FSM busy.
5398c2ecf20Sopenharmony_ci * TX_BUSY: USB DMA TX FSM busy.
5408c2ecf20Sopenharmony_ci */
5418c2ecf20Sopenharmony_ci#define USB_DMA_CFG			0x02a0
5428c2ecf20Sopenharmony_ci#define USB_DMA_CFG_RX_BULK_AGG_TIMEOUT	FIELD32(0x000000ff)
5438c2ecf20Sopenharmony_ci#define USB_DMA_CFG_RX_BULK_AGG_LIMIT	FIELD32(0x0000ff00)
5448c2ecf20Sopenharmony_ci#define USB_DMA_CFG_PHY_CLEAR		FIELD32(0x00010000)
5458c2ecf20Sopenharmony_ci#define USB_DMA_CFG_TX_CLEAR		FIELD32(0x00080000)
5468c2ecf20Sopenharmony_ci#define USB_DMA_CFG_TXOP_HALT		FIELD32(0x00100000)
5478c2ecf20Sopenharmony_ci#define USB_DMA_CFG_RX_BULK_AGG_EN	FIELD32(0x00200000)
5488c2ecf20Sopenharmony_ci#define USB_DMA_CFG_RX_BULK_EN		FIELD32(0x00400000)
5498c2ecf20Sopenharmony_ci#define USB_DMA_CFG_TX_BULK_EN		FIELD32(0x00800000)
5508c2ecf20Sopenharmony_ci#define USB_DMA_CFG_EP_OUT_VALID	FIELD32(0x3f000000)
5518c2ecf20Sopenharmony_ci#define USB_DMA_CFG_RX_BUSY		FIELD32(0x40000000)
5528c2ecf20Sopenharmony_ci#define USB_DMA_CFG_TX_BUSY		FIELD32(0x80000000)
5538c2ecf20Sopenharmony_ci
5548c2ecf20Sopenharmony_ci/*
5558c2ecf20Sopenharmony_ci * US_CYC_CNT
5568c2ecf20Sopenharmony_ci * BT_MODE_EN: Bluetooth mode enable
5578c2ecf20Sopenharmony_ci * CLOCK CYCLE: Clock cycle count in 1us.
5588c2ecf20Sopenharmony_ci * PCI:0x21, PCIE:0x7d, USB:0x1e
5598c2ecf20Sopenharmony_ci */
5608c2ecf20Sopenharmony_ci#define US_CYC_CNT			0x02a4
5618c2ecf20Sopenharmony_ci#define US_CYC_CNT_BT_MODE_EN		FIELD32(0x00000100)
5628c2ecf20Sopenharmony_ci#define US_CYC_CNT_CLOCK_CYCLE		FIELD32(0x000000ff)
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_ci/*
5658c2ecf20Sopenharmony_ci * PBF_SYS_CTRL
5668c2ecf20Sopenharmony_ci * HOST_RAM_WRITE: enable Host program ram write selection
5678c2ecf20Sopenharmony_ci */
5688c2ecf20Sopenharmony_ci#define PBF_SYS_CTRL			0x0400
5698c2ecf20Sopenharmony_ci#define PBF_SYS_CTRL_READY		FIELD32(0x00000080)
5708c2ecf20Sopenharmony_ci#define PBF_SYS_CTRL_HOST_RAM_WRITE	FIELD32(0x00010000)
5718c2ecf20Sopenharmony_ci
5728c2ecf20Sopenharmony_ci/*
5738c2ecf20Sopenharmony_ci * HOST-MCU shared memory
5748c2ecf20Sopenharmony_ci */
5758c2ecf20Sopenharmony_ci#define HOST_CMD_CSR			0x0404
5768c2ecf20Sopenharmony_ci#define HOST_CMD_CSR_HOST_COMMAND	FIELD32(0x000000ff)
5778c2ecf20Sopenharmony_ci
5788c2ecf20Sopenharmony_ci/*
5798c2ecf20Sopenharmony_ci * PBF registers
5808c2ecf20Sopenharmony_ci * Most are for debug. Driver doesn't touch PBF register.
5818c2ecf20Sopenharmony_ci */
5828c2ecf20Sopenharmony_ci#define PBF_CFG				0x0408
5838c2ecf20Sopenharmony_ci#define PBF_MAX_PCNT			0x040c
5848c2ecf20Sopenharmony_ci#define PBF_CTRL			0x0410
5858c2ecf20Sopenharmony_ci#define PBF_INT_STA			0x0414
5868c2ecf20Sopenharmony_ci#define PBF_INT_ENA			0x0418
5878c2ecf20Sopenharmony_ci
5888c2ecf20Sopenharmony_ci/*
5898c2ecf20Sopenharmony_ci * BCN_OFFSET0:
5908c2ecf20Sopenharmony_ci */
5918c2ecf20Sopenharmony_ci#define BCN_OFFSET0			0x042c
5928c2ecf20Sopenharmony_ci#define BCN_OFFSET0_BCN0		FIELD32(0x000000ff)
5938c2ecf20Sopenharmony_ci#define BCN_OFFSET0_BCN1		FIELD32(0x0000ff00)
5948c2ecf20Sopenharmony_ci#define BCN_OFFSET0_BCN2		FIELD32(0x00ff0000)
5958c2ecf20Sopenharmony_ci#define BCN_OFFSET0_BCN3		FIELD32(0xff000000)
5968c2ecf20Sopenharmony_ci
5978c2ecf20Sopenharmony_ci/*
5988c2ecf20Sopenharmony_ci * BCN_OFFSET1:
5998c2ecf20Sopenharmony_ci */
6008c2ecf20Sopenharmony_ci#define BCN_OFFSET1			0x0430
6018c2ecf20Sopenharmony_ci#define BCN_OFFSET1_BCN4		FIELD32(0x000000ff)
6028c2ecf20Sopenharmony_ci#define BCN_OFFSET1_BCN5		FIELD32(0x0000ff00)
6038c2ecf20Sopenharmony_ci#define BCN_OFFSET1_BCN6		FIELD32(0x00ff0000)
6048c2ecf20Sopenharmony_ci#define BCN_OFFSET1_BCN7		FIELD32(0xff000000)
6058c2ecf20Sopenharmony_ci
6068c2ecf20Sopenharmony_ci/*
6078c2ecf20Sopenharmony_ci * TXRXQ_PCNT: PBF register
6088c2ecf20Sopenharmony_ci * PCNT_TX0Q: Page count for TX hardware queue 0
6098c2ecf20Sopenharmony_ci * PCNT_TX1Q: Page count for TX hardware queue 1
6108c2ecf20Sopenharmony_ci * PCNT_TX2Q: Page count for TX hardware queue 2
6118c2ecf20Sopenharmony_ci * PCNT_RX0Q: Page count for RX hardware queue
6128c2ecf20Sopenharmony_ci */
6138c2ecf20Sopenharmony_ci#define TXRXQ_PCNT			0x0438
6148c2ecf20Sopenharmony_ci#define TXRXQ_PCNT_TX0Q			FIELD32(0x000000ff)
6158c2ecf20Sopenharmony_ci#define TXRXQ_PCNT_TX1Q			FIELD32(0x0000ff00)
6168c2ecf20Sopenharmony_ci#define TXRXQ_PCNT_TX2Q			FIELD32(0x00ff0000)
6178c2ecf20Sopenharmony_ci#define TXRXQ_PCNT_RX0Q			FIELD32(0xff000000)
6188c2ecf20Sopenharmony_ci
6198c2ecf20Sopenharmony_ci/*
6208c2ecf20Sopenharmony_ci * PBF register
6218c2ecf20Sopenharmony_ci * Debug. Driver doesn't touch PBF register.
6228c2ecf20Sopenharmony_ci */
6238c2ecf20Sopenharmony_ci#define PBF_DBG				0x043c
6248c2ecf20Sopenharmony_ci
6258c2ecf20Sopenharmony_ci/*
6268c2ecf20Sopenharmony_ci * RF registers
6278c2ecf20Sopenharmony_ci */
6288c2ecf20Sopenharmony_ci#define	RF_CSR_CFG			0x0500
6298c2ecf20Sopenharmony_ci#define RF_CSR_CFG_DATA			FIELD32(0x000000ff)
6308c2ecf20Sopenharmony_ci#define RF_CSR_CFG_REGNUM		FIELD32(0x00003f00)
6318c2ecf20Sopenharmony_ci#define RF_CSR_CFG_WRITE		FIELD32(0x00010000)
6328c2ecf20Sopenharmony_ci#define RF_CSR_CFG_BUSY			FIELD32(0x00020000)
6338c2ecf20Sopenharmony_ci
6348c2ecf20Sopenharmony_ci/*
6358c2ecf20Sopenharmony_ci * MT7620 RF registers (reversed order)
6368c2ecf20Sopenharmony_ci */
6378c2ecf20Sopenharmony_ci#define RF_CSR_CFG_DATA_MT7620		FIELD32(0x0000ff00)
6388c2ecf20Sopenharmony_ci#define RF_CSR_CFG_REGNUM_MT7620	FIELD32(0x03ff0000)
6398c2ecf20Sopenharmony_ci#define RF_CSR_CFG_WRITE_MT7620		FIELD32(0x00000010)
6408c2ecf20Sopenharmony_ci#define RF_CSR_CFG_BUSY_MT7620		FIELD32(0x00000001)
6418c2ecf20Sopenharmony_ci
6428c2ecf20Sopenharmony_ci/* undocumented registers for calibration of new MAC */
6438c2ecf20Sopenharmony_ci#define RF_CONTROL0			0x0518
6448c2ecf20Sopenharmony_ci#define RF_BYPASS0			0x051c
6458c2ecf20Sopenharmony_ci#define RF_CONTROL1			0x0520
6468c2ecf20Sopenharmony_ci#define RF_BYPASS1			0x0524
6478c2ecf20Sopenharmony_ci#define RF_CONTROL2			0x0528
6488c2ecf20Sopenharmony_ci#define RF_BYPASS2			0x052c
6498c2ecf20Sopenharmony_ci#define RF_CONTROL3			0x0530
6508c2ecf20Sopenharmony_ci#define RF_BYPASS3			0x0534
6518c2ecf20Sopenharmony_ci
6528c2ecf20Sopenharmony_ci/*
6538c2ecf20Sopenharmony_ci * EFUSE_CSR: RT30x0 EEPROM
6548c2ecf20Sopenharmony_ci */
6558c2ecf20Sopenharmony_ci#define EFUSE_CTRL			0x0580
6568c2ecf20Sopenharmony_ci#define EFUSE_CTRL_ADDRESS_IN		FIELD32(0x03fe0000)
6578c2ecf20Sopenharmony_ci#define EFUSE_CTRL_MODE			FIELD32(0x000000c0)
6588c2ecf20Sopenharmony_ci#define EFUSE_CTRL_KICK			FIELD32(0x40000000)
6598c2ecf20Sopenharmony_ci#define EFUSE_CTRL_PRESENT		FIELD32(0x80000000)
6608c2ecf20Sopenharmony_ci
6618c2ecf20Sopenharmony_ci/*
6628c2ecf20Sopenharmony_ci * EFUSE_DATA0
6638c2ecf20Sopenharmony_ci */
6648c2ecf20Sopenharmony_ci#define EFUSE_DATA0			0x0590
6658c2ecf20Sopenharmony_ci
6668c2ecf20Sopenharmony_ci/*
6678c2ecf20Sopenharmony_ci * EFUSE_DATA1
6688c2ecf20Sopenharmony_ci */
6698c2ecf20Sopenharmony_ci#define EFUSE_DATA1			0x0594
6708c2ecf20Sopenharmony_ci
6718c2ecf20Sopenharmony_ci/*
6728c2ecf20Sopenharmony_ci * EFUSE_DATA2
6738c2ecf20Sopenharmony_ci */
6748c2ecf20Sopenharmony_ci#define EFUSE_DATA2			0x0598
6758c2ecf20Sopenharmony_ci
6768c2ecf20Sopenharmony_ci/*
6778c2ecf20Sopenharmony_ci * EFUSE_DATA3
6788c2ecf20Sopenharmony_ci */
6798c2ecf20Sopenharmony_ci#define EFUSE_DATA3			0x059c
6808c2ecf20Sopenharmony_ci
6818c2ecf20Sopenharmony_ci/*
6828c2ecf20Sopenharmony_ci * LDO_CFG0
6838c2ecf20Sopenharmony_ci */
6848c2ecf20Sopenharmony_ci#define LDO_CFG0			0x05d4
6858c2ecf20Sopenharmony_ci#define LDO_CFG0_DELAY3			FIELD32(0x000000ff)
6868c2ecf20Sopenharmony_ci#define LDO_CFG0_DELAY2			FIELD32(0x0000ff00)
6878c2ecf20Sopenharmony_ci#define LDO_CFG0_DELAY1			FIELD32(0x00ff0000)
6888c2ecf20Sopenharmony_ci#define LDO_CFG0_BGSEL			FIELD32(0x03000000)
6898c2ecf20Sopenharmony_ci#define LDO_CFG0_LDO_CORE_VLEVEL	FIELD32(0x1c000000)
6908c2ecf20Sopenharmony_ci#define LD0_CFG0_LDO25_LEVEL		FIELD32(0x60000000)
6918c2ecf20Sopenharmony_ci#define LDO_CFG0_LDO25_LARGEA		FIELD32(0x80000000)
6928c2ecf20Sopenharmony_ci
6938c2ecf20Sopenharmony_ci/*
6948c2ecf20Sopenharmony_ci * GPIO_SWITCH
6958c2ecf20Sopenharmony_ci */
6968c2ecf20Sopenharmony_ci#define GPIO_SWITCH			0x05dc
6978c2ecf20Sopenharmony_ci#define GPIO_SWITCH_0			FIELD32(0x00000001)
6988c2ecf20Sopenharmony_ci#define GPIO_SWITCH_1			FIELD32(0x00000002)
6998c2ecf20Sopenharmony_ci#define GPIO_SWITCH_2			FIELD32(0x00000004)
7008c2ecf20Sopenharmony_ci#define GPIO_SWITCH_3			FIELD32(0x00000008)
7018c2ecf20Sopenharmony_ci#define GPIO_SWITCH_4			FIELD32(0x00000010)
7028c2ecf20Sopenharmony_ci#define GPIO_SWITCH_5			FIELD32(0x00000020)
7038c2ecf20Sopenharmony_ci#define GPIO_SWITCH_6			FIELD32(0x00000040)
7048c2ecf20Sopenharmony_ci#define GPIO_SWITCH_7			FIELD32(0x00000080)
7058c2ecf20Sopenharmony_ci
7068c2ecf20Sopenharmony_ci/*
7078c2ecf20Sopenharmony_ci * FIXME: where the DEBUG_INDEX name come from?
7088c2ecf20Sopenharmony_ci */
7098c2ecf20Sopenharmony_ci#define MAC_DEBUG_INDEX			0x05e8
7108c2ecf20Sopenharmony_ci#define MAC_DEBUG_INDEX_XTAL		FIELD32(0x80000000)
7118c2ecf20Sopenharmony_ci
7128c2ecf20Sopenharmony_ci/*
7138c2ecf20Sopenharmony_ci * MAC Control/Status Registers(CSR).
7148c2ecf20Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us.
7158c2ecf20Sopenharmony_ci */
7168c2ecf20Sopenharmony_ci
7178c2ecf20Sopenharmony_ci/*
7188c2ecf20Sopenharmony_ci * MAC_CSR0: ASIC revision number.
7198c2ecf20Sopenharmony_ci * ASIC_REV: 0
7208c2ecf20Sopenharmony_ci * ASIC_VER: 2860 or 2870
7218c2ecf20Sopenharmony_ci */
7228c2ecf20Sopenharmony_ci#define MAC_CSR0			0x1000
7238c2ecf20Sopenharmony_ci#define MAC_CSR0_REVISION		FIELD32(0x0000ffff)
7248c2ecf20Sopenharmony_ci#define MAC_CSR0_CHIPSET		FIELD32(0xffff0000)
7258c2ecf20Sopenharmony_ci
7268c2ecf20Sopenharmony_ci/*
7278c2ecf20Sopenharmony_ci * MAC_SYS_CTRL:
7288c2ecf20Sopenharmony_ci */
7298c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL			0x1004
7308c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL_RESET_CSR		FIELD32(0x00000001)
7318c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL_RESET_BBP		FIELD32(0x00000002)
7328c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL_ENABLE_TX		FIELD32(0x00000004)
7338c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL_ENABLE_RX		FIELD32(0x00000008)
7348c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL_CONTINUOUS_TX	FIELD32(0x00000010)
7358c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL_LOOPBACK		FIELD32(0x00000020)
7368c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL_WLAN_HALT		FIELD32(0x00000040)
7378c2ecf20Sopenharmony_ci#define MAC_SYS_CTRL_RX_TIMESTAMP	FIELD32(0x00000080)
7388c2ecf20Sopenharmony_ci
7398c2ecf20Sopenharmony_ci/*
7408c2ecf20Sopenharmony_ci * MAC_ADDR_DW0: STA MAC register 0
7418c2ecf20Sopenharmony_ci */
7428c2ecf20Sopenharmony_ci#define MAC_ADDR_DW0			0x1008
7438c2ecf20Sopenharmony_ci#define MAC_ADDR_DW0_BYTE0		FIELD32(0x000000ff)
7448c2ecf20Sopenharmony_ci#define MAC_ADDR_DW0_BYTE1		FIELD32(0x0000ff00)
7458c2ecf20Sopenharmony_ci#define MAC_ADDR_DW0_BYTE2		FIELD32(0x00ff0000)
7468c2ecf20Sopenharmony_ci#define MAC_ADDR_DW0_BYTE3		FIELD32(0xff000000)
7478c2ecf20Sopenharmony_ci
7488c2ecf20Sopenharmony_ci/*
7498c2ecf20Sopenharmony_ci * MAC_ADDR_DW1: STA MAC register 1
7508c2ecf20Sopenharmony_ci * UNICAST_TO_ME_MASK:
7518c2ecf20Sopenharmony_ci * Used to mask off bits from byte 5 of the MAC address
7528c2ecf20Sopenharmony_ci * to determine the UNICAST_TO_ME bit for RX frames.
7538c2ecf20Sopenharmony_ci * The full mask is complemented by BSS_ID_MASK:
7548c2ecf20Sopenharmony_ci *    MASK = BSS_ID_MASK & UNICAST_TO_ME_MASK
7558c2ecf20Sopenharmony_ci */
7568c2ecf20Sopenharmony_ci#define MAC_ADDR_DW1			0x100c
7578c2ecf20Sopenharmony_ci#define MAC_ADDR_DW1_BYTE4		FIELD32(0x000000ff)
7588c2ecf20Sopenharmony_ci#define MAC_ADDR_DW1_BYTE5		FIELD32(0x0000ff00)
7598c2ecf20Sopenharmony_ci#define MAC_ADDR_DW1_UNICAST_TO_ME_MASK	FIELD32(0x00ff0000)
7608c2ecf20Sopenharmony_ci
7618c2ecf20Sopenharmony_ci/*
7628c2ecf20Sopenharmony_ci * MAC_BSSID_DW0: BSSID register 0
7638c2ecf20Sopenharmony_ci */
7648c2ecf20Sopenharmony_ci#define MAC_BSSID_DW0			0x1010
7658c2ecf20Sopenharmony_ci#define MAC_BSSID_DW0_BYTE0		FIELD32(0x000000ff)
7668c2ecf20Sopenharmony_ci#define MAC_BSSID_DW0_BYTE1		FIELD32(0x0000ff00)
7678c2ecf20Sopenharmony_ci#define MAC_BSSID_DW0_BYTE2		FIELD32(0x00ff0000)
7688c2ecf20Sopenharmony_ci#define MAC_BSSID_DW0_BYTE3		FIELD32(0xff000000)
7698c2ecf20Sopenharmony_ci
7708c2ecf20Sopenharmony_ci/*
7718c2ecf20Sopenharmony_ci * MAC_BSSID_DW1: BSSID register 1
7728c2ecf20Sopenharmony_ci * BSS_ID_MASK:
7738c2ecf20Sopenharmony_ci *     0: 1-BSSID mode (BSS index = 0)
7748c2ecf20Sopenharmony_ci *     1: 2-BSSID mode (BSS index: Byte5, bit 0)
7758c2ecf20Sopenharmony_ci *     2: 4-BSSID mode (BSS index: byte5, bit 0 - 1)
7768c2ecf20Sopenharmony_ci *     3: 8-BSSID mode (BSS index: byte5, bit 0 - 2)
7778c2ecf20Sopenharmony_ci * This mask is used to mask off bits 0, 1 and 2 of byte 5 of the
7788c2ecf20Sopenharmony_ci * BSSID. This will make sure that those bits will be ignored
7798c2ecf20Sopenharmony_ci * when determining the MY_BSS of RX frames.
7808c2ecf20Sopenharmony_ci */
7818c2ecf20Sopenharmony_ci#define MAC_BSSID_DW1			0x1014
7828c2ecf20Sopenharmony_ci#define MAC_BSSID_DW1_BYTE4		FIELD32(0x000000ff)
7838c2ecf20Sopenharmony_ci#define MAC_BSSID_DW1_BYTE5		FIELD32(0x0000ff00)
7848c2ecf20Sopenharmony_ci#define MAC_BSSID_DW1_BSS_ID_MASK	FIELD32(0x00030000)
7858c2ecf20Sopenharmony_ci#define MAC_BSSID_DW1_BSS_BCN_NUM	FIELD32(0x001c0000)
7868c2ecf20Sopenharmony_ci
7878c2ecf20Sopenharmony_ci/*
7888c2ecf20Sopenharmony_ci * MAX_LEN_CFG: Maximum frame length register.
7898c2ecf20Sopenharmony_ci * MAX_MPDU: rt2860b max 16k bytes
7908c2ecf20Sopenharmony_ci * MAX_PSDU: Maximum PSDU length
7918c2ecf20Sopenharmony_ci *	(power factor) 0:2^13, 1:2^14, 2:2^15, 3:2^16
7928c2ecf20Sopenharmony_ci */
7938c2ecf20Sopenharmony_ci#define MAX_LEN_CFG			0x1018
7948c2ecf20Sopenharmony_ci#define MAX_LEN_CFG_MAX_MPDU		FIELD32(0x00000fff)
7958c2ecf20Sopenharmony_ci#define MAX_LEN_CFG_MAX_PSDU		FIELD32(0x00003000)
7968c2ecf20Sopenharmony_ci#define MAX_LEN_CFG_MIN_PSDU		FIELD32(0x0000c000)
7978c2ecf20Sopenharmony_ci#define MAX_LEN_CFG_MIN_MPDU		FIELD32(0x000f0000)
7988c2ecf20Sopenharmony_ci
7998c2ecf20Sopenharmony_ci/*
8008c2ecf20Sopenharmony_ci * BBP_CSR_CFG: BBP serial control register
8018c2ecf20Sopenharmony_ci * VALUE: Register value to program into BBP
8028c2ecf20Sopenharmony_ci * REG_NUM: Selected BBP register
8038c2ecf20Sopenharmony_ci * READ_CONTROL: 0 write BBP, 1 read BBP
8048c2ecf20Sopenharmony_ci * BUSY: ASIC is busy executing BBP commands
8058c2ecf20Sopenharmony_ci * BBP_PAR_DUR: 0 4 MAC clocks, 1 8 MAC clocks
8068c2ecf20Sopenharmony_ci * BBP_RW_MODE: 0 serial, 1 parallel
8078c2ecf20Sopenharmony_ci */
8088c2ecf20Sopenharmony_ci#define BBP_CSR_CFG			0x101c
8098c2ecf20Sopenharmony_ci#define BBP_CSR_CFG_VALUE		FIELD32(0x000000ff)
8108c2ecf20Sopenharmony_ci#define BBP_CSR_CFG_REGNUM		FIELD32(0x0000ff00)
8118c2ecf20Sopenharmony_ci#define BBP_CSR_CFG_READ_CONTROL	FIELD32(0x00010000)
8128c2ecf20Sopenharmony_ci#define BBP_CSR_CFG_BUSY		FIELD32(0x00020000)
8138c2ecf20Sopenharmony_ci#define BBP_CSR_CFG_BBP_PAR_DUR		FIELD32(0x00040000)
8148c2ecf20Sopenharmony_ci#define BBP_CSR_CFG_BBP_RW_MODE		FIELD32(0x00080000)
8158c2ecf20Sopenharmony_ci
8168c2ecf20Sopenharmony_ci/*
8178c2ecf20Sopenharmony_ci * RF_CSR_CFG0: RF control register
8188c2ecf20Sopenharmony_ci * REGID_AND_VALUE: Register value to program into RF
8198c2ecf20Sopenharmony_ci * BITWIDTH: Selected RF register
8208c2ecf20Sopenharmony_ci * STANDBYMODE: 0 high when standby, 1 low when standby
8218c2ecf20Sopenharmony_ci * SEL: 0 RF_LE0 activate, 1 RF_LE1 activate
8228c2ecf20Sopenharmony_ci * BUSY: ASIC is busy executing RF commands
8238c2ecf20Sopenharmony_ci */
8248c2ecf20Sopenharmony_ci#define RF_CSR_CFG0			0x1020
8258c2ecf20Sopenharmony_ci#define RF_CSR_CFG0_REGID_AND_VALUE	FIELD32(0x00ffffff)
8268c2ecf20Sopenharmony_ci#define RF_CSR_CFG0_BITWIDTH		FIELD32(0x1f000000)
8278c2ecf20Sopenharmony_ci#define RF_CSR_CFG0_REG_VALUE_BW	FIELD32(0x1fffffff)
8288c2ecf20Sopenharmony_ci#define RF_CSR_CFG0_STANDBYMODE		FIELD32(0x20000000)
8298c2ecf20Sopenharmony_ci#define RF_CSR_CFG0_SEL			FIELD32(0x40000000)
8308c2ecf20Sopenharmony_ci#define RF_CSR_CFG0_BUSY		FIELD32(0x80000000)
8318c2ecf20Sopenharmony_ci
8328c2ecf20Sopenharmony_ci/*
8338c2ecf20Sopenharmony_ci * RF_CSR_CFG1: RF control register
8348c2ecf20Sopenharmony_ci * REGID_AND_VALUE: Register value to program into RF
8358c2ecf20Sopenharmony_ci * RFGAP: Gap between BB_CONTROL_RF and RF_LE
8368c2ecf20Sopenharmony_ci *        0: 3 system clock cycle (37.5usec)
8378c2ecf20Sopenharmony_ci *        1: 5 system clock cycle (62.5usec)
8388c2ecf20Sopenharmony_ci */
8398c2ecf20Sopenharmony_ci#define RF_CSR_CFG1			0x1024
8408c2ecf20Sopenharmony_ci#define RF_CSR_CFG1_REGID_AND_VALUE	FIELD32(0x00ffffff)
8418c2ecf20Sopenharmony_ci#define RF_CSR_CFG1_RFGAP		FIELD32(0x1f000000)
8428c2ecf20Sopenharmony_ci
8438c2ecf20Sopenharmony_ci/*
8448c2ecf20Sopenharmony_ci * RF_CSR_CFG2: RF control register
8458c2ecf20Sopenharmony_ci * VALUE: Register value to program into RF
8468c2ecf20Sopenharmony_ci */
8478c2ecf20Sopenharmony_ci#define RF_CSR_CFG2			0x1028
8488c2ecf20Sopenharmony_ci#define RF_CSR_CFG2_VALUE		FIELD32(0x00ffffff)
8498c2ecf20Sopenharmony_ci
8508c2ecf20Sopenharmony_ci/*
8518c2ecf20Sopenharmony_ci * LED_CFG: LED control
8528c2ecf20Sopenharmony_ci * ON_PERIOD: LED active time (ms) during TX (only used for LED mode 1)
8538c2ecf20Sopenharmony_ci * OFF_PERIOD: LED inactive time (ms) during TX (only used for LED mode 1)
8548c2ecf20Sopenharmony_ci * SLOW_BLINK_PERIOD: LED blink interval in seconds (only used for LED mode 2)
8558c2ecf20Sopenharmony_ci * color LED's:
8568c2ecf20Sopenharmony_ci *   0: off
8578c2ecf20Sopenharmony_ci *   1: blinking upon TX2
8588c2ecf20Sopenharmony_ci *   2: periodic slow blinking
8598c2ecf20Sopenharmony_ci *   3: always on
8608c2ecf20Sopenharmony_ci * LED polarity:
8618c2ecf20Sopenharmony_ci *   0: active low
8628c2ecf20Sopenharmony_ci *   1: active high
8638c2ecf20Sopenharmony_ci */
8648c2ecf20Sopenharmony_ci#define LED_CFG				0x102c
8658c2ecf20Sopenharmony_ci#define LED_CFG_ON_PERIOD		FIELD32(0x000000ff)
8668c2ecf20Sopenharmony_ci#define LED_CFG_OFF_PERIOD		FIELD32(0x0000ff00)
8678c2ecf20Sopenharmony_ci#define LED_CFG_SLOW_BLINK_PERIOD	FIELD32(0x003f0000)
8688c2ecf20Sopenharmony_ci#define LED_CFG_R_LED_MODE		FIELD32(0x03000000)
8698c2ecf20Sopenharmony_ci#define LED_CFG_G_LED_MODE		FIELD32(0x0c000000)
8708c2ecf20Sopenharmony_ci#define LED_CFG_Y_LED_MODE		FIELD32(0x30000000)
8718c2ecf20Sopenharmony_ci#define LED_CFG_LED_POLAR		FIELD32(0x40000000)
8728c2ecf20Sopenharmony_ci
8738c2ecf20Sopenharmony_ci/*
8748c2ecf20Sopenharmony_ci * AMPDU_BA_WINSIZE: Force BlockAck window size
8758c2ecf20Sopenharmony_ci * FORCE_WINSIZE_ENABLE:
8768c2ecf20Sopenharmony_ci *   0: Disable forcing of BlockAck window size
8778c2ecf20Sopenharmony_ci *   1: Enable forcing of BlockAck window size, overwrites values BlockAck
8788c2ecf20Sopenharmony_ci *      window size values in the TXWI
8798c2ecf20Sopenharmony_ci * FORCE_WINSIZE: BlockAck window size
8808c2ecf20Sopenharmony_ci */
8818c2ecf20Sopenharmony_ci#define AMPDU_BA_WINSIZE		0x1040
8828c2ecf20Sopenharmony_ci#define AMPDU_BA_WINSIZE_FORCE_WINSIZE_ENABLE FIELD32(0x00000020)
8838c2ecf20Sopenharmony_ci#define AMPDU_BA_WINSIZE_FORCE_WINSIZE	FIELD32(0x0000001f)
8848c2ecf20Sopenharmony_ci
8858c2ecf20Sopenharmony_ci/*
8868c2ecf20Sopenharmony_ci * XIFS_TIME_CFG: MAC timing
8878c2ecf20Sopenharmony_ci * CCKM_SIFS_TIME: unit 1us. Applied after CCK RX/TX
8888c2ecf20Sopenharmony_ci * OFDM_SIFS_TIME: unit 1us. Applied after OFDM RX/TX
8898c2ecf20Sopenharmony_ci * OFDM_XIFS_TIME: unit 1us. Applied after OFDM RX
8908c2ecf20Sopenharmony_ci *	when MAC doesn't reference BBP signal BBRXEND
8918c2ecf20Sopenharmony_ci * EIFS: unit 1us
8928c2ecf20Sopenharmony_ci * BB_RXEND_ENABLE: reference RXEND signal to begin XIFS defer
8938c2ecf20Sopenharmony_ci *
8948c2ecf20Sopenharmony_ci */
8958c2ecf20Sopenharmony_ci#define XIFS_TIME_CFG			0x1100
8968c2ecf20Sopenharmony_ci#define XIFS_TIME_CFG_CCKM_SIFS_TIME	FIELD32(0x000000ff)
8978c2ecf20Sopenharmony_ci#define XIFS_TIME_CFG_OFDM_SIFS_TIME	FIELD32(0x0000ff00)
8988c2ecf20Sopenharmony_ci#define XIFS_TIME_CFG_OFDM_XIFS_TIME	FIELD32(0x000f0000)
8998c2ecf20Sopenharmony_ci#define XIFS_TIME_CFG_EIFS		FIELD32(0x1ff00000)
9008c2ecf20Sopenharmony_ci#define XIFS_TIME_CFG_BB_RXEND_ENABLE	FIELD32(0x20000000)
9018c2ecf20Sopenharmony_ci
9028c2ecf20Sopenharmony_ci/*
9038c2ecf20Sopenharmony_ci * BKOFF_SLOT_CFG:
9048c2ecf20Sopenharmony_ci */
9058c2ecf20Sopenharmony_ci#define BKOFF_SLOT_CFG			0x1104
9068c2ecf20Sopenharmony_ci#define BKOFF_SLOT_CFG_SLOT_TIME	FIELD32(0x000000ff)
9078c2ecf20Sopenharmony_ci#define BKOFF_SLOT_CFG_CC_DELAY_TIME	FIELD32(0x0000ff00)
9088c2ecf20Sopenharmony_ci
9098c2ecf20Sopenharmony_ci/*
9108c2ecf20Sopenharmony_ci * NAV_TIME_CFG:
9118c2ecf20Sopenharmony_ci */
9128c2ecf20Sopenharmony_ci#define NAV_TIME_CFG			0x1108
9138c2ecf20Sopenharmony_ci#define NAV_TIME_CFG_SIFS		FIELD32(0x000000ff)
9148c2ecf20Sopenharmony_ci#define NAV_TIME_CFG_SLOT_TIME		FIELD32(0x0000ff00)
9158c2ecf20Sopenharmony_ci#define NAV_TIME_CFG_EIFS		FIELD32(0x01ff0000)
9168c2ecf20Sopenharmony_ci#define NAV_TIME_ZERO_SIFS		FIELD32(0x02000000)
9178c2ecf20Sopenharmony_ci
9188c2ecf20Sopenharmony_ci/*
9198c2ecf20Sopenharmony_ci * CH_TIME_CFG: count as channel busy
9208c2ecf20Sopenharmony_ci * EIFS_BUSY: Count EIFS as channel busy
9218c2ecf20Sopenharmony_ci * NAV_BUSY: Count NAS as channel busy
9228c2ecf20Sopenharmony_ci * RX_BUSY: Count RX as channel busy
9238c2ecf20Sopenharmony_ci * TX_BUSY: Count TX as channel busy
9248c2ecf20Sopenharmony_ci * TMR_EN: Enable channel statistics timer
9258c2ecf20Sopenharmony_ci */
9268c2ecf20Sopenharmony_ci#define CH_TIME_CFG     	        0x110c
9278c2ecf20Sopenharmony_ci#define CH_TIME_CFG_EIFS_BUSY		FIELD32(0x00000010)
9288c2ecf20Sopenharmony_ci#define CH_TIME_CFG_NAV_BUSY		FIELD32(0x00000008)
9298c2ecf20Sopenharmony_ci#define CH_TIME_CFG_RX_BUSY		FIELD32(0x00000004)
9308c2ecf20Sopenharmony_ci#define CH_TIME_CFG_TX_BUSY		FIELD32(0x00000002)
9318c2ecf20Sopenharmony_ci#define CH_TIME_CFG_TMR_EN		FIELD32(0x00000001)
9328c2ecf20Sopenharmony_ci
9338c2ecf20Sopenharmony_ci/*
9348c2ecf20Sopenharmony_ci * PBF_LIFE_TIMER: TX/RX MPDU timestamp timer (free run) Unit: 1us
9358c2ecf20Sopenharmony_ci */
9368c2ecf20Sopenharmony_ci#define PBF_LIFE_TIMER     	        0x1110
9378c2ecf20Sopenharmony_ci
9388c2ecf20Sopenharmony_ci/*
9398c2ecf20Sopenharmony_ci * BCN_TIME_CFG:
9408c2ecf20Sopenharmony_ci * BEACON_INTERVAL: in unit of 1/16 TU
9418c2ecf20Sopenharmony_ci * TSF_TICKING: Enable TSF auto counting
9428c2ecf20Sopenharmony_ci * TSF_SYNC: Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode
9438c2ecf20Sopenharmony_ci * BEACON_GEN: Enable beacon generator
9448c2ecf20Sopenharmony_ci */
9458c2ecf20Sopenharmony_ci#define BCN_TIME_CFG			0x1114
9468c2ecf20Sopenharmony_ci#define BCN_TIME_CFG_BEACON_INTERVAL	FIELD32(0x0000ffff)
9478c2ecf20Sopenharmony_ci#define BCN_TIME_CFG_TSF_TICKING	FIELD32(0x00010000)
9488c2ecf20Sopenharmony_ci#define BCN_TIME_CFG_TSF_SYNC		FIELD32(0x00060000)
9498c2ecf20Sopenharmony_ci#define BCN_TIME_CFG_TBTT_ENABLE	FIELD32(0x00080000)
9508c2ecf20Sopenharmony_ci#define BCN_TIME_CFG_BEACON_GEN		FIELD32(0x00100000)
9518c2ecf20Sopenharmony_ci#define BCN_TIME_CFG_TX_TIME_COMPENSATE	FIELD32(0xf0000000)
9528c2ecf20Sopenharmony_ci
9538c2ecf20Sopenharmony_ci/*
9548c2ecf20Sopenharmony_ci * TBTT_SYNC_CFG:
9558c2ecf20Sopenharmony_ci * BCN_AIFSN: Beacon AIFSN after TBTT interrupt in slots
9568c2ecf20Sopenharmony_ci * BCN_CWMIN: Beacon CWMin after TBTT interrupt in slots
9578c2ecf20Sopenharmony_ci */
9588c2ecf20Sopenharmony_ci#define TBTT_SYNC_CFG			0x1118
9598c2ecf20Sopenharmony_ci#define TBTT_SYNC_CFG_TBTT_ADJUST	FIELD32(0x000000ff)
9608c2ecf20Sopenharmony_ci#define TBTT_SYNC_CFG_BCN_EXP_WIN	FIELD32(0x0000ff00)
9618c2ecf20Sopenharmony_ci#define TBTT_SYNC_CFG_BCN_AIFSN		FIELD32(0x000f0000)
9628c2ecf20Sopenharmony_ci#define TBTT_SYNC_CFG_BCN_CWMIN		FIELD32(0x00f00000)
9638c2ecf20Sopenharmony_ci
9648c2ecf20Sopenharmony_ci/*
9658c2ecf20Sopenharmony_ci * TSF_TIMER_DW0: Local lsb TSF timer, read-only
9668c2ecf20Sopenharmony_ci */
9678c2ecf20Sopenharmony_ci#define TSF_TIMER_DW0			0x111c
9688c2ecf20Sopenharmony_ci#define TSF_TIMER_DW0_LOW_WORD		FIELD32(0xffffffff)
9698c2ecf20Sopenharmony_ci
9708c2ecf20Sopenharmony_ci/*
9718c2ecf20Sopenharmony_ci * TSF_TIMER_DW1: Local msb TSF timer, read-only
9728c2ecf20Sopenharmony_ci */
9738c2ecf20Sopenharmony_ci#define TSF_TIMER_DW1			0x1120
9748c2ecf20Sopenharmony_ci#define TSF_TIMER_DW1_HIGH_WORD		FIELD32(0xffffffff)
9758c2ecf20Sopenharmony_ci
9768c2ecf20Sopenharmony_ci/*
9778c2ecf20Sopenharmony_ci * TBTT_TIMER: TImer remains till next TBTT, read-only
9788c2ecf20Sopenharmony_ci */
9798c2ecf20Sopenharmony_ci#define TBTT_TIMER			0x1124
9808c2ecf20Sopenharmony_ci
9818c2ecf20Sopenharmony_ci/*
9828c2ecf20Sopenharmony_ci * INT_TIMER_CFG: timer configuration
9838c2ecf20Sopenharmony_ci * PRE_TBTT_TIMER: leadtime to tbtt for pretbtt interrupt in units of 1/16 TU
9848c2ecf20Sopenharmony_ci * GP_TIMER: period of general purpose timer in units of 1/16 TU
9858c2ecf20Sopenharmony_ci */
9868c2ecf20Sopenharmony_ci#define INT_TIMER_CFG			0x1128
9878c2ecf20Sopenharmony_ci#define INT_TIMER_CFG_PRE_TBTT_TIMER	FIELD32(0x0000ffff)
9888c2ecf20Sopenharmony_ci#define INT_TIMER_CFG_GP_TIMER		FIELD32(0xffff0000)
9898c2ecf20Sopenharmony_ci
9908c2ecf20Sopenharmony_ci/*
9918c2ecf20Sopenharmony_ci * INT_TIMER_EN: GP-timer and pre-tbtt Int enable
9928c2ecf20Sopenharmony_ci */
9938c2ecf20Sopenharmony_ci#define INT_TIMER_EN			0x112c
9948c2ecf20Sopenharmony_ci#define INT_TIMER_EN_PRE_TBTT_TIMER	FIELD32(0x00000001)
9958c2ecf20Sopenharmony_ci#define INT_TIMER_EN_GP_TIMER		FIELD32(0x00000002)
9968c2ecf20Sopenharmony_ci
9978c2ecf20Sopenharmony_ci/*
9988c2ecf20Sopenharmony_ci * CH_IDLE_STA: channel idle time (in us)
9998c2ecf20Sopenharmony_ci */
10008c2ecf20Sopenharmony_ci#define CH_IDLE_STA			0x1130
10018c2ecf20Sopenharmony_ci
10028c2ecf20Sopenharmony_ci/*
10038c2ecf20Sopenharmony_ci * CH_BUSY_STA: channel busy time on primary channel (in us)
10048c2ecf20Sopenharmony_ci */
10058c2ecf20Sopenharmony_ci#define CH_BUSY_STA			0x1134
10068c2ecf20Sopenharmony_ci
10078c2ecf20Sopenharmony_ci/*
10088c2ecf20Sopenharmony_ci * CH_BUSY_STA_SEC: channel busy time on secondary channel in HT40 mode (in us)
10098c2ecf20Sopenharmony_ci */
10108c2ecf20Sopenharmony_ci#define CH_BUSY_STA_SEC			0x1138
10118c2ecf20Sopenharmony_ci
10128c2ecf20Sopenharmony_ci/*
10138c2ecf20Sopenharmony_ci * MAC_STATUS_CFG:
10148c2ecf20Sopenharmony_ci * BBP_RF_BUSY: When set to 0, BBP and RF are stable.
10158c2ecf20Sopenharmony_ci *	if 1 or higher one of the 2 registers is busy.
10168c2ecf20Sopenharmony_ci */
10178c2ecf20Sopenharmony_ci#define MAC_STATUS_CFG			0x1200
10188c2ecf20Sopenharmony_ci#define MAC_STATUS_CFG_BBP_RF_BUSY	FIELD32(0x00000003)
10198c2ecf20Sopenharmony_ci
10208c2ecf20Sopenharmony_ci/*
10218c2ecf20Sopenharmony_ci * PWR_PIN_CFG:
10228c2ecf20Sopenharmony_ci */
10238c2ecf20Sopenharmony_ci#define PWR_PIN_CFG			0x1204
10248c2ecf20Sopenharmony_ci
10258c2ecf20Sopenharmony_ci/*
10268c2ecf20Sopenharmony_ci * AUTOWAKEUP_CFG: Manual power control / status register
10278c2ecf20Sopenharmony_ci * TBCN_BEFORE_WAKE: ForceWake has high privilege than PutToSleep when both set
10288c2ecf20Sopenharmony_ci * AUTOWAKE: 0:sleep, 1:awake
10298c2ecf20Sopenharmony_ci */
10308c2ecf20Sopenharmony_ci#define AUTOWAKEUP_CFG			0x1208
10318c2ecf20Sopenharmony_ci#define AUTOWAKEUP_CFG_AUTO_LEAD_TIME	FIELD32(0x000000ff)
10328c2ecf20Sopenharmony_ci#define AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE	FIELD32(0x00007f00)
10338c2ecf20Sopenharmony_ci#define AUTOWAKEUP_CFG_AUTOWAKE		FIELD32(0x00008000)
10348c2ecf20Sopenharmony_ci
10358c2ecf20Sopenharmony_ci/*
10368c2ecf20Sopenharmony_ci * MIMO_PS_CFG: MIMO Power-save Configuration
10378c2ecf20Sopenharmony_ci */
10388c2ecf20Sopenharmony_ci#define MIMO_PS_CFG			0x1210
10398c2ecf20Sopenharmony_ci#define MIMO_PS_CFG_MMPS_BB_EN		FIELD32(0x00000001)
10408c2ecf20Sopenharmony_ci#define MIMO_PS_CFG_MMPS_RX_ANT_NUM	FIELD32(0x00000006)
10418c2ecf20Sopenharmony_ci#define MIMO_PS_CFG_MMPS_RF_EN		FIELD32(0x00000008)
10428c2ecf20Sopenharmony_ci#define MIMO_PS_CFG_RX_STBY_POL		FIELD32(0x00000010)
10438c2ecf20Sopenharmony_ci#define MIMO_PS_CFG_RX_RX_STBY0		FIELD32(0x00000020)
10448c2ecf20Sopenharmony_ci
10458c2ecf20Sopenharmony_ci/*
10468c2ecf20Sopenharmony_ci * EDCA_AC0_CFG:
10478c2ecf20Sopenharmony_ci */
10488c2ecf20Sopenharmony_ci#define EDCA_AC0_CFG			0x1300
10498c2ecf20Sopenharmony_ci#define EDCA_AC0_CFG_TX_OP		FIELD32(0x000000ff)
10508c2ecf20Sopenharmony_ci#define EDCA_AC0_CFG_AIFSN		FIELD32(0x00000f00)
10518c2ecf20Sopenharmony_ci#define EDCA_AC0_CFG_CWMIN		FIELD32(0x0000f000)
10528c2ecf20Sopenharmony_ci#define EDCA_AC0_CFG_CWMAX		FIELD32(0x000f0000)
10538c2ecf20Sopenharmony_ci
10548c2ecf20Sopenharmony_ci/*
10558c2ecf20Sopenharmony_ci * EDCA_AC1_CFG:
10568c2ecf20Sopenharmony_ci */
10578c2ecf20Sopenharmony_ci#define EDCA_AC1_CFG			0x1304
10588c2ecf20Sopenharmony_ci#define EDCA_AC1_CFG_TX_OP		FIELD32(0x000000ff)
10598c2ecf20Sopenharmony_ci#define EDCA_AC1_CFG_AIFSN		FIELD32(0x00000f00)
10608c2ecf20Sopenharmony_ci#define EDCA_AC1_CFG_CWMIN		FIELD32(0x0000f000)
10618c2ecf20Sopenharmony_ci#define EDCA_AC1_CFG_CWMAX		FIELD32(0x000f0000)
10628c2ecf20Sopenharmony_ci
10638c2ecf20Sopenharmony_ci/*
10648c2ecf20Sopenharmony_ci * EDCA_AC2_CFG:
10658c2ecf20Sopenharmony_ci */
10668c2ecf20Sopenharmony_ci#define EDCA_AC2_CFG			0x1308
10678c2ecf20Sopenharmony_ci#define EDCA_AC2_CFG_TX_OP		FIELD32(0x000000ff)
10688c2ecf20Sopenharmony_ci#define EDCA_AC2_CFG_AIFSN		FIELD32(0x00000f00)
10698c2ecf20Sopenharmony_ci#define EDCA_AC2_CFG_CWMIN		FIELD32(0x0000f000)
10708c2ecf20Sopenharmony_ci#define EDCA_AC2_CFG_CWMAX		FIELD32(0x000f0000)
10718c2ecf20Sopenharmony_ci
10728c2ecf20Sopenharmony_ci/*
10738c2ecf20Sopenharmony_ci * EDCA_AC3_CFG:
10748c2ecf20Sopenharmony_ci */
10758c2ecf20Sopenharmony_ci#define EDCA_AC3_CFG			0x130c
10768c2ecf20Sopenharmony_ci#define EDCA_AC3_CFG_TX_OP		FIELD32(0x000000ff)
10778c2ecf20Sopenharmony_ci#define EDCA_AC3_CFG_AIFSN		FIELD32(0x00000f00)
10788c2ecf20Sopenharmony_ci#define EDCA_AC3_CFG_CWMIN		FIELD32(0x0000f000)
10798c2ecf20Sopenharmony_ci#define EDCA_AC3_CFG_CWMAX		FIELD32(0x000f0000)
10808c2ecf20Sopenharmony_ci
10818c2ecf20Sopenharmony_ci/*
10828c2ecf20Sopenharmony_ci * EDCA_TID_AC_MAP:
10838c2ecf20Sopenharmony_ci */
10848c2ecf20Sopenharmony_ci#define EDCA_TID_AC_MAP			0x1310
10858c2ecf20Sopenharmony_ci
10868c2ecf20Sopenharmony_ci/*
10878c2ecf20Sopenharmony_ci * TX_PWR_CFG:
10888c2ecf20Sopenharmony_ci */
10898c2ecf20Sopenharmony_ci#define TX_PWR_CFG_RATE0		FIELD32(0x0000000f)
10908c2ecf20Sopenharmony_ci#define TX_PWR_CFG_RATE1		FIELD32(0x000000f0)
10918c2ecf20Sopenharmony_ci#define TX_PWR_CFG_RATE2		FIELD32(0x00000f00)
10928c2ecf20Sopenharmony_ci#define TX_PWR_CFG_RATE3		FIELD32(0x0000f000)
10938c2ecf20Sopenharmony_ci#define TX_PWR_CFG_RATE4		FIELD32(0x000f0000)
10948c2ecf20Sopenharmony_ci#define TX_PWR_CFG_RATE5		FIELD32(0x00f00000)
10958c2ecf20Sopenharmony_ci#define TX_PWR_CFG_RATE6		FIELD32(0x0f000000)
10968c2ecf20Sopenharmony_ci#define TX_PWR_CFG_RATE7		FIELD32(0xf0000000)
10978c2ecf20Sopenharmony_ci
10988c2ecf20Sopenharmony_ci/*
10998c2ecf20Sopenharmony_ci * TX_PWR_CFG_0:
11008c2ecf20Sopenharmony_ci */
11018c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0			0x1314
11028c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_1MBS		FIELD32(0x0000000f)
11038c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_2MBS		FIELD32(0x000000f0)
11048c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_55MBS		FIELD32(0x00000f00)
11058c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_11MBS		FIELD32(0x0000f000)
11068c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_6MBS		FIELD32(0x000f0000)
11078c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_9MBS		FIELD32(0x00f00000)
11088c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_12MBS		FIELD32(0x0f000000)
11098c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_18MBS		FIELD32(0xf0000000)
11108c2ecf20Sopenharmony_ci/* bits for 3T devices */
11118c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_CCK1_CH0		FIELD32(0x0000000f)
11128c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_CCK1_CH1		FIELD32(0x000000f0)
11138c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_CCK5_CH0		FIELD32(0x00000f00)
11148c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_CCK5_CH1		FIELD32(0x0000f000)
11158c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_OFDM6_CH0		FIELD32(0x000f0000)
11168c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_OFDM6_CH1		FIELD32(0x00f00000)
11178c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_OFDM12_CH0		FIELD32(0x0f000000)
11188c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_OFDM12_CH1		FIELD32(0xf0000000)
11198c2ecf20Sopenharmony_ci/* bits for new 2T devices */
11208c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0B_1MBS_2MBS		FIELD32(0x000000ff)
11218c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0B_5MBS_11MBS		FIELD32(0x0000ff00)
11228c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0B_6MBS_9MBS		FIELD32(0x00ff0000)
11238c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0B_12MBS_18MBS	FIELD32(0xff000000)
11248c2ecf20Sopenharmony_ci
11258c2ecf20Sopenharmony_ci
11268c2ecf20Sopenharmony_ci/*
11278c2ecf20Sopenharmony_ci * TX_PWR_CFG_1:
11288c2ecf20Sopenharmony_ci */
11298c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1			0x1318
11308c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_24MBS		FIELD32(0x0000000f)
11318c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_36MBS		FIELD32(0x000000f0)
11328c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_48MBS		FIELD32(0x00000f00)
11338c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_54MBS		FIELD32(0x0000f000)
11348c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_MCS0		FIELD32(0x000f0000)
11358c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_MCS1		FIELD32(0x00f00000)
11368c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_MCS2		FIELD32(0x0f000000)
11378c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_MCS3		FIELD32(0xf0000000)
11388c2ecf20Sopenharmony_ci/* bits for 3T devices */
11398c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_OFDM24_CH0		FIELD32(0x0000000f)
11408c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_OFDM24_CH1		FIELD32(0x000000f0)
11418c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_OFDM48_CH0		FIELD32(0x00000f00)
11428c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_OFDM48_CH1		FIELD32(0x0000f000)
11438c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_MCS0_CH0		FIELD32(0x000f0000)
11448c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_MCS0_CH1		FIELD32(0x00f00000)
11458c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_MCS2_CH0		FIELD32(0x0f000000)
11468c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_MCS2_CH1		FIELD32(0xf0000000)
11478c2ecf20Sopenharmony_ci/* bits for new 2T devices */
11488c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1B_24MBS_36MBS	FIELD32(0x000000ff)
11498c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1B_48MBS		FIELD32(0x0000ff00)
11508c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1B_MCS0_MCS1		FIELD32(0x00ff0000)
11518c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1B_MCS2_MCS3		FIELD32(0xff000000)
11528c2ecf20Sopenharmony_ci
11538c2ecf20Sopenharmony_ci/*
11548c2ecf20Sopenharmony_ci * TX_PWR_CFG_2:
11558c2ecf20Sopenharmony_ci */
11568c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2			0x131c
11578c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS4		FIELD32(0x0000000f)
11588c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS5		FIELD32(0x000000f0)
11598c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS6		FIELD32(0x00000f00)
11608c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS7		FIELD32(0x0000f000)
11618c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS8		FIELD32(0x000f0000)
11628c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS9		FIELD32(0x00f00000)
11638c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS10		FIELD32(0x0f000000)
11648c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS11		FIELD32(0xf0000000)
11658c2ecf20Sopenharmony_ci/* bits for 3T devices */
11668c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS4_CH0		FIELD32(0x0000000f)
11678c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS4_CH1		FIELD32(0x000000f0)
11688c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS6_CH0		FIELD32(0x00000f00)
11698c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS6_CH1		FIELD32(0x0000f000)
11708c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS8_CH0		FIELD32(0x000f0000)
11718c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS8_CH1		FIELD32(0x00f00000)
11728c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS10_CH0		FIELD32(0x0f000000)
11738c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_MCS10_CH1		FIELD32(0xf0000000)
11748c2ecf20Sopenharmony_ci/* bits for new 2T devices */
11758c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2B_MCS4_MCS5		FIELD32(0x000000ff)
11768c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2B_MCS6_MCS7		FIELD32(0x0000ff00)
11778c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2B_MCS8_MCS9		FIELD32(0x00ff0000)
11788c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2B_MCS10_MCS11	FIELD32(0xff000000)
11798c2ecf20Sopenharmony_ci
11808c2ecf20Sopenharmony_ci/*
11818c2ecf20Sopenharmony_ci * TX_PWR_CFG_3:
11828c2ecf20Sopenharmony_ci */
11838c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3			0x1320
11848c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_MCS12		FIELD32(0x0000000f)
11858c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_MCS13		FIELD32(0x000000f0)
11868c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_MCS14		FIELD32(0x00000f00)
11878c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_MCS15		FIELD32(0x0000f000)
11888c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_UNKNOWN1		FIELD32(0x000f0000)
11898c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_UNKNOWN2		FIELD32(0x00f00000)
11908c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_UNKNOWN3		FIELD32(0x0f000000)
11918c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_UNKNOWN4		FIELD32(0xf0000000)
11928c2ecf20Sopenharmony_ci/* bits for 3T devices */
11938c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_MCS12_CH0		FIELD32(0x0000000f)
11948c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_MCS12_CH1		FIELD32(0x000000f0)
11958c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_MCS14_CH0		FIELD32(0x00000f00)
11968c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_MCS14_CH1		FIELD32(0x0000f000)
11978c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_STBC0_CH0		FIELD32(0x000f0000)
11988c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_STBC0_CH1		FIELD32(0x00f00000)
11998c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_STBC2_CH0		FIELD32(0x0f000000)
12008c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_STBC2_CH1		FIELD32(0xf0000000)
12018c2ecf20Sopenharmony_ci/* bits for new 2T devices */
12028c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3B_MCS12_MCS13	FIELD32(0x000000ff)
12038c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3B_MCS14		FIELD32(0x0000ff00)
12048c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3B_STBC_MCS0_MCS1	FIELD32(0x00ff0000)
12058c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3B_STBC_MCS2_MSC3	FIELD32(0xff000000)
12068c2ecf20Sopenharmony_ci
12078c2ecf20Sopenharmony_ci/*
12088c2ecf20Sopenharmony_ci * TX_PWR_CFG_4:
12098c2ecf20Sopenharmony_ci */
12108c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4			0x1324
12118c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_UNKNOWN5		FIELD32(0x0000000f)
12128c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_UNKNOWN6		FIELD32(0x000000f0)
12138c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_UNKNOWN7		FIELD32(0x00000f00)
12148c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_UNKNOWN8		FIELD32(0x0000f000)
12158c2ecf20Sopenharmony_ci/* bits for 3T devices */
12168c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_STBC4_CH0		FIELD32(0x0000000f)
12178c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_STBC4_CH1		FIELD32(0x000000f0)
12188c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_STBC6_CH0		FIELD32(0x00000f00)
12198c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_STBC6_CH1		FIELD32(0x0000f000)
12208c2ecf20Sopenharmony_ci/* bits for new 2T devices */
12218c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4B_STBC_MCS4_MCS5	FIELD32(0x000000ff)
12228c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4B_STBC_MCS6		FIELD32(0x0000ff00)
12238c2ecf20Sopenharmony_ci
12248c2ecf20Sopenharmony_ci/*
12258c2ecf20Sopenharmony_ci * TX_PIN_CFG:
12268c2ecf20Sopenharmony_ci */
12278c2ecf20Sopenharmony_ci#define TX_PIN_CFG			0x1328
12288c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_DISABLE	0xfcfffff0
12298c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A0_EN		FIELD32(0x00000001)
12308c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G0_EN		FIELD32(0x00000002)
12318c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A1_EN		FIELD32(0x00000004)
12328c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G1_EN		FIELD32(0x00000008)
12338c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A0_POL		FIELD32(0x00000010)
12348c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G0_POL		FIELD32(0x00000020)
12358c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A1_POL		FIELD32(0x00000040)
12368c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G1_POL		FIELD32(0x00000080)
12378c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A0_EN		FIELD32(0x00000100)
12388c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G0_EN		FIELD32(0x00000200)
12398c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A1_EN		FIELD32(0x00000400)
12408c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G1_EN		FIELD32(0x00000800)
12418c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A0_POL	FIELD32(0x00001000)
12428c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G0_POL	FIELD32(0x00002000)
12438c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A1_POL	FIELD32(0x00004000)
12448c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G1_POL	FIELD32(0x00008000)
12458c2ecf20Sopenharmony_ci#define TX_PIN_CFG_RFTR_EN		FIELD32(0x00010000)
12468c2ecf20Sopenharmony_ci#define TX_PIN_CFG_RFTR_POL		FIELD32(0x00020000)
12478c2ecf20Sopenharmony_ci#define TX_PIN_CFG_TRSW_EN		FIELD32(0x00040000)
12488c2ecf20Sopenharmony_ci#define TX_PIN_CFG_TRSW_POL		FIELD32(0x00080000)
12498c2ecf20Sopenharmony_ci#define TX_PIN_CFG_RFRX_EN		FIELD32(0x00100000)
12508c2ecf20Sopenharmony_ci#define TX_PIN_CFG_RFRX_POL		FIELD32(0x00200000)
12518c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A2_EN		FIELD32(0x01000000)
12528c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G2_EN		FIELD32(0x02000000)
12538c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_A2_POL		FIELD32(0x04000000)
12548c2ecf20Sopenharmony_ci#define TX_PIN_CFG_PA_PE_G2_POL		FIELD32(0x08000000)
12558c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A2_EN		FIELD32(0x10000000)
12568c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G2_EN		FIELD32(0x20000000)
12578c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_A2_POL	FIELD32(0x40000000)
12588c2ecf20Sopenharmony_ci#define TX_PIN_CFG_LNA_PE_G2_POL	FIELD32(0x80000000)
12598c2ecf20Sopenharmony_ci
12608c2ecf20Sopenharmony_ci/*
12618c2ecf20Sopenharmony_ci * TX_BAND_CFG: 0x1 use upper 20MHz, 0x0 use lower 20MHz
12628c2ecf20Sopenharmony_ci */
12638c2ecf20Sopenharmony_ci#define TX_BAND_CFG			0x132c
12648c2ecf20Sopenharmony_ci#define TX_BAND_CFG_HT40_MINUS		FIELD32(0x00000001)
12658c2ecf20Sopenharmony_ci#define TX_BAND_CFG_A			FIELD32(0x00000002)
12668c2ecf20Sopenharmony_ci#define TX_BAND_CFG_BG			FIELD32(0x00000004)
12678c2ecf20Sopenharmony_ci
12688c2ecf20Sopenharmony_ci/*
12698c2ecf20Sopenharmony_ci * TX_SW_CFG0:
12708c2ecf20Sopenharmony_ci */
12718c2ecf20Sopenharmony_ci#define TX_SW_CFG0			0x1330
12728c2ecf20Sopenharmony_ci
12738c2ecf20Sopenharmony_ci/*
12748c2ecf20Sopenharmony_ci * TX_SW_CFG1:
12758c2ecf20Sopenharmony_ci */
12768c2ecf20Sopenharmony_ci#define TX_SW_CFG1			0x1334
12778c2ecf20Sopenharmony_ci
12788c2ecf20Sopenharmony_ci/*
12798c2ecf20Sopenharmony_ci * TX_SW_CFG2:
12808c2ecf20Sopenharmony_ci */
12818c2ecf20Sopenharmony_ci#define TX_SW_CFG2			0x1338
12828c2ecf20Sopenharmony_ci
12838c2ecf20Sopenharmony_ci/*
12848c2ecf20Sopenharmony_ci * TXOP_THRES_CFG:
12858c2ecf20Sopenharmony_ci */
12868c2ecf20Sopenharmony_ci#define TXOP_THRES_CFG			0x133c
12878c2ecf20Sopenharmony_ci
12888c2ecf20Sopenharmony_ci/*
12898c2ecf20Sopenharmony_ci * TXOP_CTRL_CFG:
12908c2ecf20Sopenharmony_ci * TIMEOUT_TRUN_EN: Enable/Disable TXOP timeout truncation
12918c2ecf20Sopenharmony_ci * AC_TRUN_EN: Enable/Disable truncation for AC change
12928c2ecf20Sopenharmony_ci * TXRATEGRP_TRUN_EN: Enable/Disable truncation for TX rate group change
12938c2ecf20Sopenharmony_ci * USER_MODE_TRUN_EN: Enable/Disable truncation for user TXOP mode
12948c2ecf20Sopenharmony_ci * MIMO_PS_TRUN_EN: Enable/Disable truncation for MIMO PS RTS/CTS
12958c2ecf20Sopenharmony_ci * RESERVED_TRUN_EN: Reserved
12968c2ecf20Sopenharmony_ci * LSIG_TXOP_EN: Enable/Disable L-SIG TXOP protection
12978c2ecf20Sopenharmony_ci * EXT_CCA_EN: Enable/Disable extension channel CCA reference (Defer 40Mhz
12988c2ecf20Sopenharmony_ci *	       transmissions if extension CCA is clear).
12998c2ecf20Sopenharmony_ci * EXT_CCA_DLY: Extension CCA signal delay time (unit: us)
13008c2ecf20Sopenharmony_ci * EXT_CWMIN: CwMin for extension channel backoff
13018c2ecf20Sopenharmony_ci *	      0: Disabled
13028c2ecf20Sopenharmony_ci *
13038c2ecf20Sopenharmony_ci */
13048c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG			0x1340
13058c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_TIMEOUT_TRUN_EN	FIELD32(0x00000001)
13068c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_AC_TRUN_EN	FIELD32(0x00000002)
13078c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_TXRATEGRP_TRUN_EN	FIELD32(0x00000004)
13088c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_USER_MODE_TRUN_EN	FIELD32(0x00000008)
13098c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_MIMO_PS_TRUN_EN	FIELD32(0x00000010)
13108c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_RESERVED_TRUN_EN	FIELD32(0x00000020)
13118c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_LSIG_TXOP_EN	FIELD32(0x00000040)
13128c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_EXT_CCA_EN	FIELD32(0x00000080)
13138c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_EXT_CCA_DLY	FIELD32(0x0000ff00)
13148c2ecf20Sopenharmony_ci#define TXOP_CTRL_CFG_EXT_CWMIN		FIELD32(0x000f0000)
13158c2ecf20Sopenharmony_ci
13168c2ecf20Sopenharmony_ci/*
13178c2ecf20Sopenharmony_ci * TX_RTS_CFG:
13188c2ecf20Sopenharmony_ci * RTS_THRES: unit:byte
13198c2ecf20Sopenharmony_ci * RTS_FBK_EN: enable rts rate fallback
13208c2ecf20Sopenharmony_ci */
13218c2ecf20Sopenharmony_ci#define TX_RTS_CFG			0x1344
13228c2ecf20Sopenharmony_ci#define TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT	FIELD32(0x000000ff)
13238c2ecf20Sopenharmony_ci#define TX_RTS_CFG_RTS_THRES		FIELD32(0x00ffff00)
13248c2ecf20Sopenharmony_ci#define TX_RTS_CFG_RTS_FBK_EN		FIELD32(0x01000000)
13258c2ecf20Sopenharmony_ci
13268c2ecf20Sopenharmony_ci/*
13278c2ecf20Sopenharmony_ci * TX_TIMEOUT_CFG:
13288c2ecf20Sopenharmony_ci * MPDU_LIFETIME: expiration time = 2^(9+MPDU LIFE TIME) us
13298c2ecf20Sopenharmony_ci * RX_ACK_TIMEOUT: unit:slot. Used for TX procedure
13308c2ecf20Sopenharmony_ci * TX_OP_TIMEOUT: TXOP timeout value for TXOP truncation.
13318c2ecf20Sopenharmony_ci *                it is recommended that:
13328c2ecf20Sopenharmony_ci *                (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT)
13338c2ecf20Sopenharmony_ci */
13348c2ecf20Sopenharmony_ci#define TX_TIMEOUT_CFG			0x1348
13358c2ecf20Sopenharmony_ci#define TX_TIMEOUT_CFG_MPDU_LIFETIME	FIELD32(0x000000f0)
13368c2ecf20Sopenharmony_ci#define TX_TIMEOUT_CFG_RX_ACK_TIMEOUT	FIELD32(0x0000ff00)
13378c2ecf20Sopenharmony_ci#define TX_TIMEOUT_CFG_TX_OP_TIMEOUT	FIELD32(0x00ff0000)
13388c2ecf20Sopenharmony_ci
13398c2ecf20Sopenharmony_ci/*
13408c2ecf20Sopenharmony_ci * TX_RTY_CFG:
13418c2ecf20Sopenharmony_ci * SHORT_RTY_LIMIT: short retry limit
13428c2ecf20Sopenharmony_ci * LONG_RTY_LIMIT: long retry limit
13438c2ecf20Sopenharmony_ci * LONG_RTY_THRE: Long retry threshoold
13448c2ecf20Sopenharmony_ci * NON_AGG_RTY_MODE: Non-Aggregate MPDU retry mode
13458c2ecf20Sopenharmony_ci *                   0:expired by retry limit, 1: expired by mpdu life timer
13468c2ecf20Sopenharmony_ci * AGG_RTY_MODE: Aggregate MPDU retry mode
13478c2ecf20Sopenharmony_ci *               0:expired by retry limit, 1: expired by mpdu life timer
13488c2ecf20Sopenharmony_ci * TX_AUTO_FB_ENABLE: Tx retry PHY rate auto fallback enable
13498c2ecf20Sopenharmony_ci */
13508c2ecf20Sopenharmony_ci#define TX_RTY_CFG			0x134c
13518c2ecf20Sopenharmony_ci#define TX_RTY_CFG_SHORT_RTY_LIMIT	FIELD32(0x000000ff)
13528c2ecf20Sopenharmony_ci#define TX_RTY_CFG_LONG_RTY_LIMIT	FIELD32(0x0000ff00)
13538c2ecf20Sopenharmony_ci#define TX_RTY_CFG_LONG_RTY_THRE	FIELD32(0x0fff0000)
13548c2ecf20Sopenharmony_ci#define TX_RTY_CFG_NON_AGG_RTY_MODE	FIELD32(0x10000000)
13558c2ecf20Sopenharmony_ci#define TX_RTY_CFG_AGG_RTY_MODE		FIELD32(0x20000000)
13568c2ecf20Sopenharmony_ci#define TX_RTY_CFG_TX_AUTO_FB_ENABLE	FIELD32(0x40000000)
13578c2ecf20Sopenharmony_ci
13588c2ecf20Sopenharmony_ci/*
13598c2ecf20Sopenharmony_ci * TX_LINK_CFG:
13608c2ecf20Sopenharmony_ci * REMOTE_MFB_LIFETIME: remote MFB life time. unit: 32us
13618c2ecf20Sopenharmony_ci * MFB_ENABLE: TX apply remote MFB 1:enable
13628c2ecf20Sopenharmony_ci * REMOTE_UMFS_ENABLE: remote unsolicit  MFB enable
13638c2ecf20Sopenharmony_ci *                     0: not apply remote remote unsolicit (MFS=7)
13648c2ecf20Sopenharmony_ci * TX_MRQ_EN: MCS request TX enable
13658c2ecf20Sopenharmony_ci * TX_RDG_EN: RDG TX enable
13668c2ecf20Sopenharmony_ci * TX_CF_ACK_EN: Piggyback CF-ACK enable
13678c2ecf20Sopenharmony_ci * REMOTE_MFB: remote MCS feedback
13688c2ecf20Sopenharmony_ci * REMOTE_MFS: remote MCS feedback sequence number
13698c2ecf20Sopenharmony_ci */
13708c2ecf20Sopenharmony_ci#define TX_LINK_CFG			0x1350
13718c2ecf20Sopenharmony_ci#define TX_LINK_CFG_REMOTE_MFB_LIFETIME	FIELD32(0x000000ff)
13728c2ecf20Sopenharmony_ci#define TX_LINK_CFG_MFB_ENABLE		FIELD32(0x00000100)
13738c2ecf20Sopenharmony_ci#define TX_LINK_CFG_REMOTE_UMFS_ENABLE	FIELD32(0x00000200)
13748c2ecf20Sopenharmony_ci#define TX_LINK_CFG_TX_MRQ_EN		FIELD32(0x00000400)
13758c2ecf20Sopenharmony_ci#define TX_LINK_CFG_TX_RDG_EN		FIELD32(0x00000800)
13768c2ecf20Sopenharmony_ci#define TX_LINK_CFG_TX_CF_ACK_EN	FIELD32(0x00001000)
13778c2ecf20Sopenharmony_ci#define TX_LINK_CFG_REMOTE_MFB		FIELD32(0x00ff0000)
13788c2ecf20Sopenharmony_ci#define TX_LINK_CFG_REMOTE_MFS		FIELD32(0xff000000)
13798c2ecf20Sopenharmony_ci
13808c2ecf20Sopenharmony_ci/*
13818c2ecf20Sopenharmony_ci * HT_FBK_CFG0:
13828c2ecf20Sopenharmony_ci */
13838c2ecf20Sopenharmony_ci#define HT_FBK_CFG0			0x1354
13848c2ecf20Sopenharmony_ci#define HT_FBK_CFG0_HTMCS0FBK		FIELD32(0x0000000f)
13858c2ecf20Sopenharmony_ci#define HT_FBK_CFG0_HTMCS1FBK		FIELD32(0x000000f0)
13868c2ecf20Sopenharmony_ci#define HT_FBK_CFG0_HTMCS2FBK		FIELD32(0x00000f00)
13878c2ecf20Sopenharmony_ci#define HT_FBK_CFG0_HTMCS3FBK		FIELD32(0x0000f000)
13888c2ecf20Sopenharmony_ci#define HT_FBK_CFG0_HTMCS4FBK		FIELD32(0x000f0000)
13898c2ecf20Sopenharmony_ci#define HT_FBK_CFG0_HTMCS5FBK		FIELD32(0x00f00000)
13908c2ecf20Sopenharmony_ci#define HT_FBK_CFG0_HTMCS6FBK		FIELD32(0x0f000000)
13918c2ecf20Sopenharmony_ci#define HT_FBK_CFG0_HTMCS7FBK		FIELD32(0xf0000000)
13928c2ecf20Sopenharmony_ci
13938c2ecf20Sopenharmony_ci/*
13948c2ecf20Sopenharmony_ci * HT_FBK_CFG1:
13958c2ecf20Sopenharmony_ci */
13968c2ecf20Sopenharmony_ci#define HT_FBK_CFG1			0x1358
13978c2ecf20Sopenharmony_ci#define HT_FBK_CFG1_HTMCS8FBK		FIELD32(0x0000000f)
13988c2ecf20Sopenharmony_ci#define HT_FBK_CFG1_HTMCS9FBK		FIELD32(0x000000f0)
13998c2ecf20Sopenharmony_ci#define HT_FBK_CFG1_HTMCS10FBK		FIELD32(0x00000f00)
14008c2ecf20Sopenharmony_ci#define HT_FBK_CFG1_HTMCS11FBK		FIELD32(0x0000f000)
14018c2ecf20Sopenharmony_ci#define HT_FBK_CFG1_HTMCS12FBK		FIELD32(0x000f0000)
14028c2ecf20Sopenharmony_ci#define HT_FBK_CFG1_HTMCS13FBK		FIELD32(0x00f00000)
14038c2ecf20Sopenharmony_ci#define HT_FBK_CFG1_HTMCS14FBK		FIELD32(0x0f000000)
14048c2ecf20Sopenharmony_ci#define HT_FBK_CFG1_HTMCS15FBK		FIELD32(0xf0000000)
14058c2ecf20Sopenharmony_ci
14068c2ecf20Sopenharmony_ci/*
14078c2ecf20Sopenharmony_ci * LG_FBK_CFG0:
14088c2ecf20Sopenharmony_ci */
14098c2ecf20Sopenharmony_ci#define LG_FBK_CFG0			0x135c
14108c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS0FBK		FIELD32(0x0000000f)
14118c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS1FBK		FIELD32(0x000000f0)
14128c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS2FBK		FIELD32(0x00000f00)
14138c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS3FBK		FIELD32(0x0000f000)
14148c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS4FBK		FIELD32(0x000f0000)
14158c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS5FBK		FIELD32(0x00f00000)
14168c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS6FBK		FIELD32(0x0f000000)
14178c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_OFDMMCS7FBK		FIELD32(0xf0000000)
14188c2ecf20Sopenharmony_ci
14198c2ecf20Sopenharmony_ci/*
14208c2ecf20Sopenharmony_ci * LG_FBK_CFG1:
14218c2ecf20Sopenharmony_ci */
14228c2ecf20Sopenharmony_ci#define LG_FBK_CFG1			0x1360
14238c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_CCKMCS0FBK		FIELD32(0x0000000f)
14248c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_CCKMCS1FBK		FIELD32(0x000000f0)
14258c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_CCKMCS2FBK		FIELD32(0x00000f00)
14268c2ecf20Sopenharmony_ci#define LG_FBK_CFG0_CCKMCS3FBK		FIELD32(0x0000f000)
14278c2ecf20Sopenharmony_ci
14288c2ecf20Sopenharmony_ci/*
14298c2ecf20Sopenharmony_ci * CCK_PROT_CFG: CCK Protection
14308c2ecf20Sopenharmony_ci * PROTECT_RATE: Protection control frame rate for CCK TX(RTS/CTS/CFEnd)
14318c2ecf20Sopenharmony_ci * PROTECT_CTRL: Protection control frame type for CCK TX
14328c2ecf20Sopenharmony_ci *               0:none, 1:RTS/CTS, 2:CTS-to-self
14338c2ecf20Sopenharmony_ci * PROTECT_NAV_SHORT: TXOP protection type for CCK TX with short NAV
14348c2ecf20Sopenharmony_ci * PROTECT_NAV_LONG: TXOP protection type for CCK TX with long NAV
14358c2ecf20Sopenharmony_ci * TX_OP_ALLOW_CCK: CCK TXOP allowance, 0:disallow
14368c2ecf20Sopenharmony_ci * TX_OP_ALLOW_OFDM: CCK TXOP allowance, 0:disallow
14378c2ecf20Sopenharmony_ci * TX_OP_ALLOW_MM20: CCK TXOP allowance, 0:disallow
14388c2ecf20Sopenharmony_ci * TX_OP_ALLOW_MM40: CCK TXOP allowance, 0:disallow
14398c2ecf20Sopenharmony_ci * TX_OP_ALLOW_GF20: CCK TXOP allowance, 0:disallow
14408c2ecf20Sopenharmony_ci * TX_OP_ALLOW_GF40: CCK TXOP allowance, 0:disallow
14418c2ecf20Sopenharmony_ci * RTS_TH_EN: RTS threshold enable on CCK TX
14428c2ecf20Sopenharmony_ci */
14438c2ecf20Sopenharmony_ci#define CCK_PROT_CFG			0x1364
14448c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_PROTECT_RATE	FIELD32(0x0000ffff)
14458c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_PROTECT_CTRL	FIELD32(0x00030000)
14468c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_PROTECT_NAV_SHORT	FIELD32(0x00040000)
14478c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_PROTECT_NAV_LONG	FIELD32(0x00080000)
14488c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_CCK	FIELD32(0x00100000)
14498c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_OFDM	FIELD32(0x00200000)
14508c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_MM20	FIELD32(0x00400000)
14518c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_MM40	FIELD32(0x00800000)
14528c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_GF20	FIELD32(0x01000000)
14538c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_TX_OP_ALLOW_GF40	FIELD32(0x02000000)
14548c2ecf20Sopenharmony_ci#define CCK_PROT_CFG_RTS_TH_EN		FIELD32(0x04000000)
14558c2ecf20Sopenharmony_ci
14568c2ecf20Sopenharmony_ci/*
14578c2ecf20Sopenharmony_ci * OFDM_PROT_CFG: OFDM Protection
14588c2ecf20Sopenharmony_ci */
14598c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG			0x1368
14608c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_PROTECT_RATE	FIELD32(0x0000ffff)
14618c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_PROTECT_CTRL	FIELD32(0x00030000)
14628c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_PROTECT_NAV_SHORT	FIELD32(0x00040000)
14638c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_PROTECT_NAV_LONG	FIELD32(0x00080000)
14648c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_CCK	FIELD32(0x00100000)
14658c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_OFDM	FIELD32(0x00200000)
14668c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_MM20	FIELD32(0x00400000)
14678c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_MM40	FIELD32(0x00800000)
14688c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_GF20	FIELD32(0x01000000)
14698c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_TX_OP_ALLOW_GF40	FIELD32(0x02000000)
14708c2ecf20Sopenharmony_ci#define OFDM_PROT_CFG_RTS_TH_EN		FIELD32(0x04000000)
14718c2ecf20Sopenharmony_ci
14728c2ecf20Sopenharmony_ci/*
14738c2ecf20Sopenharmony_ci * MM20_PROT_CFG: MM20 Protection
14748c2ecf20Sopenharmony_ci */
14758c2ecf20Sopenharmony_ci#define MM20_PROT_CFG			0x136c
14768c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_PROTECT_RATE	FIELD32(0x0000ffff)
14778c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_PROTECT_CTRL	FIELD32(0x00030000)
14788c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_PROTECT_NAV_SHORT	FIELD32(0x00040000)
14798c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_PROTECT_NAV_LONG	FIELD32(0x00080000)
14808c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_CCK	FIELD32(0x00100000)
14818c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_OFDM	FIELD32(0x00200000)
14828c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_MM20	FIELD32(0x00400000)
14838c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_MM40	FIELD32(0x00800000)
14848c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_GF20	FIELD32(0x01000000)
14858c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_TX_OP_ALLOW_GF40	FIELD32(0x02000000)
14868c2ecf20Sopenharmony_ci#define MM20_PROT_CFG_RTS_TH_EN		FIELD32(0x04000000)
14878c2ecf20Sopenharmony_ci
14888c2ecf20Sopenharmony_ci/*
14898c2ecf20Sopenharmony_ci * MM40_PROT_CFG: MM40 Protection
14908c2ecf20Sopenharmony_ci */
14918c2ecf20Sopenharmony_ci#define MM40_PROT_CFG			0x1370
14928c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_PROTECT_RATE	FIELD32(0x0000ffff)
14938c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_PROTECT_CTRL	FIELD32(0x00030000)
14948c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_PROTECT_NAV_SHORT	FIELD32(0x00040000)
14958c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_PROTECT_NAV_LONG	FIELD32(0x00080000)
14968c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_CCK	FIELD32(0x00100000)
14978c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_OFDM	FIELD32(0x00200000)
14988c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_MM20	FIELD32(0x00400000)
14998c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_MM40	FIELD32(0x00800000)
15008c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_GF20	FIELD32(0x01000000)
15018c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_TX_OP_ALLOW_GF40	FIELD32(0x02000000)
15028c2ecf20Sopenharmony_ci#define MM40_PROT_CFG_RTS_TH_EN		FIELD32(0x04000000)
15038c2ecf20Sopenharmony_ci
15048c2ecf20Sopenharmony_ci/*
15058c2ecf20Sopenharmony_ci * GF20_PROT_CFG: GF20 Protection
15068c2ecf20Sopenharmony_ci */
15078c2ecf20Sopenharmony_ci#define GF20_PROT_CFG			0x1374
15088c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_PROTECT_RATE	FIELD32(0x0000ffff)
15098c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_PROTECT_CTRL	FIELD32(0x00030000)
15108c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_PROTECT_NAV_SHORT	FIELD32(0x00040000)
15118c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_PROTECT_NAV_LONG	FIELD32(0x00080000)
15128c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_CCK	FIELD32(0x00100000)
15138c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_OFDM	FIELD32(0x00200000)
15148c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_MM20	FIELD32(0x00400000)
15158c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_MM40	FIELD32(0x00800000)
15168c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_GF20	FIELD32(0x01000000)
15178c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_TX_OP_ALLOW_GF40	FIELD32(0x02000000)
15188c2ecf20Sopenharmony_ci#define GF20_PROT_CFG_RTS_TH_EN		FIELD32(0x04000000)
15198c2ecf20Sopenharmony_ci
15208c2ecf20Sopenharmony_ci/*
15218c2ecf20Sopenharmony_ci * GF40_PROT_CFG: GF40 Protection
15228c2ecf20Sopenharmony_ci */
15238c2ecf20Sopenharmony_ci#define GF40_PROT_CFG			0x1378
15248c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_PROTECT_RATE	FIELD32(0x0000ffff)
15258c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_PROTECT_CTRL	FIELD32(0x00030000)
15268c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_PROTECT_NAV_SHORT	FIELD32(0x00040000)
15278c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_PROTECT_NAV_LONG	FIELD32(0x00080000)
15288c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_CCK	FIELD32(0x00100000)
15298c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_OFDM	FIELD32(0x00200000)
15308c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_MM20	FIELD32(0x00400000)
15318c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_MM40	FIELD32(0x00800000)
15328c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_GF20	FIELD32(0x01000000)
15338c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_TX_OP_ALLOW_GF40	FIELD32(0x02000000)
15348c2ecf20Sopenharmony_ci#define GF40_PROT_CFG_RTS_TH_EN		FIELD32(0x04000000)
15358c2ecf20Sopenharmony_ci
15368c2ecf20Sopenharmony_ci/*
15378c2ecf20Sopenharmony_ci * EXP_CTS_TIME:
15388c2ecf20Sopenharmony_ci */
15398c2ecf20Sopenharmony_ci#define EXP_CTS_TIME			0x137c
15408c2ecf20Sopenharmony_ci
15418c2ecf20Sopenharmony_ci/*
15428c2ecf20Sopenharmony_ci * EXP_ACK_TIME:
15438c2ecf20Sopenharmony_ci */
15448c2ecf20Sopenharmony_ci#define EXP_ACK_TIME			0x1380
15458c2ecf20Sopenharmony_ci
15468c2ecf20Sopenharmony_ci/* TX_PWR_CFG_5 */
15478c2ecf20Sopenharmony_ci#define TX_PWR_CFG_5			0x1384
15488c2ecf20Sopenharmony_ci#define TX_PWR_CFG_5_MCS16_CH0		FIELD32(0x0000000f)
15498c2ecf20Sopenharmony_ci#define TX_PWR_CFG_5_MCS16_CH1		FIELD32(0x000000f0)
15508c2ecf20Sopenharmony_ci#define TX_PWR_CFG_5_MCS16_CH2		FIELD32(0x00000f00)
15518c2ecf20Sopenharmony_ci#define TX_PWR_CFG_5_MCS18_CH0		FIELD32(0x000f0000)
15528c2ecf20Sopenharmony_ci#define TX_PWR_CFG_5_MCS18_CH1		FIELD32(0x00f00000)
15538c2ecf20Sopenharmony_ci#define TX_PWR_CFG_5_MCS18_CH2		FIELD32(0x0f000000)
15548c2ecf20Sopenharmony_ci
15558c2ecf20Sopenharmony_ci/* TX_PWR_CFG_6 */
15568c2ecf20Sopenharmony_ci#define TX_PWR_CFG_6			0x1388
15578c2ecf20Sopenharmony_ci#define TX_PWR_CFG_6_MCS20_CH0		FIELD32(0x0000000f)
15588c2ecf20Sopenharmony_ci#define TX_PWR_CFG_6_MCS20_CH1		FIELD32(0x000000f0)
15598c2ecf20Sopenharmony_ci#define TX_PWR_CFG_6_MCS20_CH2		FIELD32(0x00000f00)
15608c2ecf20Sopenharmony_ci#define TX_PWR_CFG_6_MCS22_CH0		FIELD32(0x000f0000)
15618c2ecf20Sopenharmony_ci#define TX_PWR_CFG_6_MCS22_CH1		FIELD32(0x00f00000)
15628c2ecf20Sopenharmony_ci#define TX_PWR_CFG_6_MCS22_CH2		FIELD32(0x0f000000)
15638c2ecf20Sopenharmony_ci
15648c2ecf20Sopenharmony_ci/* TX_PWR_CFG_0_EXT */
15658c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_EXT		0x1390
15668c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_EXT_CCK1_CH2	FIELD32(0x0000000f)
15678c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_EXT_CCK5_CH2	FIELD32(0x00000f00)
15688c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_EXT_OFDM6_CH2	FIELD32(0x000f0000)
15698c2ecf20Sopenharmony_ci#define TX_PWR_CFG_0_EXT_OFDM12_CH2	FIELD32(0x0f000000)
15708c2ecf20Sopenharmony_ci
15718c2ecf20Sopenharmony_ci/* TX_PWR_CFG_1_EXT */
15728c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_EXT		0x1394
15738c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_EXT_OFDM24_CH2	FIELD32(0x0000000f)
15748c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_EXT_OFDM48_CH2	FIELD32(0x00000f00)
15758c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_EXT_MCS0_CH2	FIELD32(0x000f0000)
15768c2ecf20Sopenharmony_ci#define TX_PWR_CFG_1_EXT_MCS2_CH2	FIELD32(0x0f000000)
15778c2ecf20Sopenharmony_ci
15788c2ecf20Sopenharmony_ci/* TX_PWR_CFG_2_EXT */
15798c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_EXT		0x1398
15808c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_EXT_MCS4_CH2	FIELD32(0x0000000f)
15818c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_EXT_MCS6_CH2	FIELD32(0x00000f00)
15828c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_EXT_MCS8_CH2	FIELD32(0x000f0000)
15838c2ecf20Sopenharmony_ci#define TX_PWR_CFG_2_EXT_MCS10_CH2	FIELD32(0x0f000000)
15848c2ecf20Sopenharmony_ci
15858c2ecf20Sopenharmony_ci/* TX_PWR_CFG_3_EXT */
15868c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_EXT		0x139c
15878c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_EXT_MCS12_CH2	FIELD32(0x0000000f)
15888c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_EXT_MCS14_CH2	FIELD32(0x00000f00)
15898c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_EXT_STBC0_CH2	FIELD32(0x000f0000)
15908c2ecf20Sopenharmony_ci#define TX_PWR_CFG_3_EXT_STBC2_CH2	FIELD32(0x0f000000)
15918c2ecf20Sopenharmony_ci
15928c2ecf20Sopenharmony_ci/* TX_PWR_CFG_4_EXT */
15938c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_EXT		0x13a0
15948c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_EXT_STBC4_CH2	FIELD32(0x0000000f)
15958c2ecf20Sopenharmony_ci#define TX_PWR_CFG_4_EXT_STBC6_CH2	FIELD32(0x00000f00)
15968c2ecf20Sopenharmony_ci
15978c2ecf20Sopenharmony_ci/* TXn_RF_GAIN_CORRECT: RF Gain Correction for each RF_ALC[3:2]
15988c2ecf20Sopenharmony_ci * Unit: 0.1 dB, Range: -3.2 dB to 3.1 dB
15998c2ecf20Sopenharmony_ci */
16008c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_CORRECT		0x13a0
16018c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_CORRECT_GAIN_CORR_0	FIELD32(0x0000003f)
16028c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_CORRECT_GAIN_CORR_1	FIELD32(0x00003f00)
16038c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_CORRECT_GAIN_CORR_2	FIELD32(0x003f0000)
16048c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_CORRECT_GAIN_CORR_3	FIELD32(0x3f000000)
16058c2ecf20Sopenharmony_ci
16068c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_CORRECT		0x13a4
16078c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_CORRECT_GAIN_CORR_0	FIELD32(0x0000003f)
16088c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_CORRECT_GAIN_CORR_1	FIELD32(0x00003f00)
16098c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_CORRECT_GAIN_CORR_2	FIELD32(0x003f0000)
16108c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_CORRECT_GAIN_CORR_3	FIELD32(0x3f000000)
16118c2ecf20Sopenharmony_ci
16128c2ecf20Sopenharmony_ci/* TXn_RF_GAIN_ATTEN: TXn RF Gain Attenuation Level
16138c2ecf20Sopenharmony_ci * Format: 7-bit, signed value
16148c2ecf20Sopenharmony_ci * Unit: 0.5 dB, Range: -20 dB to -5 dB
16158c2ecf20Sopenharmony_ci */
16168c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_ATTEN		0x13a8
16178c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_ATTEN_LEVEL_0	FIELD32(0x0000007f)
16188c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_ATTEN_LEVEL_1	FIELD32(0x00007f00)
16198c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_ATTEN_LEVEL_2	FIELD32(0x007f0000)
16208c2ecf20Sopenharmony_ci#define TX0_RF_GAIN_ATTEN_LEVEL_3	FIELD32(0x7f000000)
16218c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_ATTEN		0x13ac
16228c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_ATTEN_LEVEL_0	FIELD32(0x0000007f)
16238c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_ATTEN_LEVEL_1	FIELD32(0x00007f00)
16248c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_ATTEN_LEVEL_2	FIELD32(0x007f0000)
16258c2ecf20Sopenharmony_ci#define TX1_RF_GAIN_ATTEN_LEVEL_3	FIELD32(0x7f000000)
16268c2ecf20Sopenharmony_ci
16278c2ecf20Sopenharmony_ci/* TX_ALC_CFG_0: TX Automatic Level Control Configuration 0
16288c2ecf20Sopenharmony_ci * TX_ALC_LIMIT_n: TXn upper limit
16298c2ecf20Sopenharmony_ci * TX_ALC_CH_INIT_n: TXn channel initial transmission gain
16308c2ecf20Sopenharmony_ci * Unit: 0.5 dB, Range: 0 to 23.5 dB
16318c2ecf20Sopenharmony_ci */
16328c2ecf20Sopenharmony_ci#define TX_ALC_CFG_0			0x13b0
16338c2ecf20Sopenharmony_ci#define TX_ALC_CFG_0_CH_INIT_0		FIELD32(0x0000003f)
16348c2ecf20Sopenharmony_ci#define TX_ALC_CFG_0_CH_INIT_1		FIELD32(0x00003f00)
16358c2ecf20Sopenharmony_ci#define TX_ALC_CFG_0_LIMIT_0		FIELD32(0x003f0000)
16368c2ecf20Sopenharmony_ci#define TX_ALC_CFG_0_LIMIT_1		FIELD32(0x3f000000)
16378c2ecf20Sopenharmony_ci
16388c2ecf20Sopenharmony_ci/* TX_ALC_CFG_1: TX Automatic Level Control Configuration 1
16398c2ecf20Sopenharmony_ci * TX_TEMP_COMP:      TX Power Temperature Compensation
16408c2ecf20Sopenharmony_ci *                    Unit: 0.5 dB, Range: -10 dB to 10 dB
16418c2ecf20Sopenharmony_ci * TXn_GAIN_FINE:     TXn Gain Fine Adjustment
16428c2ecf20Sopenharmony_ci *                    Unit: 0.1 dB, Range: -0.8 dB to 0.7 dB
16438c2ecf20Sopenharmony_ci * RF_TOS_DLY:        Sets the RF_TOS_EN assertion delay after
16448c2ecf20Sopenharmony_ci *                    deassertion of PA_PE.
16458c2ecf20Sopenharmony_ci *                    Unit: 0.25 usec
16468c2ecf20Sopenharmony_ci * TXn_RF_GAIN_ATTEN: TXn RF gain attentuation selector
16478c2ecf20Sopenharmony_ci * RF_TOS_TIMEOUT:    time-out value for RF_TOS_ENABLE
16488c2ecf20Sopenharmony_ci *                    deassertion if RF_TOS_DONE is missing.
16498c2ecf20Sopenharmony_ci *                    Unit: 0.25 usec
16508c2ecf20Sopenharmony_ci * RF_TOS_ENABLE:     TX offset calibration enable
16518c2ecf20Sopenharmony_ci * ROS_BUSY_EN:       RX offset calibration busy enable
16528c2ecf20Sopenharmony_ci */
16538c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1			0x13b4
16548c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_TX_TEMP_COMP	FIELD32(0x0000003f)
16558c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_TX0_GAIN_FINE	FIELD32(0x00000f00)
16568c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_TX1_GAIN_FINE	FIELD32(0x0000f000)
16578c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_RF_TOS_DLY		FIELD32(0x00070000)
16588c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_TX0_RF_GAIN_ATTEN	FIELD32(0x00300000)
16598c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_TX1_RF_GAIN_ATTEN	FIELD32(0x00c00000)
16608c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_RF_TOS_TIMEOUT	FIELD32(0x3f000000)
16618c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_RF_TOS_ENABLE	FIELD32(0x40000000)
16628c2ecf20Sopenharmony_ci#define TX_ALC_CFG_1_ROS_BUSY_EN	FIELD32(0x80000000)
16638c2ecf20Sopenharmony_ci
16648c2ecf20Sopenharmony_ci/* TXn_BB_GAIN_ATTEN: TXn RF Gain Attenuation Level
16658c2ecf20Sopenharmony_ci * Format: 5-bit signed values
16668c2ecf20Sopenharmony_ci * Unit: 0.5 dB, Range: -8 dB to 7 dB
16678c2ecf20Sopenharmony_ci */
16688c2ecf20Sopenharmony_ci#define TX0_BB_GAIN_ATTEN		0x13c0
16698c2ecf20Sopenharmony_ci#define TX0_BB_GAIN_ATTEN_LEVEL_0	FIELD32(0x0000001f)
16708c2ecf20Sopenharmony_ci#define TX0_BB_GAIN_ATTEN_LEVEL_1	FIELD32(0x00001f00)
16718c2ecf20Sopenharmony_ci#define TX0_BB_GAIN_ATTEN_LEVEL_2	FIELD32(0x001f0000)
16728c2ecf20Sopenharmony_ci#define TX0_BB_GAIN_ATTEN_LEVEL_3	FIELD32(0x1f000000)
16738c2ecf20Sopenharmony_ci#define TX1_BB_GAIN_ATTEN		0x13c4
16748c2ecf20Sopenharmony_ci#define TX1_BB_GAIN_ATTEN_LEVEL_0	FIELD32(0x0000001f)
16758c2ecf20Sopenharmony_ci#define TX1_BB_GAIN_ATTEN_LEVEL_1	FIELD32(0x00001f00)
16768c2ecf20Sopenharmony_ci#define TX1_BB_GAIN_ATTEN_LEVEL_2	FIELD32(0x001f0000)
16778c2ecf20Sopenharmony_ci#define TX1_BB_GAIN_ATTEN_LEVEL_3	FIELD32(0x1f000000)
16788c2ecf20Sopenharmony_ci
16798c2ecf20Sopenharmony_ci/* TX_ALC_VGA3: TX Automatic Level Correction Variable Gain Amplifier 3 */
16808c2ecf20Sopenharmony_ci#define TX_ALC_VGA3			0x13c8
16818c2ecf20Sopenharmony_ci#define TX_ALC_VGA3_TX0_ALC_VGA3	FIELD32(0x0000001f)
16828c2ecf20Sopenharmony_ci#define TX_ALC_VGA3_TX1_ALC_VGA3	FIELD32(0x00001f00)
16838c2ecf20Sopenharmony_ci#define TX_ALC_VGA3_TX0_ALC_VGA2	FIELD32(0x001f0000)
16848c2ecf20Sopenharmony_ci#define TX_ALC_VGA3_TX1_ALC_VGA2	FIELD32(0x1f000000)
16858c2ecf20Sopenharmony_ci
16868c2ecf20Sopenharmony_ci/* TX_PWR_CFG_7 */
16878c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7			0x13d4
16888c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7_OFDM54_CH0		FIELD32(0x0000000f)
16898c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7_OFDM54_CH1		FIELD32(0x000000f0)
16908c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7_OFDM54_CH2		FIELD32(0x00000f00)
16918c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7_MCS7_CH0		FIELD32(0x000f0000)
16928c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7_MCS7_CH1		FIELD32(0x00f00000)
16938c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7_MCS7_CH2		FIELD32(0x0f000000)
16948c2ecf20Sopenharmony_ci/* bits for new 2T devices */
16958c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7B_54MBS		FIELD32(0x000000ff)
16968c2ecf20Sopenharmony_ci#define TX_PWR_CFG_7B_MCS7		FIELD32(0x00ff0000)
16978c2ecf20Sopenharmony_ci
16988c2ecf20Sopenharmony_ci
16998c2ecf20Sopenharmony_ci/* TX_PWR_CFG_8 */
17008c2ecf20Sopenharmony_ci#define TX_PWR_CFG_8			0x13d8
17018c2ecf20Sopenharmony_ci#define TX_PWR_CFG_8_MCS15_CH0		FIELD32(0x0000000f)
17028c2ecf20Sopenharmony_ci#define TX_PWR_CFG_8_MCS15_CH1		FIELD32(0x000000f0)
17038c2ecf20Sopenharmony_ci#define TX_PWR_CFG_8_MCS15_CH2		FIELD32(0x00000f00)
17048c2ecf20Sopenharmony_ci#define TX_PWR_CFG_8_MCS23_CH0		FIELD32(0x000f0000)
17058c2ecf20Sopenharmony_ci#define TX_PWR_CFG_8_MCS23_CH1		FIELD32(0x00f00000)
17068c2ecf20Sopenharmony_ci#define TX_PWR_CFG_8_MCS23_CH2		FIELD32(0x0f000000)
17078c2ecf20Sopenharmony_ci/* bits for new 2T devices */
17088c2ecf20Sopenharmony_ci#define TX_PWR_CFG_8B_MCS15		FIELD32(0x000000ff)
17098c2ecf20Sopenharmony_ci
17108c2ecf20Sopenharmony_ci
17118c2ecf20Sopenharmony_ci/* TX_PWR_CFG_9 */
17128c2ecf20Sopenharmony_ci#define TX_PWR_CFG_9			0x13dc
17138c2ecf20Sopenharmony_ci#define TX_PWR_CFG_9_STBC7_CH0		FIELD32(0x0000000f)
17148c2ecf20Sopenharmony_ci#define TX_PWR_CFG_9_STBC7_CH1		FIELD32(0x000000f0)
17158c2ecf20Sopenharmony_ci#define TX_PWR_CFG_9_STBC7_CH2		FIELD32(0x00000f00)
17168c2ecf20Sopenharmony_ci/* bits for new 2T devices */
17178c2ecf20Sopenharmony_ci#define TX_PWR_CFG_9B_STBC_MCS7		FIELD32(0x000000ff)
17188c2ecf20Sopenharmony_ci
17198c2ecf20Sopenharmony_ci/*
17208c2ecf20Sopenharmony_ci * TX_TXBF_CFG:
17218c2ecf20Sopenharmony_ci */
17228c2ecf20Sopenharmony_ci#define TX_TXBF_CFG_0			0x138c
17238c2ecf20Sopenharmony_ci#define TX_TXBF_CFG_1			0x13a4
17248c2ecf20Sopenharmony_ci#define TX_TXBF_CFG_2			0x13a8
17258c2ecf20Sopenharmony_ci#define TX_TXBF_CFG_3			0x13ac
17268c2ecf20Sopenharmony_ci
17278c2ecf20Sopenharmony_ci/*
17288c2ecf20Sopenharmony_ci * TX_FBK_CFG_3S:
17298c2ecf20Sopenharmony_ci */
17308c2ecf20Sopenharmony_ci#define TX_FBK_CFG_3S_0			0x13c4
17318c2ecf20Sopenharmony_ci#define TX_FBK_CFG_3S_1			0x13c8
17328c2ecf20Sopenharmony_ci
17338c2ecf20Sopenharmony_ci/*
17348c2ecf20Sopenharmony_ci * RX_FILTER_CFG: RX configuration register.
17358c2ecf20Sopenharmony_ci */
17368c2ecf20Sopenharmony_ci#define RX_FILTER_CFG			0x1400
17378c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_CRC_ERROR	FIELD32(0x00000001)
17388c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_PHY_ERROR	FIELD32(0x00000002)
17398c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_NOT_TO_ME	FIELD32(0x00000004)
17408c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_NOT_MY_BSSD	FIELD32(0x00000008)
17418c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_VER_ERROR	FIELD32(0x00000010)
17428c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_MULTICAST	FIELD32(0x00000020)
17438c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_BROADCAST	FIELD32(0x00000040)
17448c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_DUPLICATE	FIELD32(0x00000080)
17458c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_CF_END_ACK	FIELD32(0x00000100)
17468c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_CF_END	FIELD32(0x00000200)
17478c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_ACK		FIELD32(0x00000400)
17488c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_CTS		FIELD32(0x00000800)
17498c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_RTS		FIELD32(0x00001000)
17508c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_PSPOLL	FIELD32(0x00002000)
17518c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_BA		FIELD32(0x00004000)
17528c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_BAR		FIELD32(0x00008000)
17538c2ecf20Sopenharmony_ci#define RX_FILTER_CFG_DROP_CNTL		FIELD32(0x00010000)
17548c2ecf20Sopenharmony_ci
17558c2ecf20Sopenharmony_ci/*
17568c2ecf20Sopenharmony_ci * AUTO_RSP_CFG:
17578c2ecf20Sopenharmony_ci * AUTORESPONDER: 0: disable, 1: enable
17588c2ecf20Sopenharmony_ci * BAC_ACK_POLICY: 0:long, 1:short preamble
17598c2ecf20Sopenharmony_ci * CTS_40_MMODE: Response CTS 40MHz duplicate mode
17608c2ecf20Sopenharmony_ci * CTS_40_MREF: Response CTS 40MHz duplicate mode
17618c2ecf20Sopenharmony_ci * AR_PREAMBLE: Auto responder preamble 0:long, 1:short preamble
17628c2ecf20Sopenharmony_ci * DUAL_CTS_EN: Power bit value in control frame
17638c2ecf20Sopenharmony_ci * ACK_CTS_PSM_BIT:Power bit value in control frame
17648c2ecf20Sopenharmony_ci */
17658c2ecf20Sopenharmony_ci#define AUTO_RSP_CFG			0x1404
17668c2ecf20Sopenharmony_ci#define AUTO_RSP_CFG_AUTORESPONDER	FIELD32(0x00000001)
17678c2ecf20Sopenharmony_ci#define AUTO_RSP_CFG_BAC_ACK_POLICY	FIELD32(0x00000002)
17688c2ecf20Sopenharmony_ci#define AUTO_RSP_CFG_CTS_40_MMODE	FIELD32(0x00000004)
17698c2ecf20Sopenharmony_ci#define AUTO_RSP_CFG_CTS_40_MREF	FIELD32(0x00000008)
17708c2ecf20Sopenharmony_ci#define AUTO_RSP_CFG_AR_PREAMBLE	FIELD32(0x00000010)
17718c2ecf20Sopenharmony_ci#define AUTO_RSP_CFG_DUAL_CTS_EN	FIELD32(0x00000040)
17728c2ecf20Sopenharmony_ci#define AUTO_RSP_CFG_ACK_CTS_PSM_BIT	FIELD32(0x00000080)
17738c2ecf20Sopenharmony_ci
17748c2ecf20Sopenharmony_ci/*
17758c2ecf20Sopenharmony_ci * LEGACY_BASIC_RATE:
17768c2ecf20Sopenharmony_ci */
17778c2ecf20Sopenharmony_ci#define LEGACY_BASIC_RATE		0x1408
17788c2ecf20Sopenharmony_ci
17798c2ecf20Sopenharmony_ci/*
17808c2ecf20Sopenharmony_ci * HT_BASIC_RATE:
17818c2ecf20Sopenharmony_ci */
17828c2ecf20Sopenharmony_ci#define HT_BASIC_RATE			0x140c
17838c2ecf20Sopenharmony_ci
17848c2ecf20Sopenharmony_ci/*
17858c2ecf20Sopenharmony_ci * HT_CTRL_CFG:
17868c2ecf20Sopenharmony_ci */
17878c2ecf20Sopenharmony_ci#define HT_CTRL_CFG			0x1410
17888c2ecf20Sopenharmony_ci
17898c2ecf20Sopenharmony_ci/*
17908c2ecf20Sopenharmony_ci * SIFS_COST_CFG:
17918c2ecf20Sopenharmony_ci */
17928c2ecf20Sopenharmony_ci#define SIFS_COST_CFG			0x1414
17938c2ecf20Sopenharmony_ci
17948c2ecf20Sopenharmony_ci/*
17958c2ecf20Sopenharmony_ci * RX_PARSER_CFG:
17968c2ecf20Sopenharmony_ci * Set NAV for all received frames
17978c2ecf20Sopenharmony_ci */
17988c2ecf20Sopenharmony_ci#define RX_PARSER_CFG			0x1418
17998c2ecf20Sopenharmony_ci
18008c2ecf20Sopenharmony_ci/*
18018c2ecf20Sopenharmony_ci * TX_SEC_CNT0:
18028c2ecf20Sopenharmony_ci */
18038c2ecf20Sopenharmony_ci#define TX_SEC_CNT0			0x1500
18048c2ecf20Sopenharmony_ci
18058c2ecf20Sopenharmony_ci/*
18068c2ecf20Sopenharmony_ci * RX_SEC_CNT0:
18078c2ecf20Sopenharmony_ci */
18088c2ecf20Sopenharmony_ci#define RX_SEC_CNT0			0x1504
18098c2ecf20Sopenharmony_ci
18108c2ecf20Sopenharmony_ci/*
18118c2ecf20Sopenharmony_ci * CCMP_FC_MUTE:
18128c2ecf20Sopenharmony_ci */
18138c2ecf20Sopenharmony_ci#define CCMP_FC_MUTE			0x1508
18148c2ecf20Sopenharmony_ci
18158c2ecf20Sopenharmony_ci/*
18168c2ecf20Sopenharmony_ci * TXOP_HLDR_ADDR0:
18178c2ecf20Sopenharmony_ci */
18188c2ecf20Sopenharmony_ci#define TXOP_HLDR_ADDR0			0x1600
18198c2ecf20Sopenharmony_ci
18208c2ecf20Sopenharmony_ci/*
18218c2ecf20Sopenharmony_ci * TXOP_HLDR_ADDR1:
18228c2ecf20Sopenharmony_ci */
18238c2ecf20Sopenharmony_ci#define TXOP_HLDR_ADDR1			0x1604
18248c2ecf20Sopenharmony_ci
18258c2ecf20Sopenharmony_ci/*
18268c2ecf20Sopenharmony_ci * TXOP_HLDR_ET:
18278c2ecf20Sopenharmony_ci */
18288c2ecf20Sopenharmony_ci#define TXOP_HLDR_ET			0x1608
18298c2ecf20Sopenharmony_ci
18308c2ecf20Sopenharmony_ci/*
18318c2ecf20Sopenharmony_ci * QOS_CFPOLL_RA_DW0:
18328c2ecf20Sopenharmony_ci */
18338c2ecf20Sopenharmony_ci#define QOS_CFPOLL_RA_DW0		0x160c
18348c2ecf20Sopenharmony_ci
18358c2ecf20Sopenharmony_ci/*
18368c2ecf20Sopenharmony_ci * QOS_CFPOLL_RA_DW1:
18378c2ecf20Sopenharmony_ci */
18388c2ecf20Sopenharmony_ci#define QOS_CFPOLL_RA_DW1		0x1610
18398c2ecf20Sopenharmony_ci
18408c2ecf20Sopenharmony_ci/*
18418c2ecf20Sopenharmony_ci * QOS_CFPOLL_QC:
18428c2ecf20Sopenharmony_ci */
18438c2ecf20Sopenharmony_ci#define QOS_CFPOLL_QC			0x1614
18448c2ecf20Sopenharmony_ci
18458c2ecf20Sopenharmony_ci/*
18468c2ecf20Sopenharmony_ci * RX_STA_CNT0: RX PLCP error count & RX CRC error count
18478c2ecf20Sopenharmony_ci */
18488c2ecf20Sopenharmony_ci#define RX_STA_CNT0			0x1700
18498c2ecf20Sopenharmony_ci#define RX_STA_CNT0_CRC_ERR		FIELD32(0x0000ffff)
18508c2ecf20Sopenharmony_ci#define RX_STA_CNT0_PHY_ERR		FIELD32(0xffff0000)
18518c2ecf20Sopenharmony_ci
18528c2ecf20Sopenharmony_ci/*
18538c2ecf20Sopenharmony_ci * RX_STA_CNT1: RX False CCA count & RX LONG frame count
18548c2ecf20Sopenharmony_ci */
18558c2ecf20Sopenharmony_ci#define RX_STA_CNT1			0x1704
18568c2ecf20Sopenharmony_ci#define RX_STA_CNT1_FALSE_CCA		FIELD32(0x0000ffff)
18578c2ecf20Sopenharmony_ci#define RX_STA_CNT1_PLCP_ERR		FIELD32(0xffff0000)
18588c2ecf20Sopenharmony_ci
18598c2ecf20Sopenharmony_ci/*
18608c2ecf20Sopenharmony_ci * RX_STA_CNT2:
18618c2ecf20Sopenharmony_ci */
18628c2ecf20Sopenharmony_ci#define RX_STA_CNT2			0x1708
18638c2ecf20Sopenharmony_ci#define RX_STA_CNT2_RX_DUPLI_COUNT	FIELD32(0x0000ffff)
18648c2ecf20Sopenharmony_ci#define RX_STA_CNT2_RX_FIFO_OVERFLOW	FIELD32(0xffff0000)
18658c2ecf20Sopenharmony_ci
18668c2ecf20Sopenharmony_ci/*
18678c2ecf20Sopenharmony_ci * TX_STA_CNT0: TX Beacon count
18688c2ecf20Sopenharmony_ci */
18698c2ecf20Sopenharmony_ci#define TX_STA_CNT0			0x170c
18708c2ecf20Sopenharmony_ci#define TX_STA_CNT0_TX_FAIL_COUNT	FIELD32(0x0000ffff)
18718c2ecf20Sopenharmony_ci#define TX_STA_CNT0_TX_BEACON_COUNT	FIELD32(0xffff0000)
18728c2ecf20Sopenharmony_ci
18738c2ecf20Sopenharmony_ci/*
18748c2ecf20Sopenharmony_ci * TX_STA_CNT1: TX tx count
18758c2ecf20Sopenharmony_ci */
18768c2ecf20Sopenharmony_ci#define TX_STA_CNT1			0x1710
18778c2ecf20Sopenharmony_ci#define TX_STA_CNT1_TX_SUCCESS		FIELD32(0x0000ffff)
18788c2ecf20Sopenharmony_ci#define TX_STA_CNT1_TX_RETRANSMIT	FIELD32(0xffff0000)
18798c2ecf20Sopenharmony_ci
18808c2ecf20Sopenharmony_ci/*
18818c2ecf20Sopenharmony_ci * TX_STA_CNT2: TX tx count
18828c2ecf20Sopenharmony_ci */
18838c2ecf20Sopenharmony_ci#define TX_STA_CNT2			0x1714
18848c2ecf20Sopenharmony_ci#define TX_STA_CNT2_TX_ZERO_LEN_COUNT	FIELD32(0x0000ffff)
18858c2ecf20Sopenharmony_ci#define TX_STA_CNT2_TX_UNDER_FLOW_COUNT	FIELD32(0xffff0000)
18868c2ecf20Sopenharmony_ci
18878c2ecf20Sopenharmony_ci/*
18888c2ecf20Sopenharmony_ci * TX_STA_FIFO: TX Result for specific PID status fifo register.
18898c2ecf20Sopenharmony_ci *
18908c2ecf20Sopenharmony_ci * This register is implemented as FIFO with 16 entries in the HW. Each
18918c2ecf20Sopenharmony_ci * register read fetches the next tx result. If the FIFO is full because
18928c2ecf20Sopenharmony_ci * it wasn't read fast enough after the according interrupt (TX_FIFO_STATUS)
18938c2ecf20Sopenharmony_ci * triggered, the hw seems to simply drop further tx results.
18948c2ecf20Sopenharmony_ci *
18958c2ecf20Sopenharmony_ci * VALID: 1: this tx result is valid
18968c2ecf20Sopenharmony_ci *        0: no valid tx result -> driver should stop reading
18978c2ecf20Sopenharmony_ci * PID_TYPE: The PID latched from the PID field in the TXWI, can be used
18988c2ecf20Sopenharmony_ci *           to match a frame with its tx result (even though the PID is
18998c2ecf20Sopenharmony_ci *           only 4 bits wide).
19008c2ecf20Sopenharmony_ci * PID_QUEUE: Part of PID_TYPE, this is the queue index number (0-3)
19018c2ecf20Sopenharmony_ci * PID_ENTRY: Part of PID_TYPE, this is the queue entry index number (1-3)
19028c2ecf20Sopenharmony_ci *            This identification number is calculated by ((idx % 3) + 1).
19038c2ecf20Sopenharmony_ci * TX_SUCCESS: Indicates tx success (1) or failure (0)
19048c2ecf20Sopenharmony_ci * TX_AGGRE: Indicates if the frame was part of an aggregate (1) or not (0)
19058c2ecf20Sopenharmony_ci * TX_ACK_REQUIRED: Indicates if the frame needed to get ack'ed (1) or not (0)
19068c2ecf20Sopenharmony_ci * WCID: The wireless client ID.
19078c2ecf20Sopenharmony_ci * MCS: The tx rate used during the last transmission of this frame, be it
19088c2ecf20Sopenharmony_ci *      successful or not.
19098c2ecf20Sopenharmony_ci * PHYMODE: The phymode used for the transmission.
19108c2ecf20Sopenharmony_ci */
19118c2ecf20Sopenharmony_ci#define TX_STA_FIFO			0x1718
19128c2ecf20Sopenharmony_ci#define TX_STA_FIFO_VALID		FIELD32(0x00000001)
19138c2ecf20Sopenharmony_ci#define TX_STA_FIFO_PID_TYPE		FIELD32(0x0000001e)
19148c2ecf20Sopenharmony_ci#define TX_STA_FIFO_PID_QUEUE		FIELD32(0x00000006)
19158c2ecf20Sopenharmony_ci#define TX_STA_FIFO_PID_ENTRY		FIELD32(0x00000018)
19168c2ecf20Sopenharmony_ci#define TX_STA_FIFO_TX_SUCCESS		FIELD32(0x00000020)
19178c2ecf20Sopenharmony_ci#define TX_STA_FIFO_TX_AGGRE		FIELD32(0x00000040)
19188c2ecf20Sopenharmony_ci#define TX_STA_FIFO_TX_ACK_REQUIRED	FIELD32(0x00000080)
19198c2ecf20Sopenharmony_ci#define TX_STA_FIFO_WCID		FIELD32(0x0000ff00)
19208c2ecf20Sopenharmony_ci#define TX_STA_FIFO_SUCCESS_RATE	FIELD32(0xffff0000)
19218c2ecf20Sopenharmony_ci#define TX_STA_FIFO_MCS			FIELD32(0x007f0000)
19228c2ecf20Sopenharmony_ci#define TX_STA_FIFO_BW			FIELD32(0x00800000)
19238c2ecf20Sopenharmony_ci#define TX_STA_FIFO_SGI			FIELD32(0x01000000)
19248c2ecf20Sopenharmony_ci#define TX_STA_FIFO_PHYMODE		FIELD32(0xc0000000)
19258c2ecf20Sopenharmony_ci
19268c2ecf20Sopenharmony_ci/*
19278c2ecf20Sopenharmony_ci * TX_AGG_CNT: Debug counter
19288c2ecf20Sopenharmony_ci */
19298c2ecf20Sopenharmony_ci#define TX_AGG_CNT			0x171c
19308c2ecf20Sopenharmony_ci#define TX_AGG_CNT_NON_AGG_TX_COUNT	FIELD32(0x0000ffff)
19318c2ecf20Sopenharmony_ci#define TX_AGG_CNT_AGG_TX_COUNT		FIELD32(0xffff0000)
19328c2ecf20Sopenharmony_ci
19338c2ecf20Sopenharmony_ci/*
19348c2ecf20Sopenharmony_ci * TX_AGG_CNT0:
19358c2ecf20Sopenharmony_ci */
19368c2ecf20Sopenharmony_ci#define TX_AGG_CNT0			0x1720
19378c2ecf20Sopenharmony_ci#define TX_AGG_CNT0_AGG_SIZE_1_COUNT	FIELD32(0x0000ffff)
19388c2ecf20Sopenharmony_ci#define TX_AGG_CNT0_AGG_SIZE_2_COUNT	FIELD32(0xffff0000)
19398c2ecf20Sopenharmony_ci
19408c2ecf20Sopenharmony_ci/*
19418c2ecf20Sopenharmony_ci * TX_AGG_CNT1:
19428c2ecf20Sopenharmony_ci */
19438c2ecf20Sopenharmony_ci#define TX_AGG_CNT1			0x1724
19448c2ecf20Sopenharmony_ci#define TX_AGG_CNT1_AGG_SIZE_3_COUNT	FIELD32(0x0000ffff)
19458c2ecf20Sopenharmony_ci#define TX_AGG_CNT1_AGG_SIZE_4_COUNT	FIELD32(0xffff0000)
19468c2ecf20Sopenharmony_ci
19478c2ecf20Sopenharmony_ci/*
19488c2ecf20Sopenharmony_ci * TX_AGG_CNT2:
19498c2ecf20Sopenharmony_ci */
19508c2ecf20Sopenharmony_ci#define TX_AGG_CNT2			0x1728
19518c2ecf20Sopenharmony_ci#define TX_AGG_CNT2_AGG_SIZE_5_COUNT	FIELD32(0x0000ffff)
19528c2ecf20Sopenharmony_ci#define TX_AGG_CNT2_AGG_SIZE_6_COUNT	FIELD32(0xffff0000)
19538c2ecf20Sopenharmony_ci
19548c2ecf20Sopenharmony_ci/*
19558c2ecf20Sopenharmony_ci * TX_AGG_CNT3:
19568c2ecf20Sopenharmony_ci */
19578c2ecf20Sopenharmony_ci#define TX_AGG_CNT3			0x172c
19588c2ecf20Sopenharmony_ci#define TX_AGG_CNT3_AGG_SIZE_7_COUNT	FIELD32(0x0000ffff)
19598c2ecf20Sopenharmony_ci#define TX_AGG_CNT3_AGG_SIZE_8_COUNT	FIELD32(0xffff0000)
19608c2ecf20Sopenharmony_ci
19618c2ecf20Sopenharmony_ci/*
19628c2ecf20Sopenharmony_ci * TX_AGG_CNT4:
19638c2ecf20Sopenharmony_ci */
19648c2ecf20Sopenharmony_ci#define TX_AGG_CNT4			0x1730
19658c2ecf20Sopenharmony_ci#define TX_AGG_CNT4_AGG_SIZE_9_COUNT	FIELD32(0x0000ffff)
19668c2ecf20Sopenharmony_ci#define TX_AGG_CNT4_AGG_SIZE_10_COUNT	FIELD32(0xffff0000)
19678c2ecf20Sopenharmony_ci
19688c2ecf20Sopenharmony_ci/*
19698c2ecf20Sopenharmony_ci * TX_AGG_CNT5:
19708c2ecf20Sopenharmony_ci */
19718c2ecf20Sopenharmony_ci#define TX_AGG_CNT5			0x1734
19728c2ecf20Sopenharmony_ci#define TX_AGG_CNT5_AGG_SIZE_11_COUNT	FIELD32(0x0000ffff)
19738c2ecf20Sopenharmony_ci#define TX_AGG_CNT5_AGG_SIZE_12_COUNT	FIELD32(0xffff0000)
19748c2ecf20Sopenharmony_ci
19758c2ecf20Sopenharmony_ci/*
19768c2ecf20Sopenharmony_ci * TX_AGG_CNT6:
19778c2ecf20Sopenharmony_ci */
19788c2ecf20Sopenharmony_ci#define TX_AGG_CNT6			0x1738
19798c2ecf20Sopenharmony_ci#define TX_AGG_CNT6_AGG_SIZE_13_COUNT	FIELD32(0x0000ffff)
19808c2ecf20Sopenharmony_ci#define TX_AGG_CNT6_AGG_SIZE_14_COUNT	FIELD32(0xffff0000)
19818c2ecf20Sopenharmony_ci
19828c2ecf20Sopenharmony_ci/*
19838c2ecf20Sopenharmony_ci * TX_AGG_CNT7:
19848c2ecf20Sopenharmony_ci */
19858c2ecf20Sopenharmony_ci#define TX_AGG_CNT7			0x173c
19868c2ecf20Sopenharmony_ci#define TX_AGG_CNT7_AGG_SIZE_15_COUNT	FIELD32(0x0000ffff)
19878c2ecf20Sopenharmony_ci#define TX_AGG_CNT7_AGG_SIZE_16_COUNT	FIELD32(0xffff0000)
19888c2ecf20Sopenharmony_ci
19898c2ecf20Sopenharmony_ci/*
19908c2ecf20Sopenharmony_ci * MPDU_DENSITY_CNT:
19918c2ecf20Sopenharmony_ci * TX_ZERO_DEL: TX zero length delimiter count
19928c2ecf20Sopenharmony_ci * RX_ZERO_DEL: RX zero length delimiter count
19938c2ecf20Sopenharmony_ci */
19948c2ecf20Sopenharmony_ci#define MPDU_DENSITY_CNT		0x1740
19958c2ecf20Sopenharmony_ci#define MPDU_DENSITY_CNT_TX_ZERO_DEL	FIELD32(0x0000ffff)
19968c2ecf20Sopenharmony_ci#define MPDU_DENSITY_CNT_RX_ZERO_DEL	FIELD32(0xffff0000)
19978c2ecf20Sopenharmony_ci
19988c2ecf20Sopenharmony_ci/*
19998c2ecf20Sopenharmony_ci * Security key table memory.
20008c2ecf20Sopenharmony_ci *
20018c2ecf20Sopenharmony_ci * The pairwise key table shares some memory with the beacon frame
20028c2ecf20Sopenharmony_ci * buffers 6 and 7. That basically means that when beacon 6 & 7
20038c2ecf20Sopenharmony_ci * are used we should only use the reduced pairwise key table which
20048c2ecf20Sopenharmony_ci * has a maximum of 222 entries.
20058c2ecf20Sopenharmony_ci *
20068c2ecf20Sopenharmony_ci * ---------------------------------------------
20078c2ecf20Sopenharmony_ci * |0x4000 | Pairwise Key   | Reduced Pairwise |
20088c2ecf20Sopenharmony_ci * |       | Table          | Key Table        |
20098c2ecf20Sopenharmony_ci * |       | Size: 256 * 32 | Size: 222 * 32   |
20108c2ecf20Sopenharmony_ci * |0x5BC0 |                |-------------------
20118c2ecf20Sopenharmony_ci * |       |                | Beacon 6         |
20128c2ecf20Sopenharmony_ci * |0x5DC0 |                |-------------------
20138c2ecf20Sopenharmony_ci * |       |                | Beacon 7         |
20148c2ecf20Sopenharmony_ci * |0x5FC0 |                |-------------------
20158c2ecf20Sopenharmony_ci * |0x5FFF |                |
20168c2ecf20Sopenharmony_ci * --------------------------
20178c2ecf20Sopenharmony_ci *
20188c2ecf20Sopenharmony_ci * MAC_WCID_BASE: 8-bytes (use only 6 bytes) * 256 entry
20198c2ecf20Sopenharmony_ci * PAIRWISE_KEY_TABLE_BASE: 32-byte * 256 entry
20208c2ecf20Sopenharmony_ci * MAC_IVEIV_TABLE_BASE: 8-byte * 256-entry
20218c2ecf20Sopenharmony_ci * MAC_WCID_ATTRIBUTE_BASE: 4-byte * 256-entry
20228c2ecf20Sopenharmony_ci * SHARED_KEY_TABLE_BASE: 32-byte * 16-entry
20238c2ecf20Sopenharmony_ci * SHARED_KEY_MODE_BASE: 4-byte * 16-entry
20248c2ecf20Sopenharmony_ci */
20258c2ecf20Sopenharmony_ci#define MAC_WCID_BASE			0x1800
20268c2ecf20Sopenharmony_ci#define PAIRWISE_KEY_TABLE_BASE		0x4000
20278c2ecf20Sopenharmony_ci#define MAC_IVEIV_TABLE_BASE		0x6000
20288c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_BASE		0x6800
20298c2ecf20Sopenharmony_ci#define SHARED_KEY_TABLE_BASE		0x6c00
20308c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BASE		0x7000
20318c2ecf20Sopenharmony_ci
20328c2ecf20Sopenharmony_ci#define MAC_WCID_ENTRY(__idx) \
20338c2ecf20Sopenharmony_ci	(MAC_WCID_BASE + ((__idx) * sizeof(struct mac_wcid_entry)))
20348c2ecf20Sopenharmony_ci#define PAIRWISE_KEY_ENTRY(__idx) \
20358c2ecf20Sopenharmony_ci	(PAIRWISE_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)))
20368c2ecf20Sopenharmony_ci#define MAC_IVEIV_ENTRY(__idx) \
20378c2ecf20Sopenharmony_ci	(MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry)))
20388c2ecf20Sopenharmony_ci#define MAC_WCID_ATTR_ENTRY(__idx) \
20398c2ecf20Sopenharmony_ci	(MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32)))
20408c2ecf20Sopenharmony_ci#define SHARED_KEY_ENTRY(__idx) \
20418c2ecf20Sopenharmony_ci	(SHARED_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)))
20428c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_ENTRY(__idx) \
20438c2ecf20Sopenharmony_ci	(SHARED_KEY_MODE_BASE + ((__idx) * sizeof(u32)))
20448c2ecf20Sopenharmony_ci
20458c2ecf20Sopenharmony_cistruct mac_wcid_entry {
20468c2ecf20Sopenharmony_ci	u8 mac[6];
20478c2ecf20Sopenharmony_ci	u8 reserved[2];
20488c2ecf20Sopenharmony_ci} __packed;
20498c2ecf20Sopenharmony_ci
20508c2ecf20Sopenharmony_cistruct hw_key_entry {
20518c2ecf20Sopenharmony_ci	u8 key[16];
20528c2ecf20Sopenharmony_ci	u8 tx_mic[8];
20538c2ecf20Sopenharmony_ci	u8 rx_mic[8];
20548c2ecf20Sopenharmony_ci} __packed;
20558c2ecf20Sopenharmony_ci
20568c2ecf20Sopenharmony_cistruct mac_iveiv_entry {
20578c2ecf20Sopenharmony_ci	u8 iv[8];
20588c2ecf20Sopenharmony_ci} __packed;
20598c2ecf20Sopenharmony_ci
20608c2ecf20Sopenharmony_ci/*
20618c2ecf20Sopenharmony_ci * MAC_WCID_ATTRIBUTE:
20628c2ecf20Sopenharmony_ci */
20638c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_KEYTAB	FIELD32(0x00000001)
20648c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_CIPHER	FIELD32(0x0000000e)
20658c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_BSS_IDX	FIELD32(0x00000070)
20668c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_RX_WIUDF	FIELD32(0x00000380)
20678c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_CIPHER_EXT	FIELD32(0x00000400)
20688c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_BSS_IDX_EXT	FIELD32(0x00000800)
20698c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_WAPI_MCBC	FIELD32(0x00008000)
20708c2ecf20Sopenharmony_ci#define MAC_WCID_ATTRIBUTE_WAPI_KEY_IDX	FIELD32(0xff000000)
20718c2ecf20Sopenharmony_ci
20728c2ecf20Sopenharmony_ci/*
20738c2ecf20Sopenharmony_ci * SHARED_KEY_MODE:
20748c2ecf20Sopenharmony_ci */
20758c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BSS0_KEY0	FIELD32(0x00000007)
20768c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BSS0_KEY1	FIELD32(0x00000070)
20778c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BSS0_KEY2	FIELD32(0x00000700)
20788c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BSS0_KEY3	FIELD32(0x00007000)
20798c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BSS1_KEY0	FIELD32(0x00070000)
20808c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BSS1_KEY1	FIELD32(0x00700000)
20818c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BSS1_KEY2	FIELD32(0x07000000)
20828c2ecf20Sopenharmony_ci#define SHARED_KEY_MODE_BSS1_KEY3	FIELD32(0x70000000)
20838c2ecf20Sopenharmony_ci
20848c2ecf20Sopenharmony_ci/*
20858c2ecf20Sopenharmony_ci * HOST-MCU communication
20868c2ecf20Sopenharmony_ci */
20878c2ecf20Sopenharmony_ci
20888c2ecf20Sopenharmony_ci/*
20898c2ecf20Sopenharmony_ci * H2M_MAILBOX_CSR: Host-to-MCU Mailbox.
20908c2ecf20Sopenharmony_ci * CMD_TOKEN: Command id, 0xff disable status reporting.
20918c2ecf20Sopenharmony_ci */
20928c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR			0x7010
20938c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR_ARG0		FIELD32(0x000000ff)
20948c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR_ARG1		FIELD32(0x0000ff00)
20958c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR_CMD_TOKEN	FIELD32(0x00ff0000)
20968c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR_OWNER		FIELD32(0xff000000)
20978c2ecf20Sopenharmony_ci
20988c2ecf20Sopenharmony_ci/*
20998c2ecf20Sopenharmony_ci * H2M_MAILBOX_CID:
21008c2ecf20Sopenharmony_ci * Free slots contain 0xff. MCU will store command's token to lowest free slot.
21018c2ecf20Sopenharmony_ci * If all slots are occupied status will be dropped.
21028c2ecf20Sopenharmony_ci */
21038c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CID			0x7014
21048c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CID_CMD0		FIELD32(0x000000ff)
21058c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CID_CMD1		FIELD32(0x0000ff00)
21068c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CID_CMD2		FIELD32(0x00ff0000)
21078c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CID_CMD3		FIELD32(0xff000000)
21088c2ecf20Sopenharmony_ci
21098c2ecf20Sopenharmony_ci/*
21108c2ecf20Sopenharmony_ci * H2M_MAILBOX_STATUS:
21118c2ecf20Sopenharmony_ci * Command status will be saved to same slot as command id.
21128c2ecf20Sopenharmony_ci */
21138c2ecf20Sopenharmony_ci#define H2M_MAILBOX_STATUS		0x701c
21148c2ecf20Sopenharmony_ci
21158c2ecf20Sopenharmony_ci/*
21168c2ecf20Sopenharmony_ci * H2M_INT_SRC:
21178c2ecf20Sopenharmony_ci */
21188c2ecf20Sopenharmony_ci#define H2M_INT_SRC			0x7024
21198c2ecf20Sopenharmony_ci
21208c2ecf20Sopenharmony_ci/*
21218c2ecf20Sopenharmony_ci * H2M_BBP_AGENT:
21228c2ecf20Sopenharmony_ci */
21238c2ecf20Sopenharmony_ci#define H2M_BBP_AGENT			0x7028
21248c2ecf20Sopenharmony_ci
21258c2ecf20Sopenharmony_ci/*
21268c2ecf20Sopenharmony_ci * MCU_LEDCS: LED control for MCU Mailbox.
21278c2ecf20Sopenharmony_ci */
21288c2ecf20Sopenharmony_ci#define MCU_LEDCS_LED_MODE		FIELD8(0x1f)
21298c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY		FIELD8(0x01)
21308c2ecf20Sopenharmony_ci
21318c2ecf20Sopenharmony_ci/*
21328c2ecf20Sopenharmony_ci * HW_CS_CTS_BASE:
21338c2ecf20Sopenharmony_ci * Carrier-sense CTS frame base address.
21348c2ecf20Sopenharmony_ci * It's where mac stores carrier-sense frame for carrier-sense function.
21358c2ecf20Sopenharmony_ci */
21368c2ecf20Sopenharmony_ci#define HW_CS_CTS_BASE			0x7700
21378c2ecf20Sopenharmony_ci
21388c2ecf20Sopenharmony_ci/*
21398c2ecf20Sopenharmony_ci * HW_DFS_CTS_BASE:
21408c2ecf20Sopenharmony_ci * DFS CTS frame base address. It's where mac stores CTS frame for DFS.
21418c2ecf20Sopenharmony_ci */
21428c2ecf20Sopenharmony_ci#define HW_DFS_CTS_BASE			0x7780
21438c2ecf20Sopenharmony_ci
21448c2ecf20Sopenharmony_ci/*
21458c2ecf20Sopenharmony_ci * TXRX control registers - base address 0x3000
21468c2ecf20Sopenharmony_ci */
21478c2ecf20Sopenharmony_ci
21488c2ecf20Sopenharmony_ci/*
21498c2ecf20Sopenharmony_ci * TXRX_CSR1:
21508c2ecf20Sopenharmony_ci * rt2860b  UNKNOWN reg use R/O Reg Addr 0x77d0 first..
21518c2ecf20Sopenharmony_ci */
21528c2ecf20Sopenharmony_ci#define TXRX_CSR1			0x77d0
21538c2ecf20Sopenharmony_ci
21548c2ecf20Sopenharmony_ci/*
21558c2ecf20Sopenharmony_ci * HW_DEBUG_SETTING_BASE:
21568c2ecf20Sopenharmony_ci * since NULL frame won't be that long (256 byte)
21578c2ecf20Sopenharmony_ci * We steal 16 tail bytes to save debugging settings
21588c2ecf20Sopenharmony_ci */
21598c2ecf20Sopenharmony_ci#define HW_DEBUG_SETTING_BASE		0x77f0
21608c2ecf20Sopenharmony_ci#define HW_DEBUG_SETTING_BASE2		0x7770
21618c2ecf20Sopenharmony_ci
21628c2ecf20Sopenharmony_ci/*
21638c2ecf20Sopenharmony_ci * HW_BEACON_BASE
21648c2ecf20Sopenharmony_ci * In order to support maximum 8 MBSS and its maximum length
21658c2ecf20Sopenharmony_ci * is 512 bytes for each beacon
21668c2ecf20Sopenharmony_ci * Three section discontinue memory segments will be used.
21678c2ecf20Sopenharmony_ci * 1. The original region for BCN 0~3
21688c2ecf20Sopenharmony_ci * 2. Extract memory from FCE table for BCN 4~5
21698c2ecf20Sopenharmony_ci * 3. Extract memory from Pair-wise key table for BCN 6~7
21708c2ecf20Sopenharmony_ci *    It occupied those memory of wcid 238~253 for BCN 6
21718c2ecf20Sopenharmony_ci *    and wcid 222~237 for BCN 7 (see Security key table memory
21728c2ecf20Sopenharmony_ci *    for more info).
21738c2ecf20Sopenharmony_ci *
21748c2ecf20Sopenharmony_ci * IMPORTANT NOTE: Not sure why legacy driver does this,
21758c2ecf20Sopenharmony_ci * but HW_BEACON_BASE7 is 0x0200 bytes below HW_BEACON_BASE6.
21768c2ecf20Sopenharmony_ci */
21778c2ecf20Sopenharmony_ci#define HW_BEACON_BASE0			0x7800
21788c2ecf20Sopenharmony_ci#define HW_BEACON_BASE1			0x7a00
21798c2ecf20Sopenharmony_ci#define HW_BEACON_BASE2			0x7c00
21808c2ecf20Sopenharmony_ci#define HW_BEACON_BASE3			0x7e00
21818c2ecf20Sopenharmony_ci#define HW_BEACON_BASE4			0x7200
21828c2ecf20Sopenharmony_ci#define HW_BEACON_BASE5			0x7400
21838c2ecf20Sopenharmony_ci#define HW_BEACON_BASE6			0x5dc0
21848c2ecf20Sopenharmony_ci#define HW_BEACON_BASE7			0x5bc0
21858c2ecf20Sopenharmony_ci
21868c2ecf20Sopenharmony_ci#define HW_BEACON_BASE(__index) \
21878c2ecf20Sopenharmony_ci	(((__index) < 4) ? (HW_BEACON_BASE0 + (__index * 0x0200)) : \
21888c2ecf20Sopenharmony_ci	  (((__index) < 6) ? (HW_BEACON_BASE4 + ((__index - 4) * 0x0200)) : \
21898c2ecf20Sopenharmony_ci	  (HW_BEACON_BASE6 - ((__index - 6) * 0x0200))))
21908c2ecf20Sopenharmony_ci
21918c2ecf20Sopenharmony_ci#define BEACON_BASE_TO_OFFSET(_base)	(((_base) - 0x4000) / 64)
21928c2ecf20Sopenharmony_ci
21938c2ecf20Sopenharmony_ci/*
21948c2ecf20Sopenharmony_ci * BBP registers.
21958c2ecf20Sopenharmony_ci * The wordsize of the BBP is 8 bits.
21968c2ecf20Sopenharmony_ci */
21978c2ecf20Sopenharmony_ci
21988c2ecf20Sopenharmony_ci/*
21998c2ecf20Sopenharmony_ci * BBP 1: TX Antenna & Power Control
22008c2ecf20Sopenharmony_ci * POWER_CTRL:
22018c2ecf20Sopenharmony_ci * 0 - normal,
22028c2ecf20Sopenharmony_ci * 1 - drop tx power by 6dBm,
22038c2ecf20Sopenharmony_ci * 2 - drop tx power by 12dBm,
22048c2ecf20Sopenharmony_ci * 3 - increase tx power by 6dBm
22058c2ecf20Sopenharmony_ci */
22068c2ecf20Sopenharmony_ci#define BBP1_TX_POWER_CTRL		FIELD8(0x03)
22078c2ecf20Sopenharmony_ci#define BBP1_TX_ANTENNA			FIELD8(0x18)
22088c2ecf20Sopenharmony_ci
22098c2ecf20Sopenharmony_ci/*
22108c2ecf20Sopenharmony_ci * BBP 3: RX Antenna
22118c2ecf20Sopenharmony_ci */
22128c2ecf20Sopenharmony_ci#define BBP3_RX_ADC			FIELD8(0x03)
22138c2ecf20Sopenharmony_ci#define BBP3_RX_ANTENNA			FIELD8(0x18)
22148c2ecf20Sopenharmony_ci#define BBP3_HT40_MINUS			FIELD8(0x20)
22158c2ecf20Sopenharmony_ci#define BBP3_ADC_MODE_SWITCH		FIELD8(0x40)
22168c2ecf20Sopenharmony_ci#define BBP3_ADC_INIT_MODE		FIELD8(0x80)
22178c2ecf20Sopenharmony_ci
22188c2ecf20Sopenharmony_ci/*
22198c2ecf20Sopenharmony_ci * BBP 4: Bandwidth
22208c2ecf20Sopenharmony_ci */
22218c2ecf20Sopenharmony_ci#define BBP4_TX_BF			FIELD8(0x01)
22228c2ecf20Sopenharmony_ci#define BBP4_BANDWIDTH			FIELD8(0x18)
22238c2ecf20Sopenharmony_ci#define BBP4_MAC_IF_CTRL		FIELD8(0x40)
22248c2ecf20Sopenharmony_ci
22258c2ecf20Sopenharmony_ci/* BBP27 */
22268c2ecf20Sopenharmony_ci#define BBP27_RX_CHAIN_SEL		FIELD8(0x60)
22278c2ecf20Sopenharmony_ci
22288c2ecf20Sopenharmony_ci/*
22298c2ecf20Sopenharmony_ci * BBP 47: Bandwidth
22308c2ecf20Sopenharmony_ci */
22318c2ecf20Sopenharmony_ci#define BBP47_TSSI_REPORT_SEL		FIELD8(0x03)
22328c2ecf20Sopenharmony_ci#define BBP47_TSSI_UPDATE_REQ		FIELD8(0x04)
22338c2ecf20Sopenharmony_ci#define BBP47_TSSI_TSSI_MODE		FIELD8(0x18)
22348c2ecf20Sopenharmony_ci#define BBP47_TSSI_ADC6			FIELD8(0x80)
22358c2ecf20Sopenharmony_ci
22368c2ecf20Sopenharmony_ci/*
22378c2ecf20Sopenharmony_ci * BBP 49
22388c2ecf20Sopenharmony_ci */
22398c2ecf20Sopenharmony_ci#define BBP49_UPDATE_FLAG		FIELD8(0x01)
22408c2ecf20Sopenharmony_ci
22418c2ecf20Sopenharmony_ci/*
22428c2ecf20Sopenharmony_ci * BBP 105:
22438c2ecf20Sopenharmony_ci * - bit0: detect SIG on primary channel only (on 40MHz bandwidth)
22448c2ecf20Sopenharmony_ci * - bit1: FEQ (Feed Forward Compensation) for independend streams
22458c2ecf20Sopenharmony_ci * - bit2: MLD (Maximum Likehood Detection) for 2 streams (reserved on single
22468c2ecf20Sopenharmony_ci *	   stream)
22478c2ecf20Sopenharmony_ci * - bit4: channel estimation updates based on remodulation of
22488c2ecf20Sopenharmony_ci *	   L-SIG and HT-SIG symbols
22498c2ecf20Sopenharmony_ci */
22508c2ecf20Sopenharmony_ci#define BBP105_DETECT_SIG_ON_PRIMARY	FIELD8(0x01)
22518c2ecf20Sopenharmony_ci#define BBP105_FEQ			FIELD8(0x02)
22528c2ecf20Sopenharmony_ci#define BBP105_MLD			FIELD8(0x04)
22538c2ecf20Sopenharmony_ci#define BBP105_SIG_REMODULATION		FIELD8(0x08)
22548c2ecf20Sopenharmony_ci
22558c2ecf20Sopenharmony_ci/*
22568c2ecf20Sopenharmony_ci * BBP 109
22578c2ecf20Sopenharmony_ci */
22588c2ecf20Sopenharmony_ci#define BBP109_TX0_POWER		FIELD8(0x0f)
22598c2ecf20Sopenharmony_ci#define BBP109_TX1_POWER		FIELD8(0xf0)
22608c2ecf20Sopenharmony_ci
22618c2ecf20Sopenharmony_ci/* BBP 110 */
22628c2ecf20Sopenharmony_ci#define BBP110_TX2_POWER		FIELD8(0x0f)
22638c2ecf20Sopenharmony_ci
22648c2ecf20Sopenharmony_ci
22658c2ecf20Sopenharmony_ci/*
22668c2ecf20Sopenharmony_ci * BBP 138: Unknown
22678c2ecf20Sopenharmony_ci */
22688c2ecf20Sopenharmony_ci#define BBP138_RX_ADC1			FIELD8(0x02)
22698c2ecf20Sopenharmony_ci#define BBP138_RX_ADC2			FIELD8(0x04)
22708c2ecf20Sopenharmony_ci#define BBP138_TX_DAC1			FIELD8(0x20)
22718c2ecf20Sopenharmony_ci#define BBP138_TX_DAC2			FIELD8(0x40)
22728c2ecf20Sopenharmony_ci
22738c2ecf20Sopenharmony_ci/*
22748c2ecf20Sopenharmony_ci * BBP 152: Rx Ant
22758c2ecf20Sopenharmony_ci */
22768c2ecf20Sopenharmony_ci#define BBP152_RX_DEFAULT_ANT		FIELD8(0x80)
22778c2ecf20Sopenharmony_ci
22788c2ecf20Sopenharmony_ci/*
22798c2ecf20Sopenharmony_ci * BBP 254: unknown
22808c2ecf20Sopenharmony_ci */
22818c2ecf20Sopenharmony_ci#define BBP254_BIT7			FIELD8(0x80)
22828c2ecf20Sopenharmony_ci
22838c2ecf20Sopenharmony_ci/*
22848c2ecf20Sopenharmony_ci * RFCSR registers
22858c2ecf20Sopenharmony_ci * The wordsize of the RFCSR is 8 bits.
22868c2ecf20Sopenharmony_ci */
22878c2ecf20Sopenharmony_ci
22888c2ecf20Sopenharmony_ci/*
22898c2ecf20Sopenharmony_ci * RFCSR 1:
22908c2ecf20Sopenharmony_ci */
22918c2ecf20Sopenharmony_ci#define RFCSR1_RF_BLOCK_EN		FIELD8(0x01)
22928c2ecf20Sopenharmony_ci#define RFCSR1_PLL_PD			FIELD8(0x02)
22938c2ecf20Sopenharmony_ci#define RFCSR1_RX0_PD			FIELD8(0x04)
22948c2ecf20Sopenharmony_ci#define RFCSR1_TX0_PD			FIELD8(0x08)
22958c2ecf20Sopenharmony_ci#define RFCSR1_RX1_PD			FIELD8(0x10)
22968c2ecf20Sopenharmony_ci#define RFCSR1_TX1_PD			FIELD8(0x20)
22978c2ecf20Sopenharmony_ci#define RFCSR1_RX2_PD			FIELD8(0x40)
22988c2ecf20Sopenharmony_ci#define RFCSR1_TX2_PD			FIELD8(0x80)
22998c2ecf20Sopenharmony_ci#define RFCSR1_TX2_EN_MT7620		FIELD8(0x02)
23008c2ecf20Sopenharmony_ci
23018c2ecf20Sopenharmony_ci/*
23028c2ecf20Sopenharmony_ci * RFCSR 2:
23038c2ecf20Sopenharmony_ci */
23048c2ecf20Sopenharmony_ci#define RFCSR2_RESCAL_BP		FIELD8(0x40)
23058c2ecf20Sopenharmony_ci#define RFCSR2_RESCAL_EN		FIELD8(0x80)
23068c2ecf20Sopenharmony_ci#define RFCSR2_RX2_EN_MT7620		FIELD8(0x02)
23078c2ecf20Sopenharmony_ci#define RFCSR2_TX2_EN_MT7620		FIELD8(0x20)
23088c2ecf20Sopenharmony_ci
23098c2ecf20Sopenharmony_ci/*
23108c2ecf20Sopenharmony_ci * RFCSR 3:
23118c2ecf20Sopenharmony_ci */
23128c2ecf20Sopenharmony_ci#define RFCSR3_K			FIELD8(0x0f)
23138c2ecf20Sopenharmony_ci/* Bits [7-4] for RF3320 (RT3370/RT3390), on other chipsets reserved */
23148c2ecf20Sopenharmony_ci#define RFCSR3_PA1_BIAS_CCK		FIELD8(0x70)
23158c2ecf20Sopenharmony_ci#define RFCSR3_PA2_CASCODE_BIAS_CCKK	FIELD8(0x80)
23168c2ecf20Sopenharmony_ci/* Bits for RF3290/RF5360/RF5362/RF5370/RF5372/RF5390/RF5392 */
23178c2ecf20Sopenharmony_ci#define RFCSR3_VCOCAL_EN		FIELD8(0x80)
23188c2ecf20Sopenharmony_ci/* Bits for RF3050 */
23198c2ecf20Sopenharmony_ci#define RFCSR3_BIT1			FIELD8(0x02)
23208c2ecf20Sopenharmony_ci#define RFCSR3_BIT2			FIELD8(0x04)
23218c2ecf20Sopenharmony_ci#define RFCSR3_BIT3			FIELD8(0x08)
23228c2ecf20Sopenharmony_ci#define RFCSR3_BIT4			FIELD8(0x10)
23238c2ecf20Sopenharmony_ci#define RFCSR3_BIT5			FIELD8(0x20)
23248c2ecf20Sopenharmony_ci
23258c2ecf20Sopenharmony_ci/*
23268c2ecf20Sopenharmony_ci * RFCSR 4:
23278c2ecf20Sopenharmony_ci * VCOCAL_EN used by MT7620
23288c2ecf20Sopenharmony_ci */
23298c2ecf20Sopenharmony_ci#define RFCSR4_VCOCAL_EN		FIELD8(0x80)
23308c2ecf20Sopenharmony_ci
23318c2ecf20Sopenharmony_ci/*
23328c2ecf20Sopenharmony_ci * FRCSR 5:
23338c2ecf20Sopenharmony_ci */
23348c2ecf20Sopenharmony_ci#define RFCSR5_R1			FIELD8(0x0c)
23358c2ecf20Sopenharmony_ci
23368c2ecf20Sopenharmony_ci/*
23378c2ecf20Sopenharmony_ci * RFCSR 6:
23388c2ecf20Sopenharmony_ci */
23398c2ecf20Sopenharmony_ci#define RFCSR6_R1			FIELD8(0x03)
23408c2ecf20Sopenharmony_ci#define RFCSR6_R2			FIELD8(0x40)
23418c2ecf20Sopenharmony_ci#define RFCSR6_TXDIV			FIELD8(0x0c)
23428c2ecf20Sopenharmony_ci/* bits for RF3053 */
23438c2ecf20Sopenharmony_ci#define RFCSR6_VCO_IC			FIELD8(0xc0)
23448c2ecf20Sopenharmony_ci
23458c2ecf20Sopenharmony_ci/*
23468c2ecf20Sopenharmony_ci * RFCSR 7:
23478c2ecf20Sopenharmony_ci */
23488c2ecf20Sopenharmony_ci#define RFCSR7_RF_TUNING		FIELD8(0x01)
23498c2ecf20Sopenharmony_ci#define RFCSR7_BIT1			FIELD8(0x02)
23508c2ecf20Sopenharmony_ci#define RFCSR7_BIT2			FIELD8(0x04)
23518c2ecf20Sopenharmony_ci#define RFCSR7_BIT3			FIELD8(0x08)
23528c2ecf20Sopenharmony_ci#define RFCSR7_BIT4			FIELD8(0x10)
23538c2ecf20Sopenharmony_ci#define RFCSR7_BIT5			FIELD8(0x20)
23548c2ecf20Sopenharmony_ci#define RFCSR7_BITS67			FIELD8(0xc0)
23558c2ecf20Sopenharmony_ci
23568c2ecf20Sopenharmony_ci/*
23578c2ecf20Sopenharmony_ci * RFCSR 9:
23588c2ecf20Sopenharmony_ci */
23598c2ecf20Sopenharmony_ci#define RFCSR9_K			FIELD8(0x0f)
23608c2ecf20Sopenharmony_ci#define RFCSR9_N			FIELD8(0x10)
23618c2ecf20Sopenharmony_ci#define RFCSR9_UNKNOWN			FIELD8(0x60)
23628c2ecf20Sopenharmony_ci#define RFCSR9_MOD			FIELD8(0x80)
23638c2ecf20Sopenharmony_ci
23648c2ecf20Sopenharmony_ci/*
23658c2ecf20Sopenharmony_ci * RFCSR 11:
23668c2ecf20Sopenharmony_ci */
23678c2ecf20Sopenharmony_ci#define RFCSR11_R			FIELD8(0x03)
23688c2ecf20Sopenharmony_ci#define RFCSR11_PLL_MOD			FIELD8(0x0c)
23698c2ecf20Sopenharmony_ci#define RFCSR11_MOD			FIELD8(0xc0)
23708c2ecf20Sopenharmony_ci/* bits for RF3053 */
23718c2ecf20Sopenharmony_ci/* TODO: verify RFCSR11_MOD usage on other chips */
23728c2ecf20Sopenharmony_ci#define RFCSR11_PLL_IDOH		FIELD8(0x40)
23738c2ecf20Sopenharmony_ci
23748c2ecf20Sopenharmony_ci
23758c2ecf20Sopenharmony_ci/*
23768c2ecf20Sopenharmony_ci * RFCSR 12:
23778c2ecf20Sopenharmony_ci */
23788c2ecf20Sopenharmony_ci#define RFCSR12_TX_POWER		FIELD8(0x1f)
23798c2ecf20Sopenharmony_ci#define RFCSR12_DR0			FIELD8(0xe0)
23808c2ecf20Sopenharmony_ci
23818c2ecf20Sopenharmony_ci/*
23828c2ecf20Sopenharmony_ci * RFCSR 13:
23838c2ecf20Sopenharmony_ci */
23848c2ecf20Sopenharmony_ci#define RFCSR13_TX_POWER		FIELD8(0x1f)
23858c2ecf20Sopenharmony_ci#define RFCSR13_DR0			FIELD8(0xe0)
23868c2ecf20Sopenharmony_ci#define RFCSR13_RDIV_MT7620		FIELD8(0x03)
23878c2ecf20Sopenharmony_ci
23888c2ecf20Sopenharmony_ci/*
23898c2ecf20Sopenharmony_ci * RFCSR 15:
23908c2ecf20Sopenharmony_ci */
23918c2ecf20Sopenharmony_ci#define RFCSR15_TX_LO2_EN		FIELD8(0x08)
23928c2ecf20Sopenharmony_ci
23938c2ecf20Sopenharmony_ci/*
23948c2ecf20Sopenharmony_ci * RFCSR 16:
23958c2ecf20Sopenharmony_ci */
23968c2ecf20Sopenharmony_ci#define RFCSR16_TXMIXER_GAIN		FIELD8(0x07)
23978c2ecf20Sopenharmony_ci#define RFCSR16_RF_PLL_FREQ_SEL_MT7620	FIELD8(0x0F)
23988c2ecf20Sopenharmony_ci#define RFCSR16_SDM_MODE_MT7620		FIELD8(0xE0)
23998c2ecf20Sopenharmony_ci
24008c2ecf20Sopenharmony_ci/*
24018c2ecf20Sopenharmony_ci * RFCSR 17:
24028c2ecf20Sopenharmony_ci */
24038c2ecf20Sopenharmony_ci#define RFCSR17_TXMIXER_GAIN		FIELD8(0x07)
24048c2ecf20Sopenharmony_ci#define RFCSR17_TX_LO1_EN		FIELD8(0x08)
24058c2ecf20Sopenharmony_ci#define RFCSR17_R			FIELD8(0x20)
24068c2ecf20Sopenharmony_ci#define RFCSR17_CODE			FIELD8(0x7f)
24078c2ecf20Sopenharmony_ci
24088c2ecf20Sopenharmony_ci/* RFCSR 18 */
24098c2ecf20Sopenharmony_ci#define RFCSR18_XO_TUNE_BYPASS		FIELD8(0x40)
24108c2ecf20Sopenharmony_ci
24118c2ecf20Sopenharmony_ci/* RFCSR 19 */
24128c2ecf20Sopenharmony_ci#define RFCSR19_K			FIELD8(0x03)
24138c2ecf20Sopenharmony_ci
24148c2ecf20Sopenharmony_ci/*
24158c2ecf20Sopenharmony_ci * RFCSR 20:
24168c2ecf20Sopenharmony_ci */
24178c2ecf20Sopenharmony_ci#define RFCSR20_RX_LO1_EN		FIELD8(0x08)
24188c2ecf20Sopenharmony_ci
24198c2ecf20Sopenharmony_ci/*
24208c2ecf20Sopenharmony_ci * RFCSR 21:
24218c2ecf20Sopenharmony_ci */
24228c2ecf20Sopenharmony_ci#define RFCSR21_RX_LO2_EN		FIELD8(0x08)
24238c2ecf20Sopenharmony_ci#define RFCSR21_BIT1			FIELD8(0x01)
24248c2ecf20Sopenharmony_ci#define RFCSR21_BIT8			FIELD8(0x80)
24258c2ecf20Sopenharmony_ci
24268c2ecf20Sopenharmony_ci/*
24278c2ecf20Sopenharmony_ci * RFCSR 22:
24288c2ecf20Sopenharmony_ci */
24298c2ecf20Sopenharmony_ci#define RFCSR22_BASEBAND_LOOPBACK	FIELD8(0x01)
24308c2ecf20Sopenharmony_ci#define RFCSR22_FREQPLAN_D_MT7620	FIELD8(0x07)
24318c2ecf20Sopenharmony_ci
24328c2ecf20Sopenharmony_ci/*
24338c2ecf20Sopenharmony_ci * RFCSR 23:
24348c2ecf20Sopenharmony_ci */
24358c2ecf20Sopenharmony_ci#define RFCSR23_FREQ_OFFSET		FIELD8(0x7f)
24368c2ecf20Sopenharmony_ci
24378c2ecf20Sopenharmony_ci/*
24388c2ecf20Sopenharmony_ci * RFCSR 24:
24398c2ecf20Sopenharmony_ci */
24408c2ecf20Sopenharmony_ci#define RFCSR24_TX_AGC_FC		FIELD8(0x1f)
24418c2ecf20Sopenharmony_ci#define RFCSR24_TX_H20M			FIELD8(0x20)
24428c2ecf20Sopenharmony_ci#define RFCSR24_TX_CALIB		FIELD8(0x7f)
24438c2ecf20Sopenharmony_ci
24448c2ecf20Sopenharmony_ci/*
24458c2ecf20Sopenharmony_ci * RFCSR 27:
24468c2ecf20Sopenharmony_ci */
24478c2ecf20Sopenharmony_ci#define RFCSR27_R1			FIELD8(0x03)
24488c2ecf20Sopenharmony_ci#define RFCSR27_R2			FIELD8(0x04)
24498c2ecf20Sopenharmony_ci#define RFCSR27_R3			FIELD8(0x30)
24508c2ecf20Sopenharmony_ci#define RFCSR27_R4			FIELD8(0x40)
24518c2ecf20Sopenharmony_ci
24528c2ecf20Sopenharmony_ci/*
24538c2ecf20Sopenharmony_ci * RFCSR 28:
24548c2ecf20Sopenharmony_ci */
24558c2ecf20Sopenharmony_ci#define RFCSR28_CH11_HT40		FIELD8(0x04)
24568c2ecf20Sopenharmony_ci
24578c2ecf20Sopenharmony_ci/*
24588c2ecf20Sopenharmony_ci * RFCSR 29:
24598c2ecf20Sopenharmony_ci */
24608c2ecf20Sopenharmony_ci#define RFCSR29_ADC6_TEST		FIELD8(0x01)
24618c2ecf20Sopenharmony_ci#define RFCSR29_ADC6_INT_TEST		FIELD8(0x02)
24628c2ecf20Sopenharmony_ci#define RFCSR29_RSSI_RESET		FIELD8(0x04)
24638c2ecf20Sopenharmony_ci#define RFCSR29_RSSI_ON			FIELD8(0x08)
24648c2ecf20Sopenharmony_ci#define RFCSR29_RSSI_RIP_CTRL		FIELD8(0x30)
24658c2ecf20Sopenharmony_ci#define RFCSR29_RSSI_GAIN		FIELD8(0xc0)
24668c2ecf20Sopenharmony_ci
24678c2ecf20Sopenharmony_ci/*
24688c2ecf20Sopenharmony_ci * RFCSR 30:
24698c2ecf20Sopenharmony_ci */
24708c2ecf20Sopenharmony_ci#define RFCSR30_TX_H20M			FIELD8(0x02)
24718c2ecf20Sopenharmony_ci#define RFCSR30_RX_H20M			FIELD8(0x04)
24728c2ecf20Sopenharmony_ci#define RFCSR30_RX_VCM			FIELD8(0x18)
24738c2ecf20Sopenharmony_ci#define RFCSR30_RF_CALIBRATION		FIELD8(0x80)
24748c2ecf20Sopenharmony_ci#define RF3322_RFCSR30_TX_H20M		FIELD8(0x01)
24758c2ecf20Sopenharmony_ci#define RF3322_RFCSR30_RX_H20M		FIELD8(0x02)
24768c2ecf20Sopenharmony_ci
24778c2ecf20Sopenharmony_ci/*
24788c2ecf20Sopenharmony_ci * RFCSR 31:
24798c2ecf20Sopenharmony_ci */
24808c2ecf20Sopenharmony_ci#define RFCSR31_RX_AGC_FC		FIELD8(0x1f)
24818c2ecf20Sopenharmony_ci#define RFCSR31_RX_H20M			FIELD8(0x20)
24828c2ecf20Sopenharmony_ci#define RFCSR31_RX_CALIB		FIELD8(0x7f)
24838c2ecf20Sopenharmony_ci
24848c2ecf20Sopenharmony_ci/* RFCSR 32 bits for RF3053 */
24858c2ecf20Sopenharmony_ci#define RFCSR32_TX_AGC_FC		FIELD8(0xf8)
24868c2ecf20Sopenharmony_ci
24878c2ecf20Sopenharmony_ci/* RFCSR 36 bits for RF3053 */
24888c2ecf20Sopenharmony_ci#define RFCSR36_RF_BS			FIELD8(0x80)
24898c2ecf20Sopenharmony_ci
24908c2ecf20Sopenharmony_ci/*
24918c2ecf20Sopenharmony_ci * RFCSR 34:
24928c2ecf20Sopenharmony_ci */
24938c2ecf20Sopenharmony_ci#define RFCSR34_TX0_EXT_PA		FIELD8(0x04)
24948c2ecf20Sopenharmony_ci#define RFCSR34_TX1_EXT_PA		FIELD8(0x08)
24958c2ecf20Sopenharmony_ci
24968c2ecf20Sopenharmony_ci/*
24978c2ecf20Sopenharmony_ci * RFCSR 38:
24988c2ecf20Sopenharmony_ci */
24998c2ecf20Sopenharmony_ci#define RFCSR38_RX_LO1_EN		FIELD8(0x20)
25008c2ecf20Sopenharmony_ci
25018c2ecf20Sopenharmony_ci/*
25028c2ecf20Sopenharmony_ci * RFCSR 39:
25038c2ecf20Sopenharmony_ci */
25048c2ecf20Sopenharmony_ci#define RFCSR39_RX_DIV			FIELD8(0x40)
25058c2ecf20Sopenharmony_ci#define RFCSR39_RX_LO2_EN		FIELD8(0x80)
25068c2ecf20Sopenharmony_ci
25078c2ecf20Sopenharmony_ci/*
25088c2ecf20Sopenharmony_ci * RFCSR 41:
25098c2ecf20Sopenharmony_ci */
25108c2ecf20Sopenharmony_ci#define RFCSR41_BIT1			FIELD8(0x01)
25118c2ecf20Sopenharmony_ci#define RFCSR41_BIT4			FIELD8(0x08)
25128c2ecf20Sopenharmony_ci
25138c2ecf20Sopenharmony_ci/*
25148c2ecf20Sopenharmony_ci * RFCSR 42:
25158c2ecf20Sopenharmony_ci */
25168c2ecf20Sopenharmony_ci#define RFCSR42_BIT1			FIELD8(0x01)
25178c2ecf20Sopenharmony_ci#define RFCSR42_BIT4			FIELD8(0x08)
25188c2ecf20Sopenharmony_ci#define RFCSR42_TX2_EN_MT7620		FIELD8(0x40)
25198c2ecf20Sopenharmony_ci
25208c2ecf20Sopenharmony_ci/*
25218c2ecf20Sopenharmony_ci * RFCSR 49:
25228c2ecf20Sopenharmony_ci */
25238c2ecf20Sopenharmony_ci#define RFCSR49_TX			FIELD8(0x3f)
25248c2ecf20Sopenharmony_ci#define RFCSR49_EP			FIELD8(0xc0)
25258c2ecf20Sopenharmony_ci/* bits for RT3593 */
25268c2ecf20Sopenharmony_ci#define RFCSR49_TX_LO1_IC		FIELD8(0x1c)
25278c2ecf20Sopenharmony_ci#define RFCSR49_TX_DIV			FIELD8(0x20)
25288c2ecf20Sopenharmony_ci
25298c2ecf20Sopenharmony_ci/*
25308c2ecf20Sopenharmony_ci * RFCSR 50:
25318c2ecf20Sopenharmony_ci */
25328c2ecf20Sopenharmony_ci#define RFCSR50_TX			FIELD8(0x3f)
25338c2ecf20Sopenharmony_ci#define RFCSR50_TX0_EXT_PA		FIELD8(0x02)
25348c2ecf20Sopenharmony_ci#define RFCSR50_TX1_EXT_PA		FIELD8(0x10)
25358c2ecf20Sopenharmony_ci#define RFCSR50_EP			FIELD8(0xc0)
25368c2ecf20Sopenharmony_ci/* bits for RT3593 */
25378c2ecf20Sopenharmony_ci#define RFCSR50_TX_LO1_EN		FIELD8(0x20)
25388c2ecf20Sopenharmony_ci#define RFCSR50_TX_LO2_EN		FIELD8(0x10)
25398c2ecf20Sopenharmony_ci
25408c2ecf20Sopenharmony_ci/* RFCSR 51 */
25418c2ecf20Sopenharmony_ci/* bits for RT3593 */
25428c2ecf20Sopenharmony_ci#define RFCSR51_BITS01			FIELD8(0x03)
25438c2ecf20Sopenharmony_ci#define RFCSR51_BITS24			FIELD8(0x1c)
25448c2ecf20Sopenharmony_ci#define RFCSR51_BITS57			FIELD8(0xe0)
25458c2ecf20Sopenharmony_ci
25468c2ecf20Sopenharmony_ci#define RFCSR53_TX_POWER		FIELD8(0x3f)
25478c2ecf20Sopenharmony_ci#define RFCSR53_UNKNOWN			FIELD8(0xc0)
25488c2ecf20Sopenharmony_ci
25498c2ecf20Sopenharmony_ci#define RFCSR54_TX_POWER		FIELD8(0x3f)
25508c2ecf20Sopenharmony_ci#define RFCSR54_UNKNOWN			FIELD8(0xc0)
25518c2ecf20Sopenharmony_ci
25528c2ecf20Sopenharmony_ci#define RFCSR55_TX_POWER		FIELD8(0x3f)
25538c2ecf20Sopenharmony_ci#define RFCSR55_UNKNOWN			FIELD8(0xc0)
25548c2ecf20Sopenharmony_ci
25558c2ecf20Sopenharmony_ci#define RFCSR57_DRV_CC			FIELD8(0xfc)
25568c2ecf20Sopenharmony_ci
25578c2ecf20Sopenharmony_ci
25588c2ecf20Sopenharmony_ci/*
25598c2ecf20Sopenharmony_ci * RF registers
25608c2ecf20Sopenharmony_ci */
25618c2ecf20Sopenharmony_ci
25628c2ecf20Sopenharmony_ci/*
25638c2ecf20Sopenharmony_ci * RF 2
25648c2ecf20Sopenharmony_ci */
25658c2ecf20Sopenharmony_ci#define RF2_ANTENNA_RX2			FIELD32(0x00000040)
25668c2ecf20Sopenharmony_ci#define RF2_ANTENNA_TX1			FIELD32(0x00004000)
25678c2ecf20Sopenharmony_ci#define RF2_ANTENNA_RX1			FIELD32(0x00020000)
25688c2ecf20Sopenharmony_ci
25698c2ecf20Sopenharmony_ci/*
25708c2ecf20Sopenharmony_ci * RF 3
25718c2ecf20Sopenharmony_ci */
25728c2ecf20Sopenharmony_ci#define RF3_TXPOWER_G			FIELD32(0x00003e00)
25738c2ecf20Sopenharmony_ci#define RF3_TXPOWER_A_7DBM_BOOST	FIELD32(0x00000200)
25748c2ecf20Sopenharmony_ci#define RF3_TXPOWER_A			FIELD32(0x00003c00)
25758c2ecf20Sopenharmony_ci
25768c2ecf20Sopenharmony_ci/*
25778c2ecf20Sopenharmony_ci * RF 4
25788c2ecf20Sopenharmony_ci */
25798c2ecf20Sopenharmony_ci#define RF4_TXPOWER_G			FIELD32(0x000007c0)
25808c2ecf20Sopenharmony_ci#define RF4_TXPOWER_A_7DBM_BOOST	FIELD32(0x00000040)
25818c2ecf20Sopenharmony_ci#define RF4_TXPOWER_A			FIELD32(0x00000780)
25828c2ecf20Sopenharmony_ci#define RF4_FREQ_OFFSET			FIELD32(0x001f8000)
25838c2ecf20Sopenharmony_ci#define RF4_HT40			FIELD32(0x00200000)
25848c2ecf20Sopenharmony_ci
25858c2ecf20Sopenharmony_ci/*
25868c2ecf20Sopenharmony_ci * EEPROM content.
25878c2ecf20Sopenharmony_ci * The wordsize of the EEPROM is 16 bits.
25888c2ecf20Sopenharmony_ci */
25898c2ecf20Sopenharmony_ci
25908c2ecf20Sopenharmony_cienum rt2800_eeprom_word {
25918c2ecf20Sopenharmony_ci	EEPROM_CHIP_ID = 0,
25928c2ecf20Sopenharmony_ci	EEPROM_VERSION,
25938c2ecf20Sopenharmony_ci	EEPROM_MAC_ADDR_0,
25948c2ecf20Sopenharmony_ci	EEPROM_MAC_ADDR_1,
25958c2ecf20Sopenharmony_ci	EEPROM_MAC_ADDR_2,
25968c2ecf20Sopenharmony_ci	EEPROM_NIC_CONF0,
25978c2ecf20Sopenharmony_ci	EEPROM_NIC_CONF1,
25988c2ecf20Sopenharmony_ci	EEPROM_FREQ,
25998c2ecf20Sopenharmony_ci	EEPROM_LED_AG_CONF,
26008c2ecf20Sopenharmony_ci	EEPROM_LED_ACT_CONF,
26018c2ecf20Sopenharmony_ci	EEPROM_LED_POLARITY,
26028c2ecf20Sopenharmony_ci	EEPROM_NIC_CONF2,
26038c2ecf20Sopenharmony_ci	EEPROM_LNA,
26048c2ecf20Sopenharmony_ci	EEPROM_RSSI_BG,
26058c2ecf20Sopenharmony_ci	EEPROM_RSSI_BG2,
26068c2ecf20Sopenharmony_ci	EEPROM_TXMIXER_GAIN_BG,
26078c2ecf20Sopenharmony_ci	EEPROM_RSSI_A,
26088c2ecf20Sopenharmony_ci	EEPROM_RSSI_A2,
26098c2ecf20Sopenharmony_ci	EEPROM_TXMIXER_GAIN_A,
26108c2ecf20Sopenharmony_ci	EEPROM_EIRP_MAX_TX_POWER,
26118c2ecf20Sopenharmony_ci	EEPROM_TXPOWER_DELTA,
26128c2ecf20Sopenharmony_ci	EEPROM_TXPOWER_BG1,
26138c2ecf20Sopenharmony_ci	EEPROM_TXPOWER_BG2,
26148c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_BG1,
26158c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_BG2,
26168c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_BG3,
26178c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_BG4,
26188c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_BG5,
26198c2ecf20Sopenharmony_ci	EEPROM_TXPOWER_A1,
26208c2ecf20Sopenharmony_ci	EEPROM_TXPOWER_A2,
26218c2ecf20Sopenharmony_ci	EEPROM_TXPOWER_INIT,
26228c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_A1,
26238c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_A2,
26248c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_A3,
26258c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_A4,
26268c2ecf20Sopenharmony_ci	EEPROM_TSSI_BOUND_A5,
26278c2ecf20Sopenharmony_ci	EEPROM_TXPOWER_BYRATE,
26288c2ecf20Sopenharmony_ci	EEPROM_BBP_START,
26298c2ecf20Sopenharmony_ci
26308c2ecf20Sopenharmony_ci	/* IDs for extended EEPROM format used by three-chain devices */
26318c2ecf20Sopenharmony_ci	EEPROM_EXT_LNA2,
26328c2ecf20Sopenharmony_ci	EEPROM_EXT_TXPOWER_BG3,
26338c2ecf20Sopenharmony_ci	EEPROM_EXT_TXPOWER_A3,
26348c2ecf20Sopenharmony_ci
26358c2ecf20Sopenharmony_ci	/* New values must be added before this */
26368c2ecf20Sopenharmony_ci	EEPROM_WORD_COUNT
26378c2ecf20Sopenharmony_ci};
26388c2ecf20Sopenharmony_ci
26398c2ecf20Sopenharmony_ci/*
26408c2ecf20Sopenharmony_ci * EEPROM Version
26418c2ecf20Sopenharmony_ci */
26428c2ecf20Sopenharmony_ci#define EEPROM_VERSION_FAE		FIELD16(0x00ff)
26438c2ecf20Sopenharmony_ci#define EEPROM_VERSION_VERSION		FIELD16(0xff00)
26448c2ecf20Sopenharmony_ci
26458c2ecf20Sopenharmony_ci/*
26468c2ecf20Sopenharmony_ci * HW MAC address.
26478c2ecf20Sopenharmony_ci */
26488c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE0		FIELD16(0x00ff)
26498c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE1		FIELD16(0xff00)
26508c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE2		FIELD16(0x00ff)
26518c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE3		FIELD16(0xff00)
26528c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE4		FIELD16(0x00ff)
26538c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE5		FIELD16(0xff00)
26548c2ecf20Sopenharmony_ci
26558c2ecf20Sopenharmony_ci/*
26568c2ecf20Sopenharmony_ci * EEPROM NIC Configuration 0
26578c2ecf20Sopenharmony_ci * RXPATH: 1: 1R, 2: 2R, 3: 3R
26588c2ecf20Sopenharmony_ci * TXPATH: 1: 1T, 2: 2T, 3: 3T
26598c2ecf20Sopenharmony_ci * RF_TYPE: RFIC type
26608c2ecf20Sopenharmony_ci */
26618c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF0_RXPATH		FIELD16(0x000f)
26628c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF0_TXPATH		FIELD16(0x00f0)
26638c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF0_RF_TYPE	FIELD16(0x0f00)
26648c2ecf20Sopenharmony_ci
26658c2ecf20Sopenharmony_ci/*
26668c2ecf20Sopenharmony_ci * EEPROM NIC Configuration 1
26678c2ecf20Sopenharmony_ci * HW_RADIO: 0: disable, 1: enable
26688c2ecf20Sopenharmony_ci * EXTERNAL_TX_ALC: 0: disable, 1: enable
26698c2ecf20Sopenharmony_ci * EXTERNAL_LNA_2G: 0: disable, 1: enable
26708c2ecf20Sopenharmony_ci * EXTERNAL_LNA_5G: 0: disable, 1: enable
26718c2ecf20Sopenharmony_ci * CARDBUS_ACCEL: 0: enable, 1: disable
26728c2ecf20Sopenharmony_ci * BW40M_SB_2G: 0: disable, 1: enable
26738c2ecf20Sopenharmony_ci * BW40M_SB_5G: 0: disable, 1: enable
26748c2ecf20Sopenharmony_ci * WPS_PBC: 0: disable, 1: enable
26758c2ecf20Sopenharmony_ci * BW40M_2G: 0: enable, 1: disable
26768c2ecf20Sopenharmony_ci * BW40M_5G: 0: enable, 1: disable
26778c2ecf20Sopenharmony_ci * BROADBAND_EXT_LNA: 0: disable, 1: enable
26788c2ecf20Sopenharmony_ci * ANT_DIVERSITY: 00: Disable, 01: Diversity,
26798c2ecf20Sopenharmony_ci * 				  10: Main antenna, 11: Aux antenna
26808c2ecf20Sopenharmony_ci * INTERNAL_TX_ALC: 0: disable, 1: enable
26818c2ecf20Sopenharmony_ci * BT_COEXIST: 0: disable, 1: enable
26828c2ecf20Sopenharmony_ci * DAC_TEST: 0: disable, 1: enable
26838c2ecf20Sopenharmony_ci * EXTERNAL_TX0_PA: 0: disable, 1: enable (only on RT3352)
26848c2ecf20Sopenharmony_ci * EXTERNAL_TX1_PA: 0: disable, 1: enable (only on RT3352)
26858c2ecf20Sopenharmony_ci */
26868c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_HW_RADIO		FIELD16(0x0001)
26878c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_TX_ALC	FIELD16(0x0002)
26888c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_LNA_2G	FIELD16(0x0004)
26898c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_LNA_5G	FIELD16(0x0008)
26908c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_CARDBUS_ACCEL		FIELD16(0x0010)
26918c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_BW40M_SB_2G		FIELD16(0x0020)
26928c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_BW40M_SB_5G		FIELD16(0x0040)
26938c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_WPS_PBC		FIELD16(0x0080)
26948c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_BW40M_2G		FIELD16(0x0100)
26958c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_BW40M_5G		FIELD16(0x0200)
26968c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_BROADBAND_EXT_LNA	FIELD16(0x400)
26978c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_ANT_DIVERSITY		FIELD16(0x1800)
26988c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_INTERNAL_TX_ALC	FIELD16(0x2000)
26998c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_BT_COEXIST		FIELD16(0x4000)
27008c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_DAC_TEST		FIELD16(0x8000)
27018c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352	FIELD16(0x4000)
27028c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF1_EXTERNAL_TX1_PA_3352	FIELD16(0x8000)
27038c2ecf20Sopenharmony_ci
27048c2ecf20Sopenharmony_ci/*
27058c2ecf20Sopenharmony_ci * EEPROM frequency
27068c2ecf20Sopenharmony_ci */
27078c2ecf20Sopenharmony_ci#define EEPROM_FREQ_OFFSET		FIELD16(0x00ff)
27088c2ecf20Sopenharmony_ci#define EEPROM_FREQ_LED_MODE		FIELD16(0x7f00)
27098c2ecf20Sopenharmony_ci#define EEPROM_FREQ_LED_POLARITY	FIELD16(0x1000)
27108c2ecf20Sopenharmony_ci
27118c2ecf20Sopenharmony_ci/*
27128c2ecf20Sopenharmony_ci * EEPROM LED
27138c2ecf20Sopenharmony_ci * POLARITY_RDY_G: Polarity RDY_G setting.
27148c2ecf20Sopenharmony_ci * POLARITY_RDY_A: Polarity RDY_A setting.
27158c2ecf20Sopenharmony_ci * POLARITY_ACT: Polarity ACT setting.
27168c2ecf20Sopenharmony_ci * POLARITY_GPIO_0: Polarity GPIO0 setting.
27178c2ecf20Sopenharmony_ci * POLARITY_GPIO_1: Polarity GPIO1 setting.
27188c2ecf20Sopenharmony_ci * POLARITY_GPIO_2: Polarity GPIO2 setting.
27198c2ecf20Sopenharmony_ci * POLARITY_GPIO_3: Polarity GPIO3 setting.
27208c2ecf20Sopenharmony_ci * POLARITY_GPIO_4: Polarity GPIO4 setting.
27218c2ecf20Sopenharmony_ci * LED_MODE: Led mode.
27228c2ecf20Sopenharmony_ci */
27238c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_RDY_BG	FIELD16(0x0001)
27248c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_RDY_A	FIELD16(0x0002)
27258c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_ACT		FIELD16(0x0004)
27268c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_0	FIELD16(0x0008)
27278c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_1	FIELD16(0x0010)
27288c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_2	FIELD16(0x0020)
27298c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_3	FIELD16(0x0040)
27308c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_4	FIELD16(0x0080)
27318c2ecf20Sopenharmony_ci#define EEPROM_LED_LED_MODE		FIELD16(0x1f00)
27328c2ecf20Sopenharmony_ci
27338c2ecf20Sopenharmony_ci/*
27348c2ecf20Sopenharmony_ci * EEPROM NIC Configuration 2
27358c2ecf20Sopenharmony_ci * RX_STREAM: 0: Reserved, 1: 1 Stream, 2: 2 Stream
27368c2ecf20Sopenharmony_ci * TX_STREAM: 0: Reserved, 1: 1 Stream, 2: 2 Stream
27378c2ecf20Sopenharmony_ci * CRYSTAL: 00: Reserved, 01: One crystal, 10: Two crystal, 11: Reserved
27388c2ecf20Sopenharmony_ci */
27398c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF2_RX_STREAM	FIELD16(0x000f)
27408c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF2_TX_STREAM	FIELD16(0x00f0)
27418c2ecf20Sopenharmony_ci#define EEPROM_NIC_CONF2_CRYSTAL	FIELD16(0x0600)
27428c2ecf20Sopenharmony_ci
27438c2ecf20Sopenharmony_ci/*
27448c2ecf20Sopenharmony_ci * EEPROM LNA
27458c2ecf20Sopenharmony_ci */
27468c2ecf20Sopenharmony_ci#define EEPROM_LNA_BG			FIELD16(0x00ff)
27478c2ecf20Sopenharmony_ci#define EEPROM_LNA_A0			FIELD16(0xff00)
27488c2ecf20Sopenharmony_ci
27498c2ecf20Sopenharmony_ci/*
27508c2ecf20Sopenharmony_ci * EEPROM RSSI BG offset
27518c2ecf20Sopenharmony_ci */
27528c2ecf20Sopenharmony_ci#define EEPROM_RSSI_BG_OFFSET0		FIELD16(0x00ff)
27538c2ecf20Sopenharmony_ci#define EEPROM_RSSI_BG_OFFSET1		FIELD16(0xff00)
27548c2ecf20Sopenharmony_ci
27558c2ecf20Sopenharmony_ci/*
27568c2ecf20Sopenharmony_ci * EEPROM RSSI BG2 offset
27578c2ecf20Sopenharmony_ci */
27588c2ecf20Sopenharmony_ci#define EEPROM_RSSI_BG2_OFFSET2		FIELD16(0x00ff)
27598c2ecf20Sopenharmony_ci#define EEPROM_RSSI_BG2_LNA_A1		FIELD16(0xff00)
27608c2ecf20Sopenharmony_ci
27618c2ecf20Sopenharmony_ci/*
27628c2ecf20Sopenharmony_ci * EEPROM TXMIXER GAIN BG offset (note overlaps with EEPROM RSSI BG2).
27638c2ecf20Sopenharmony_ci */
27648c2ecf20Sopenharmony_ci#define EEPROM_TXMIXER_GAIN_BG_VAL	FIELD16(0x0007)
27658c2ecf20Sopenharmony_ci
27668c2ecf20Sopenharmony_ci/*
27678c2ecf20Sopenharmony_ci * EEPROM RSSI A offset
27688c2ecf20Sopenharmony_ci */
27698c2ecf20Sopenharmony_ci#define EEPROM_RSSI_A_OFFSET0		FIELD16(0x00ff)
27708c2ecf20Sopenharmony_ci#define EEPROM_RSSI_A_OFFSET1		FIELD16(0xff00)
27718c2ecf20Sopenharmony_ci
27728c2ecf20Sopenharmony_ci/*
27738c2ecf20Sopenharmony_ci * EEPROM RSSI A2 offset
27748c2ecf20Sopenharmony_ci */
27758c2ecf20Sopenharmony_ci#define EEPROM_RSSI_A2_OFFSET2		FIELD16(0x00ff)
27768c2ecf20Sopenharmony_ci#define EEPROM_RSSI_A2_LNA_A2		FIELD16(0xff00)
27778c2ecf20Sopenharmony_ci
27788c2ecf20Sopenharmony_ci/*
27798c2ecf20Sopenharmony_ci * EEPROM TXMIXER GAIN A offset (note overlaps with EEPROM RSSI A2).
27808c2ecf20Sopenharmony_ci */
27818c2ecf20Sopenharmony_ci#define EEPROM_TXMIXER_GAIN_A_VAL	FIELD16(0x0007)
27828c2ecf20Sopenharmony_ci
27838c2ecf20Sopenharmony_ci/*
27848c2ecf20Sopenharmony_ci * EEPROM EIRP Maximum TX power values(unit: dbm)
27858c2ecf20Sopenharmony_ci */
27868c2ecf20Sopenharmony_ci#define EEPROM_EIRP_MAX_TX_POWER_2GHZ	FIELD16(0x00ff)
27878c2ecf20Sopenharmony_ci#define EEPROM_EIRP_MAX_TX_POWER_5GHZ	FIELD16(0xff00)
27888c2ecf20Sopenharmony_ci
27898c2ecf20Sopenharmony_ci/*
27908c2ecf20Sopenharmony_ci * EEPROM TXpower delta: 20MHZ AND 40 MHZ use different power.
27918c2ecf20Sopenharmony_ci * This is delta in 40MHZ.
27928c2ecf20Sopenharmony_ci * VALUE: Tx Power dalta value, MAX=4(unit: dbm)
27938c2ecf20Sopenharmony_ci * TYPE: 1: Plus the delta value, 0: minus the delta value
27948c2ecf20Sopenharmony_ci * ENABLE: enable tx power compensation for 40BW
27958c2ecf20Sopenharmony_ci */
27968c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_VALUE_2G	FIELD16(0x003f)
27978c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_TYPE_2G	FIELD16(0x0040)
27988c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_ENABLE_2G	FIELD16(0x0080)
27998c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_VALUE_5G	FIELD16(0x3f00)
28008c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_TYPE_5G	FIELD16(0x4000)
28018c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_DELTA_ENABLE_5G	FIELD16(0x8000)
28028c2ecf20Sopenharmony_ci
28038c2ecf20Sopenharmony_ci/*
28048c2ecf20Sopenharmony_ci * EEPROM TXPOWER 802.11BG
28058c2ecf20Sopenharmony_ci */
28068c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_BG_SIZE		7
28078c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_BG_1		FIELD16(0x00ff)
28088c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_BG_2		FIELD16(0xff00)
28098c2ecf20Sopenharmony_ci
28108c2ecf20Sopenharmony_ci/*
28118c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG
28128c2ecf20Sopenharmony_ci * MINUS4: If the actual TSSI is below this boundary, tx power needs to be
28138c2ecf20Sopenharmony_ci *         reduced by (agc_step * -4)
28148c2ecf20Sopenharmony_ci * MINUS3: If the actual TSSI is below this boundary, tx power needs to be
28158c2ecf20Sopenharmony_ci *         reduced by (agc_step * -3)
28168c2ecf20Sopenharmony_ci */
28178c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG1_MINUS4	FIELD16(0x00ff)
28188c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG1_MINUS3	FIELD16(0xff00)
28198c2ecf20Sopenharmony_ci
28208c2ecf20Sopenharmony_ci/*
28218c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG
28228c2ecf20Sopenharmony_ci * MINUS2: If the actual TSSI is below this boundary, tx power needs to be
28238c2ecf20Sopenharmony_ci *         reduced by (agc_step * -2)
28248c2ecf20Sopenharmony_ci * MINUS1: If the actual TSSI is below this boundary, tx power needs to be
28258c2ecf20Sopenharmony_ci *         reduced by (agc_step * -1)
28268c2ecf20Sopenharmony_ci */
28278c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG2_MINUS2	FIELD16(0x00ff)
28288c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG2_MINUS1	FIELD16(0xff00)
28298c2ecf20Sopenharmony_ci
28308c2ecf20Sopenharmony_ci/*
28318c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG
28328c2ecf20Sopenharmony_ci * REF: Reference TSSI value, no tx power changes needed
28338c2ecf20Sopenharmony_ci * PLUS1: If the actual TSSI is above this boundary, tx power needs to be
28348c2ecf20Sopenharmony_ci *        increased by (agc_step * 1)
28358c2ecf20Sopenharmony_ci */
28368c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG3_REF	FIELD16(0x00ff)
28378c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG3_PLUS1	FIELD16(0xff00)
28388c2ecf20Sopenharmony_ci
28398c2ecf20Sopenharmony_ci/*
28408c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG
28418c2ecf20Sopenharmony_ci * PLUS2: If the actual TSSI is above this boundary, tx power needs to be
28428c2ecf20Sopenharmony_ci *        increased by (agc_step * 2)
28438c2ecf20Sopenharmony_ci * PLUS3: If the actual TSSI is above this boundary, tx power needs to be
28448c2ecf20Sopenharmony_ci *        increased by (agc_step * 3)
28458c2ecf20Sopenharmony_ci */
28468c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG4_PLUS2	FIELD16(0x00ff)
28478c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG4_PLUS3	FIELD16(0xff00)
28488c2ecf20Sopenharmony_ci
28498c2ecf20Sopenharmony_ci/*
28508c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11BG
28518c2ecf20Sopenharmony_ci * PLUS4: If the actual TSSI is above this boundary, tx power needs to be
28528c2ecf20Sopenharmony_ci *        increased by (agc_step * 4)
28538c2ecf20Sopenharmony_ci * AGC_STEP: Temperature compensation step.
28548c2ecf20Sopenharmony_ci */
28558c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG5_PLUS4	FIELD16(0x00ff)
28568c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_BG5_AGC_STEP	FIELD16(0xff00)
28578c2ecf20Sopenharmony_ci
28588c2ecf20Sopenharmony_ci/*
28598c2ecf20Sopenharmony_ci * EEPROM TXPOWER 802.11A
28608c2ecf20Sopenharmony_ci */
28618c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_A_SIZE		6
28628c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_A_1		FIELD16(0x00ff)
28638c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_A_2		FIELD16(0xff00)
28648c2ecf20Sopenharmony_ci
28658c2ecf20Sopenharmony_ci/* EEPROM_TXPOWER_{A,G} fields for RT3593 */
28668c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_ALC		FIELD8(0x1f)
28678c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_FINE_CTRL	FIELD8(0xe0)
28688c2ecf20Sopenharmony_ci
28698c2ecf20Sopenharmony_ci/*
28708c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A
28718c2ecf20Sopenharmony_ci * MINUS4: If the actual TSSI is below this boundary, tx power needs to be
28728c2ecf20Sopenharmony_ci *         reduced by (agc_step * -4)
28738c2ecf20Sopenharmony_ci * MINUS3: If the actual TSSI is below this boundary, tx power needs to be
28748c2ecf20Sopenharmony_ci *         reduced by (agc_step * -3)
28758c2ecf20Sopenharmony_ci */
28768c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A1_MINUS4	FIELD16(0x00ff)
28778c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A1_MINUS3	FIELD16(0xff00)
28788c2ecf20Sopenharmony_ci
28798c2ecf20Sopenharmony_ci/*
28808c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A
28818c2ecf20Sopenharmony_ci * MINUS2: If the actual TSSI is below this boundary, tx power needs to be
28828c2ecf20Sopenharmony_ci *         reduced by (agc_step * -2)
28838c2ecf20Sopenharmony_ci * MINUS1: If the actual TSSI is below this boundary, tx power needs to be
28848c2ecf20Sopenharmony_ci *         reduced by (agc_step * -1)
28858c2ecf20Sopenharmony_ci */
28868c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A2_MINUS2	FIELD16(0x00ff)
28878c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A2_MINUS1	FIELD16(0xff00)
28888c2ecf20Sopenharmony_ci
28898c2ecf20Sopenharmony_ci/*
28908c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A
28918c2ecf20Sopenharmony_ci * REF: Reference TSSI value, no tx power changes needed
28928c2ecf20Sopenharmony_ci * PLUS1: If the actual TSSI is above this boundary, tx power needs to be
28938c2ecf20Sopenharmony_ci *        increased by (agc_step * 1)
28948c2ecf20Sopenharmony_ci */
28958c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A3_REF	FIELD16(0x00ff)
28968c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A3_PLUS1	FIELD16(0xff00)
28978c2ecf20Sopenharmony_ci
28988c2ecf20Sopenharmony_ci/*
28998c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A
29008c2ecf20Sopenharmony_ci * PLUS2: If the actual TSSI is above this boundary, tx power needs to be
29018c2ecf20Sopenharmony_ci *        increased by (agc_step * 2)
29028c2ecf20Sopenharmony_ci * PLUS3: If the actual TSSI is above this boundary, tx power needs to be
29038c2ecf20Sopenharmony_ci *        increased by (agc_step * 3)
29048c2ecf20Sopenharmony_ci */
29058c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A4_PLUS2	FIELD16(0x00ff)
29068c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A4_PLUS3	FIELD16(0xff00)
29078c2ecf20Sopenharmony_ci
29088c2ecf20Sopenharmony_ci/*
29098c2ecf20Sopenharmony_ci * EEPROM temperature compensation boundaries 802.11A
29108c2ecf20Sopenharmony_ci * PLUS4: If the actual TSSI is above this boundary, tx power needs to be
29118c2ecf20Sopenharmony_ci *        increased by (agc_step * 4)
29128c2ecf20Sopenharmony_ci * AGC_STEP: Temperature compensation step.
29138c2ecf20Sopenharmony_ci */
29148c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A5_PLUS4	FIELD16(0x00ff)
29158c2ecf20Sopenharmony_ci#define EEPROM_TSSI_BOUND_A5_AGC_STEP	FIELD16(0xff00)
29168c2ecf20Sopenharmony_ci
29178c2ecf20Sopenharmony_ci/*
29188c2ecf20Sopenharmony_ci * EEPROM TXPOWER by rate: tx power per tx rate for HT20 mode
29198c2ecf20Sopenharmony_ci */
29208c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_SIZE	9
29218c2ecf20Sopenharmony_ci
29228c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_RATE0	FIELD16(0x000f)
29238c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_RATE1	FIELD16(0x00f0)
29248c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_RATE2	FIELD16(0x0f00)
29258c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_BYRATE_RATE3	FIELD16(0xf000)
29268c2ecf20Sopenharmony_ci
29278c2ecf20Sopenharmony_ci/*
29288c2ecf20Sopenharmony_ci * EEPROM BBP.
29298c2ecf20Sopenharmony_ci */
29308c2ecf20Sopenharmony_ci#define EEPROM_BBP_SIZE			16
29318c2ecf20Sopenharmony_ci#define EEPROM_BBP_VALUE		FIELD16(0x00ff)
29328c2ecf20Sopenharmony_ci#define EEPROM_BBP_REG_ID		FIELD16(0xff00)
29338c2ecf20Sopenharmony_ci
29348c2ecf20Sopenharmony_ci/* EEPROM_EXT_LNA2 */
29358c2ecf20Sopenharmony_ci#define EEPROM_EXT_LNA2_A1		FIELD16(0x00ff)
29368c2ecf20Sopenharmony_ci#define EEPROM_EXT_LNA2_A2		FIELD16(0xff00)
29378c2ecf20Sopenharmony_ci
29388c2ecf20Sopenharmony_ci/*
29398c2ecf20Sopenharmony_ci * EEPROM IQ Calibration, unlike other entries those are byte addresses.
29408c2ecf20Sopenharmony_ci */
29418c2ecf20Sopenharmony_ci
29428c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX0_2G			0x130
29438c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX0_2G			0x131
29448c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX0_2G			0x132
29458c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX1_2G			0x133
29468c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX1_2G			0x134
29478c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX1_2G			0x135
29488c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX0_2G			0x136
29498c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX0_2G			0x137
29508c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX0_2G			0x138
29518c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX1_2G			0x139
29528c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX1_2G			0x13A
29538c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX1_2G			0x13B
29548c2ecf20Sopenharmony_ci#define EEPROM_RF_IQ_COMPENSATION_CONTROL		0x13C
29558c2ecf20Sopenharmony_ci#define EEPROM_RF_IQ_IMBALANCE_COMPENSATION_CONTROL	0x13D
29568c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX0_CH36_TO_CH64_5G		0x144
29578c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX0_CH36_TO_CH64_5G		0x145
29588c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX0_CH100_TO_CH138_5G	0X146
29598c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX0_CH100_TO_CH138_5G	0x147
29608c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX0_CH140_TO_CH165_5G	0x148
29618c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX0_CH140_TO_CH165_5G	0x149
29628c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX1_CH36_TO_CH64_5G		0x14A
29638c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX1_CH36_TO_CH64_5G		0x14B
29648c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX1_CH100_TO_CH138_5G	0X14C
29658c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX1_CH100_TO_CH138_5G	0x14D
29668c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_TX1_CH140_TO_CH165_5G	0x14E
29678c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_TX1_CH140_TO_CH165_5G	0x14F
29688c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX0_CH36_TO_CH64_5G	0x150
29698c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX1_CH36_TO_CH64_5G	0x151
29708c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX0_CH100_TO_CH138_5G	0x152
29718c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX1_CH100_TO_CH138_5G	0x153
29728c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX0_CH140_TO_CH165_5G	0x154
29738c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_TX1_CH140_TO_CH165_5G	0x155
29748c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX0_CH36_TO_CH64_5G		0x156
29758c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX0_CH36_TO_CH64_5G		0x157
29768c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX0_CH100_TO_CH138_5G	0X158
29778c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX0_CH100_TO_CH138_5G	0x159
29788c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX0_CH140_TO_CH165_5G	0x15A
29798c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX0_CH140_TO_CH165_5G	0x15B
29808c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX1_CH36_TO_CH64_5G		0x15C
29818c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX1_CH36_TO_CH64_5G		0x15D
29828c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX1_CH100_TO_CH138_5G	0X15E
29838c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX1_CH100_TO_CH138_5G	0x15F
29848c2ecf20Sopenharmony_ci#define EEPROM_IQ_GAIN_CAL_RX1_CH140_TO_CH165_5G	0x160
29858c2ecf20Sopenharmony_ci#define EEPROM_IQ_PHASE_CAL_RX1_CH140_TO_CH165_5G	0x161
29868c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX0_CH36_TO_CH64_5G	0x162
29878c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX1_CH36_TO_CH64_5G	0x163
29888c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX0_CH100_TO_CH138_5G	0x164
29898c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX1_CH100_TO_CH138_5G	0x165
29908c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX0_CH140_TO_CH165_5G	0x166
29918c2ecf20Sopenharmony_ci#define EEPROM_IQ_GROUPDELAY_CAL_RX1_CH140_TO_CH165_5G	0x167
29928c2ecf20Sopenharmony_ci
29938c2ecf20Sopenharmony_ci/*
29948c2ecf20Sopenharmony_ci * MCU mailbox commands.
29958c2ecf20Sopenharmony_ci * MCU_SLEEP - go to power-save mode.
29968c2ecf20Sopenharmony_ci *             arg1: 1: save as much power as possible, 0: save less power.
29978c2ecf20Sopenharmony_ci *             status: 1: success, 2: already asleep,
29988c2ecf20Sopenharmony_ci *                     3: maybe MAC is busy so can't finish this task.
29998c2ecf20Sopenharmony_ci * MCU_RADIO_OFF
30008c2ecf20Sopenharmony_ci *             arg0: 0: do power-saving, NOT turn off radio.
30018c2ecf20Sopenharmony_ci */
30028c2ecf20Sopenharmony_ci#define MCU_SLEEP			0x30
30038c2ecf20Sopenharmony_ci#define MCU_WAKEUP			0x31
30048c2ecf20Sopenharmony_ci#define MCU_RADIO_OFF			0x35
30058c2ecf20Sopenharmony_ci#define MCU_CURRENT			0x36
30068c2ecf20Sopenharmony_ci#define MCU_LED				0x50
30078c2ecf20Sopenharmony_ci#define MCU_LED_STRENGTH		0x51
30088c2ecf20Sopenharmony_ci#define MCU_LED_AG_CONF			0x52
30098c2ecf20Sopenharmony_ci#define MCU_LED_ACT_CONF		0x53
30108c2ecf20Sopenharmony_ci#define MCU_LED_LED_POLARITY		0x54
30118c2ecf20Sopenharmony_ci#define MCU_RADAR			0x60
30128c2ecf20Sopenharmony_ci#define MCU_BOOT_SIGNAL			0x72
30138c2ecf20Sopenharmony_ci#define MCU_ANT_SELECT			0X73
30148c2ecf20Sopenharmony_ci#define MCU_FREQ_OFFSET			0x74
30158c2ecf20Sopenharmony_ci#define MCU_BBP_SIGNAL			0x80
30168c2ecf20Sopenharmony_ci#define MCU_POWER_SAVE			0x83
30178c2ecf20Sopenharmony_ci#define MCU_BAND_SELECT			0x91
30188c2ecf20Sopenharmony_ci
30198c2ecf20Sopenharmony_ci/*
30208c2ecf20Sopenharmony_ci * MCU mailbox tokens
30218c2ecf20Sopenharmony_ci */
30228c2ecf20Sopenharmony_ci#define TOKEN_SLEEP			1
30238c2ecf20Sopenharmony_ci#define TOKEN_RADIO_OFF			2
30248c2ecf20Sopenharmony_ci#define TOKEN_WAKEUP			3
30258c2ecf20Sopenharmony_ci
30268c2ecf20Sopenharmony_ci
30278c2ecf20Sopenharmony_ci/*
30288c2ecf20Sopenharmony_ci * DMA descriptor defines.
30298c2ecf20Sopenharmony_ci */
30308c2ecf20Sopenharmony_ci
30318c2ecf20Sopenharmony_ci#define TXWI_DESC_SIZE_4WORDS		(4 * sizeof(__le32))
30328c2ecf20Sopenharmony_ci#define TXWI_DESC_SIZE_5WORDS		(5 * sizeof(__le32))
30338c2ecf20Sopenharmony_ci
30348c2ecf20Sopenharmony_ci#define RXWI_DESC_SIZE_4WORDS		(4 * sizeof(__le32))
30358c2ecf20Sopenharmony_ci#define RXWI_DESC_SIZE_5WORDS		(5 * sizeof(__le32))
30368c2ecf20Sopenharmony_ci#define RXWI_DESC_SIZE_6WORDS		(6 * sizeof(__le32))
30378c2ecf20Sopenharmony_ci
30388c2ecf20Sopenharmony_ci/*
30398c2ecf20Sopenharmony_ci * TX WI structure
30408c2ecf20Sopenharmony_ci */
30418c2ecf20Sopenharmony_ci
30428c2ecf20Sopenharmony_ci/*
30438c2ecf20Sopenharmony_ci * Word0
30448c2ecf20Sopenharmony_ci * FRAG: 1 To inform TKIP engine this is a fragment.
30458c2ecf20Sopenharmony_ci * MIMO_PS: The remote peer is in dynamic MIMO-PS mode
30468c2ecf20Sopenharmony_ci * TX_OP: 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs
30478c2ecf20Sopenharmony_ci * BW: Channel bandwidth 0:20MHz, 1:40 MHz (for legacy rates this will
30488c2ecf20Sopenharmony_ci *     duplicate the frame to both channels).
30498c2ecf20Sopenharmony_ci * STBC: 1: STBC support MCS =0-7, 2,3 : RESERVED
30508c2ecf20Sopenharmony_ci * AMPDU: 1: this frame is eligible for AMPDU aggregation, the hw will
30518c2ecf20Sopenharmony_ci *        aggregate consecutive frames with the same RA and QoS TID. If
30528c2ecf20Sopenharmony_ci *        a frame A with the same RA and QoS TID but AMPDU=0 is queued
30538c2ecf20Sopenharmony_ci *        directly after a frame B with AMPDU=1, frame A might still
30548c2ecf20Sopenharmony_ci *        get aggregated into the AMPDU started by frame B. So, setting
30558c2ecf20Sopenharmony_ci *        AMPDU to 0 does _not_ necessarily mean the frame is sent as
30568c2ecf20Sopenharmony_ci *        MPDU, it can still end up in an AMPDU if the previous frame
30578c2ecf20Sopenharmony_ci *        was tagged as AMPDU.
30588c2ecf20Sopenharmony_ci */
30598c2ecf20Sopenharmony_ci#define TXWI_W0_FRAG			FIELD32(0x00000001)
30608c2ecf20Sopenharmony_ci#define TXWI_W0_MIMO_PS			FIELD32(0x00000002)
30618c2ecf20Sopenharmony_ci#define TXWI_W0_CF_ACK			FIELD32(0x00000004)
30628c2ecf20Sopenharmony_ci#define TXWI_W0_TS			FIELD32(0x00000008)
30638c2ecf20Sopenharmony_ci#define TXWI_W0_AMPDU			FIELD32(0x00000010)
30648c2ecf20Sopenharmony_ci#define TXWI_W0_MPDU_DENSITY		FIELD32(0x000000e0)
30658c2ecf20Sopenharmony_ci#define TXWI_W0_TX_OP			FIELD32(0x00000300)
30668c2ecf20Sopenharmony_ci#define TXWI_W0_MCS			FIELD32(0x007f0000)
30678c2ecf20Sopenharmony_ci#define TXWI_W0_BW			FIELD32(0x00800000)
30688c2ecf20Sopenharmony_ci#define TXWI_W0_SHORT_GI		FIELD32(0x01000000)
30698c2ecf20Sopenharmony_ci#define TXWI_W0_STBC			FIELD32(0x06000000)
30708c2ecf20Sopenharmony_ci#define TXWI_W0_IFS			FIELD32(0x08000000)
30718c2ecf20Sopenharmony_ci#define TXWI_W0_PHYMODE			FIELD32(0xc0000000)
30728c2ecf20Sopenharmony_ci
30738c2ecf20Sopenharmony_ci/*
30748c2ecf20Sopenharmony_ci * Word1
30758c2ecf20Sopenharmony_ci * ACK: 0: No Ack needed, 1: Ack needed
30768c2ecf20Sopenharmony_ci * NSEQ: 0: Don't assign hw sequence number, 1: Assign hw sequence number
30778c2ecf20Sopenharmony_ci * BW_WIN_SIZE: BA windows size of the recipient
30788c2ecf20Sopenharmony_ci * WIRELESS_CLI_ID: Client ID for WCID table access
30798c2ecf20Sopenharmony_ci * MPDU_TOTAL_BYTE_COUNT: Length of 802.11 frame
30808c2ecf20Sopenharmony_ci * PACKETID: Will be latched into the TX_STA_FIFO register once the according
30818c2ecf20Sopenharmony_ci *           frame was processed. If multiple frames are aggregated together
30828c2ecf20Sopenharmony_ci *           (AMPDU==1) the reported tx status will always contain the packet
30838c2ecf20Sopenharmony_ci *           id of the first frame. 0: Don't report tx status for this frame.
30848c2ecf20Sopenharmony_ci * PACKETID_QUEUE: Part of PACKETID, This is the queue index (0-3)
30858c2ecf20Sopenharmony_ci * PACKETID_ENTRY: Part of PACKETID, THis is the queue entry index (1-3)
30868c2ecf20Sopenharmony_ci *                 This identification number is calculated by ((idx % 3) + 1).
30878c2ecf20Sopenharmony_ci *		   The (+1) is required to prevent PACKETID to become 0.
30888c2ecf20Sopenharmony_ci */
30898c2ecf20Sopenharmony_ci#define TXWI_W1_ACK			FIELD32(0x00000001)
30908c2ecf20Sopenharmony_ci#define TXWI_W1_NSEQ			FIELD32(0x00000002)
30918c2ecf20Sopenharmony_ci#define TXWI_W1_BW_WIN_SIZE		FIELD32(0x000000fc)
30928c2ecf20Sopenharmony_ci#define TXWI_W1_WIRELESS_CLI_ID		FIELD32(0x0000ff00)
30938c2ecf20Sopenharmony_ci#define TXWI_W1_MPDU_TOTAL_BYTE_COUNT	FIELD32(0x0fff0000)
30948c2ecf20Sopenharmony_ci#define TXWI_W1_PACKETID		FIELD32(0xf0000000)
30958c2ecf20Sopenharmony_ci#define TXWI_W1_PACKETID_QUEUE		FIELD32(0x30000000)
30968c2ecf20Sopenharmony_ci#define TXWI_W1_PACKETID_ENTRY		FIELD32(0xc0000000)
30978c2ecf20Sopenharmony_ci
30988c2ecf20Sopenharmony_ci/*
30998c2ecf20Sopenharmony_ci * Word2
31008c2ecf20Sopenharmony_ci */
31018c2ecf20Sopenharmony_ci#define TXWI_W2_IV			FIELD32(0xffffffff)
31028c2ecf20Sopenharmony_ci
31038c2ecf20Sopenharmony_ci/*
31048c2ecf20Sopenharmony_ci * Word3
31058c2ecf20Sopenharmony_ci */
31068c2ecf20Sopenharmony_ci#define TXWI_W3_EIV			FIELD32(0xffffffff)
31078c2ecf20Sopenharmony_ci
31088c2ecf20Sopenharmony_ci/*
31098c2ecf20Sopenharmony_ci * RX WI structure
31108c2ecf20Sopenharmony_ci */
31118c2ecf20Sopenharmony_ci
31128c2ecf20Sopenharmony_ci/*
31138c2ecf20Sopenharmony_ci * Word0
31148c2ecf20Sopenharmony_ci */
31158c2ecf20Sopenharmony_ci#define RXWI_W0_WIRELESS_CLI_ID		FIELD32(0x000000ff)
31168c2ecf20Sopenharmony_ci#define RXWI_W0_KEY_INDEX		FIELD32(0x00000300)
31178c2ecf20Sopenharmony_ci#define RXWI_W0_BSSID			FIELD32(0x00001c00)
31188c2ecf20Sopenharmony_ci#define RXWI_W0_UDF			FIELD32(0x0000e000)
31198c2ecf20Sopenharmony_ci#define RXWI_W0_MPDU_TOTAL_BYTE_COUNT	FIELD32(0x0fff0000)
31208c2ecf20Sopenharmony_ci#define RXWI_W0_TID			FIELD32(0xf0000000)
31218c2ecf20Sopenharmony_ci
31228c2ecf20Sopenharmony_ci/*
31238c2ecf20Sopenharmony_ci * Word1
31248c2ecf20Sopenharmony_ci */
31258c2ecf20Sopenharmony_ci#define RXWI_W1_FRAG			FIELD32(0x0000000f)
31268c2ecf20Sopenharmony_ci#define RXWI_W1_SEQUENCE		FIELD32(0x0000fff0)
31278c2ecf20Sopenharmony_ci#define RXWI_W1_MCS			FIELD32(0x007f0000)
31288c2ecf20Sopenharmony_ci#define RXWI_W1_BW			FIELD32(0x00800000)
31298c2ecf20Sopenharmony_ci#define RXWI_W1_SHORT_GI		FIELD32(0x01000000)
31308c2ecf20Sopenharmony_ci#define RXWI_W1_STBC			FIELD32(0x06000000)
31318c2ecf20Sopenharmony_ci#define RXWI_W1_PHYMODE			FIELD32(0xc0000000)
31328c2ecf20Sopenharmony_ci
31338c2ecf20Sopenharmony_ci/*
31348c2ecf20Sopenharmony_ci * Word2
31358c2ecf20Sopenharmony_ci */
31368c2ecf20Sopenharmony_ci#define RXWI_W2_RSSI0			FIELD32(0x000000ff)
31378c2ecf20Sopenharmony_ci#define RXWI_W2_RSSI1			FIELD32(0x0000ff00)
31388c2ecf20Sopenharmony_ci#define RXWI_W2_RSSI2			FIELD32(0x00ff0000)
31398c2ecf20Sopenharmony_ci
31408c2ecf20Sopenharmony_ci/*
31418c2ecf20Sopenharmony_ci * Word3
31428c2ecf20Sopenharmony_ci */
31438c2ecf20Sopenharmony_ci#define RXWI_W3_SNR0			FIELD32(0x000000ff)
31448c2ecf20Sopenharmony_ci#define RXWI_W3_SNR1			FIELD32(0x0000ff00)
31458c2ecf20Sopenharmony_ci
31468c2ecf20Sopenharmony_ci/*
31478c2ecf20Sopenharmony_ci * Macros for converting txpower from EEPROM to mac80211 value
31488c2ecf20Sopenharmony_ci * and from mac80211 value to register value.
31498c2ecf20Sopenharmony_ci */
31508c2ecf20Sopenharmony_ci#define MIN_G_TXPOWER	0
31518c2ecf20Sopenharmony_ci#define MIN_A_TXPOWER	-7
31528c2ecf20Sopenharmony_ci#define MAX_G_TXPOWER	31
31538c2ecf20Sopenharmony_ci#define MAX_A_TXPOWER	15
31548c2ecf20Sopenharmony_ci#define DEFAULT_TXPOWER	5
31558c2ecf20Sopenharmony_ci
31568c2ecf20Sopenharmony_ci#define MIN_A_TXPOWER_3593	0
31578c2ecf20Sopenharmony_ci#define MAX_A_TXPOWER_3593	31
31588c2ecf20Sopenharmony_ci
31598c2ecf20Sopenharmony_ci#define TXPOWER_G_FROM_DEV(__txpower) \
31608c2ecf20Sopenharmony_ci	((__txpower) > MAX_G_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
31618c2ecf20Sopenharmony_ci
31628c2ecf20Sopenharmony_ci#define TXPOWER_A_FROM_DEV(__txpower) \
31638c2ecf20Sopenharmony_ci	((__txpower) > MAX_A_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
31648c2ecf20Sopenharmony_ci
31658c2ecf20Sopenharmony_ci/*
31668c2ecf20Sopenharmony_ci *  Board's maximun TX power limitation
31678c2ecf20Sopenharmony_ci */
31688c2ecf20Sopenharmony_ci#define EIRP_MAX_TX_POWER_LIMIT	0x50
31698c2ecf20Sopenharmony_ci
31708c2ecf20Sopenharmony_ci/*
31718c2ecf20Sopenharmony_ci * Number of TBTT intervals after which we have to adjust
31728c2ecf20Sopenharmony_ci * the hw beacon timer.
31738c2ecf20Sopenharmony_ci */
31748c2ecf20Sopenharmony_ci#define BCN_TBTT_OFFSET 64
31758c2ecf20Sopenharmony_ci
31768c2ecf20Sopenharmony_ci#endif /* RT2800_H */
3177