18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci	Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
48c2ecf20Sopenharmony_ci	<http://rt2x00.serialmonkey.com>
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/*
98c2ecf20Sopenharmony_ci	Module: rt61pci
108c2ecf20Sopenharmony_ci	Abstract: Data structures and registers for the rt61pci module.
118c2ecf20Sopenharmony_ci	Supported chipsets: RT2561, RT2561s, RT2661.
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#ifndef RT61PCI_H
158c2ecf20Sopenharmony_ci#define RT61PCI_H
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/*
188c2ecf20Sopenharmony_ci * RT chip PCI IDs.
198c2ecf20Sopenharmony_ci */
208c2ecf20Sopenharmony_ci#define RT2561s_PCI_ID			0x0301
218c2ecf20Sopenharmony_ci#define RT2561_PCI_ID			0x0302
228c2ecf20Sopenharmony_ci#define RT2661_PCI_ID			0x0401
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/*
258c2ecf20Sopenharmony_ci * RF chip defines.
268c2ecf20Sopenharmony_ci */
278c2ecf20Sopenharmony_ci#define RF5225				0x0001
288c2ecf20Sopenharmony_ci#define RF5325				0x0002
298c2ecf20Sopenharmony_ci#define RF2527				0x0003
308c2ecf20Sopenharmony_ci#define RF2529				0x0004
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci/*
338c2ecf20Sopenharmony_ci * Signal information.
348c2ecf20Sopenharmony_ci * Default offset is required for RSSI <-> dBm conversion.
358c2ecf20Sopenharmony_ci */
368c2ecf20Sopenharmony_ci#define DEFAULT_RSSI_OFFSET		120
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci/*
398c2ecf20Sopenharmony_ci * Register layout information.
408c2ecf20Sopenharmony_ci */
418c2ecf20Sopenharmony_ci#define CSR_REG_BASE			0x3000
428c2ecf20Sopenharmony_ci#define CSR_REG_SIZE			0x04b0
438c2ecf20Sopenharmony_ci#define EEPROM_BASE			0x0000
448c2ecf20Sopenharmony_ci#define EEPROM_SIZE			0x0100
458c2ecf20Sopenharmony_ci#define BBP_BASE			0x0000
468c2ecf20Sopenharmony_ci#define BBP_SIZE			0x0080
478c2ecf20Sopenharmony_ci#define RF_BASE				0x0004
488c2ecf20Sopenharmony_ci#define RF_SIZE				0x0010
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci/*
518c2ecf20Sopenharmony_ci * Number of TX queues.
528c2ecf20Sopenharmony_ci */
538c2ecf20Sopenharmony_ci#define NUM_TX_QUEUES			4
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/*
568c2ecf20Sopenharmony_ci * PCI registers.
578c2ecf20Sopenharmony_ci */
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci/*
608c2ecf20Sopenharmony_ci * HOST_CMD_CSR: For HOST to interrupt embedded processor
618c2ecf20Sopenharmony_ci */
628c2ecf20Sopenharmony_ci#define HOST_CMD_CSR			0x0008
638c2ecf20Sopenharmony_ci#define HOST_CMD_CSR_HOST_COMMAND	FIELD32(0x0000007f)
648c2ecf20Sopenharmony_ci#define HOST_CMD_CSR_INTERRUPT_MCU	FIELD32(0x00000080)
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/*
678c2ecf20Sopenharmony_ci * MCU_CNTL_CSR
688c2ecf20Sopenharmony_ci * SELECT_BANK: Select 8051 program bank.
698c2ecf20Sopenharmony_ci * RESET: Enable 8051 reset state.
708c2ecf20Sopenharmony_ci * READY: Ready state for 8051.
718c2ecf20Sopenharmony_ci */
728c2ecf20Sopenharmony_ci#define MCU_CNTL_CSR			0x000c
738c2ecf20Sopenharmony_ci#define MCU_CNTL_CSR_SELECT_BANK	FIELD32(0x00000001)
748c2ecf20Sopenharmony_ci#define MCU_CNTL_CSR_RESET		FIELD32(0x00000002)
758c2ecf20Sopenharmony_ci#define MCU_CNTL_CSR_READY		FIELD32(0x00000004)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/*
788c2ecf20Sopenharmony_ci * SOFT_RESET_CSR
798c2ecf20Sopenharmony_ci * FORCE_CLOCK_ON: Host force MAC clock ON
808c2ecf20Sopenharmony_ci */
818c2ecf20Sopenharmony_ci#define SOFT_RESET_CSR			0x0010
828c2ecf20Sopenharmony_ci#define SOFT_RESET_CSR_FORCE_CLOCK_ON	FIELD32(0x00000002)
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci/*
858c2ecf20Sopenharmony_ci * MCU_INT_SOURCE_CSR: MCU interrupt source/mask register.
868c2ecf20Sopenharmony_ci */
878c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR		0x0014
888c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_0		FIELD32(0x00000001)
898c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_1		FIELD32(0x00000002)
908c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_2		FIELD32(0x00000004)
918c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_3		FIELD32(0x00000008)
928c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_4		FIELD32(0x00000010)
938c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_5		FIELD32(0x00000020)
948c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_6		FIELD32(0x00000040)
958c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_7		FIELD32(0x00000080)
968c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_TWAKEUP	FIELD32(0x00000100)
978c2ecf20Sopenharmony_ci#define MCU_INT_SOURCE_CSR_TBTT_EXPIRE	FIELD32(0x00000200)
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci/*
1008c2ecf20Sopenharmony_ci * MCU_INT_MASK_CSR: MCU interrupt source/mask register.
1018c2ecf20Sopenharmony_ci */
1028c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR		0x0018
1038c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_0		FIELD32(0x00000001)
1048c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_1		FIELD32(0x00000002)
1058c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_2		FIELD32(0x00000004)
1068c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_3		FIELD32(0x00000008)
1078c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_4		FIELD32(0x00000010)
1088c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_5		FIELD32(0x00000020)
1098c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_6		FIELD32(0x00000040)
1108c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_7		FIELD32(0x00000080)
1118c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_TWAKEUP	FIELD32(0x00000100)
1128c2ecf20Sopenharmony_ci#define MCU_INT_MASK_CSR_TBTT_EXPIRE	FIELD32(0x00000200)
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci/*
1158c2ecf20Sopenharmony_ci * PCI_USEC_CSR
1168c2ecf20Sopenharmony_ci */
1178c2ecf20Sopenharmony_ci#define PCI_USEC_CSR			0x001c
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci/*
1208c2ecf20Sopenharmony_ci * Security key table memory.
1218c2ecf20Sopenharmony_ci * 16 entries 32-byte for shared key table
1228c2ecf20Sopenharmony_ci * 64 entries 32-byte for pairwise key table
1238c2ecf20Sopenharmony_ci * 64 entries 8-byte for pairwise ta key table
1248c2ecf20Sopenharmony_ci */
1258c2ecf20Sopenharmony_ci#define SHARED_KEY_TABLE_BASE		0x1000
1268c2ecf20Sopenharmony_ci#define PAIRWISE_KEY_TABLE_BASE		0x1200
1278c2ecf20Sopenharmony_ci#define PAIRWISE_TA_TABLE_BASE		0x1a00
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#define SHARED_KEY_ENTRY(__idx) \
1308c2ecf20Sopenharmony_ci	(SHARED_KEY_TABLE_BASE + \
1318c2ecf20Sopenharmony_ci		((__idx) * sizeof(struct hw_key_entry)))
1328c2ecf20Sopenharmony_ci#define PAIRWISE_KEY_ENTRY(__idx) \
1338c2ecf20Sopenharmony_ci	(PAIRWISE_KEY_TABLE_BASE + \
1348c2ecf20Sopenharmony_ci		((__idx) * sizeof(struct hw_key_entry)))
1358c2ecf20Sopenharmony_ci#define PAIRWISE_TA_ENTRY(__idx) \
1368c2ecf20Sopenharmony_ci	(PAIRWISE_TA_TABLE_BASE + \
1378c2ecf20Sopenharmony_ci		((__idx) * sizeof(struct hw_pairwise_ta_entry)))
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_cistruct hw_key_entry {
1408c2ecf20Sopenharmony_ci	u8 key[16];
1418c2ecf20Sopenharmony_ci	u8 tx_mic[8];
1428c2ecf20Sopenharmony_ci	u8 rx_mic[8];
1438c2ecf20Sopenharmony_ci} __packed;
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_cistruct hw_pairwise_ta_entry {
1468c2ecf20Sopenharmony_ci	u8 address[6];
1478c2ecf20Sopenharmony_ci	u8 cipher;
1488c2ecf20Sopenharmony_ci	u8 reserved;
1498c2ecf20Sopenharmony_ci} __packed;
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci/*
1528c2ecf20Sopenharmony_ci * Other on-chip shared memory space.
1538c2ecf20Sopenharmony_ci */
1548c2ecf20Sopenharmony_ci#define HW_CIS_BASE			0x2000
1558c2ecf20Sopenharmony_ci#define HW_NULL_BASE			0x2b00
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/*
1588c2ecf20Sopenharmony_ci * Since NULL frame won't be that long (256 byte),
1598c2ecf20Sopenharmony_ci * We steal 16 tail bytes to save debugging settings.
1608c2ecf20Sopenharmony_ci */
1618c2ecf20Sopenharmony_ci#define HW_DEBUG_SETTING_BASE		0x2bf0
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci/*
1648c2ecf20Sopenharmony_ci * On-chip BEACON frame space.
1658c2ecf20Sopenharmony_ci */
1668c2ecf20Sopenharmony_ci#define HW_BEACON_BASE0			0x2c00
1678c2ecf20Sopenharmony_ci#define HW_BEACON_BASE1			0x2d00
1688c2ecf20Sopenharmony_ci#define HW_BEACON_BASE2			0x2e00
1698c2ecf20Sopenharmony_ci#define HW_BEACON_BASE3			0x2f00
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci#define HW_BEACON_OFFSET(__index) \
1728c2ecf20Sopenharmony_ci	(HW_BEACON_BASE0 + (__index * 0x0100))
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci/*
1758c2ecf20Sopenharmony_ci * HOST-MCU shared memory.
1768c2ecf20Sopenharmony_ci */
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci/*
1798c2ecf20Sopenharmony_ci * H2M_MAILBOX_CSR: Host-to-MCU Mailbox.
1808c2ecf20Sopenharmony_ci */
1818c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR			0x2100
1828c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR_ARG0		FIELD32(0x000000ff)
1838c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR_ARG1		FIELD32(0x0000ff00)
1848c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR_CMD_TOKEN	FIELD32(0x00ff0000)
1858c2ecf20Sopenharmony_ci#define H2M_MAILBOX_CSR_OWNER		FIELD32(0xff000000)
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci/*
1888c2ecf20Sopenharmony_ci * MCU_LEDCS: LED control for MCU Mailbox.
1898c2ecf20Sopenharmony_ci */
1908c2ecf20Sopenharmony_ci#define MCU_LEDCS_LED_MODE		FIELD16(0x001f)
1918c2ecf20Sopenharmony_ci#define MCU_LEDCS_RADIO_STATUS		FIELD16(0x0020)
1928c2ecf20Sopenharmony_ci#define MCU_LEDCS_LINK_BG_STATUS	FIELD16(0x0040)
1938c2ecf20Sopenharmony_ci#define MCU_LEDCS_LINK_A_STATUS		FIELD16(0x0080)
1948c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY_GPIO_0	FIELD16(0x0100)
1958c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY_GPIO_1	FIELD16(0x0200)
1968c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY_GPIO_2	FIELD16(0x0400)
1978c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY_GPIO_3	FIELD16(0x0800)
1988c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY_GPIO_4	FIELD16(0x1000)
1998c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY_ACT		FIELD16(0x2000)
2008c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY_READY_BG	FIELD16(0x4000)
2018c2ecf20Sopenharmony_ci#define MCU_LEDCS_POLARITY_READY_A	FIELD16(0x8000)
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci/*
2048c2ecf20Sopenharmony_ci * M2H_CMD_DONE_CSR.
2058c2ecf20Sopenharmony_ci */
2068c2ecf20Sopenharmony_ci#define M2H_CMD_DONE_CSR		0x2104
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci/*
2098c2ecf20Sopenharmony_ci * MCU_TXOP_ARRAY_BASE.
2108c2ecf20Sopenharmony_ci */
2118c2ecf20Sopenharmony_ci#define MCU_TXOP_ARRAY_BASE		0x2110
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci/*
2148c2ecf20Sopenharmony_ci * MAC Control/Status Registers(CSR).
2158c2ecf20Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us.
2168c2ecf20Sopenharmony_ci */
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci/*
2198c2ecf20Sopenharmony_ci * MAC_CSR0: ASIC revision number.
2208c2ecf20Sopenharmony_ci */
2218c2ecf20Sopenharmony_ci#define MAC_CSR0			0x3000
2228c2ecf20Sopenharmony_ci#define MAC_CSR0_REVISION		FIELD32(0x0000000f)
2238c2ecf20Sopenharmony_ci#define MAC_CSR0_CHIPSET		FIELD32(0x000ffff0)
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci/*
2268c2ecf20Sopenharmony_ci * MAC_CSR1: System control register.
2278c2ecf20Sopenharmony_ci * SOFT_RESET: Software reset bit, 1: reset, 0: normal.
2288c2ecf20Sopenharmony_ci * BBP_RESET: Hardware reset BBP.
2298c2ecf20Sopenharmony_ci * HOST_READY: Host is ready after initialization, 1: ready.
2308c2ecf20Sopenharmony_ci */
2318c2ecf20Sopenharmony_ci#define MAC_CSR1			0x3004
2328c2ecf20Sopenharmony_ci#define MAC_CSR1_SOFT_RESET		FIELD32(0x00000001)
2338c2ecf20Sopenharmony_ci#define MAC_CSR1_BBP_RESET		FIELD32(0x00000002)
2348c2ecf20Sopenharmony_ci#define MAC_CSR1_HOST_READY		FIELD32(0x00000004)
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci/*
2378c2ecf20Sopenharmony_ci * MAC_CSR2: STA MAC register 0.
2388c2ecf20Sopenharmony_ci */
2398c2ecf20Sopenharmony_ci#define MAC_CSR2			0x3008
2408c2ecf20Sopenharmony_ci#define MAC_CSR2_BYTE0			FIELD32(0x000000ff)
2418c2ecf20Sopenharmony_ci#define MAC_CSR2_BYTE1			FIELD32(0x0000ff00)
2428c2ecf20Sopenharmony_ci#define MAC_CSR2_BYTE2			FIELD32(0x00ff0000)
2438c2ecf20Sopenharmony_ci#define MAC_CSR2_BYTE3			FIELD32(0xff000000)
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci/*
2468c2ecf20Sopenharmony_ci * MAC_CSR3: STA MAC register 1.
2478c2ecf20Sopenharmony_ci * UNICAST_TO_ME_MASK:
2488c2ecf20Sopenharmony_ci *	Used to mask off bits from byte 5 of the MAC address
2498c2ecf20Sopenharmony_ci *	to determine the UNICAST_TO_ME bit for RX frames.
2508c2ecf20Sopenharmony_ci *	The full mask is complemented by BSS_ID_MASK:
2518c2ecf20Sopenharmony_ci *		MASK = BSS_ID_MASK & UNICAST_TO_ME_MASK
2528c2ecf20Sopenharmony_ci */
2538c2ecf20Sopenharmony_ci#define MAC_CSR3			0x300c
2548c2ecf20Sopenharmony_ci#define MAC_CSR3_BYTE4			FIELD32(0x000000ff)
2558c2ecf20Sopenharmony_ci#define MAC_CSR3_BYTE5			FIELD32(0x0000ff00)
2568c2ecf20Sopenharmony_ci#define MAC_CSR3_UNICAST_TO_ME_MASK	FIELD32(0x00ff0000)
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci/*
2598c2ecf20Sopenharmony_ci * MAC_CSR4: BSSID register 0.
2608c2ecf20Sopenharmony_ci */
2618c2ecf20Sopenharmony_ci#define MAC_CSR4			0x3010
2628c2ecf20Sopenharmony_ci#define MAC_CSR4_BYTE0			FIELD32(0x000000ff)
2638c2ecf20Sopenharmony_ci#define MAC_CSR4_BYTE1			FIELD32(0x0000ff00)
2648c2ecf20Sopenharmony_ci#define MAC_CSR4_BYTE2			FIELD32(0x00ff0000)
2658c2ecf20Sopenharmony_ci#define MAC_CSR4_BYTE3			FIELD32(0xff000000)
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci/*
2688c2ecf20Sopenharmony_ci * MAC_CSR5: BSSID register 1.
2698c2ecf20Sopenharmony_ci * BSS_ID_MASK:
2708c2ecf20Sopenharmony_ci *	This mask is used to mask off bits 0 and 1 of byte 5 of the
2718c2ecf20Sopenharmony_ci *	BSSID. This will make sure that those bits will be ignored
2728c2ecf20Sopenharmony_ci *	when determining the MY_BSS of RX frames.
2738c2ecf20Sopenharmony_ci *		0: 1-BSSID mode (BSS index = 0)
2748c2ecf20Sopenharmony_ci *		1: 2-BSSID mode (BSS index: Byte5, bit 0)
2758c2ecf20Sopenharmony_ci *		2: 2-BSSID mode (BSS index: byte5, bit 1)
2768c2ecf20Sopenharmony_ci *		3: 4-BSSID mode (BSS index: byte5, bit 0 - 1)
2778c2ecf20Sopenharmony_ci */
2788c2ecf20Sopenharmony_ci#define MAC_CSR5			0x3014
2798c2ecf20Sopenharmony_ci#define MAC_CSR5_BYTE4			FIELD32(0x000000ff)
2808c2ecf20Sopenharmony_ci#define MAC_CSR5_BYTE5			FIELD32(0x0000ff00)
2818c2ecf20Sopenharmony_ci#define MAC_CSR5_BSS_ID_MASK		FIELD32(0x00ff0000)
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci/*
2848c2ecf20Sopenharmony_ci * MAC_CSR6: Maximum frame length register.
2858c2ecf20Sopenharmony_ci */
2868c2ecf20Sopenharmony_ci#define MAC_CSR6			0x3018
2878c2ecf20Sopenharmony_ci#define MAC_CSR6_MAX_FRAME_UNIT		FIELD32(0x00000fff)
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci/*
2908c2ecf20Sopenharmony_ci * MAC_CSR7: Reserved
2918c2ecf20Sopenharmony_ci */
2928c2ecf20Sopenharmony_ci#define MAC_CSR7			0x301c
2938c2ecf20Sopenharmony_ci
2948c2ecf20Sopenharmony_ci/*
2958c2ecf20Sopenharmony_ci * MAC_CSR8: SIFS/EIFS register.
2968c2ecf20Sopenharmony_ci * All units are in US.
2978c2ecf20Sopenharmony_ci */
2988c2ecf20Sopenharmony_ci#define MAC_CSR8			0x3020
2998c2ecf20Sopenharmony_ci#define MAC_CSR8_SIFS			FIELD32(0x000000ff)
3008c2ecf20Sopenharmony_ci#define MAC_CSR8_SIFS_AFTER_RX_OFDM	FIELD32(0x0000ff00)
3018c2ecf20Sopenharmony_ci#define MAC_CSR8_EIFS			FIELD32(0xffff0000)
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci/*
3048c2ecf20Sopenharmony_ci * MAC_CSR9: Back-Off control register.
3058c2ecf20Sopenharmony_ci * SLOT_TIME: Slot time, default is 20us for 802.11BG.
3068c2ecf20Sopenharmony_ci * CWMIN: Bit for Cwmin. default Cwmin is 31 (2^5 - 1).
3078c2ecf20Sopenharmony_ci * CWMAX: Bit for Cwmax, default Cwmax is 1023 (2^10 - 1).
3088c2ecf20Sopenharmony_ci * CW_SELECT: 1: CWmin/Cwmax select from register, 0:select from TxD.
3098c2ecf20Sopenharmony_ci */
3108c2ecf20Sopenharmony_ci#define MAC_CSR9			0x3024
3118c2ecf20Sopenharmony_ci#define MAC_CSR9_SLOT_TIME		FIELD32(0x000000ff)
3128c2ecf20Sopenharmony_ci#define MAC_CSR9_CWMIN			FIELD32(0x00000f00)
3138c2ecf20Sopenharmony_ci#define MAC_CSR9_CWMAX			FIELD32(0x0000f000)
3148c2ecf20Sopenharmony_ci#define MAC_CSR9_CW_SELECT		FIELD32(0x00010000)
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci/*
3178c2ecf20Sopenharmony_ci * MAC_CSR10: Power state configuration.
3188c2ecf20Sopenharmony_ci */
3198c2ecf20Sopenharmony_ci#define MAC_CSR10			0x3028
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_ci/*
3228c2ecf20Sopenharmony_ci * MAC_CSR11: Power saving transition time register.
3238c2ecf20Sopenharmony_ci * DELAY_AFTER_TBCN: Delay after Tbcn expired in units of TU.
3248c2ecf20Sopenharmony_ci * TBCN_BEFORE_WAKEUP: Number of beacon before wakeup.
3258c2ecf20Sopenharmony_ci * WAKEUP_LATENCY: In unit of TU.
3268c2ecf20Sopenharmony_ci */
3278c2ecf20Sopenharmony_ci#define MAC_CSR11			0x302c
3288c2ecf20Sopenharmony_ci#define MAC_CSR11_DELAY_AFTER_TBCN	FIELD32(0x000000ff)
3298c2ecf20Sopenharmony_ci#define MAC_CSR11_TBCN_BEFORE_WAKEUP	FIELD32(0x00007f00)
3308c2ecf20Sopenharmony_ci#define MAC_CSR11_AUTOWAKE		FIELD32(0x00008000)
3318c2ecf20Sopenharmony_ci#define MAC_CSR11_WAKEUP_LATENCY	FIELD32(0x000f0000)
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci/*
3348c2ecf20Sopenharmony_ci * MAC_CSR12: Manual power control / status register (merge CSR20 & PWRCSR1).
3358c2ecf20Sopenharmony_ci * CURRENT_STATE: 0:sleep, 1:awake.
3368c2ecf20Sopenharmony_ci * FORCE_WAKEUP: This has higher priority than PUT_TO_SLEEP.
3378c2ecf20Sopenharmony_ci * BBP_CURRENT_STATE: 0: BBP sleep, 1: BBP awake.
3388c2ecf20Sopenharmony_ci */
3398c2ecf20Sopenharmony_ci#define MAC_CSR12			0x3030
3408c2ecf20Sopenharmony_ci#define MAC_CSR12_CURRENT_STATE		FIELD32(0x00000001)
3418c2ecf20Sopenharmony_ci#define MAC_CSR12_PUT_TO_SLEEP		FIELD32(0x00000002)
3428c2ecf20Sopenharmony_ci#define MAC_CSR12_FORCE_WAKEUP		FIELD32(0x00000004)
3438c2ecf20Sopenharmony_ci#define MAC_CSR12_BBP_CURRENT_STATE	FIELD32(0x00000008)
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ci/*
3468c2ecf20Sopenharmony_ci * MAC_CSR13: GPIO.
3478c2ecf20Sopenharmony_ci *	MAC_CSR13_VALx: GPIO value
3488c2ecf20Sopenharmony_ci *	MAC_CSR13_DIRx: GPIO direction: 0 = output; 1 = input
3498c2ecf20Sopenharmony_ci */
3508c2ecf20Sopenharmony_ci#define MAC_CSR13			0x3034
3518c2ecf20Sopenharmony_ci#define MAC_CSR13_VAL0			FIELD32(0x00000001)
3528c2ecf20Sopenharmony_ci#define MAC_CSR13_VAL1			FIELD32(0x00000002)
3538c2ecf20Sopenharmony_ci#define MAC_CSR13_VAL2			FIELD32(0x00000004)
3548c2ecf20Sopenharmony_ci#define MAC_CSR13_VAL3			FIELD32(0x00000008)
3558c2ecf20Sopenharmony_ci#define MAC_CSR13_VAL4			FIELD32(0x00000010)
3568c2ecf20Sopenharmony_ci#define MAC_CSR13_VAL5			FIELD32(0x00000020)
3578c2ecf20Sopenharmony_ci#define MAC_CSR13_DIR0			FIELD32(0x00000100)
3588c2ecf20Sopenharmony_ci#define MAC_CSR13_DIR1			FIELD32(0x00000200)
3598c2ecf20Sopenharmony_ci#define MAC_CSR13_DIR2			FIELD32(0x00000400)
3608c2ecf20Sopenharmony_ci#define MAC_CSR13_DIR3			FIELD32(0x00000800)
3618c2ecf20Sopenharmony_ci#define MAC_CSR13_DIR4			FIELD32(0x00001000)
3628c2ecf20Sopenharmony_ci#define MAC_CSR13_DIR5			FIELD32(0x00002000)
3638c2ecf20Sopenharmony_ci
3648c2ecf20Sopenharmony_ci/*
3658c2ecf20Sopenharmony_ci * MAC_CSR14: LED control register.
3668c2ecf20Sopenharmony_ci * ON_PERIOD: On period, default 70ms.
3678c2ecf20Sopenharmony_ci * OFF_PERIOD: Off period, default 30ms.
3688c2ecf20Sopenharmony_ci * HW_LED: HW TX activity, 1: normal OFF, 0: normal ON.
3698c2ecf20Sopenharmony_ci * SW_LED: s/w LED, 1: ON, 0: OFF.
3708c2ecf20Sopenharmony_ci * HW_LED_POLARITY: 0: active low, 1: active high.
3718c2ecf20Sopenharmony_ci */
3728c2ecf20Sopenharmony_ci#define MAC_CSR14			0x3038
3738c2ecf20Sopenharmony_ci#define MAC_CSR14_ON_PERIOD		FIELD32(0x000000ff)
3748c2ecf20Sopenharmony_ci#define MAC_CSR14_OFF_PERIOD		FIELD32(0x0000ff00)
3758c2ecf20Sopenharmony_ci#define MAC_CSR14_HW_LED		FIELD32(0x00010000)
3768c2ecf20Sopenharmony_ci#define MAC_CSR14_SW_LED		FIELD32(0x00020000)
3778c2ecf20Sopenharmony_ci#define MAC_CSR14_HW_LED_POLARITY	FIELD32(0x00040000)
3788c2ecf20Sopenharmony_ci#define MAC_CSR14_SW_LED2		FIELD32(0x00080000)
3798c2ecf20Sopenharmony_ci
3808c2ecf20Sopenharmony_ci/*
3818c2ecf20Sopenharmony_ci * MAC_CSR15: NAV control.
3828c2ecf20Sopenharmony_ci */
3838c2ecf20Sopenharmony_ci#define MAC_CSR15			0x303c
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_ci/*
3868c2ecf20Sopenharmony_ci * TXRX control registers.
3878c2ecf20Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us.
3888c2ecf20Sopenharmony_ci */
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_ci/*
3918c2ecf20Sopenharmony_ci * TXRX_CSR0: TX/RX configuration register.
3928c2ecf20Sopenharmony_ci * TSF_OFFSET: Default is 24.
3938c2ecf20Sopenharmony_ci * AUTO_TX_SEQ: 1: ASIC auto replace sequence nr in outgoing frame.
3948c2ecf20Sopenharmony_ci * DISABLE_RX: Disable Rx engine.
3958c2ecf20Sopenharmony_ci * DROP_CRC: Drop CRC error.
3968c2ecf20Sopenharmony_ci * DROP_PHYSICAL: Drop physical error.
3978c2ecf20Sopenharmony_ci * DROP_CONTROL: Drop control frame.
3988c2ecf20Sopenharmony_ci * DROP_NOT_TO_ME: Drop not to me unicast frame.
3998c2ecf20Sopenharmony_ci * DROP_TO_DS: Drop fram ToDs bit is true.
4008c2ecf20Sopenharmony_ci * DROP_VERSION_ERROR: Drop version error frame.
4018c2ecf20Sopenharmony_ci * DROP_MULTICAST: Drop multicast frames.
4028c2ecf20Sopenharmony_ci * DROP_BORADCAST: Drop broadcast frames.
4038c2ecf20Sopenharmony_ci * DROP_ACK_CTS: Drop received ACK and CTS.
4048c2ecf20Sopenharmony_ci */
4058c2ecf20Sopenharmony_ci#define TXRX_CSR0			0x3040
4068c2ecf20Sopenharmony_ci#define TXRX_CSR0_RX_ACK_TIMEOUT	FIELD32(0x000001ff)
4078c2ecf20Sopenharmony_ci#define TXRX_CSR0_TSF_OFFSET		FIELD32(0x00007e00)
4088c2ecf20Sopenharmony_ci#define TXRX_CSR0_AUTO_TX_SEQ		FIELD32(0x00008000)
4098c2ecf20Sopenharmony_ci#define TXRX_CSR0_DISABLE_RX		FIELD32(0x00010000)
4108c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_CRC		FIELD32(0x00020000)
4118c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_PHYSICAL		FIELD32(0x00040000)
4128c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_CONTROL		FIELD32(0x00080000)
4138c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_NOT_TO_ME	FIELD32(0x00100000)
4148c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_TO_DS		FIELD32(0x00200000)
4158c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_VERSION_ERROR	FIELD32(0x00400000)
4168c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_MULTICAST	FIELD32(0x00800000)
4178c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_BROADCAST	FIELD32(0x01000000)
4188c2ecf20Sopenharmony_ci#define TXRX_CSR0_DROP_ACK_CTS		FIELD32(0x02000000)
4198c2ecf20Sopenharmony_ci#define TXRX_CSR0_TX_WITHOUT_WAITING	FIELD32(0x04000000)
4208c2ecf20Sopenharmony_ci
4218c2ecf20Sopenharmony_ci/*
4228c2ecf20Sopenharmony_ci * TXRX_CSR1
4238c2ecf20Sopenharmony_ci */
4248c2ecf20Sopenharmony_ci#define TXRX_CSR1			0x3044
4258c2ecf20Sopenharmony_ci#define TXRX_CSR1_BBP_ID0		FIELD32(0x0000007f)
4268c2ecf20Sopenharmony_ci#define TXRX_CSR1_BBP_ID0_VALID		FIELD32(0x00000080)
4278c2ecf20Sopenharmony_ci#define TXRX_CSR1_BBP_ID1		FIELD32(0x00007f00)
4288c2ecf20Sopenharmony_ci#define TXRX_CSR1_BBP_ID1_VALID		FIELD32(0x00008000)
4298c2ecf20Sopenharmony_ci#define TXRX_CSR1_BBP_ID2		FIELD32(0x007f0000)
4308c2ecf20Sopenharmony_ci#define TXRX_CSR1_BBP_ID2_VALID		FIELD32(0x00800000)
4318c2ecf20Sopenharmony_ci#define TXRX_CSR1_BBP_ID3		FIELD32(0x7f000000)
4328c2ecf20Sopenharmony_ci#define TXRX_CSR1_BBP_ID3_VALID		FIELD32(0x80000000)
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci/*
4358c2ecf20Sopenharmony_ci * TXRX_CSR2
4368c2ecf20Sopenharmony_ci */
4378c2ecf20Sopenharmony_ci#define TXRX_CSR2			0x3048
4388c2ecf20Sopenharmony_ci#define TXRX_CSR2_BBP_ID0		FIELD32(0x0000007f)
4398c2ecf20Sopenharmony_ci#define TXRX_CSR2_BBP_ID0_VALID		FIELD32(0x00000080)
4408c2ecf20Sopenharmony_ci#define TXRX_CSR2_BBP_ID1		FIELD32(0x00007f00)
4418c2ecf20Sopenharmony_ci#define TXRX_CSR2_BBP_ID1_VALID		FIELD32(0x00008000)
4428c2ecf20Sopenharmony_ci#define TXRX_CSR2_BBP_ID2		FIELD32(0x007f0000)
4438c2ecf20Sopenharmony_ci#define TXRX_CSR2_BBP_ID2_VALID		FIELD32(0x00800000)
4448c2ecf20Sopenharmony_ci#define TXRX_CSR2_BBP_ID3		FIELD32(0x7f000000)
4458c2ecf20Sopenharmony_ci#define TXRX_CSR2_BBP_ID3_VALID		FIELD32(0x80000000)
4468c2ecf20Sopenharmony_ci
4478c2ecf20Sopenharmony_ci/*
4488c2ecf20Sopenharmony_ci * TXRX_CSR3
4498c2ecf20Sopenharmony_ci */
4508c2ecf20Sopenharmony_ci#define TXRX_CSR3			0x304c
4518c2ecf20Sopenharmony_ci#define TXRX_CSR3_BBP_ID0		FIELD32(0x0000007f)
4528c2ecf20Sopenharmony_ci#define TXRX_CSR3_BBP_ID0_VALID		FIELD32(0x00000080)
4538c2ecf20Sopenharmony_ci#define TXRX_CSR3_BBP_ID1		FIELD32(0x00007f00)
4548c2ecf20Sopenharmony_ci#define TXRX_CSR3_BBP_ID1_VALID		FIELD32(0x00008000)
4558c2ecf20Sopenharmony_ci#define TXRX_CSR3_BBP_ID2		FIELD32(0x007f0000)
4568c2ecf20Sopenharmony_ci#define TXRX_CSR3_BBP_ID2_VALID		FIELD32(0x00800000)
4578c2ecf20Sopenharmony_ci#define TXRX_CSR3_BBP_ID3		FIELD32(0x7f000000)
4588c2ecf20Sopenharmony_ci#define TXRX_CSR3_BBP_ID3_VALID		FIELD32(0x80000000)
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ci/*
4618c2ecf20Sopenharmony_ci * TXRX_CSR4: Auto-Responder/Tx-retry register.
4628c2ecf20Sopenharmony_ci * AUTORESPOND_PREAMBLE: 0:long, 1:short preamble.
4638c2ecf20Sopenharmony_ci * OFDM_TX_RATE_DOWN: 1:enable.
4648c2ecf20Sopenharmony_ci * OFDM_TX_RATE_STEP: 0:1-step, 1: 2-step, 2:3-step, 3:4-step.
4658c2ecf20Sopenharmony_ci * OFDM_TX_FALLBACK_CCK: 0: Fallback to OFDM 6M only, 1: Fallback to CCK 1M,2M.
4668c2ecf20Sopenharmony_ci */
4678c2ecf20Sopenharmony_ci#define TXRX_CSR4			0x3050
4688c2ecf20Sopenharmony_ci#define TXRX_CSR4_TX_ACK_TIMEOUT	FIELD32(0x000000ff)
4698c2ecf20Sopenharmony_ci#define TXRX_CSR4_CNTL_ACK_POLICY	FIELD32(0x00000700)
4708c2ecf20Sopenharmony_ci#define TXRX_CSR4_ACK_CTS_PSM		FIELD32(0x00010000)
4718c2ecf20Sopenharmony_ci#define TXRX_CSR4_AUTORESPOND_ENABLE	FIELD32(0x00020000)
4728c2ecf20Sopenharmony_ci#define TXRX_CSR4_AUTORESPOND_PREAMBLE	FIELD32(0x00040000)
4738c2ecf20Sopenharmony_ci#define TXRX_CSR4_OFDM_TX_RATE_DOWN	FIELD32(0x00080000)
4748c2ecf20Sopenharmony_ci#define TXRX_CSR4_OFDM_TX_RATE_STEP	FIELD32(0x00300000)
4758c2ecf20Sopenharmony_ci#define TXRX_CSR4_OFDM_TX_FALLBACK_CCK	FIELD32(0x00400000)
4768c2ecf20Sopenharmony_ci#define TXRX_CSR4_LONG_RETRY_LIMIT	FIELD32(0x0f000000)
4778c2ecf20Sopenharmony_ci#define TXRX_CSR4_SHORT_RETRY_LIMIT	FIELD32(0xf0000000)
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci/*
4808c2ecf20Sopenharmony_ci * TXRX_CSR5
4818c2ecf20Sopenharmony_ci */
4828c2ecf20Sopenharmony_ci#define TXRX_CSR5			0x3054
4838c2ecf20Sopenharmony_ci
4848c2ecf20Sopenharmony_ci/*
4858c2ecf20Sopenharmony_ci * TXRX_CSR6: ACK/CTS payload consumed time
4868c2ecf20Sopenharmony_ci */
4878c2ecf20Sopenharmony_ci#define TXRX_CSR6			0x3058
4888c2ecf20Sopenharmony_ci
4898c2ecf20Sopenharmony_ci/*
4908c2ecf20Sopenharmony_ci * TXRX_CSR7: OFDM ACK/CTS payload consumed time for 6/9/12/18 mbps.
4918c2ecf20Sopenharmony_ci */
4928c2ecf20Sopenharmony_ci#define TXRX_CSR7			0x305c
4938c2ecf20Sopenharmony_ci#define TXRX_CSR7_ACK_CTS_6MBS		FIELD32(0x000000ff)
4948c2ecf20Sopenharmony_ci#define TXRX_CSR7_ACK_CTS_9MBS		FIELD32(0x0000ff00)
4958c2ecf20Sopenharmony_ci#define TXRX_CSR7_ACK_CTS_12MBS		FIELD32(0x00ff0000)
4968c2ecf20Sopenharmony_ci#define TXRX_CSR7_ACK_CTS_18MBS		FIELD32(0xff000000)
4978c2ecf20Sopenharmony_ci
4988c2ecf20Sopenharmony_ci/*
4998c2ecf20Sopenharmony_ci * TXRX_CSR8: OFDM ACK/CTS payload consumed time for 24/36/48/54 mbps.
5008c2ecf20Sopenharmony_ci */
5018c2ecf20Sopenharmony_ci#define TXRX_CSR8			0x3060
5028c2ecf20Sopenharmony_ci#define TXRX_CSR8_ACK_CTS_24MBS		FIELD32(0x000000ff)
5038c2ecf20Sopenharmony_ci#define TXRX_CSR8_ACK_CTS_36MBS		FIELD32(0x0000ff00)
5048c2ecf20Sopenharmony_ci#define TXRX_CSR8_ACK_CTS_48MBS		FIELD32(0x00ff0000)
5058c2ecf20Sopenharmony_ci#define TXRX_CSR8_ACK_CTS_54MBS		FIELD32(0xff000000)
5068c2ecf20Sopenharmony_ci
5078c2ecf20Sopenharmony_ci/*
5088c2ecf20Sopenharmony_ci * TXRX_CSR9: Synchronization control register.
5098c2ecf20Sopenharmony_ci * BEACON_INTERVAL: In unit of 1/16 TU.
5108c2ecf20Sopenharmony_ci * TSF_TICKING: Enable TSF auto counting.
5118c2ecf20Sopenharmony_ci * TSF_SYNC: Tsf sync, 0: disable, 1: infra, 2: ad-hoc/master mode.
5128c2ecf20Sopenharmony_ci * BEACON_GEN: Enable beacon generator.
5138c2ecf20Sopenharmony_ci */
5148c2ecf20Sopenharmony_ci#define TXRX_CSR9			0x3064
5158c2ecf20Sopenharmony_ci#define TXRX_CSR9_BEACON_INTERVAL	FIELD32(0x0000ffff)
5168c2ecf20Sopenharmony_ci#define TXRX_CSR9_TSF_TICKING		FIELD32(0x00010000)
5178c2ecf20Sopenharmony_ci#define TXRX_CSR9_TSF_SYNC		FIELD32(0x00060000)
5188c2ecf20Sopenharmony_ci#define TXRX_CSR9_TBTT_ENABLE		FIELD32(0x00080000)
5198c2ecf20Sopenharmony_ci#define TXRX_CSR9_BEACON_GEN		FIELD32(0x00100000)
5208c2ecf20Sopenharmony_ci#define TXRX_CSR9_TIMESTAMP_COMPENSATE	FIELD32(0xff000000)
5218c2ecf20Sopenharmony_ci
5228c2ecf20Sopenharmony_ci/*
5238c2ecf20Sopenharmony_ci * TXRX_CSR10: BEACON alignment.
5248c2ecf20Sopenharmony_ci */
5258c2ecf20Sopenharmony_ci#define TXRX_CSR10			0x3068
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci/*
5288c2ecf20Sopenharmony_ci * TXRX_CSR11: AES mask.
5298c2ecf20Sopenharmony_ci */
5308c2ecf20Sopenharmony_ci#define TXRX_CSR11			0x306c
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_ci/*
5338c2ecf20Sopenharmony_ci * TXRX_CSR12: TSF low 32.
5348c2ecf20Sopenharmony_ci */
5358c2ecf20Sopenharmony_ci#define TXRX_CSR12			0x3070
5368c2ecf20Sopenharmony_ci#define TXRX_CSR12_LOW_TSFTIMER		FIELD32(0xffffffff)
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci/*
5398c2ecf20Sopenharmony_ci * TXRX_CSR13: TSF high 32.
5408c2ecf20Sopenharmony_ci */
5418c2ecf20Sopenharmony_ci#define TXRX_CSR13			0x3074
5428c2ecf20Sopenharmony_ci#define TXRX_CSR13_HIGH_TSFTIMER	FIELD32(0xffffffff)
5438c2ecf20Sopenharmony_ci
5448c2ecf20Sopenharmony_ci/*
5458c2ecf20Sopenharmony_ci * TXRX_CSR14: TBTT timer.
5468c2ecf20Sopenharmony_ci */
5478c2ecf20Sopenharmony_ci#define TXRX_CSR14			0x3078
5488c2ecf20Sopenharmony_ci
5498c2ecf20Sopenharmony_ci/*
5508c2ecf20Sopenharmony_ci * TXRX_CSR15: TKIP MIC priority byte "AND" mask.
5518c2ecf20Sopenharmony_ci */
5528c2ecf20Sopenharmony_ci#define TXRX_CSR15			0x307c
5538c2ecf20Sopenharmony_ci
5548c2ecf20Sopenharmony_ci/*
5558c2ecf20Sopenharmony_ci * PHY control registers.
5568c2ecf20Sopenharmony_ci * Some values are set in TU, whereas 1 TU == 1024 us.
5578c2ecf20Sopenharmony_ci */
5588c2ecf20Sopenharmony_ci
5598c2ecf20Sopenharmony_ci/*
5608c2ecf20Sopenharmony_ci * PHY_CSR0: RF/PS control.
5618c2ecf20Sopenharmony_ci */
5628c2ecf20Sopenharmony_ci#define PHY_CSR0			0x3080
5638c2ecf20Sopenharmony_ci#define PHY_CSR0_PA_PE_BG		FIELD32(0x00010000)
5648c2ecf20Sopenharmony_ci#define PHY_CSR0_PA_PE_A		FIELD32(0x00020000)
5658c2ecf20Sopenharmony_ci
5668c2ecf20Sopenharmony_ci/*
5678c2ecf20Sopenharmony_ci * PHY_CSR1
5688c2ecf20Sopenharmony_ci */
5698c2ecf20Sopenharmony_ci#define PHY_CSR1			0x3084
5708c2ecf20Sopenharmony_ci
5718c2ecf20Sopenharmony_ci/*
5728c2ecf20Sopenharmony_ci * PHY_CSR2: Pre-TX BBP control.
5738c2ecf20Sopenharmony_ci */
5748c2ecf20Sopenharmony_ci#define PHY_CSR2			0x3088
5758c2ecf20Sopenharmony_ci
5768c2ecf20Sopenharmony_ci/*
5778c2ecf20Sopenharmony_ci * PHY_CSR3: BBP serial control register.
5788c2ecf20Sopenharmony_ci * VALUE: Register value to program into BBP.
5798c2ecf20Sopenharmony_ci * REG_NUM: Selected BBP register.
5808c2ecf20Sopenharmony_ci * READ_CONTROL: 0: Write BBP, 1: Read BBP.
5818c2ecf20Sopenharmony_ci * BUSY: 1: ASIC is busy execute BBP programming.
5828c2ecf20Sopenharmony_ci */
5838c2ecf20Sopenharmony_ci#define PHY_CSR3			0x308c
5848c2ecf20Sopenharmony_ci#define PHY_CSR3_VALUE			FIELD32(0x000000ff)
5858c2ecf20Sopenharmony_ci#define PHY_CSR3_REGNUM			FIELD32(0x00007f00)
5868c2ecf20Sopenharmony_ci#define PHY_CSR3_READ_CONTROL		FIELD32(0x00008000)
5878c2ecf20Sopenharmony_ci#define PHY_CSR3_BUSY			FIELD32(0x00010000)
5888c2ecf20Sopenharmony_ci
5898c2ecf20Sopenharmony_ci/*
5908c2ecf20Sopenharmony_ci * PHY_CSR4: RF serial control register
5918c2ecf20Sopenharmony_ci * VALUE: Register value (include register id) serial out to RF/IF chip.
5928c2ecf20Sopenharmony_ci * NUMBER_OF_BITS: Number of bits used in RFRegValue (I:20, RFMD:22).
5938c2ecf20Sopenharmony_ci * IF_SELECT: 1: select IF to program, 0: select RF to program.
5948c2ecf20Sopenharmony_ci * PLL_LD: RF PLL_LD status.
5958c2ecf20Sopenharmony_ci * BUSY: 1: ASIC is busy execute RF programming.
5968c2ecf20Sopenharmony_ci */
5978c2ecf20Sopenharmony_ci#define PHY_CSR4			0x3090
5988c2ecf20Sopenharmony_ci#define PHY_CSR4_VALUE			FIELD32(0x00ffffff)
5998c2ecf20Sopenharmony_ci#define PHY_CSR4_NUMBER_OF_BITS		FIELD32(0x1f000000)
6008c2ecf20Sopenharmony_ci#define PHY_CSR4_IF_SELECT		FIELD32(0x20000000)
6018c2ecf20Sopenharmony_ci#define PHY_CSR4_PLL_LD			FIELD32(0x40000000)
6028c2ecf20Sopenharmony_ci#define PHY_CSR4_BUSY			FIELD32(0x80000000)
6038c2ecf20Sopenharmony_ci
6048c2ecf20Sopenharmony_ci/*
6058c2ecf20Sopenharmony_ci * PHY_CSR5: RX to TX signal switch timing control.
6068c2ecf20Sopenharmony_ci */
6078c2ecf20Sopenharmony_ci#define PHY_CSR5			0x3094
6088c2ecf20Sopenharmony_ci#define PHY_CSR5_IQ_FLIP		FIELD32(0x00000004)
6098c2ecf20Sopenharmony_ci
6108c2ecf20Sopenharmony_ci/*
6118c2ecf20Sopenharmony_ci * PHY_CSR6: TX to RX signal timing control.
6128c2ecf20Sopenharmony_ci */
6138c2ecf20Sopenharmony_ci#define PHY_CSR6			0x3098
6148c2ecf20Sopenharmony_ci#define PHY_CSR6_IQ_FLIP		FIELD32(0x00000004)
6158c2ecf20Sopenharmony_ci
6168c2ecf20Sopenharmony_ci/*
6178c2ecf20Sopenharmony_ci * PHY_CSR7: TX DAC switching timing control.
6188c2ecf20Sopenharmony_ci */
6198c2ecf20Sopenharmony_ci#define PHY_CSR7			0x309c
6208c2ecf20Sopenharmony_ci
6218c2ecf20Sopenharmony_ci/*
6228c2ecf20Sopenharmony_ci * Security control register.
6238c2ecf20Sopenharmony_ci */
6248c2ecf20Sopenharmony_ci
6258c2ecf20Sopenharmony_ci/*
6268c2ecf20Sopenharmony_ci * SEC_CSR0: Shared key table control.
6278c2ecf20Sopenharmony_ci */
6288c2ecf20Sopenharmony_ci#define SEC_CSR0			0x30a0
6298c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS0_KEY0_VALID	FIELD32(0x00000001)
6308c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS0_KEY1_VALID	FIELD32(0x00000002)
6318c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS0_KEY2_VALID	FIELD32(0x00000004)
6328c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS0_KEY3_VALID	FIELD32(0x00000008)
6338c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS1_KEY0_VALID	FIELD32(0x00000010)
6348c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS1_KEY1_VALID	FIELD32(0x00000020)
6358c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS1_KEY2_VALID	FIELD32(0x00000040)
6368c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS1_KEY3_VALID	FIELD32(0x00000080)
6378c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS2_KEY0_VALID	FIELD32(0x00000100)
6388c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS2_KEY1_VALID	FIELD32(0x00000200)
6398c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS2_KEY2_VALID	FIELD32(0x00000400)
6408c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS2_KEY3_VALID	FIELD32(0x00000800)
6418c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS3_KEY0_VALID	FIELD32(0x00001000)
6428c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS3_KEY1_VALID	FIELD32(0x00002000)
6438c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS3_KEY2_VALID	FIELD32(0x00004000)
6448c2ecf20Sopenharmony_ci#define SEC_CSR0_BSS3_KEY3_VALID	FIELD32(0x00008000)
6458c2ecf20Sopenharmony_ci
6468c2ecf20Sopenharmony_ci/*
6478c2ecf20Sopenharmony_ci * SEC_CSR1: Shared key table security mode register.
6488c2ecf20Sopenharmony_ci */
6498c2ecf20Sopenharmony_ci#define SEC_CSR1			0x30a4
6508c2ecf20Sopenharmony_ci#define SEC_CSR1_BSS0_KEY0_CIPHER_ALG	FIELD32(0x00000007)
6518c2ecf20Sopenharmony_ci#define SEC_CSR1_BSS0_KEY1_CIPHER_ALG	FIELD32(0x00000070)
6528c2ecf20Sopenharmony_ci#define SEC_CSR1_BSS0_KEY2_CIPHER_ALG	FIELD32(0x00000700)
6538c2ecf20Sopenharmony_ci#define SEC_CSR1_BSS0_KEY3_CIPHER_ALG	FIELD32(0x00007000)
6548c2ecf20Sopenharmony_ci#define SEC_CSR1_BSS1_KEY0_CIPHER_ALG	FIELD32(0x00070000)
6558c2ecf20Sopenharmony_ci#define SEC_CSR1_BSS1_KEY1_CIPHER_ALG	FIELD32(0x00700000)
6568c2ecf20Sopenharmony_ci#define SEC_CSR1_BSS1_KEY2_CIPHER_ALG	FIELD32(0x07000000)
6578c2ecf20Sopenharmony_ci#define SEC_CSR1_BSS1_KEY3_CIPHER_ALG	FIELD32(0x70000000)
6588c2ecf20Sopenharmony_ci
6598c2ecf20Sopenharmony_ci/*
6608c2ecf20Sopenharmony_ci * Pairwise key table valid bitmap registers.
6618c2ecf20Sopenharmony_ci * SEC_CSR2: pairwise key table valid bitmap 0.
6628c2ecf20Sopenharmony_ci * SEC_CSR3: pairwise key table valid bitmap 1.
6638c2ecf20Sopenharmony_ci */
6648c2ecf20Sopenharmony_ci#define SEC_CSR2			0x30a8
6658c2ecf20Sopenharmony_ci#define SEC_CSR3			0x30ac
6668c2ecf20Sopenharmony_ci
6678c2ecf20Sopenharmony_ci/*
6688c2ecf20Sopenharmony_ci * SEC_CSR4: Pairwise key table lookup control.
6698c2ecf20Sopenharmony_ci */
6708c2ecf20Sopenharmony_ci#define SEC_CSR4			0x30b0
6718c2ecf20Sopenharmony_ci#define SEC_CSR4_ENABLE_BSS0		FIELD32(0x00000001)
6728c2ecf20Sopenharmony_ci#define SEC_CSR4_ENABLE_BSS1		FIELD32(0x00000002)
6738c2ecf20Sopenharmony_ci#define SEC_CSR4_ENABLE_BSS2		FIELD32(0x00000004)
6748c2ecf20Sopenharmony_ci#define SEC_CSR4_ENABLE_BSS3		FIELD32(0x00000008)
6758c2ecf20Sopenharmony_ci
6768c2ecf20Sopenharmony_ci/*
6778c2ecf20Sopenharmony_ci * SEC_CSR5: shared key table security mode register.
6788c2ecf20Sopenharmony_ci */
6798c2ecf20Sopenharmony_ci#define SEC_CSR5			0x30b4
6808c2ecf20Sopenharmony_ci#define SEC_CSR5_BSS2_KEY0_CIPHER_ALG	FIELD32(0x00000007)
6818c2ecf20Sopenharmony_ci#define SEC_CSR5_BSS2_KEY1_CIPHER_ALG	FIELD32(0x00000070)
6828c2ecf20Sopenharmony_ci#define SEC_CSR5_BSS2_KEY2_CIPHER_ALG	FIELD32(0x00000700)
6838c2ecf20Sopenharmony_ci#define SEC_CSR5_BSS2_KEY3_CIPHER_ALG	FIELD32(0x00007000)
6848c2ecf20Sopenharmony_ci#define SEC_CSR5_BSS3_KEY0_CIPHER_ALG	FIELD32(0x00070000)
6858c2ecf20Sopenharmony_ci#define SEC_CSR5_BSS3_KEY1_CIPHER_ALG	FIELD32(0x00700000)
6868c2ecf20Sopenharmony_ci#define SEC_CSR5_BSS3_KEY2_CIPHER_ALG	FIELD32(0x07000000)
6878c2ecf20Sopenharmony_ci#define SEC_CSR5_BSS3_KEY3_CIPHER_ALG	FIELD32(0x70000000)
6888c2ecf20Sopenharmony_ci
6898c2ecf20Sopenharmony_ci/*
6908c2ecf20Sopenharmony_ci * STA control registers.
6918c2ecf20Sopenharmony_ci */
6928c2ecf20Sopenharmony_ci
6938c2ecf20Sopenharmony_ci/*
6948c2ecf20Sopenharmony_ci * STA_CSR0: RX PLCP error count & RX FCS error count.
6958c2ecf20Sopenharmony_ci */
6968c2ecf20Sopenharmony_ci#define STA_CSR0			0x30c0
6978c2ecf20Sopenharmony_ci#define STA_CSR0_FCS_ERROR		FIELD32(0x0000ffff)
6988c2ecf20Sopenharmony_ci#define STA_CSR0_PLCP_ERROR		FIELD32(0xffff0000)
6998c2ecf20Sopenharmony_ci
7008c2ecf20Sopenharmony_ci/*
7018c2ecf20Sopenharmony_ci * STA_CSR1: RX False CCA count & RX LONG frame count.
7028c2ecf20Sopenharmony_ci */
7038c2ecf20Sopenharmony_ci#define STA_CSR1			0x30c4
7048c2ecf20Sopenharmony_ci#define STA_CSR1_PHYSICAL_ERROR		FIELD32(0x0000ffff)
7058c2ecf20Sopenharmony_ci#define STA_CSR1_FALSE_CCA_ERROR	FIELD32(0xffff0000)
7068c2ecf20Sopenharmony_ci
7078c2ecf20Sopenharmony_ci/*
7088c2ecf20Sopenharmony_ci * STA_CSR2: TX Beacon count and RX FIFO overflow count.
7098c2ecf20Sopenharmony_ci */
7108c2ecf20Sopenharmony_ci#define STA_CSR2			0x30c8
7118c2ecf20Sopenharmony_ci#define STA_CSR2_RX_FIFO_OVERFLOW_COUNT	FIELD32(0x0000ffff)
7128c2ecf20Sopenharmony_ci#define STA_CSR2_RX_OVERFLOW_COUNT	FIELD32(0xffff0000)
7138c2ecf20Sopenharmony_ci
7148c2ecf20Sopenharmony_ci/*
7158c2ecf20Sopenharmony_ci * STA_CSR3: TX Beacon count.
7168c2ecf20Sopenharmony_ci */
7178c2ecf20Sopenharmony_ci#define STA_CSR3			0x30cc
7188c2ecf20Sopenharmony_ci#define STA_CSR3_TX_BEACON_COUNT	FIELD32(0x0000ffff)
7198c2ecf20Sopenharmony_ci
7208c2ecf20Sopenharmony_ci/*
7218c2ecf20Sopenharmony_ci * STA_CSR4: TX Result status register.
7228c2ecf20Sopenharmony_ci * VALID: 1:This register contains a valid TX result.
7238c2ecf20Sopenharmony_ci */
7248c2ecf20Sopenharmony_ci#define STA_CSR4			0x30d0
7258c2ecf20Sopenharmony_ci#define STA_CSR4_VALID			FIELD32(0x00000001)
7268c2ecf20Sopenharmony_ci#define STA_CSR4_TX_RESULT		FIELD32(0x0000000e)
7278c2ecf20Sopenharmony_ci#define STA_CSR4_RETRY_COUNT		FIELD32(0x000000f0)
7288c2ecf20Sopenharmony_ci#define STA_CSR4_PID_SUBTYPE		FIELD32(0x00001f00)
7298c2ecf20Sopenharmony_ci#define STA_CSR4_PID_TYPE		FIELD32(0x0000e000)
7308c2ecf20Sopenharmony_ci#define STA_CSR4_TXRATE			FIELD32(0x000f0000)
7318c2ecf20Sopenharmony_ci
7328c2ecf20Sopenharmony_ci/*
7338c2ecf20Sopenharmony_ci * QOS control registers.
7348c2ecf20Sopenharmony_ci */
7358c2ecf20Sopenharmony_ci
7368c2ecf20Sopenharmony_ci/*
7378c2ecf20Sopenharmony_ci * QOS_CSR0: TXOP holder MAC address register.
7388c2ecf20Sopenharmony_ci */
7398c2ecf20Sopenharmony_ci#define QOS_CSR0			0x30e0
7408c2ecf20Sopenharmony_ci#define QOS_CSR0_BYTE0			FIELD32(0x000000ff)
7418c2ecf20Sopenharmony_ci#define QOS_CSR0_BYTE1			FIELD32(0x0000ff00)
7428c2ecf20Sopenharmony_ci#define QOS_CSR0_BYTE2			FIELD32(0x00ff0000)
7438c2ecf20Sopenharmony_ci#define QOS_CSR0_BYTE3			FIELD32(0xff000000)
7448c2ecf20Sopenharmony_ci
7458c2ecf20Sopenharmony_ci/*
7468c2ecf20Sopenharmony_ci * QOS_CSR1: TXOP holder MAC address register.
7478c2ecf20Sopenharmony_ci */
7488c2ecf20Sopenharmony_ci#define QOS_CSR1			0x30e4
7498c2ecf20Sopenharmony_ci#define QOS_CSR1_BYTE4			FIELD32(0x000000ff)
7508c2ecf20Sopenharmony_ci#define QOS_CSR1_BYTE5			FIELD32(0x0000ff00)
7518c2ecf20Sopenharmony_ci
7528c2ecf20Sopenharmony_ci/*
7538c2ecf20Sopenharmony_ci * QOS_CSR2: TXOP holder timeout register.
7548c2ecf20Sopenharmony_ci */
7558c2ecf20Sopenharmony_ci#define QOS_CSR2			0x30e8
7568c2ecf20Sopenharmony_ci
7578c2ecf20Sopenharmony_ci/*
7588c2ecf20Sopenharmony_ci * RX QOS-CFPOLL MAC address register.
7598c2ecf20Sopenharmony_ci * QOS_CSR3: RX QOS-CFPOLL MAC address 0.
7608c2ecf20Sopenharmony_ci * QOS_CSR4: RX QOS-CFPOLL MAC address 1.
7618c2ecf20Sopenharmony_ci */
7628c2ecf20Sopenharmony_ci#define QOS_CSR3			0x30ec
7638c2ecf20Sopenharmony_ci#define QOS_CSR4			0x30f0
7648c2ecf20Sopenharmony_ci
7658c2ecf20Sopenharmony_ci/*
7668c2ecf20Sopenharmony_ci * QOS_CSR5: "QosControl" field of the RX QOS-CFPOLL.
7678c2ecf20Sopenharmony_ci */
7688c2ecf20Sopenharmony_ci#define QOS_CSR5			0x30f4
7698c2ecf20Sopenharmony_ci
7708c2ecf20Sopenharmony_ci/*
7718c2ecf20Sopenharmony_ci * Host DMA registers.
7728c2ecf20Sopenharmony_ci */
7738c2ecf20Sopenharmony_ci
7748c2ecf20Sopenharmony_ci/*
7758c2ecf20Sopenharmony_ci * AC0_BASE_CSR: AC_VO base address.
7768c2ecf20Sopenharmony_ci */
7778c2ecf20Sopenharmony_ci#define AC0_BASE_CSR			0x3400
7788c2ecf20Sopenharmony_ci#define AC0_BASE_CSR_RING_REGISTER	FIELD32(0xffffffff)
7798c2ecf20Sopenharmony_ci
7808c2ecf20Sopenharmony_ci/*
7818c2ecf20Sopenharmony_ci * AC1_BASE_CSR: AC_VI base address.
7828c2ecf20Sopenharmony_ci */
7838c2ecf20Sopenharmony_ci#define AC1_BASE_CSR			0x3404
7848c2ecf20Sopenharmony_ci#define AC1_BASE_CSR_RING_REGISTER	FIELD32(0xffffffff)
7858c2ecf20Sopenharmony_ci
7868c2ecf20Sopenharmony_ci/*
7878c2ecf20Sopenharmony_ci * AC2_BASE_CSR: AC_BE base address.
7888c2ecf20Sopenharmony_ci */
7898c2ecf20Sopenharmony_ci#define AC2_BASE_CSR			0x3408
7908c2ecf20Sopenharmony_ci#define AC2_BASE_CSR_RING_REGISTER	FIELD32(0xffffffff)
7918c2ecf20Sopenharmony_ci
7928c2ecf20Sopenharmony_ci/*
7938c2ecf20Sopenharmony_ci * AC3_BASE_CSR: AC_BK base address.
7948c2ecf20Sopenharmony_ci */
7958c2ecf20Sopenharmony_ci#define AC3_BASE_CSR			0x340c
7968c2ecf20Sopenharmony_ci#define AC3_BASE_CSR_RING_REGISTER	FIELD32(0xffffffff)
7978c2ecf20Sopenharmony_ci
7988c2ecf20Sopenharmony_ci/*
7998c2ecf20Sopenharmony_ci * MGMT_BASE_CSR: MGMT ring base address.
8008c2ecf20Sopenharmony_ci */
8018c2ecf20Sopenharmony_ci#define MGMT_BASE_CSR			0x3410
8028c2ecf20Sopenharmony_ci#define MGMT_BASE_CSR_RING_REGISTER	FIELD32(0xffffffff)
8038c2ecf20Sopenharmony_ci
8048c2ecf20Sopenharmony_ci/*
8058c2ecf20Sopenharmony_ci * TX_RING_CSR0: TX Ring size for AC_VO, AC_VI, AC_BE, AC_BK.
8068c2ecf20Sopenharmony_ci */
8078c2ecf20Sopenharmony_ci#define TX_RING_CSR0			0x3418
8088c2ecf20Sopenharmony_ci#define TX_RING_CSR0_AC0_RING_SIZE	FIELD32(0x000000ff)
8098c2ecf20Sopenharmony_ci#define TX_RING_CSR0_AC1_RING_SIZE	FIELD32(0x0000ff00)
8108c2ecf20Sopenharmony_ci#define TX_RING_CSR0_AC2_RING_SIZE	FIELD32(0x00ff0000)
8118c2ecf20Sopenharmony_ci#define TX_RING_CSR0_AC3_RING_SIZE	FIELD32(0xff000000)
8128c2ecf20Sopenharmony_ci
8138c2ecf20Sopenharmony_ci/*
8148c2ecf20Sopenharmony_ci * TX_RING_CSR1: TX Ring size for MGMT Ring, HCCA Ring
8158c2ecf20Sopenharmony_ci * TXD_SIZE: In unit of 32-bit.
8168c2ecf20Sopenharmony_ci */
8178c2ecf20Sopenharmony_ci#define TX_RING_CSR1			0x341c
8188c2ecf20Sopenharmony_ci#define TX_RING_CSR1_MGMT_RING_SIZE	FIELD32(0x000000ff)
8198c2ecf20Sopenharmony_ci#define TX_RING_CSR1_HCCA_RING_SIZE	FIELD32(0x0000ff00)
8208c2ecf20Sopenharmony_ci#define TX_RING_CSR1_TXD_SIZE		FIELD32(0x003f0000)
8218c2ecf20Sopenharmony_ci
8228c2ecf20Sopenharmony_ci/*
8238c2ecf20Sopenharmony_ci * AIFSN_CSR: AIFSN for each EDCA AC.
8248c2ecf20Sopenharmony_ci * AIFSN0: For AC_VO.
8258c2ecf20Sopenharmony_ci * AIFSN1: For AC_VI.
8268c2ecf20Sopenharmony_ci * AIFSN2: For AC_BE.
8278c2ecf20Sopenharmony_ci * AIFSN3: For AC_BK.
8288c2ecf20Sopenharmony_ci */
8298c2ecf20Sopenharmony_ci#define AIFSN_CSR			0x3420
8308c2ecf20Sopenharmony_ci#define AIFSN_CSR_AIFSN0		FIELD32(0x0000000f)
8318c2ecf20Sopenharmony_ci#define AIFSN_CSR_AIFSN1		FIELD32(0x000000f0)
8328c2ecf20Sopenharmony_ci#define AIFSN_CSR_AIFSN2		FIELD32(0x00000f00)
8338c2ecf20Sopenharmony_ci#define AIFSN_CSR_AIFSN3		FIELD32(0x0000f000)
8348c2ecf20Sopenharmony_ci
8358c2ecf20Sopenharmony_ci/*
8368c2ecf20Sopenharmony_ci * CWMIN_CSR: CWmin for each EDCA AC.
8378c2ecf20Sopenharmony_ci * CWMIN0: For AC_VO.
8388c2ecf20Sopenharmony_ci * CWMIN1: For AC_VI.
8398c2ecf20Sopenharmony_ci * CWMIN2: For AC_BE.
8408c2ecf20Sopenharmony_ci * CWMIN3: For AC_BK.
8418c2ecf20Sopenharmony_ci */
8428c2ecf20Sopenharmony_ci#define CWMIN_CSR			0x3424
8438c2ecf20Sopenharmony_ci#define CWMIN_CSR_CWMIN0		FIELD32(0x0000000f)
8448c2ecf20Sopenharmony_ci#define CWMIN_CSR_CWMIN1		FIELD32(0x000000f0)
8458c2ecf20Sopenharmony_ci#define CWMIN_CSR_CWMIN2		FIELD32(0x00000f00)
8468c2ecf20Sopenharmony_ci#define CWMIN_CSR_CWMIN3		FIELD32(0x0000f000)
8478c2ecf20Sopenharmony_ci
8488c2ecf20Sopenharmony_ci/*
8498c2ecf20Sopenharmony_ci * CWMAX_CSR: CWmax for each EDCA AC.
8508c2ecf20Sopenharmony_ci * CWMAX0: For AC_VO.
8518c2ecf20Sopenharmony_ci * CWMAX1: For AC_VI.
8528c2ecf20Sopenharmony_ci * CWMAX2: For AC_BE.
8538c2ecf20Sopenharmony_ci * CWMAX3: For AC_BK.
8548c2ecf20Sopenharmony_ci */
8558c2ecf20Sopenharmony_ci#define CWMAX_CSR			0x3428
8568c2ecf20Sopenharmony_ci#define CWMAX_CSR_CWMAX0		FIELD32(0x0000000f)
8578c2ecf20Sopenharmony_ci#define CWMAX_CSR_CWMAX1		FIELD32(0x000000f0)
8588c2ecf20Sopenharmony_ci#define CWMAX_CSR_CWMAX2		FIELD32(0x00000f00)
8598c2ecf20Sopenharmony_ci#define CWMAX_CSR_CWMAX3		FIELD32(0x0000f000)
8608c2ecf20Sopenharmony_ci
8618c2ecf20Sopenharmony_ci/*
8628c2ecf20Sopenharmony_ci * TX_DMA_DST_CSR: TX DMA destination
8638c2ecf20Sopenharmony_ci * 0: TX ring0, 1: TX ring1, 2: TX ring2 3: invalid
8648c2ecf20Sopenharmony_ci */
8658c2ecf20Sopenharmony_ci#define TX_DMA_DST_CSR			0x342c
8668c2ecf20Sopenharmony_ci#define TX_DMA_DST_CSR_DEST_AC0		FIELD32(0x00000003)
8678c2ecf20Sopenharmony_ci#define TX_DMA_DST_CSR_DEST_AC1		FIELD32(0x0000000c)
8688c2ecf20Sopenharmony_ci#define TX_DMA_DST_CSR_DEST_AC2		FIELD32(0x00000030)
8698c2ecf20Sopenharmony_ci#define TX_DMA_DST_CSR_DEST_AC3		FIELD32(0x000000c0)
8708c2ecf20Sopenharmony_ci#define TX_DMA_DST_CSR_DEST_MGMT	FIELD32(0x00000300)
8718c2ecf20Sopenharmony_ci
8728c2ecf20Sopenharmony_ci/*
8738c2ecf20Sopenharmony_ci * TX_CNTL_CSR: KICK/Abort TX.
8748c2ecf20Sopenharmony_ci * KICK_TX_AC0: For AC_VO.
8758c2ecf20Sopenharmony_ci * KICK_TX_AC1: For AC_VI.
8768c2ecf20Sopenharmony_ci * KICK_TX_AC2: For AC_BE.
8778c2ecf20Sopenharmony_ci * KICK_TX_AC3: For AC_BK.
8788c2ecf20Sopenharmony_ci * ABORT_TX_AC0: For AC_VO.
8798c2ecf20Sopenharmony_ci * ABORT_TX_AC1: For AC_VI.
8808c2ecf20Sopenharmony_ci * ABORT_TX_AC2: For AC_BE.
8818c2ecf20Sopenharmony_ci * ABORT_TX_AC3: For AC_BK.
8828c2ecf20Sopenharmony_ci */
8838c2ecf20Sopenharmony_ci#define TX_CNTL_CSR			0x3430
8848c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_KICK_TX_AC0		FIELD32(0x00000001)
8858c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_KICK_TX_AC1		FIELD32(0x00000002)
8868c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_KICK_TX_AC2		FIELD32(0x00000004)
8878c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_KICK_TX_AC3		FIELD32(0x00000008)
8888c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_KICK_TX_MGMT	FIELD32(0x00000010)
8898c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_ABORT_TX_AC0	FIELD32(0x00010000)
8908c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_ABORT_TX_AC1	FIELD32(0x00020000)
8918c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_ABORT_TX_AC2	FIELD32(0x00040000)
8928c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_ABORT_TX_AC3	FIELD32(0x00080000)
8938c2ecf20Sopenharmony_ci#define TX_CNTL_CSR_ABORT_TX_MGMT	FIELD32(0x00100000)
8948c2ecf20Sopenharmony_ci
8958c2ecf20Sopenharmony_ci/*
8968c2ecf20Sopenharmony_ci * LOAD_TX_RING_CSR: Load RX desriptor
8978c2ecf20Sopenharmony_ci */
8988c2ecf20Sopenharmony_ci#define LOAD_TX_RING_CSR		0x3434
8998c2ecf20Sopenharmony_ci#define LOAD_TX_RING_CSR_LOAD_TXD_AC0	FIELD32(0x00000001)
9008c2ecf20Sopenharmony_ci#define LOAD_TX_RING_CSR_LOAD_TXD_AC1	FIELD32(0x00000002)
9018c2ecf20Sopenharmony_ci#define LOAD_TX_RING_CSR_LOAD_TXD_AC2	FIELD32(0x00000004)
9028c2ecf20Sopenharmony_ci#define LOAD_TX_RING_CSR_LOAD_TXD_AC3	FIELD32(0x00000008)
9038c2ecf20Sopenharmony_ci#define LOAD_TX_RING_CSR_LOAD_TXD_MGMT	FIELD32(0x00000010)
9048c2ecf20Sopenharmony_ci
9058c2ecf20Sopenharmony_ci/*
9068c2ecf20Sopenharmony_ci * Several read-only registers, for debugging.
9078c2ecf20Sopenharmony_ci */
9088c2ecf20Sopenharmony_ci#define AC0_TXPTR_CSR			0x3438
9098c2ecf20Sopenharmony_ci#define AC1_TXPTR_CSR			0x343c
9108c2ecf20Sopenharmony_ci#define AC2_TXPTR_CSR			0x3440
9118c2ecf20Sopenharmony_ci#define AC3_TXPTR_CSR			0x3444
9128c2ecf20Sopenharmony_ci#define MGMT_TXPTR_CSR			0x3448
9138c2ecf20Sopenharmony_ci
9148c2ecf20Sopenharmony_ci/*
9158c2ecf20Sopenharmony_ci * RX_BASE_CSR
9168c2ecf20Sopenharmony_ci */
9178c2ecf20Sopenharmony_ci#define RX_BASE_CSR			0x3450
9188c2ecf20Sopenharmony_ci#define RX_BASE_CSR_RING_REGISTER	FIELD32(0xffffffff)
9198c2ecf20Sopenharmony_ci
9208c2ecf20Sopenharmony_ci/*
9218c2ecf20Sopenharmony_ci * RX_RING_CSR.
9228c2ecf20Sopenharmony_ci * RXD_SIZE: In unit of 32-bit.
9238c2ecf20Sopenharmony_ci */
9248c2ecf20Sopenharmony_ci#define RX_RING_CSR			0x3454
9258c2ecf20Sopenharmony_ci#define RX_RING_CSR_RING_SIZE		FIELD32(0x000000ff)
9268c2ecf20Sopenharmony_ci#define RX_RING_CSR_RXD_SIZE		FIELD32(0x00003f00)
9278c2ecf20Sopenharmony_ci#define RX_RING_CSR_RXD_WRITEBACK_SIZE	FIELD32(0x00070000)
9288c2ecf20Sopenharmony_ci
9298c2ecf20Sopenharmony_ci/*
9308c2ecf20Sopenharmony_ci * RX_CNTL_CSR
9318c2ecf20Sopenharmony_ci */
9328c2ecf20Sopenharmony_ci#define RX_CNTL_CSR			0x3458
9338c2ecf20Sopenharmony_ci#define RX_CNTL_CSR_ENABLE_RX_DMA	FIELD32(0x00000001)
9348c2ecf20Sopenharmony_ci#define RX_CNTL_CSR_LOAD_RXD		FIELD32(0x00000002)
9358c2ecf20Sopenharmony_ci
9368c2ecf20Sopenharmony_ci/*
9378c2ecf20Sopenharmony_ci * RXPTR_CSR: Read-only, for debugging.
9388c2ecf20Sopenharmony_ci */
9398c2ecf20Sopenharmony_ci#define RXPTR_CSR			0x345c
9408c2ecf20Sopenharmony_ci
9418c2ecf20Sopenharmony_ci/*
9428c2ecf20Sopenharmony_ci * PCI_CFG_CSR
9438c2ecf20Sopenharmony_ci */
9448c2ecf20Sopenharmony_ci#define PCI_CFG_CSR			0x3460
9458c2ecf20Sopenharmony_ci
9468c2ecf20Sopenharmony_ci/*
9478c2ecf20Sopenharmony_ci * BUF_FORMAT_CSR
9488c2ecf20Sopenharmony_ci */
9498c2ecf20Sopenharmony_ci#define BUF_FORMAT_CSR			0x3464
9508c2ecf20Sopenharmony_ci
9518c2ecf20Sopenharmony_ci/*
9528c2ecf20Sopenharmony_ci * INT_SOURCE_CSR: Interrupt source register.
9538c2ecf20Sopenharmony_ci * Write one to clear corresponding bit.
9548c2ecf20Sopenharmony_ci */
9558c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR			0x3468
9568c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_TXDONE		FIELD32(0x00000001)
9578c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_RXDONE		FIELD32(0x00000002)
9588c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_BEACON_DONE	FIELD32(0x00000004)
9598c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_TX_ABORT_DONE	FIELD32(0x00000010)
9608c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AC0_DMA_DONE	FIELD32(0x00010000)
9618c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AC1_DMA_DONE	FIELD32(0x00020000)
9628c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AC2_DMA_DONE	FIELD32(0x00040000)
9638c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_AC3_DMA_DONE	FIELD32(0x00080000)
9648c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_MGMT_DMA_DONE	FIELD32(0x00100000)
9658c2ecf20Sopenharmony_ci#define INT_SOURCE_CSR_HCCA_DMA_DONE	FIELD32(0x00200000)
9668c2ecf20Sopenharmony_ci
9678c2ecf20Sopenharmony_ci/*
9688c2ecf20Sopenharmony_ci * INT_MASK_CSR: Interrupt MASK register. 1: the interrupt is mask OFF.
9698c2ecf20Sopenharmony_ci * MITIGATION_PERIOD: Interrupt mitigation in unit of 32 PCI clock.
9708c2ecf20Sopenharmony_ci */
9718c2ecf20Sopenharmony_ci#define INT_MASK_CSR			0x346c
9728c2ecf20Sopenharmony_ci#define INT_MASK_CSR_TXDONE		FIELD32(0x00000001)
9738c2ecf20Sopenharmony_ci#define INT_MASK_CSR_RXDONE		FIELD32(0x00000002)
9748c2ecf20Sopenharmony_ci#define INT_MASK_CSR_BEACON_DONE	FIELD32(0x00000004)
9758c2ecf20Sopenharmony_ci#define INT_MASK_CSR_TX_ABORT_DONE	FIELD32(0x00000010)
9768c2ecf20Sopenharmony_ci#define INT_MASK_CSR_ENABLE_MITIGATION	FIELD32(0x00000080)
9778c2ecf20Sopenharmony_ci#define INT_MASK_CSR_MITIGATION_PERIOD	FIELD32(0x0000ff00)
9788c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AC0_DMA_DONE	FIELD32(0x00010000)
9798c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AC1_DMA_DONE	FIELD32(0x00020000)
9808c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AC2_DMA_DONE	FIELD32(0x00040000)
9818c2ecf20Sopenharmony_ci#define INT_MASK_CSR_AC3_DMA_DONE	FIELD32(0x00080000)
9828c2ecf20Sopenharmony_ci#define INT_MASK_CSR_MGMT_DMA_DONE	FIELD32(0x00100000)
9838c2ecf20Sopenharmony_ci#define INT_MASK_CSR_HCCA_DMA_DONE	FIELD32(0x00200000)
9848c2ecf20Sopenharmony_ci
9858c2ecf20Sopenharmony_ci/*
9868c2ecf20Sopenharmony_ci * E2PROM_CSR: EEPROM control register.
9878c2ecf20Sopenharmony_ci * RELOAD: Write 1 to reload eeprom content.
9888c2ecf20Sopenharmony_ci * TYPE_93C46: 1: 93c46, 0:93c66.
9898c2ecf20Sopenharmony_ci * LOAD_STATUS: 1:loading, 0:done.
9908c2ecf20Sopenharmony_ci */
9918c2ecf20Sopenharmony_ci#define E2PROM_CSR			0x3470
9928c2ecf20Sopenharmony_ci#define E2PROM_CSR_RELOAD		FIELD32(0x00000001)
9938c2ecf20Sopenharmony_ci#define E2PROM_CSR_DATA_CLOCK		FIELD32(0x00000002)
9948c2ecf20Sopenharmony_ci#define E2PROM_CSR_CHIP_SELECT		FIELD32(0x00000004)
9958c2ecf20Sopenharmony_ci#define E2PROM_CSR_DATA_IN		FIELD32(0x00000008)
9968c2ecf20Sopenharmony_ci#define E2PROM_CSR_DATA_OUT		FIELD32(0x00000010)
9978c2ecf20Sopenharmony_ci#define E2PROM_CSR_TYPE_93C46		FIELD32(0x00000020)
9988c2ecf20Sopenharmony_ci#define E2PROM_CSR_LOAD_STATUS		FIELD32(0x00000040)
9998c2ecf20Sopenharmony_ci
10008c2ecf20Sopenharmony_ci/*
10018c2ecf20Sopenharmony_ci * AC_TXOP_CSR0: AC_VO/AC_VI TXOP register.
10028c2ecf20Sopenharmony_ci * AC0_TX_OP: For AC_VO, in unit of 32us.
10038c2ecf20Sopenharmony_ci * AC1_TX_OP: For AC_VI, in unit of 32us.
10048c2ecf20Sopenharmony_ci */
10058c2ecf20Sopenharmony_ci#define AC_TXOP_CSR0			0x3474
10068c2ecf20Sopenharmony_ci#define AC_TXOP_CSR0_AC0_TX_OP		FIELD32(0x0000ffff)
10078c2ecf20Sopenharmony_ci#define AC_TXOP_CSR0_AC1_TX_OP		FIELD32(0xffff0000)
10088c2ecf20Sopenharmony_ci
10098c2ecf20Sopenharmony_ci/*
10108c2ecf20Sopenharmony_ci * AC_TXOP_CSR1: AC_BE/AC_BK TXOP register.
10118c2ecf20Sopenharmony_ci * AC2_TX_OP: For AC_BE, in unit of 32us.
10128c2ecf20Sopenharmony_ci * AC3_TX_OP: For AC_BK, in unit of 32us.
10138c2ecf20Sopenharmony_ci */
10148c2ecf20Sopenharmony_ci#define AC_TXOP_CSR1			0x3478
10158c2ecf20Sopenharmony_ci#define AC_TXOP_CSR1_AC2_TX_OP		FIELD32(0x0000ffff)
10168c2ecf20Sopenharmony_ci#define AC_TXOP_CSR1_AC3_TX_OP		FIELD32(0xffff0000)
10178c2ecf20Sopenharmony_ci
10188c2ecf20Sopenharmony_ci/*
10198c2ecf20Sopenharmony_ci * DMA_STATUS_CSR
10208c2ecf20Sopenharmony_ci */
10218c2ecf20Sopenharmony_ci#define DMA_STATUS_CSR			0x3480
10228c2ecf20Sopenharmony_ci
10238c2ecf20Sopenharmony_ci/*
10248c2ecf20Sopenharmony_ci * TEST_MODE_CSR
10258c2ecf20Sopenharmony_ci */
10268c2ecf20Sopenharmony_ci#define TEST_MODE_CSR			0x3484
10278c2ecf20Sopenharmony_ci
10288c2ecf20Sopenharmony_ci/*
10298c2ecf20Sopenharmony_ci * UART0_TX_CSR
10308c2ecf20Sopenharmony_ci */
10318c2ecf20Sopenharmony_ci#define UART0_TX_CSR			0x3488
10328c2ecf20Sopenharmony_ci
10338c2ecf20Sopenharmony_ci/*
10348c2ecf20Sopenharmony_ci * UART0_RX_CSR
10358c2ecf20Sopenharmony_ci */
10368c2ecf20Sopenharmony_ci#define UART0_RX_CSR			0x348c
10378c2ecf20Sopenharmony_ci
10388c2ecf20Sopenharmony_ci/*
10398c2ecf20Sopenharmony_ci * UART0_FRAME_CSR
10408c2ecf20Sopenharmony_ci */
10418c2ecf20Sopenharmony_ci#define UART0_FRAME_CSR			0x3490
10428c2ecf20Sopenharmony_ci
10438c2ecf20Sopenharmony_ci/*
10448c2ecf20Sopenharmony_ci * UART0_BUFFER_CSR
10458c2ecf20Sopenharmony_ci */
10468c2ecf20Sopenharmony_ci#define UART0_BUFFER_CSR		0x3494
10478c2ecf20Sopenharmony_ci
10488c2ecf20Sopenharmony_ci/*
10498c2ecf20Sopenharmony_ci * IO_CNTL_CSR
10508c2ecf20Sopenharmony_ci * RF_PS: Set RF interface value to power save
10518c2ecf20Sopenharmony_ci */
10528c2ecf20Sopenharmony_ci#define IO_CNTL_CSR			0x3498
10538c2ecf20Sopenharmony_ci#define IO_CNTL_CSR_RF_PS		FIELD32(0x00000004)
10548c2ecf20Sopenharmony_ci
10558c2ecf20Sopenharmony_ci/*
10568c2ecf20Sopenharmony_ci * UART_INT_SOURCE_CSR
10578c2ecf20Sopenharmony_ci */
10588c2ecf20Sopenharmony_ci#define UART_INT_SOURCE_CSR		0x34a8
10598c2ecf20Sopenharmony_ci
10608c2ecf20Sopenharmony_ci/*
10618c2ecf20Sopenharmony_ci * UART_INT_MASK_CSR
10628c2ecf20Sopenharmony_ci */
10638c2ecf20Sopenharmony_ci#define UART_INT_MASK_CSR		0x34ac
10648c2ecf20Sopenharmony_ci
10658c2ecf20Sopenharmony_ci/*
10668c2ecf20Sopenharmony_ci * PBF_QUEUE_CSR
10678c2ecf20Sopenharmony_ci */
10688c2ecf20Sopenharmony_ci#define PBF_QUEUE_CSR			0x34b0
10698c2ecf20Sopenharmony_ci
10708c2ecf20Sopenharmony_ci/*
10718c2ecf20Sopenharmony_ci * Firmware DMA registers.
10728c2ecf20Sopenharmony_ci * Firmware DMA registers are dedicated for MCU usage
10738c2ecf20Sopenharmony_ci * and should not be touched by host driver.
10748c2ecf20Sopenharmony_ci * Therefore we skip the definition of these registers.
10758c2ecf20Sopenharmony_ci */
10768c2ecf20Sopenharmony_ci#define FW_TX_BASE_CSR			0x34c0
10778c2ecf20Sopenharmony_ci#define FW_TX_START_CSR			0x34c4
10788c2ecf20Sopenharmony_ci#define FW_TX_LAST_CSR			0x34c8
10798c2ecf20Sopenharmony_ci#define FW_MODE_CNTL_CSR		0x34cc
10808c2ecf20Sopenharmony_ci#define FW_TXPTR_CSR			0x34d0
10818c2ecf20Sopenharmony_ci
10828c2ecf20Sopenharmony_ci/*
10838c2ecf20Sopenharmony_ci * 8051 firmware image.
10848c2ecf20Sopenharmony_ci */
10858c2ecf20Sopenharmony_ci#define FIRMWARE_RT2561			"rt2561.bin"
10868c2ecf20Sopenharmony_ci#define FIRMWARE_RT2561s		"rt2561s.bin"
10878c2ecf20Sopenharmony_ci#define FIRMWARE_RT2661			"rt2661.bin"
10888c2ecf20Sopenharmony_ci#define FIRMWARE_IMAGE_BASE		0x4000
10898c2ecf20Sopenharmony_ci
10908c2ecf20Sopenharmony_ci/*
10918c2ecf20Sopenharmony_ci * BBP registers.
10928c2ecf20Sopenharmony_ci * The wordsize of the BBP is 8 bits.
10938c2ecf20Sopenharmony_ci */
10948c2ecf20Sopenharmony_ci
10958c2ecf20Sopenharmony_ci/*
10968c2ecf20Sopenharmony_ci * R2
10978c2ecf20Sopenharmony_ci */
10988c2ecf20Sopenharmony_ci#define BBP_R2_BG_MODE			FIELD8(0x20)
10998c2ecf20Sopenharmony_ci
11008c2ecf20Sopenharmony_ci/*
11018c2ecf20Sopenharmony_ci * R3
11028c2ecf20Sopenharmony_ci */
11038c2ecf20Sopenharmony_ci#define BBP_R3_SMART_MODE		FIELD8(0x01)
11048c2ecf20Sopenharmony_ci
11058c2ecf20Sopenharmony_ci/*
11068c2ecf20Sopenharmony_ci * R4: RX antenna control
11078c2ecf20Sopenharmony_ci * FRAME_END: 1 - DPDT, 0 - SPDT (Only valid for 802.11G, RF2527 & RF2529)
11088c2ecf20Sopenharmony_ci */
11098c2ecf20Sopenharmony_ci
11108c2ecf20Sopenharmony_ci/*
11118c2ecf20Sopenharmony_ci * ANTENNA_CONTROL semantics (guessed):
11128c2ecf20Sopenharmony_ci * 0x1: Software controlled antenna switching (fixed or SW diversity)
11138c2ecf20Sopenharmony_ci * 0x2: Hardware diversity.
11148c2ecf20Sopenharmony_ci */
11158c2ecf20Sopenharmony_ci#define BBP_R4_RX_ANTENNA_CONTROL	FIELD8(0x03)
11168c2ecf20Sopenharmony_ci#define BBP_R4_RX_FRAME_END		FIELD8(0x20)
11178c2ecf20Sopenharmony_ci
11188c2ecf20Sopenharmony_ci/*
11198c2ecf20Sopenharmony_ci * R77
11208c2ecf20Sopenharmony_ci */
11218c2ecf20Sopenharmony_ci#define BBP_R77_RX_ANTENNA		FIELD8(0x03)
11228c2ecf20Sopenharmony_ci
11238c2ecf20Sopenharmony_ci/*
11248c2ecf20Sopenharmony_ci * RF registers
11258c2ecf20Sopenharmony_ci */
11268c2ecf20Sopenharmony_ci
11278c2ecf20Sopenharmony_ci/*
11288c2ecf20Sopenharmony_ci * RF 3
11298c2ecf20Sopenharmony_ci */
11308c2ecf20Sopenharmony_ci#define RF3_TXPOWER			FIELD32(0x00003e00)
11318c2ecf20Sopenharmony_ci
11328c2ecf20Sopenharmony_ci/*
11338c2ecf20Sopenharmony_ci * RF 4
11348c2ecf20Sopenharmony_ci */
11358c2ecf20Sopenharmony_ci#define RF4_FREQ_OFFSET			FIELD32(0x0003f000)
11368c2ecf20Sopenharmony_ci
11378c2ecf20Sopenharmony_ci/*
11388c2ecf20Sopenharmony_ci * EEPROM content.
11398c2ecf20Sopenharmony_ci * The wordsize of the EEPROM is 16 bits.
11408c2ecf20Sopenharmony_ci */
11418c2ecf20Sopenharmony_ci
11428c2ecf20Sopenharmony_ci/*
11438c2ecf20Sopenharmony_ci * HW MAC address.
11448c2ecf20Sopenharmony_ci */
11458c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_0		0x0002
11468c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE0		FIELD16(0x00ff)
11478c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE1		FIELD16(0xff00)
11488c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR1		0x0003
11498c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE2		FIELD16(0x00ff)
11508c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE3		FIELD16(0xff00)
11518c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_2		0x0004
11528c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE4		FIELD16(0x00ff)
11538c2ecf20Sopenharmony_ci#define EEPROM_MAC_ADDR_BYTE5		FIELD16(0xff00)
11548c2ecf20Sopenharmony_ci
11558c2ecf20Sopenharmony_ci/*
11568c2ecf20Sopenharmony_ci * EEPROM antenna.
11578c2ecf20Sopenharmony_ci * ANTENNA_NUM: Number of antenna's.
11588c2ecf20Sopenharmony_ci * TX_DEFAULT: Default antenna 0: diversity, 1: A, 2: B.
11598c2ecf20Sopenharmony_ci * RX_DEFAULT: Default antenna 0: diversity, 1: A, 2: B.
11608c2ecf20Sopenharmony_ci * FRAME_TYPE: 0: DPDT , 1: SPDT , noted this bit is valid for g only.
11618c2ecf20Sopenharmony_ci * DYN_TXAGC: Dynamic TX AGC control.
11628c2ecf20Sopenharmony_ci * HARDWARE_RADIO: 1: Hardware controlled radio. Read GPIO0.
11638c2ecf20Sopenharmony_ci * RF_TYPE: Rf_type of this adapter.
11648c2ecf20Sopenharmony_ci */
11658c2ecf20Sopenharmony_ci#define EEPROM_ANTENNA			0x0010
11668c2ecf20Sopenharmony_ci#define EEPROM_ANTENNA_NUM		FIELD16(0x0003)
11678c2ecf20Sopenharmony_ci#define EEPROM_ANTENNA_TX_DEFAULT	FIELD16(0x000c)
11688c2ecf20Sopenharmony_ci#define EEPROM_ANTENNA_RX_DEFAULT	FIELD16(0x0030)
11698c2ecf20Sopenharmony_ci#define EEPROM_ANTENNA_FRAME_TYPE	FIELD16(0x0040)
11708c2ecf20Sopenharmony_ci#define EEPROM_ANTENNA_DYN_TXAGC	FIELD16(0x0200)
11718c2ecf20Sopenharmony_ci#define EEPROM_ANTENNA_HARDWARE_RADIO	FIELD16(0x0400)
11728c2ecf20Sopenharmony_ci#define EEPROM_ANTENNA_RF_TYPE		FIELD16(0xf800)
11738c2ecf20Sopenharmony_ci
11748c2ecf20Sopenharmony_ci/*
11758c2ecf20Sopenharmony_ci * EEPROM NIC config.
11768c2ecf20Sopenharmony_ci * ENABLE_DIVERSITY: 1:enable, 0:disable.
11778c2ecf20Sopenharmony_ci * EXTERNAL_LNA_BG: External LNA enable for 2.4G.
11788c2ecf20Sopenharmony_ci * CARDBUS_ACCEL: 0:enable, 1:disable.
11798c2ecf20Sopenharmony_ci * EXTERNAL_LNA_A: External LNA enable for 5G.
11808c2ecf20Sopenharmony_ci */
11818c2ecf20Sopenharmony_ci#define EEPROM_NIC			0x0011
11828c2ecf20Sopenharmony_ci#define EEPROM_NIC_ENABLE_DIVERSITY	FIELD16(0x0001)
11838c2ecf20Sopenharmony_ci#define EEPROM_NIC_TX_DIVERSITY		FIELD16(0x0002)
11848c2ecf20Sopenharmony_ci#define EEPROM_NIC_RX_FIXED		FIELD16(0x0004)
11858c2ecf20Sopenharmony_ci#define EEPROM_NIC_TX_FIXED		FIELD16(0x0008)
11868c2ecf20Sopenharmony_ci#define EEPROM_NIC_EXTERNAL_LNA_BG	FIELD16(0x0010)
11878c2ecf20Sopenharmony_ci#define EEPROM_NIC_CARDBUS_ACCEL	FIELD16(0x0020)
11888c2ecf20Sopenharmony_ci#define EEPROM_NIC_EXTERNAL_LNA_A	FIELD16(0x0040)
11898c2ecf20Sopenharmony_ci
11908c2ecf20Sopenharmony_ci/*
11918c2ecf20Sopenharmony_ci * EEPROM geography.
11928c2ecf20Sopenharmony_ci * GEO_A: Default geographical setting for 5GHz band
11938c2ecf20Sopenharmony_ci * GEO: Default geographical setting.
11948c2ecf20Sopenharmony_ci */
11958c2ecf20Sopenharmony_ci#define EEPROM_GEOGRAPHY		0x0012
11968c2ecf20Sopenharmony_ci#define EEPROM_GEOGRAPHY_GEO_A		FIELD16(0x00ff)
11978c2ecf20Sopenharmony_ci#define EEPROM_GEOGRAPHY_GEO		FIELD16(0xff00)
11988c2ecf20Sopenharmony_ci
11998c2ecf20Sopenharmony_ci/*
12008c2ecf20Sopenharmony_ci * EEPROM BBP.
12018c2ecf20Sopenharmony_ci */
12028c2ecf20Sopenharmony_ci#define EEPROM_BBP_START		0x0013
12038c2ecf20Sopenharmony_ci#define EEPROM_BBP_SIZE			16
12048c2ecf20Sopenharmony_ci#define EEPROM_BBP_VALUE		FIELD16(0x00ff)
12058c2ecf20Sopenharmony_ci#define EEPROM_BBP_REG_ID		FIELD16(0xff00)
12068c2ecf20Sopenharmony_ci
12078c2ecf20Sopenharmony_ci/*
12088c2ecf20Sopenharmony_ci * EEPROM TXPOWER 802.11G
12098c2ecf20Sopenharmony_ci */
12108c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_G_START		0x0023
12118c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_G_SIZE		7
12128c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_G_1		FIELD16(0x00ff)
12138c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_G_2		FIELD16(0xff00)
12148c2ecf20Sopenharmony_ci
12158c2ecf20Sopenharmony_ci/*
12168c2ecf20Sopenharmony_ci * EEPROM Frequency
12178c2ecf20Sopenharmony_ci */
12188c2ecf20Sopenharmony_ci#define EEPROM_FREQ			0x002f
12198c2ecf20Sopenharmony_ci#define EEPROM_FREQ_OFFSET		FIELD16(0x00ff)
12208c2ecf20Sopenharmony_ci#define EEPROM_FREQ_SEQ_MASK		FIELD16(0xff00)
12218c2ecf20Sopenharmony_ci#define EEPROM_FREQ_SEQ			FIELD16(0x0300)
12228c2ecf20Sopenharmony_ci
12238c2ecf20Sopenharmony_ci/*
12248c2ecf20Sopenharmony_ci * EEPROM LED.
12258c2ecf20Sopenharmony_ci * POLARITY_RDY_G: Polarity RDY_G setting.
12268c2ecf20Sopenharmony_ci * POLARITY_RDY_A: Polarity RDY_A setting.
12278c2ecf20Sopenharmony_ci * POLARITY_ACT: Polarity ACT setting.
12288c2ecf20Sopenharmony_ci * POLARITY_GPIO_0: Polarity GPIO0 setting.
12298c2ecf20Sopenharmony_ci * POLARITY_GPIO_1: Polarity GPIO1 setting.
12308c2ecf20Sopenharmony_ci * POLARITY_GPIO_2: Polarity GPIO2 setting.
12318c2ecf20Sopenharmony_ci * POLARITY_GPIO_3: Polarity GPIO3 setting.
12328c2ecf20Sopenharmony_ci * POLARITY_GPIO_4: Polarity GPIO4 setting.
12338c2ecf20Sopenharmony_ci * LED_MODE: Led mode.
12348c2ecf20Sopenharmony_ci */
12358c2ecf20Sopenharmony_ci#define EEPROM_LED			0x0030
12368c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_RDY_G	FIELD16(0x0001)
12378c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_RDY_A	FIELD16(0x0002)
12388c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_ACT		FIELD16(0x0004)
12398c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_0	FIELD16(0x0008)
12408c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_1	FIELD16(0x0010)
12418c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_2	FIELD16(0x0020)
12428c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_3	FIELD16(0x0040)
12438c2ecf20Sopenharmony_ci#define EEPROM_LED_POLARITY_GPIO_4	FIELD16(0x0080)
12448c2ecf20Sopenharmony_ci#define EEPROM_LED_LED_MODE		FIELD16(0x1f00)
12458c2ecf20Sopenharmony_ci
12468c2ecf20Sopenharmony_ci/*
12478c2ecf20Sopenharmony_ci * EEPROM TXPOWER 802.11A
12488c2ecf20Sopenharmony_ci */
12498c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_A_START		0x0031
12508c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_A_SIZE		12
12518c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_A_1		FIELD16(0x00ff)
12528c2ecf20Sopenharmony_ci#define EEPROM_TXPOWER_A_2		FIELD16(0xff00)
12538c2ecf20Sopenharmony_ci
12548c2ecf20Sopenharmony_ci/*
12558c2ecf20Sopenharmony_ci * EEPROM RSSI offset 802.11BG
12568c2ecf20Sopenharmony_ci */
12578c2ecf20Sopenharmony_ci#define EEPROM_RSSI_OFFSET_BG		0x004d
12588c2ecf20Sopenharmony_ci#define EEPROM_RSSI_OFFSET_BG_1		FIELD16(0x00ff)
12598c2ecf20Sopenharmony_ci#define EEPROM_RSSI_OFFSET_BG_2		FIELD16(0xff00)
12608c2ecf20Sopenharmony_ci
12618c2ecf20Sopenharmony_ci/*
12628c2ecf20Sopenharmony_ci * EEPROM RSSI offset 802.11A
12638c2ecf20Sopenharmony_ci */
12648c2ecf20Sopenharmony_ci#define EEPROM_RSSI_OFFSET_A		0x004e
12658c2ecf20Sopenharmony_ci#define EEPROM_RSSI_OFFSET_A_1		FIELD16(0x00ff)
12668c2ecf20Sopenharmony_ci#define EEPROM_RSSI_OFFSET_A_2		FIELD16(0xff00)
12678c2ecf20Sopenharmony_ci
12688c2ecf20Sopenharmony_ci/*
12698c2ecf20Sopenharmony_ci * MCU mailbox commands.
12708c2ecf20Sopenharmony_ci */
12718c2ecf20Sopenharmony_ci#define MCU_SLEEP			0x30
12728c2ecf20Sopenharmony_ci#define MCU_WAKEUP			0x31
12738c2ecf20Sopenharmony_ci#define MCU_LED				0x50
12748c2ecf20Sopenharmony_ci#define MCU_LED_STRENGTH		0x52
12758c2ecf20Sopenharmony_ci
12768c2ecf20Sopenharmony_ci/*
12778c2ecf20Sopenharmony_ci * DMA descriptor defines.
12788c2ecf20Sopenharmony_ci */
12798c2ecf20Sopenharmony_ci#define TXD_DESC_SIZE			(16 * sizeof(__le32))
12808c2ecf20Sopenharmony_ci#define TXINFO_SIZE			(6 * sizeof(__le32))
12818c2ecf20Sopenharmony_ci#define RXD_DESC_SIZE			(16 * sizeof(__le32))
12828c2ecf20Sopenharmony_ci
12838c2ecf20Sopenharmony_ci/*
12848c2ecf20Sopenharmony_ci * TX descriptor format for TX, PRIO and Beacon Ring.
12858c2ecf20Sopenharmony_ci */
12868c2ecf20Sopenharmony_ci
12878c2ecf20Sopenharmony_ci/*
12888c2ecf20Sopenharmony_ci * Word0
12898c2ecf20Sopenharmony_ci * TKIP_MIC: ASIC appends TKIP MIC if TKIP is used.
12908c2ecf20Sopenharmony_ci * KEY_TABLE: Use per-client pairwise KEY table.
12918c2ecf20Sopenharmony_ci * KEY_INDEX:
12928c2ecf20Sopenharmony_ci * Key index (0~31) to the pairwise KEY table.
12938c2ecf20Sopenharmony_ci * 0~3 to shared KEY table 0 (BSS0).
12948c2ecf20Sopenharmony_ci * 4~7 to shared KEY table 1 (BSS1).
12958c2ecf20Sopenharmony_ci * 8~11 to shared KEY table 2 (BSS2).
12968c2ecf20Sopenharmony_ci * 12~15 to shared KEY table 3 (BSS3).
12978c2ecf20Sopenharmony_ci * BURST: Next frame belongs to same "burst" event.
12988c2ecf20Sopenharmony_ci */
12998c2ecf20Sopenharmony_ci#define TXD_W0_OWNER_NIC		FIELD32(0x00000001)
13008c2ecf20Sopenharmony_ci#define TXD_W0_VALID			FIELD32(0x00000002)
13018c2ecf20Sopenharmony_ci#define TXD_W0_MORE_FRAG		FIELD32(0x00000004)
13028c2ecf20Sopenharmony_ci#define TXD_W0_ACK			FIELD32(0x00000008)
13038c2ecf20Sopenharmony_ci#define TXD_W0_TIMESTAMP		FIELD32(0x00000010)
13048c2ecf20Sopenharmony_ci#define TXD_W0_OFDM			FIELD32(0x00000020)
13058c2ecf20Sopenharmony_ci#define TXD_W0_IFS			FIELD32(0x00000040)
13068c2ecf20Sopenharmony_ci#define TXD_W0_RETRY_MODE		FIELD32(0x00000080)
13078c2ecf20Sopenharmony_ci#define TXD_W0_TKIP_MIC			FIELD32(0x00000100)
13088c2ecf20Sopenharmony_ci#define TXD_W0_KEY_TABLE		FIELD32(0x00000200)
13098c2ecf20Sopenharmony_ci#define TXD_W0_KEY_INDEX		FIELD32(0x0000fc00)
13108c2ecf20Sopenharmony_ci#define TXD_W0_DATABYTE_COUNT		FIELD32(0x0fff0000)
13118c2ecf20Sopenharmony_ci#define TXD_W0_BURST			FIELD32(0x10000000)
13128c2ecf20Sopenharmony_ci#define TXD_W0_CIPHER_ALG		FIELD32(0xe0000000)
13138c2ecf20Sopenharmony_ci
13148c2ecf20Sopenharmony_ci/*
13158c2ecf20Sopenharmony_ci * Word1
13168c2ecf20Sopenharmony_ci * HOST_Q_ID: EDCA/HCCA queue ID.
13178c2ecf20Sopenharmony_ci * HW_SEQUENCE: MAC overwrites the frame sequence number.
13188c2ecf20Sopenharmony_ci * BUFFER_COUNT: Number of buffers in this TXD.
13198c2ecf20Sopenharmony_ci */
13208c2ecf20Sopenharmony_ci#define TXD_W1_HOST_Q_ID		FIELD32(0x0000000f)
13218c2ecf20Sopenharmony_ci#define TXD_W1_AIFSN			FIELD32(0x000000f0)
13228c2ecf20Sopenharmony_ci#define TXD_W1_CWMIN			FIELD32(0x00000f00)
13238c2ecf20Sopenharmony_ci#define TXD_W1_CWMAX			FIELD32(0x0000f000)
13248c2ecf20Sopenharmony_ci#define TXD_W1_IV_OFFSET		FIELD32(0x003f0000)
13258c2ecf20Sopenharmony_ci#define TXD_W1_PIGGY_BACK		FIELD32(0x01000000)
13268c2ecf20Sopenharmony_ci#define TXD_W1_HW_SEQUENCE		FIELD32(0x10000000)
13278c2ecf20Sopenharmony_ci#define TXD_W1_BUFFER_COUNT		FIELD32(0xe0000000)
13288c2ecf20Sopenharmony_ci
13298c2ecf20Sopenharmony_ci/*
13308c2ecf20Sopenharmony_ci * Word2: PLCP information
13318c2ecf20Sopenharmony_ci */
13328c2ecf20Sopenharmony_ci#define TXD_W2_PLCP_SIGNAL		FIELD32(0x000000ff)
13338c2ecf20Sopenharmony_ci#define TXD_W2_PLCP_SERVICE		FIELD32(0x0000ff00)
13348c2ecf20Sopenharmony_ci#define TXD_W2_PLCP_LENGTH_LOW		FIELD32(0x00ff0000)
13358c2ecf20Sopenharmony_ci#define TXD_W2_PLCP_LENGTH_HIGH		FIELD32(0xff000000)
13368c2ecf20Sopenharmony_ci
13378c2ecf20Sopenharmony_ci/*
13388c2ecf20Sopenharmony_ci * Word3
13398c2ecf20Sopenharmony_ci */
13408c2ecf20Sopenharmony_ci#define TXD_W3_IV			FIELD32(0xffffffff)
13418c2ecf20Sopenharmony_ci
13428c2ecf20Sopenharmony_ci/*
13438c2ecf20Sopenharmony_ci * Word4
13448c2ecf20Sopenharmony_ci */
13458c2ecf20Sopenharmony_ci#define TXD_W4_EIV			FIELD32(0xffffffff)
13468c2ecf20Sopenharmony_ci
13478c2ecf20Sopenharmony_ci/*
13488c2ecf20Sopenharmony_ci * Word5
13498c2ecf20Sopenharmony_ci * FRAME_OFFSET: Frame start offset inside ASIC TXFIFO (after TXINFO field).
13508c2ecf20Sopenharmony_ci * TXD_W5_PID_SUBTYPE: Driver assigned packet ID index for txdone handler.
13518c2ecf20Sopenharmony_ci * TXD_W5_PID_TYPE: Driver assigned packet ID type for txdone handler.
13528c2ecf20Sopenharmony_ci * WAITING_DMA_DONE_INT: TXD been filled with data
13538c2ecf20Sopenharmony_ci * and waiting for TxDoneISR housekeeping.
13548c2ecf20Sopenharmony_ci */
13558c2ecf20Sopenharmony_ci#define TXD_W5_FRAME_OFFSET		FIELD32(0x000000ff)
13568c2ecf20Sopenharmony_ci#define TXD_W5_PID_SUBTYPE		FIELD32(0x00001f00)
13578c2ecf20Sopenharmony_ci#define TXD_W5_PID_TYPE			FIELD32(0x0000e000)
13588c2ecf20Sopenharmony_ci#define TXD_W5_TX_POWER			FIELD32(0x00ff0000)
13598c2ecf20Sopenharmony_ci#define TXD_W5_WAITING_DMA_DONE_INT	FIELD32(0x01000000)
13608c2ecf20Sopenharmony_ci
13618c2ecf20Sopenharmony_ci/*
13628c2ecf20Sopenharmony_ci * the above 24-byte is called TXINFO and will be DMAed to MAC block
13638c2ecf20Sopenharmony_ci * through TXFIFO. MAC block use this TXINFO to control the transmission
13648c2ecf20Sopenharmony_ci * behavior of this frame.
13658c2ecf20Sopenharmony_ci * The following fields are not used by MAC block.
13668c2ecf20Sopenharmony_ci * They are used by DMA block and HOST driver only.
13678c2ecf20Sopenharmony_ci * Once a frame has been DMA to ASIC, all the following fields are useless
13688c2ecf20Sopenharmony_ci * to ASIC.
13698c2ecf20Sopenharmony_ci */
13708c2ecf20Sopenharmony_ci
13718c2ecf20Sopenharmony_ci/*
13728c2ecf20Sopenharmony_ci * Word6-10: Buffer physical address
13738c2ecf20Sopenharmony_ci */
13748c2ecf20Sopenharmony_ci#define TXD_W6_BUFFER_PHYSICAL_ADDRESS	FIELD32(0xffffffff)
13758c2ecf20Sopenharmony_ci#define TXD_W7_BUFFER_PHYSICAL_ADDRESS	FIELD32(0xffffffff)
13768c2ecf20Sopenharmony_ci#define TXD_W8_BUFFER_PHYSICAL_ADDRESS	FIELD32(0xffffffff)
13778c2ecf20Sopenharmony_ci#define TXD_W9_BUFFER_PHYSICAL_ADDRESS	FIELD32(0xffffffff)
13788c2ecf20Sopenharmony_ci#define TXD_W10_BUFFER_PHYSICAL_ADDRESS	FIELD32(0xffffffff)
13798c2ecf20Sopenharmony_ci
13808c2ecf20Sopenharmony_ci/*
13818c2ecf20Sopenharmony_ci * Word11-13: Buffer length
13828c2ecf20Sopenharmony_ci */
13838c2ecf20Sopenharmony_ci#define TXD_W11_BUFFER_LENGTH0		FIELD32(0x00000fff)
13848c2ecf20Sopenharmony_ci#define TXD_W11_BUFFER_LENGTH1		FIELD32(0x0fff0000)
13858c2ecf20Sopenharmony_ci#define TXD_W12_BUFFER_LENGTH2		FIELD32(0x00000fff)
13868c2ecf20Sopenharmony_ci#define TXD_W12_BUFFER_LENGTH3		FIELD32(0x0fff0000)
13878c2ecf20Sopenharmony_ci#define TXD_W13_BUFFER_LENGTH4		FIELD32(0x00000fff)
13888c2ecf20Sopenharmony_ci
13898c2ecf20Sopenharmony_ci/*
13908c2ecf20Sopenharmony_ci * Word14
13918c2ecf20Sopenharmony_ci */
13928c2ecf20Sopenharmony_ci#define TXD_W14_SK_BUFFER		FIELD32(0xffffffff)
13938c2ecf20Sopenharmony_ci
13948c2ecf20Sopenharmony_ci/*
13958c2ecf20Sopenharmony_ci * Word15
13968c2ecf20Sopenharmony_ci */
13978c2ecf20Sopenharmony_ci#define TXD_W15_NEXT_SK_BUFFER		FIELD32(0xffffffff)
13988c2ecf20Sopenharmony_ci
13998c2ecf20Sopenharmony_ci/*
14008c2ecf20Sopenharmony_ci * RX descriptor format for RX Ring.
14018c2ecf20Sopenharmony_ci */
14028c2ecf20Sopenharmony_ci
14038c2ecf20Sopenharmony_ci/*
14048c2ecf20Sopenharmony_ci * Word0
14058c2ecf20Sopenharmony_ci * CIPHER_ERROR: 1:ICV error, 2:MIC error, 3:invalid key.
14068c2ecf20Sopenharmony_ci * KEY_INDEX: Decryption key actually used.
14078c2ecf20Sopenharmony_ci */
14088c2ecf20Sopenharmony_ci#define RXD_W0_OWNER_NIC		FIELD32(0x00000001)
14098c2ecf20Sopenharmony_ci#define RXD_W0_DROP			FIELD32(0x00000002)
14108c2ecf20Sopenharmony_ci#define RXD_W0_UNICAST_TO_ME		FIELD32(0x00000004)
14118c2ecf20Sopenharmony_ci#define RXD_W0_MULTICAST		FIELD32(0x00000008)
14128c2ecf20Sopenharmony_ci#define RXD_W0_BROADCAST		FIELD32(0x00000010)
14138c2ecf20Sopenharmony_ci#define RXD_W0_MY_BSS			FIELD32(0x00000020)
14148c2ecf20Sopenharmony_ci#define RXD_W0_CRC_ERROR		FIELD32(0x00000040)
14158c2ecf20Sopenharmony_ci#define RXD_W0_OFDM			FIELD32(0x00000080)
14168c2ecf20Sopenharmony_ci#define RXD_W0_CIPHER_ERROR		FIELD32(0x00000300)
14178c2ecf20Sopenharmony_ci#define RXD_W0_KEY_INDEX		FIELD32(0x0000fc00)
14188c2ecf20Sopenharmony_ci#define RXD_W0_DATABYTE_COUNT		FIELD32(0x0fff0000)
14198c2ecf20Sopenharmony_ci#define RXD_W0_CIPHER_ALG		FIELD32(0xe0000000)
14208c2ecf20Sopenharmony_ci
14218c2ecf20Sopenharmony_ci/*
14228c2ecf20Sopenharmony_ci * Word1
14238c2ecf20Sopenharmony_ci * SIGNAL: RX raw data rate reported by BBP.
14248c2ecf20Sopenharmony_ci */
14258c2ecf20Sopenharmony_ci#define RXD_W1_SIGNAL			FIELD32(0x000000ff)
14268c2ecf20Sopenharmony_ci#define RXD_W1_RSSI_AGC			FIELD32(0x00001f00)
14278c2ecf20Sopenharmony_ci#define RXD_W1_RSSI_LNA			FIELD32(0x00006000)
14288c2ecf20Sopenharmony_ci#define RXD_W1_FRAME_OFFSET		FIELD32(0x7f000000)
14298c2ecf20Sopenharmony_ci
14308c2ecf20Sopenharmony_ci/*
14318c2ecf20Sopenharmony_ci * Word2
14328c2ecf20Sopenharmony_ci * IV: Received IV of originally encrypted.
14338c2ecf20Sopenharmony_ci */
14348c2ecf20Sopenharmony_ci#define RXD_W2_IV			FIELD32(0xffffffff)
14358c2ecf20Sopenharmony_ci
14368c2ecf20Sopenharmony_ci/*
14378c2ecf20Sopenharmony_ci * Word3
14388c2ecf20Sopenharmony_ci * EIV: Received EIV of originally encrypted.
14398c2ecf20Sopenharmony_ci */
14408c2ecf20Sopenharmony_ci#define RXD_W3_EIV			FIELD32(0xffffffff)
14418c2ecf20Sopenharmony_ci
14428c2ecf20Sopenharmony_ci/*
14438c2ecf20Sopenharmony_ci * Word4
14448c2ecf20Sopenharmony_ci * ICV: Received ICV of originally encrypted.
14458c2ecf20Sopenharmony_ci * NOTE: This is a guess, the official definition is "reserved"
14468c2ecf20Sopenharmony_ci */
14478c2ecf20Sopenharmony_ci#define RXD_W4_ICV			FIELD32(0xffffffff)
14488c2ecf20Sopenharmony_ci
14498c2ecf20Sopenharmony_ci/*
14508c2ecf20Sopenharmony_ci * the above 20-byte is called RXINFO and will be DMAed to MAC RX block
14518c2ecf20Sopenharmony_ci * and passed to the HOST driver.
14528c2ecf20Sopenharmony_ci * The following fields are for DMA block and HOST usage only.
14538c2ecf20Sopenharmony_ci * Can't be touched by ASIC MAC block.
14548c2ecf20Sopenharmony_ci */
14558c2ecf20Sopenharmony_ci
14568c2ecf20Sopenharmony_ci/*
14578c2ecf20Sopenharmony_ci * Word5
14588c2ecf20Sopenharmony_ci */
14598c2ecf20Sopenharmony_ci#define RXD_W5_BUFFER_PHYSICAL_ADDRESS	FIELD32(0xffffffff)
14608c2ecf20Sopenharmony_ci
14618c2ecf20Sopenharmony_ci/*
14628c2ecf20Sopenharmony_ci * Word6-15: Reserved
14638c2ecf20Sopenharmony_ci */
14648c2ecf20Sopenharmony_ci#define RXD_W6_RESERVED			FIELD32(0xffffffff)
14658c2ecf20Sopenharmony_ci#define RXD_W7_RESERVED			FIELD32(0xffffffff)
14668c2ecf20Sopenharmony_ci#define RXD_W8_RESERVED			FIELD32(0xffffffff)
14678c2ecf20Sopenharmony_ci#define RXD_W9_RESERVED			FIELD32(0xffffffff)
14688c2ecf20Sopenharmony_ci#define RXD_W10_RESERVED		FIELD32(0xffffffff)
14698c2ecf20Sopenharmony_ci#define RXD_W11_RESERVED		FIELD32(0xffffffff)
14708c2ecf20Sopenharmony_ci#define RXD_W12_RESERVED		FIELD32(0xffffffff)
14718c2ecf20Sopenharmony_ci#define RXD_W13_RESERVED		FIELD32(0xffffffff)
14728c2ecf20Sopenharmony_ci#define RXD_W14_RESERVED		FIELD32(0xffffffff)
14738c2ecf20Sopenharmony_ci#define RXD_W15_RESERVED		FIELD32(0xffffffff)
14748c2ecf20Sopenharmony_ci
14758c2ecf20Sopenharmony_ci/*
14768c2ecf20Sopenharmony_ci * Macros for converting txpower from EEPROM to mac80211 value
14778c2ecf20Sopenharmony_ci * and from mac80211 value to register value.
14788c2ecf20Sopenharmony_ci */
14798c2ecf20Sopenharmony_ci#define MIN_TXPOWER	0
14808c2ecf20Sopenharmony_ci#define MAX_TXPOWER	31
14818c2ecf20Sopenharmony_ci#define DEFAULT_TXPOWER	24
14828c2ecf20Sopenharmony_ci
14838c2ecf20Sopenharmony_ci#define TXPOWER_FROM_DEV(__txpower) \
14848c2ecf20Sopenharmony_ci	(((u8)(__txpower)) > MAX_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
14858c2ecf20Sopenharmony_ci
14868c2ecf20Sopenharmony_ci#define TXPOWER_TO_DEV(__txpower) \
14878c2ecf20Sopenharmony_ci	clamp_t(char, __txpower, MIN_TXPOWER, MAX_TXPOWER)
14888c2ecf20Sopenharmony_ci
14898c2ecf20Sopenharmony_ci#endif /* RT61PCI_H */
1490