xref: /freebsd/sys/dev/ath/ath_hal/ar5211/ar5211reg.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1*6e778a7eSPedro F. Giffuni /*-
2*6e778a7eSPedro F. Giffuni  * SPDX-License-Identifier: ISC
3*6e778a7eSPedro F. Giffuni  *
414779705SSam Leffler  * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
514779705SSam Leffler  * Copyright (c) 2002-2006 Atheros Communications, Inc.
614779705SSam Leffler  *
714779705SSam Leffler  * Permission to use, copy, modify, and/or distribute this software for any
814779705SSam Leffler  * purpose with or without fee is hereby granted, provided that the above
914779705SSam Leffler  * copyright notice and this permission notice appear in all copies.
1014779705SSam Leffler  *
1114779705SSam Leffler  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1214779705SSam Leffler  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1314779705SSam Leffler  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1414779705SSam Leffler  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1514779705SSam Leffler  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1614779705SSam Leffler  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1714779705SSam Leffler  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1814779705SSam Leffler  */
1914779705SSam Leffler #ifndef _DEV_ATH_AR5211REG_H
2014779705SSam Leffler #define _DEV_ATH_AR5211REG_H
2114779705SSam Leffler 
2214779705SSam Leffler /*
2314779705SSam Leffler  * Definitions for the Atheros AR5211/5311 chipset.
2414779705SSam Leffler  */
2514779705SSam Leffler 
2614779705SSam Leffler /*
2714779705SSam Leffler  * Maui2/Spirit specific registers/fields are indicated by AR5311.
2814779705SSam Leffler  * Oahu specific registers/fields are indicated by AR5211.
2914779705SSam Leffler  */
3014779705SSam Leffler 
3114779705SSam Leffler /* DMA Control and Interrupt Registers */
3214779705SSam Leffler #define	AR_CR		0x0008		/* control register */
3314779705SSam Leffler #define	AR_RXDP		0x000C		/* receive queue descriptor pointer */
3414779705SSam Leffler #define	AR_CFG		0x0014		/* configuration and status register */
3514779705SSam Leffler #define	AR_IER		0x0024		/* Interrupt enable register */
3614779705SSam Leffler #define	AR_RTSD0	0x0028		/* RTS Duration Parameters 0 */
3714779705SSam Leffler #define	AR_RTSD1	0x002c		/* RTS Duration Parameters 1 */
3814779705SSam Leffler #define	AR_TXCFG	0x0030		/* tx DMA size config register */
3914779705SSam Leffler #define	AR_RXCFG	0x0034		/* rx DMA size config register */
4014779705SSam Leffler #define	AR5211_JUMBO_LAST	0x0038	/* Jumbo descriptor last address */
4114779705SSam Leffler #define	AR_MIBC		0x0040		/* MIB control register */
4214779705SSam Leffler #define	AR_TOPS		0x0044		/* timeout prescale count */
4314779705SSam Leffler #define	AR_RXNPTO	0x0048		/* no frame received timeout */
4414779705SSam Leffler #define	AR_TXNPTO	0x004C		/* no frame trasmitted timeout */
4514779705SSam Leffler #define	AR_RFGTO	0x0050		/* receive frame gap timeout */
4614779705SSam Leffler #define	AR_RFCNT	0x0054		/* receive frame count limit */
4714779705SSam Leffler #define	AR_MACMISC	0x0058		/* miscellaneous control/status */
4814779705SSam Leffler #define	AR5311_QDCLKGATE	0x005c	/* QCU/DCU clock gating control */
4914779705SSam Leffler #define	AR_ISR		0x0080		/* Primary interrupt status register */
5014779705SSam Leffler #define	AR_ISR_S0	0x0084		/* Secondary interrupt status reg 0 */
5114779705SSam Leffler #define	AR_ISR_S1	0x0088		/* Secondary interrupt status reg 1 */
5214779705SSam Leffler #define	AR_ISR_S2	0x008c		/* Secondary interrupt status reg 2 */
5314779705SSam Leffler #define	AR_ISR_S3	0x0090		/* Secondary interrupt status reg 3 */
5414779705SSam Leffler #define	AR_ISR_S4	0x0094		/* Secondary interrupt status reg 4 */
5514779705SSam Leffler #define	AR_IMR		0x00a0		/* Primary interrupt mask register */
5614779705SSam Leffler #define	AR_IMR_S0	0x00a4		/* Secondary interrupt mask reg 0 */
5714779705SSam Leffler #define	AR_IMR_S1	0x00a8		/* Secondary interrupt mask reg 1 */
5814779705SSam Leffler #define	AR_IMR_S2	0x00ac		/* Secondary interrupt mask reg 2 */
5914779705SSam Leffler #define	AR_IMR_S3	0x00b0		/* Secondary interrupt mask reg 3 */
6014779705SSam Leffler #define	AR_IMR_S4	0x00b4		/* Secondary interrupt mask reg 4 */
6114779705SSam Leffler #define	AR_ISR_RAC	0x00c0		/* Primary interrupt status reg, */
6214779705SSam Leffler /* Shadow copies with read-and-clear access */
6314779705SSam Leffler #define	AR_ISR_S0_S	0x00c4		/* Secondary interrupt status reg 0 */
6414779705SSam Leffler #define	AR_ISR_S1_S	0x00c8		/* Secondary interrupt status reg 1 */
6514779705SSam Leffler #define	AR_ISR_S2_S	0x00cc		/* Secondary interrupt status reg 2 */
6614779705SSam Leffler #define	AR_ISR_S3_S	0x00d0		/* Secondary interrupt status reg 3 */
6714779705SSam Leffler #define	AR_ISR_S4_S	0x00d4		/* Secondary interrupt status reg 4 */
6814779705SSam Leffler 
6914779705SSam Leffler #define	AR_Q0_TXDP	0x0800		/* Transmit Queue descriptor pointer */
7014779705SSam Leffler #define	AR_Q1_TXDP	0x0804		/* Transmit Queue descriptor pointer */
7114779705SSam Leffler #define	AR_Q2_TXDP	0x0808		/* Transmit Queue descriptor pointer */
7214779705SSam Leffler #define	AR_Q3_TXDP	0x080c		/* Transmit Queue descriptor pointer */
7314779705SSam Leffler #define	AR_Q4_TXDP	0x0810		/* Transmit Queue descriptor pointer */
7414779705SSam Leffler #define	AR_Q5_TXDP	0x0814		/* Transmit Queue descriptor pointer */
7514779705SSam Leffler #define	AR_Q6_TXDP	0x0818		/* Transmit Queue descriptor pointer */
7614779705SSam Leffler #define	AR_Q7_TXDP	0x081c		/* Transmit Queue descriptor pointer */
7714779705SSam Leffler #define	AR_Q8_TXDP	0x0820		/* Transmit Queue descriptor pointer */
7814779705SSam Leffler #define	AR_Q9_TXDP	0x0824		/* Transmit Queue descriptor pointer */
7914779705SSam Leffler #define	AR_QTXDP(i)	(AR_Q0_TXDP + ((i)<<2))
8014779705SSam Leffler 
8114779705SSam Leffler #define	AR_Q_TXE	0x0840		/* Transmit Queue enable */
8214779705SSam Leffler #define	AR_Q_TXD	0x0880		/* Transmit Queue disable */
8314779705SSam Leffler 
8414779705SSam Leffler #define	AR_Q0_CBRCFG	0x08c0		/* CBR configuration */
8514779705SSam Leffler #define	AR_Q1_CBRCFG	0x08c4		/* CBR configuration */
8614779705SSam Leffler #define	AR_Q2_CBRCFG	0x08c8		/* CBR configuration */
8714779705SSam Leffler #define	AR_Q3_CBRCFG	0x08cc		/* CBR configuration */
8814779705SSam Leffler #define	AR_Q4_CBRCFG	0x08d0		/* CBR configuration */
8914779705SSam Leffler #define	AR_Q5_CBRCFG	0x08d4		/* CBR configuration */
9014779705SSam Leffler #define	AR_Q6_CBRCFG	0x08d8		/* CBR configuration */
9114779705SSam Leffler #define	AR_Q7_CBRCFG	0x08dc		/* CBR configuration */
9214779705SSam Leffler #define	AR_Q8_CBRCFG	0x08e0		/* CBR configuration */
9314779705SSam Leffler #define	AR_Q9_CBRCFG	0x08e4		/* CBR configuration */
9414779705SSam Leffler #define	AR_QCBRCFG(i)	(AR_Q0_CBRCFG + ((i)<<2))
9514779705SSam Leffler 
9614779705SSam Leffler #define	AR_Q0_RDYTIMECFG	0x0900	/* ReadyTime configuration */
9714779705SSam Leffler #define	AR_Q1_RDYTIMECFG	0x0904	/* ReadyTime configuration */
9814779705SSam Leffler #define	AR_Q2_RDYTIMECFG	0x0908	/* ReadyTime configuration */
9914779705SSam Leffler #define	AR_Q3_RDYTIMECFG	0x090c	/* ReadyTime configuration */
10014779705SSam Leffler #define	AR_Q4_RDYTIMECFG	0x0910	/* ReadyTime configuration */
10114779705SSam Leffler #define	AR_Q5_RDYTIMECFG	0x0914	/* ReadyTime configuration */
10214779705SSam Leffler #define	AR_Q6_RDYTIMECFG	0x0918	/* ReadyTime configuration */
10314779705SSam Leffler #define	AR_Q7_RDYTIMECFG	0x091c	/* ReadyTime configuration */
10414779705SSam Leffler #define	AR_Q8_RDYTIMECFG	0x0920	/* ReadyTime configuration */
10514779705SSam Leffler #define	AR_Q9_RDYTIMECFG	0x0924	/* ReadyTime configuration */
10614779705SSam Leffler #define	AR_QRDYTIMECFG(i)	(AR_Q0_RDYTIMECFG + ((i)<<2))
10714779705SSam Leffler 
10814779705SSam Leffler #define	AR_Q_ONESHOTARM_SC	0x0940	/* OneShotArm set control */
10914779705SSam Leffler #define	AR_Q_ONESHOTARM_CC	0x0980	/* OneShotArm clear control */
11014779705SSam Leffler 
11114779705SSam Leffler #define	AR_Q0_MISC	0x09c0		/* Miscellaneous QCU settings */
11214779705SSam Leffler #define	AR_Q1_MISC	0x09c4		/* Miscellaneous QCU settings */
11314779705SSam Leffler #define	AR_Q2_MISC	0x09c8		/* Miscellaneous QCU settings */
11414779705SSam Leffler #define	AR_Q3_MISC	0x09cc		/* Miscellaneous QCU settings */
11514779705SSam Leffler #define	AR_Q4_MISC	0x09d0		/* Miscellaneous QCU settings */
11614779705SSam Leffler #define	AR_Q5_MISC	0x09d4		/* Miscellaneous QCU settings */
11714779705SSam Leffler #define	AR_Q6_MISC	0x09d8		/* Miscellaneous QCU settings */
11814779705SSam Leffler #define	AR_Q7_MISC	0x09dc		/* Miscellaneous QCU settings */
11914779705SSam Leffler #define	AR_Q8_MISC	0x09e0		/* Miscellaneous QCU settings */
12014779705SSam Leffler #define	AR_Q9_MISC	0x09e4		/* Miscellaneous QCU settings */
12114779705SSam Leffler #define	AR_QMISC(i)	(AR_Q0_MISC + ((i)<<2))
12214779705SSam Leffler 
12314779705SSam Leffler #define	AR_Q0_STS	0x0a00		/* Miscellaneous QCU status */
12414779705SSam Leffler #define	AR_Q1_STS	0x0a04		/* Miscellaneous QCU status */
12514779705SSam Leffler #define	AR_Q2_STS	0x0a08		/* Miscellaneous QCU status */
12614779705SSam Leffler #define	AR_Q3_STS	0x0a0c		/* Miscellaneous QCU status */
12714779705SSam Leffler #define	AR_Q4_STS	0x0a10		/* Miscellaneous QCU status */
12814779705SSam Leffler #define	AR_Q5_STS	0x0a14		/* Miscellaneous QCU status */
12914779705SSam Leffler #define	AR_Q6_STS	0x0a18		/* Miscellaneous QCU status */
13014779705SSam Leffler #define	AR_Q7_STS	0x0a1c		/* Miscellaneous QCU status */
13114779705SSam Leffler #define	AR_Q8_STS	0x0a20		/* Miscellaneous QCU status */
13214779705SSam Leffler #define	AR_Q9_STS	0x0a24		/* Miscellaneous QCU status */
13314779705SSam Leffler #define	AR_QSTS(i)	(AR_Q0_STS + ((i)<<2))
13414779705SSam Leffler 
13514779705SSam Leffler #define	AR_Q_RDYTIMESHDN	0x0a40	/* ReadyTimeShutdown status */
13614779705SSam Leffler #define	AR_D0_QCUMASK	0x1000		/* QCU Mask */
13714779705SSam Leffler #define	AR_D1_QCUMASK	0x1004		/* QCU Mask */
13814779705SSam Leffler #define	AR_D2_QCUMASK	0x1008		/* QCU Mask */
13914779705SSam Leffler #define	AR_D3_QCUMASK	0x100c		/* QCU Mask */
14014779705SSam Leffler #define	AR_D4_QCUMASK	0x1010		/* QCU Mask */
14114779705SSam Leffler #define	AR_D5_QCUMASK	0x1014		/* QCU Mask */
14214779705SSam Leffler #define	AR_D6_QCUMASK	0x1018		/* QCU Mask */
14314779705SSam Leffler #define	AR_D7_QCUMASK	0x101c		/* QCU Mask */
14414779705SSam Leffler #define	AR_D8_QCUMASK	0x1020		/* QCU Mask */
14514779705SSam Leffler #define	AR_D9_QCUMASK	0x1024		/* QCU Mask */
14614779705SSam Leffler #define	AR_DQCUMASK(i)	(AR_D0_QCUMASK + ((i)<<2))
14714779705SSam Leffler 
14814779705SSam Leffler #define	AR_D0_LCL_IFS	0x1040		/* DCU-specific IFS settings */
14914779705SSam Leffler #define	AR_D1_LCL_IFS	0x1044		/* DCU-specific IFS settings */
15014779705SSam Leffler #define	AR_D2_LCL_IFS	0x1048		/* DCU-specific IFS settings */
15114779705SSam Leffler #define	AR_D3_LCL_IFS	0x104c		/* DCU-specific IFS settings */
15214779705SSam Leffler #define	AR_D4_LCL_IFS	0x1050		/* DCU-specific IFS settings */
15314779705SSam Leffler #define	AR_D5_LCL_IFS	0x1054		/* DCU-specific IFS settings */
15414779705SSam Leffler #define	AR_D6_LCL_IFS	0x1058		/* DCU-specific IFS settings */
15514779705SSam Leffler #define	AR_D7_LCL_IFS	0x105c		/* DCU-specific IFS settings */
15614779705SSam Leffler #define	AR_D8_LCL_IFS	0x1060		/* DCU-specific IFS settings */
15714779705SSam Leffler #define	AR_D9_LCL_IFS	0x1064		/* DCU-specific IFS settings */
15814779705SSam Leffler #define	AR_DLCL_IFS(i)	(AR_D0_LCL_IFS + ((i)<<2))
15914779705SSam Leffler 
16014779705SSam Leffler #define	AR_D0_RETRY_LIMIT	0x1080	/* Retry limits */
16114779705SSam Leffler #define	AR_D1_RETRY_LIMIT	0x1084	/* Retry limits */
16214779705SSam Leffler #define	AR_D2_RETRY_LIMIT	0x1088	/* Retry limits */
16314779705SSam Leffler #define	AR_D3_RETRY_LIMIT	0x108c	/* Retry limits */
16414779705SSam Leffler #define	AR_D4_RETRY_LIMIT	0x1090	/* Retry limits */
16514779705SSam Leffler #define	AR_D5_RETRY_LIMIT	0x1094	/* Retry limits */
16614779705SSam Leffler #define	AR_D6_RETRY_LIMIT	0x1098	/* Retry limits */
16714779705SSam Leffler #define	AR_D7_RETRY_LIMIT	0x109c	/* Retry limits */
16814779705SSam Leffler #define	AR_D8_RETRY_LIMIT	0x10a0	/* Retry limits */
16914779705SSam Leffler #define	AR_D9_RETRY_LIMIT	0x10a4	/* Retry limits */
17014779705SSam Leffler #define	AR_DRETRY_LIMIT(i)	(AR_D0_RETRY_LIMIT + ((i)<<2))
17114779705SSam Leffler 
17214779705SSam Leffler #define	AR_D0_CHNTIME	0x10c0		/* ChannelTime settings */
17314779705SSam Leffler #define	AR_D1_CHNTIME	0x10c4		/* ChannelTime settings */
17414779705SSam Leffler #define	AR_D2_CHNTIME	0x10c8		/* ChannelTime settings */
17514779705SSam Leffler #define	AR_D3_CHNTIME	0x10cc		/* ChannelTime settings */
17614779705SSam Leffler #define	AR_D4_CHNTIME	0x10d0		/* ChannelTime settings */
17714779705SSam Leffler #define	AR_D5_CHNTIME	0x10d4		/* ChannelTime settings */
17814779705SSam Leffler #define	AR_D6_CHNTIME	0x10d8		/* ChannelTime settings */
17914779705SSam Leffler #define	AR_D7_CHNTIME	0x10dc		/* ChannelTime settings */
18014779705SSam Leffler #define	AR_D8_CHNTIME	0x10e0		/* ChannelTime settings */
18114779705SSam Leffler #define	AR_D9_CHNTIME	0x10e4		/* ChannelTime settings */
18214779705SSam Leffler #define	AR_DCHNTIME(i)	(AR_D0_CHNTIME + ((i)<<2))
18314779705SSam Leffler 
18414779705SSam Leffler #define	AR_D0_MISC	0x1100		/* Misc DCU-specific settings */
18514779705SSam Leffler #define	AR_D1_MISC	0x1104		/* Misc DCU-specific settings */
18614779705SSam Leffler #define	AR_D2_MISC	0x1108		/* Misc DCU-specific settings */
18714779705SSam Leffler #define	AR_D3_MISC	0x110c		/* Misc DCU-specific settings */
18814779705SSam Leffler #define	AR_D4_MISC	0x1110		/* Misc DCU-specific settings */
18914779705SSam Leffler #define	AR_D5_MISC	0x1114		/* Misc DCU-specific settings */
19014779705SSam Leffler #define	AR_D6_MISC	0x1118		/* Misc DCU-specific settings */
19114779705SSam Leffler #define	AR_D7_MISC	0x111c		/* Misc DCU-specific settings */
19214779705SSam Leffler #define	AR_D8_MISC	0x1120		/* Misc DCU-specific settings */
19314779705SSam Leffler #define	AR_D9_MISC	0x1124		/* Misc DCU-specific settings */
19414779705SSam Leffler #define	AR_DMISC(i)	(AR_D0_MISC + ((i)<<2))
19514779705SSam Leffler 
19614779705SSam Leffler #define	AR_D0_SEQNUM	0x1140		/* Frame seqnum control/status */
19714779705SSam Leffler #define	AR_D1_SEQNUM	0x1144		/* Frame seqnum control/status */
19814779705SSam Leffler #define	AR_D2_SEQNUM	0x1148		/* Frame seqnum control/status */
19914779705SSam Leffler #define	AR_D3_SEQNUM	0x114c		/* Frame seqnum control/status */
20014779705SSam Leffler #define	AR_D4_SEQNUM	0x1150		/* Frame seqnum control/status */
20114779705SSam Leffler #define	AR_D5_SEQNUM	0x1154		/* Frame seqnum control/status */
20214779705SSam Leffler #define	AR_D6_SEQNUM	0x1158		/* Frame seqnum control/status */
20314779705SSam Leffler #define	AR_D7_SEQNUM	0x115c		/* Frame seqnum control/status */
20414779705SSam Leffler #define	AR_D8_SEQNUM	0x1160		/* Frame seqnum control/status */
20514779705SSam Leffler #define	AR_D9_SEQNUM	0x1164		/* Frame seqnum control/status */
20614779705SSam Leffler #define	AR_DSEQNUM(i)	(AR_D0_SEQNUM + ((i<<2)))
20714779705SSam Leffler 
20814779705SSam Leffler /* MAC DCU-global IFS settings */
20914779705SSam Leffler #define	AR_D_GBL_IFS_SIFS	0x1030	/* DCU global SIFS settings */
21014779705SSam Leffler #define	AR_D_GBL_IFS_SLOT	0x1070	/* DC global slot interval */
21114779705SSam Leffler #define	AR_D_GBL_IFS_EIFS	0x10b0	/* DCU global EIFS setting */
21214779705SSam Leffler #define	AR_D_GBL_IFS_MISC	0x10f0	/* DCU global misc. IFS settings */
21314779705SSam Leffler #define	AR_D_FPCTL	0x1230		/* DCU frame prefetch settings */
21414779705SSam Leffler #define	AR_D_TXPSE	0x1270		/* DCU transmit pause control/status */
21514779705SSam Leffler #define	AR_D_TXBLK_CMD	0x1038		/* DCU transmit filter cmd (w/only) */
21614779705SSam Leffler #define	AR_D_TXBLK_DATA(i) (AR_D_TXBLK_CMD+(i))	/* DCU transmit filter data */
21714779705SSam Leffler #define	AR_D_TXBLK_CLR	0x143c		/* DCU clear tx filter (w/only) */
21814779705SSam Leffler #define	AR_D_TXBLK_SET	0x147c		/* DCU set tx filter (w/only) */
21914779705SSam Leffler 
22014779705SSam Leffler #define	AR_D_TXPSE	0x1270		/* DCU transmit pause control/status */
22114779705SSam Leffler 
22214779705SSam Leffler #define	AR_RC		0x4000		/* Warm reset control register */
22314779705SSam Leffler #define	AR_SCR		0x4004		/* Sleep control register */
22414779705SSam Leffler #define	AR_INTPEND	0x4008		/* Interrupt Pending register */
22514779705SSam Leffler #define	AR_SFR		0x400C		/* Sleep force register */
22614779705SSam Leffler #define	AR_PCICFG	0x4010		/* PCI configuration register */
22714779705SSam Leffler #define	AR_GPIOCR	0x4014		/* GPIO control register */
22814779705SSam Leffler #define	AR_GPIODO	0x4018		/* GPIO data output access register */
22914779705SSam Leffler #define	AR_GPIODI	0x401C		/* GPIO data input access register */
23014779705SSam Leffler #define	AR_SREV		0x4020		/* Silicon Revision register */
23114779705SSam Leffler 
23214779705SSam Leffler #define	AR_EEPROM_ADDR	0x6000		/* EEPROM address register (10 bit) */
23314779705SSam Leffler #define	AR_EEPROM_DATA	0x6004		/* EEPROM data register (16 bit) */
23414779705SSam Leffler #define	AR_EEPROM_CMD	0x6008		/* EEPROM command register */
23514779705SSam Leffler #define	AR_EEPROM_STS	0x600c		/* EEPROM status register */
23614779705SSam Leffler #define	AR_EEPROM_CFG	0x6010		/* EEPROM configuration register */
23714779705SSam Leffler 
23814779705SSam Leffler #define	AR_STA_ID0	0x8000		/* station ID0 - low 32 bits */
23914779705SSam Leffler #define	AR_STA_ID1	0x8004		/* station ID1 - upper 16 bits */
24014779705SSam Leffler #define	AR_BSS_ID0	0x8008		/* BSSID low 32 bits */
24114779705SSam Leffler #define	AR_BSS_ID1	0x800C		/* BSSID upper 16 bits / AID */
24214779705SSam Leffler #define	AR_SLOT_TIME	0x8010		/* Time-out after a collision */
24314779705SSam Leffler #define	AR_TIME_OUT	0x8014		/* ACK & CTS time-out */
24414779705SSam Leffler #define	AR_RSSI_THR	0x8018		/* RSSI warning & missed beacon threshold */
24514779705SSam Leffler #define	AR_USEC		0x801c		/* transmit latency register */
24614779705SSam Leffler #define	AR_BEACON	0x8020		/* beacon control value/mode bits */
24714779705SSam Leffler #define	AR_CFP_PERIOD	0x8024		/* CFP Interval (TU/msec) */
24814779705SSam Leffler #define	AR_TIMER0	0x8028		/* Next beacon time (TU/msec) */
24914779705SSam Leffler #define	AR_TIMER1	0x802c		/* DMA beacon alert time (1/8 TU) */
25014779705SSam Leffler #define	AR_TIMER2	0x8030		/* Software beacon alert (1/8 TU) */
25114779705SSam Leffler #define	AR_TIMER3	0x8034		/* ATIM window time */
25214779705SSam Leffler #define	AR_CFP_DUR	0x8038		/* maximum CFP duration in TU */
25314779705SSam Leffler #define	AR_RX_FILTER	0x803C		/* receive filter register */
25414779705SSam Leffler #define	AR_MCAST_FIL0	0x8040		/* multicast filter lower 32 bits */
25514779705SSam Leffler #define	AR_MCAST_FIL1	0x8044		/* multicast filter upper 32 bits */
25614779705SSam Leffler #define	AR_DIAG_SW	0x8048		/* PCU control register */
25714779705SSam Leffler #define	AR_TSF_L32	0x804c		/* local clock lower 32 bits */
25814779705SSam Leffler #define	AR_TSF_U32	0x8050		/* local clock upper 32 bits */
25914779705SSam Leffler #define	AR_TST_ADDAC	0x8054		/* ADDAC test register */
26014779705SSam Leffler #define	AR_DEF_ANTENNA	0x8058		/* default antenna register */
26114779705SSam Leffler 
26214779705SSam Leffler #define	AR_LAST_TSTP	0x8080		/* Time stamp of the last beacon rcvd */
26314779705SSam Leffler #define	AR_NAV		0x8084		/* current NAV value */
26414779705SSam Leffler #define	AR_RTS_OK	0x8088		/* RTS exchange success counter */
26514779705SSam Leffler #define	AR_RTS_FAIL	0x808c		/* RTS exchange failure counter */
26614779705SSam Leffler #define	AR_ACK_FAIL	0x8090		/* ACK failure counter */
26714779705SSam Leffler #define	AR_FCS_FAIL	0x8094		/* FCS check failure counter */
26814779705SSam Leffler #define	AR_BEACON_CNT	0x8098		/* Valid beacon counter */
26914779705SSam Leffler 
27014779705SSam Leffler #define	AR_KEYTABLE_0	0x8800		/* Encryption key table */
27114779705SSam Leffler #define	AR_KEYTABLE(n)	(AR_KEYTABLE_0 + ((n)*32))
27214779705SSam Leffler 
27314779705SSam Leffler #define	AR_CR_RXE	0x00000004	/* Receive enable */
27414779705SSam Leffler #define	AR_CR_RXD	0x00000020	/* Receive disable */
27514779705SSam Leffler #define	AR_CR_SWI	0x00000040	/* One-shot software interrupt */
27614779705SSam Leffler #define	AR_CR_BITS	"\20\3RXE\6RXD\7SWI"
27714779705SSam Leffler 
27814779705SSam Leffler #define	AR_CFG_SWTD	0x00000001	/* byteswap tx descriptor words */
27914779705SSam Leffler #define	AR_CFG_SWTB	0x00000002	/* byteswap tx data buffer words */
28014779705SSam Leffler #define	AR_CFG_SWRD	0x00000004	/* byteswap rx descriptor words */
28114779705SSam Leffler #define	AR_CFG_SWRB	0x00000008	/* byteswap rx data buffer words */
28214779705SSam Leffler #define	AR_CFG_SWRG	0x00000010	/* byteswap register access data words */
28314779705SSam Leffler #define	AR_CFG_AP_ADHOC_INDICATION	0x00000020	/* AP/adhoc indication (0-AP, 1-Adhoc) */
28414779705SSam Leffler #define	AR_CFG_PHOK	0x00000100	/* PHY OK status */
28514779705SSam Leffler #define	AR_CFG_EEBS	0x00000200	/* EEPROM busy */
28614779705SSam Leffler #define	AR_CFG_CLK_GATE_DIS	0x00000400	/* Clock gating disable (Oahu only) */
28714779705SSam Leffler #define	AR_CFG_PCI_MASTER_REQ_Q_THRESH_M	0x00060000	/* Mask of PCI core master request queue full threshold */
28814779705SSam Leffler #define	AR_CFG_PCI_MASTER_REQ_Q_THRESH_S	17        	/* Shift for PCI core master request queue full threshold */
28914779705SSam Leffler #define	AR_CFG_BITS \
29014779705SSam Leffler 	"\20\1SWTD\2SWTB\3SWRD\4SWRB\5SWRG\10PHYOK11EEBS"
29114779705SSam Leffler 
29214779705SSam Leffler #define	AR_IER_ENABLE	0x00000001	/* Global interrupt enable */
29314779705SSam Leffler #define	AR_IER_DISABLE	0x00000000	/* Global interrupt disable */
29414779705SSam Leffler #define	AR_IER_BITS	"\20\1ENABLE"
29514779705SSam Leffler 
29614779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_6_M	0x000000FF
29714779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_6_S	0
29814779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_9_M	0x0000FF00
29914779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_9_S	8
30014779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_12_M	0x00FF0000
30114779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_12_S	16
30214779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_18_M	0xFF000000
30314779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_18_S	24
30414779705SSam Leffler 
30514779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_24_M	0x000000FF
30614779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_24_S	0
30714779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_36_M	0x0000FF00
30814779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_36_S	8
30914779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_48_M	0x00FF0000
31014779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_48_S	16
31114779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_54_M	0xFF000000
31214779705SSam Leffler #define	AR_RTSD0_RTS_DURATION_54_S	24
31314779705SSam Leffler 
31414779705SSam Leffler #define	AR_DMASIZE_4B	0x00000000	/* DMA size 4 bytes (TXCFG + RXCFG) */
31514779705SSam Leffler #define	AR_DMASIZE_8B	0x00000001	/* DMA size 8 bytes */
31614779705SSam Leffler #define	AR_DMASIZE_16B	0x00000002	/* DMA size 16 bytes */
31714779705SSam Leffler #define	AR_DMASIZE_32B	0x00000003	/* DMA size 32 bytes */
31814779705SSam Leffler #define	AR_DMASIZE_64B	0x00000004	/* DMA size 64 bytes */
31914779705SSam Leffler #define	AR_DMASIZE_128B	0x00000005	/* DMA size 128 bytes */
32014779705SSam Leffler #define	AR_DMASIZE_256B	0x00000006	/* DMA size 256 bytes */
32114779705SSam Leffler #define	AR_DMASIZE_512B	0x00000007	/* DMA size 512 bytes */
32214779705SSam Leffler 
32314779705SSam Leffler #define	AR_TXCFG_FTRIG_M	0x000003F0	/* Mask for Frame trigger level */
32414779705SSam Leffler #define	AR_TXCFG_FTRIG_S	4         	/* Shift for Frame trigger level */
32514779705SSam Leffler #define	AR_TXCFG_FTRIG_IMMED	0x00000000	/* bytes in PCU TX FIFO before air */
32614779705SSam Leffler #define	AR_TXCFG_FTRIG_64B	0x00000010	/* default */
32714779705SSam Leffler #define	AR_TXCFG_FTRIG_128B	0x00000020
32814779705SSam Leffler #define	AR_TXCFG_FTRIG_192B	0x00000030
32914779705SSam Leffler #define	AR_TXCFG_FTRIG_256B	0x00000040	/* 5 bits total */
33014779705SSam Leffler #define	AR_TXCFG_BITS	"\20"
33114779705SSam Leffler 
33214779705SSam Leffler #define	AR5311_RXCFG_DEF_RX_ANTENNA	0x00000008	/* Default Receive Antenna */
33314779705SSam Leffler 						/* Maui2/Spirit only - reserved on Oahu */
33414779705SSam Leffler #define	AR_RXCFG_ZLFDMA	0x00000010	/* Enable DMA of zero-length frame */
33514779705SSam Leffler #define	AR_RXCFG_EN_JUM	0x00000020	/* Enable jumbo rx descriptors */
33614779705SSam Leffler #define	AR_RXCFG_WR_JUM	0x00000040	/* Wrap jumbo rx descriptors */
33714779705SSam Leffler 
33814779705SSam Leffler #define	AR_MIBC_COW	0x00000001	/* counter overflow warning */
33914779705SSam Leffler #define	AR_MIBC_FMC	0x00000002	/* freeze MIB counters */
34014779705SSam Leffler #define	AR_MIBC_CMC	0x00000004	/* clear MIB counters */
34114779705SSam Leffler #define	AR_MIBC_MCS	0x00000008	/* MIB counter strobe, increment all */
34214779705SSam Leffler 
34314779705SSam Leffler #define	AR_TOPS_MASK	0x0000FFFF	/* Mask for timeout prescale */
34414779705SSam Leffler 
34514779705SSam Leffler #define	AR_RXNPTO_MASK	0x000003FF	/* Mask for no frame received timeout */
34614779705SSam Leffler 
34714779705SSam Leffler #define	AR_TXNPTO_MASK	0x000003FF	/* Mask for no frame transmitted timeout */
34814779705SSam Leffler #define	AR_TXNPTO_QCU_MASK	0x03FFFC00	/* Mask indicating the set of QCUs */
34914779705SSam Leffler 					/* for which frame completions will cause */
35014779705SSam Leffler 					/* a reset of the no frame transmitted timeout */
35114779705SSam Leffler 
35214779705SSam Leffler #define	AR_RPGTO_MASK	0x000003FF	/* Mask for receive frame gap timeout */
35314779705SSam Leffler 
35414779705SSam Leffler #define	AR_RPCNT_MASK	0x0000001F	/* Mask for receive frame count limit */
35514779705SSam Leffler 
35614779705SSam Leffler #define	AR_MACMISC_DMA_OBS_M	0x000001E0	/* Mask for DMA observation bus mux select */
35714779705SSam Leffler #define	AR_MACMISC_DMA_OBS_S	5         	/* Shift for DMA observation bus mux select */
35814779705SSam Leffler #define	AR_MACMISC_MISC_OBS_M	0x00000E00	/* Mask for MISC observation bus mux select */
35914779705SSam Leffler #define	AR_MACMISC_MISC_OBS_S	9         	/* Shift for MISC observation bus mux select */
36014779705SSam Leffler #define	AR_MACMISC_MAC_OBS_BUS_LSB_M	0x00007000	/* Mask for MAC observation bus mux select (lsb) */
36114779705SSam Leffler #define	AR_MACMISC_MAC_OBS_BUS_LSB_S	12        	/* Shift for MAC observation bus mux select (lsb) */
36214779705SSam Leffler #define	AR_MACMISC_MAC_OBS_BUS_MSB_M	0x00038000	/* Mask for MAC observation bus mux select (msb) */
36314779705SSam Leffler #define	AR_MACMISC_MAC_OBS_BUS_MSB_S	15        	/* Shift for MAC observation bus mux select (msb) */
36414779705SSam Leffler 
36514779705SSam Leffler 				/* Maui2/Spirit only. */
36614779705SSam Leffler #define	AR5311_QDCLKGATE_QCU_M	0x0000FFFF	/* Mask for QCU clock disable */
36714779705SSam Leffler #define	AR5311_QDCLKGATE_DCU_M	0x07FF0000	/* Mask for DCU clock disable */
36814779705SSam Leffler 
36914779705SSam Leffler 	/* Interrupt Status Registers */
37014779705SSam Leffler #define	AR_ISR_RXOK	0x00000001	/* At least one frame received sans errors */
37114779705SSam Leffler #define	AR_ISR_RXDESC	0x00000002	/* Receive interrupt request */
37214779705SSam Leffler #define	AR_ISR_RXERR	0x00000004	/* Receive error interrupt */
37314779705SSam Leffler #define	AR_ISR_RXNOPKT	0x00000008	/* No frame received within timeout clock */
37414779705SSam Leffler #define	AR_ISR_RXEOL	0x00000010	/* Received descriptor empty interrupt */
37514779705SSam Leffler #define	AR_ISR_RXORN	0x00000020	/* Receive FIFO overrun interrupt */
37614779705SSam Leffler #define	AR_ISR_TXOK	0x00000040	/* Transmit okay interrupt */
37714779705SSam Leffler #define	AR_ISR_TXDESC	0x00000080	/* Transmit interrupt request */
37814779705SSam Leffler #define	AR_ISR_TXERR	0x00000100	/* Transmit error interrupt */
37914779705SSam Leffler #define	AR_ISR_TXNOPKT	0x00000200	/* No frame transmitted interrupt */
38014779705SSam Leffler #define	AR_ISR_TXEOL	0x00000400	/* Transmit descriptor empty interrupt */
38114779705SSam Leffler #define	AR_ISR_TXURN	0x00000800	/* Transmit FIFO underrun interrupt */
38214779705SSam Leffler #define	AR_ISR_MIB	0x00001000	/* MIB interrupt - see MIBC */
38314779705SSam Leffler #define	AR_ISR_SWI	0x00002000	/* Software interrupt */
38414779705SSam Leffler #define	AR_ISR_RXPHY	0x00004000	/* PHY receive error interrupt */
38514779705SSam Leffler #define	AR_ISR_RXKCM	0x00008000	/* Key-cache miss interrupt */
38614779705SSam Leffler #define	AR_ISR_SWBA	0x00010000	/* Software beacon alert interrupt */
38714779705SSam Leffler #define	AR_ISR_BRSSI	0x00020000	/* Beacon threshold interrupt */
38814779705SSam Leffler #define	AR_ISR_BMISS	0x00040000	/* Beacon missed interrupt */
38914779705SSam Leffler #define	AR_ISR_HIUERR	0x00080000	/* An unexpected bus error has occurred */
39014779705SSam Leffler #define	AR_ISR_BNR	0x00100000	/* Beacon not ready interrupt */
39114779705SSam Leffler #define	AR_ISR_TIM	0x00800000	/* TIM interrupt */
39214779705SSam Leffler #define	AR_ISR_GPIO	0x01000000	/* GPIO Interrupt */
39314779705SSam Leffler #define	AR_ISR_QCBROVF	0x02000000	/* QCU CBR overflow interrupt */
39414779705SSam Leffler #define	AR_ISR_QCBRURN	0x04000000	/* QCU CBR underrun interrupt */
39514779705SSam Leffler #define	AR_ISR_QTRIG	0x08000000	/* QCU scheduling trigger interrupt */
39614779705SSam Leffler #define	AR_ISR_RESV0	0xF0000000	/* Reserved */
39714779705SSam Leffler 
39814779705SSam Leffler #define	AR_ISR_S0_QCU_TXOK_M	0x000003FF	/* Mask for TXOK (QCU 0-9) */
39914779705SSam Leffler #define	AR_ISR_S0_QCU_TXDESC_M	0x03FF0000	/* Mask for TXDESC (QCU 0-9) */
40014779705SSam Leffler 
40114779705SSam Leffler #define	AR_ISR_S1_QCU_TXERR_M	0x000003FF	/* Mask for TXERR (QCU 0-9) */
40214779705SSam Leffler #define	AR_ISR_S1_QCU_TXEOL_M	0x03FF0000	/* Mask for TXEOL (QCU 0-9) */
40314779705SSam Leffler 
40414779705SSam Leffler #define	AR_ISR_S2_QCU_TXURN_M	0x000003FF	/* Mask for TXURN (QCU 0-9) */
40514779705SSam Leffler #define	AR_ISR_S2_MCABT	0x00010000	/* Master cycle abort interrupt */
40614779705SSam Leffler #define	AR_ISR_S2_SSERR	0x00020000	/* SERR interrupt */
40714779705SSam Leffler #define	AR_ISR_S2_DPERR	0x00040000	/* PCI bus parity error */
40814779705SSam Leffler #define	AR_ISR_S2_RESV0	0xFFF80000	/* Reserved */
40914779705SSam Leffler 
41014779705SSam Leffler #define	AR_ISR_S3_QCU_QCBROVF_M	0x000003FF	/* Mask for QCBROVF (QCU 0-9) */
41114779705SSam Leffler #define	AR_ISR_S3_QCU_QCBRURN_M	0x03FF0000	/* Mask for QCBRURN (QCU 0-9) */
41214779705SSam Leffler 
41314779705SSam Leffler #define	AR_ISR_S4_QCU_QTRIG_M	0x000003FF	/* Mask for QTRIG (QCU 0-9) */
41414779705SSam Leffler #define	AR_ISR_S4_RESV0	0xFFFFFC00	/* Reserved */
41514779705SSam Leffler 
41614779705SSam Leffler 	/* Interrupt Mask Registers */
41714779705SSam Leffler #define	AR_IMR_RXOK	0x00000001	/* At least one frame received sans errors */
41814779705SSam Leffler #define	AR_IMR_RXDESC	0x00000002	/* Receive interrupt request */
41914779705SSam Leffler #define	AR_IMR_RXERR	0x00000004	/* Receive error interrupt */
42014779705SSam Leffler #define	AR_IMR_RXNOPKT	0x00000008	/* No frame received within timeout clock */
42114779705SSam Leffler #define	AR_IMR_RXEOL	0x00000010	/* Received descriptor empty interrupt */
42214779705SSam Leffler #define	AR_IMR_RXORN	0x00000020	/* Receive FIFO overrun interrupt */
42314779705SSam Leffler #define	AR_IMR_TXOK	0x00000040	/* Transmit okay interrupt */
42414779705SSam Leffler #define	AR_IMR_TXDESC	0x00000080	/* Transmit interrupt request */
42514779705SSam Leffler #define	AR_IMR_TXERR	0x00000100	/* Transmit error interrupt */
42614779705SSam Leffler #define	AR_IMR_TXNOPKT	0x00000200	/* No frame transmitted interrupt */
42714779705SSam Leffler #define	AR_IMR_TXEOL	0x00000400	/* Transmit descriptor empty interrupt */
42814779705SSam Leffler #define	AR_IMR_TXURN	0x00000800	/* Transmit FIFO underrun interrupt */
42914779705SSam Leffler #define	AR_IMR_MIB	0x00001000	/* MIB interrupt - see MIBC */
43014779705SSam Leffler #define	AR_IMR_SWI	0x00002000	/* Software interrupt */
43114779705SSam Leffler #define	AR_IMR_RXPHY	0x00004000	/* PHY receive error interrupt */
43214779705SSam Leffler #define	AR_IMR_RXKCM	0x00008000	/* Key-cache miss interrupt */
43314779705SSam Leffler #define	AR_IMR_SWBA	0x00010000	/* Software beacon alert interrupt */
43414779705SSam Leffler #define	AR_IMR_BRSSI	0x00020000	/* Beacon threshold interrupt */
43514779705SSam Leffler #define	AR_IMR_BMISS	0x00040000	/* Beacon missed interrupt */
43614779705SSam Leffler #define	AR_IMR_HIUERR	0x00080000	/* An unexpected bus error has occurred */
43714779705SSam Leffler #define	AR_IMR_BNR	0x00100000	/* BNR interrupt */
43814779705SSam Leffler #define	AR_IMR_TIM	0x00800000	/* TIM interrupt */
43914779705SSam Leffler #define	AR_IMR_GPIO	0x01000000	/* GPIO Interrupt */
44014779705SSam Leffler #define	AR_IMR_QCBROVF	0x02000000	/* QCU CBR overflow interrupt */
44114779705SSam Leffler #define	AR_IMR_QCBRURN	0x04000000	/* QCU CBR underrun interrupt */
44214779705SSam Leffler #define	AR_IMR_QTRIG	0x08000000	/* QCU scheduling trigger interrupt */
44314779705SSam Leffler #define	AR_IMR_RESV0	0xF0000000	/* Reserved */
44414779705SSam Leffler 
44514779705SSam Leffler #define	AR_IMR_S0_QCU_TXOK	0x000003FF	/* Mask for TXOK (QCU 0-9) */
44614779705SSam Leffler #define	AR_IMR_S0_QCU_TXOK_S	0
44714779705SSam Leffler #define	AR_IMR_S0_QCU_TXDESC	0x03FF0000	/* Mask for TXDESC (QCU 0-9) */
44814779705SSam Leffler #define	AR_IMR_S0_QCU_TXDESC_S	16        	/* Shift for TXDESC (QCU 0-9) */
44914779705SSam Leffler 
45014779705SSam Leffler #define	AR_IMR_S1_QCU_TXERR	0x000003FF	/* Mask for TXERR (QCU 0-9) */
45114779705SSam Leffler #define	AR_IMR_S1_QCU_TXERR_S	0
45214779705SSam Leffler #define	AR_IMR_S1_QCU_TXEOL	0x03FF0000	/* Mask for TXEOL (QCU 0-9) */
45314779705SSam Leffler #define	AR_IMR_S1_QCU_TXEOL_S	16        	/* Shift for TXEOL (QCU 0-9) */
45414779705SSam Leffler 
45514779705SSam Leffler #define	AR_IMR_S2_QCU_TXURN	0x000003FF	/* Mask for TXURN (QCU 0-9) */
45614779705SSam Leffler #define	AR_IMR_S2_QCU_TXURN_S	0
45714779705SSam Leffler #define	AR_IMR_S2_MCABT	0x00010000	/* Master cycle abort interrupt */
45814779705SSam Leffler #define	AR_IMR_S2_SSERR	0x00020000	/* SERR interrupt */
45914779705SSam Leffler #define	AR_IMR_S2_DPERR	0x00040000	/* PCI bus parity error */
46014779705SSam Leffler #define	AR_IMR_S2_RESV0	0xFFF80000	/* Reserved */
46114779705SSam Leffler 
46214779705SSam Leffler #define	AR_IMR_S3_QCU_QCBROVF_M	0x000003FF	/* Mask for QCBROVF (QCU 0-9) */
46314779705SSam Leffler #define	AR_IMR_S3_QCU_QCBRURN_M	0x03FF0000	/* Mask for QCBRURN (QCU 0-9) */
46414779705SSam Leffler #define	AR_IMR_S3_QCU_QCBRURN_S	16        	/* Shift for QCBRURN (QCU 0-9) */
46514779705SSam Leffler 
46614779705SSam Leffler #define	AR_IMR_S4_QCU_QTRIG_M	0x000003FF	/* Mask for QTRIG (QCU 0-9) */
46714779705SSam Leffler #define	AR_IMR_S4_RESV0	0xFFFFFC00	/* Reserved */
46814779705SSam Leffler 
46914779705SSam Leffler 	/* Interrupt status registers (read-and-clear access, secondary shadow copies) */
47014779705SSam Leffler 
47114779705SSam Leffler 	/* QCU registers */
47214779705SSam Leffler #define	AR_NUM_QCU	10    	/* Only use QCU 0-9 for forward QCU compatibility */
47314779705SSam Leffler #define	AR_QCU_0	0x0001
47414779705SSam Leffler #define	AR_QCU_1	0x0002
47514779705SSam Leffler #define	AR_QCU_2	0x0004
47614779705SSam Leffler #define	AR_QCU_3	0x0008
47714779705SSam Leffler #define	AR_QCU_4	0x0010
47814779705SSam Leffler #define	AR_QCU_5	0x0020
47914779705SSam Leffler #define	AR_QCU_6	0x0040
48014779705SSam Leffler #define	AR_QCU_7	0x0080
48114779705SSam Leffler #define	AR_QCU_8	0x0100
48214779705SSam Leffler #define	AR_QCU_9	0x0200
48314779705SSam Leffler 
48414779705SSam Leffler #define	AR_Q_TXE_M	0x000003FF	/* Mask for TXE (QCU 0-9) */
48514779705SSam Leffler 
48614779705SSam Leffler #define	AR_Q_TXD_M	0x000003FF	/* Mask for TXD (QCU 0-9) */
48714779705SSam Leffler 
48814779705SSam Leffler #define	AR_Q_CBRCFG_CBR_INTERVAL	0x00FFFFFF	/* Mask for CBR interval (us) */
48914779705SSam Leffler #define	AR_Q_CBRCFG_CBR_INTERVAL_S		0	/* Shift for CBR interval */
49014779705SSam Leffler #define	AR_Q_CBRCFG_CBR_OVF_THRESH	0xFF000000	/* Mask for CBR overflow threshold */
49114779705SSam Leffler #define	AR_Q_CBRCFG_CBR_OVF_THRESH_S		24	/* Shift for " " " */
49214779705SSam Leffler 
49314779705SSam Leffler #define	AR_Q_RDYTIMECFG_INT	0x00FFFFFF 	/* CBR interval (us) */
49414779705SSam Leffler #define	AR_Q_RDYTIMECFG_INT_S	0		/* Shift for ReadyTime Interval (us) */
49514779705SSam Leffler #define	AR_Q_RDYTIMECFG_DURATION_M	0x00FFFFFF	/* Mask for CBR interval (us) */
49614779705SSam Leffler #define	AR_Q_RDYTIMECFG_EN	0x01000000	/* ReadyTime enable */
49714779705SSam Leffler #define	AR_Q_RDYTIMECFG_RESV0	0xFE000000	/* Reserved */
49814779705SSam Leffler 
49914779705SSam Leffler #define	AR_Q_ONESHOTARM_SC_M	0x0000FFFF	/* Mask for MAC_Q_ONESHOTARM_SC (QCU 0-15) */
50014779705SSam Leffler #define	AR_Q_ONESHOTARM_SC_RESV0 0xFFFF0000	/* Reserved */
50114779705SSam Leffler 
50214779705SSam Leffler #define	AR_Q_ONESHOTARM_CC_M	0x0000FFFF	/* Mask for MAC_Q_ONESHOTARM_CC (QCU 0-15) */
50314779705SSam Leffler #define	AR_Q_ONESHOTARM_CC_RESV0 0xFFFF0000	/* Reserved */
50414779705SSam Leffler 
50514779705SSam Leffler #define	AR_Q_MISC_FSP_M		0x0000000F	/* Mask for Frame Scheduling Policy */
50614779705SSam Leffler #define	AR_Q_MISC_FSP_ASAP		0	/* ASAP */
50714779705SSam Leffler #define	AR_Q_MISC_FSP_CBR		1	/* CBR */
50814779705SSam Leffler #define	AR_Q_MISC_FSP_DBA_GATED		2	/* DMA Beacon Alert gated */
50914779705SSam Leffler #define	AR_Q_MISC_FSP_TIM_GATED		3	/* TIM gated */
51014779705SSam Leffler #define	AR_Q_MISC_FSP_BEACON_SENT_GATED	4	/* Beacon-sent-gated */
51114779705SSam Leffler #define	AR_Q_MISC_ONE_SHOT_EN	0x00000010	/* OneShot enable */
51214779705SSam Leffler #define	AR_Q_MISC_CBR_INCR_DIS1	0x00000020	/* Disable CBR expired counter
51314779705SSam Leffler 						   incr (empty q) */
51414779705SSam Leffler #define	AR_Q_MISC_CBR_INCR_DIS0	0x00000040	/* Disable CBR expired counter
51514779705SSam Leffler 						   incr (empty beacon q) */
51614779705SSam Leffler #define	AR_Q_MISC_BEACON_USE	0x00000080	/* Beacon use indication */
51714779705SSam Leffler #define	AR_Q_MISC_CBR_EXP_CNTR_LIMIT	0x00000100	/* CBR expired counter limit enable */
51814779705SSam Leffler #define	AR_Q_MISC_RDYTIME_EXP_POLICY	0x00000200	/* Enable TXE cleared on ReadyTime expired or VEOL */
51914779705SSam Leffler #define	AR_Q_MISC_RESET_CBR_EXP_CTR	0x00000400	/* Reset CBR expired counter */
52014779705SSam Leffler #define	AR_Q_MISC_DCU_EARLY_TERM_REQ	0x00000800	/* DCU frame early termination request control */
52114779705SSam Leffler #define	AR_Q_MISC_RESV0	0xFFFFF000	/* Reserved */
52214779705SSam Leffler 
52314779705SSam Leffler #define	AR_Q_STS_PEND_FR_CNT_M	0x00000003	/* Mask for Pending Frame Count */
52414779705SSam Leffler #define	AR_Q_STS_RESV0	0x000000FC	/* Reserved */
52514779705SSam Leffler #define	AR_Q_STS_CBR_EXP_CNT_M	0x0000FF00	/* Mask for CBR expired counter */
52614779705SSam Leffler #define	AR_Q_STS_RESV1	0xFFFF0000	/* Reserved */
52714779705SSam Leffler 
52814779705SSam Leffler #define	AR_Q_RDYTIMESHDN_M	0x000003FF	/* Mask for ReadyTimeShutdown status (QCU 0-9) */
52914779705SSam Leffler 
53014779705SSam Leffler 	/* DCU registers */
53114779705SSam Leffler #define	AR_NUM_DCU	10    	/* Only use 10 DCU's for forward QCU/DCU compatibility */
53214779705SSam Leffler #define	AR_DCU_0	0x0001
53314779705SSam Leffler #define	AR_DCU_1	0x0002
53414779705SSam Leffler #define	AR_DCU_2	0x0004
53514779705SSam Leffler #define	AR_DCU_3	0x0008
53614779705SSam Leffler #define	AR_DCU_4	0x0010
53714779705SSam Leffler #define	AR_DCU_5	0x0020
53814779705SSam Leffler #define	AR_DCU_6	0x0040
53914779705SSam Leffler #define	AR_DCU_7	0x0080
54014779705SSam Leffler #define	AR_DCU_8	0x0100
54114779705SSam Leffler #define	AR_DCU_9	0x0200
54214779705SSam Leffler 
54314779705SSam Leffler #define	AR_D_QCUMASK_M	0x000003FF	/* Mask for QCU Mask (QCU 0-9) */
54414779705SSam Leffler #define	AR_D_QCUMASK_RESV0	0xFFFFFC00	/* Reserved */
54514779705SSam Leffler 
54614779705SSam Leffler #define	AR_D_LCL_IFS_CWMIN	0x000003FF	/* Mask for CW_MIN */
54714779705SSam Leffler #define	AR_D_LCL_IFS_CWMIN_S	0		/* Shift for CW_MIN */
54814779705SSam Leffler #define	AR_D_LCL_IFS_CWMAX	0x000FFC00	/* Mask for CW_MAX */
54914779705SSam Leffler #define	AR_D_LCL_IFS_CWMAX_S	10        	/* Shift for CW_MAX */
55014779705SSam Leffler #define	AR_D_LCL_IFS_AIFS	0x0FF00000	/* Mask for AIFS */
55114779705SSam Leffler #define	AR_D_LCL_IFS_AIFS_S	20        	/* Shift for AIFS */
55214779705SSam Leffler #define	AR_D_LCL_IFS_RESV0	0xF0000000	/* Reserved */
55314779705SSam Leffler 
55414779705SSam Leffler #define	AR_D_RETRY_LIMIT_FR_SH	0x0000000F	/* Mask for frame short retry limit */
55514779705SSam Leffler #define	AR_D_RETRY_LIMIT_FR_SH_S	0	/* Shift for frame short retry limit */
55614779705SSam Leffler #define	AR_D_RETRY_LIMIT_FR_LG	0x000000F0	/* Mask for frame long retry limit */
55714779705SSam Leffler #define	AR_D_RETRY_LIMIT_FR_LG_S	4	/* Shift for frame long retry limit */
55814779705SSam Leffler #define	AR_D_RETRY_LIMIT_STA_SH	0x00003F00	/* Mask for station short retry limit */
55914779705SSam Leffler #define	AR_D_RETRY_LIMIT_STA_SH_S	8	/* Shift for station short retry limit */
56014779705SSam Leffler #define	AR_D_RETRY_LIMIT_STA_LG	0x000FC000	/* Mask for station short retry limit */
56114779705SSam Leffler #define	AR_D_RETRY_LIMIT_STA_LG_S	14	/* Shift for station short retry limit */
56214779705SSam Leffler #define	AR_D_RETRY_LIMIT_RESV0	0xFFF00000	/* Reserved */
56314779705SSam Leffler 
56414779705SSam Leffler #define	AR_D_CHNTIME_EN	0x00100000	/* ChannelTime enable */
56514779705SSam Leffler #define	AR_D_CHNTIME_RESV0	0xFFE00000	/* Reserved */
56614779705SSam Leffler #define	AR_D_CHNTIME_DUR	0x000FFFFF	/* Mask for ChannelTime duration (us) */
56714779705SSam Leffler #define AR_D_CHNTIME_DUR_S              0 /* Shift for ChannelTime duration */
56814779705SSam Leffler 
56914779705SSam Leffler #define	AR_D_MISC_BKOFF_THRESH_M	0x000007FF	/* Mask for Backoff threshold setting */
57014779705SSam Leffler #define AR_D_MISC_FRAG_BKOFF_EN         0x00000200 /* Backoff during a frag burst */
57114779705SSam Leffler #define	AR_D_MISC_HCF_POLL_EN	0x00000800	/* HFC poll enable */
57214779705SSam Leffler #define	AR_D_MISC_BKOFF_PERSISTENCE	0x00001000	/* Backoff persistence factor setting */
57314779705SSam Leffler #define	AR_D_MISC_FR_PREFETCH_EN	0x00002000	/* Frame prefetch enable */
57414779705SSam Leffler #define	AR_D_MISC_VIR_COL_HANDLING_M	0x0000C000	/* Mask for Virtual collision handling policy */
57514779705SSam Leffler #define	AR_D_MISC_VIR_COL_HANDLING_NORMAL	0     	/* Normal */
57614779705SSam Leffler #define	AR_D_MISC_VIR_COL_HANDLING_MODIFIED	1   	/* Modified */
57714779705SSam Leffler #define	AR_D_MISC_VIR_COL_HANDLING_IGNORE	2     	/* Ignore */
57814779705SSam Leffler #define	AR_D_MISC_BEACON_USE	0x00010000	/* Beacon use indication */
57914779705SSam Leffler #define	AR_D_MISC_ARB_LOCKOUT_CNTRL	0x00060000	/* Mask for DCU arbiter lockout control */
58014779705SSam Leffler #define	AR_D_MISC_ARB_LOCKOUT_CNTRL_S	17        	/* Shift for DCU arbiter lockout control */
58114779705SSam Leffler #define	AR_D_MISC_ARB_LOCKOUT_CNTRL_NONE	0      	/* No lockout */
58214779705SSam Leffler #define	AR_D_MISC_ARB_LOCKOUT_CNTRL_INTRA_FR	1  	/* Intra-frame */
58314779705SSam Leffler #define	AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL	2    	/* Global */
58414779705SSam Leffler #define	AR_D_MISC_ARB_LOCKOUT_IGNORE	0x00080000	/* DCU arbiter lockout ignore control */
58514779705SSam Leffler #define	AR_D_MISC_SEQ_NUM_INCR_DIS	0x00100000	/* Sequence number increment disable */
58614779705SSam Leffler #define	AR_D_MISC_POST_FR_BKOFF_DIS	0x00200000	/* Post-frame backoff disable */
58714779705SSam Leffler #define	AR_D_MISC_VIRT_COLL_POLICY	0x00400000	/* Virtual coll. handling policy */
58814779705SSam Leffler #define	AR_D_MISC_BLOWN_IFS_POLICY	0x00800000	/* Blown IFS handling policy */
58914779705SSam Leffler #define	AR5311_D_MISC_SEQ_NUM_CONTROL	0x01000000	/* Sequence Number local or global */
59014779705SSam Leffler 						/* Maui2/Spirit only, reserved on Oahu */
59114779705SSam Leffler #define	AR_D_MISC_RESV0	0xFE000000	/* Reserved */
59214779705SSam Leffler 
59314779705SSam Leffler #define	AR_D_SEQNUM_M	0x00000FFF	/* Mask for value of sequence number */
59414779705SSam Leffler #define	AR_D_SEQNUM_RESV0	0xFFFFF000	/* Reserved */
59514779705SSam Leffler 
59614779705SSam Leffler #define	AR_D_GBL_IFS_MISC_LFSR_SLICE_SEL	0x00000007	/* Mask forLFSR slice select */
59714779705SSam Leffler #define	AR_D_GBL_IFS_MISC_TURBO_MODE	0x00000008	/* Turbo mode indication */
59814779705SSam Leffler #define	AR_D_GBL_IFS_MISC_SIFS_DURATION_USEC	0x000003F0	/* Mask for SIFS duration (us) */
59914779705SSam Leffler #define	AR_D_GBL_IFS_MISC_USEC_DURATION	0x000FFC00	/* Mask for microsecond duration */
60014779705SSam Leffler #define	AR_D_GBL_IFS_MISC_DCU_ARBITER_DLY	0x00300000	/* Mask for DCU arbiter delay */
60114779705SSam Leffler #define	AR_D_GBL_IFS_MISC_RESV0	0xFFC00000	/* Reserved */
60214779705SSam Leffler 
60314779705SSam Leffler /* Oahu only */
60414779705SSam Leffler #define	AR_D_TXPSE_CTRL_M	0x000003FF	/* Mask of DCUs to pause (DCUs 0-9) */
60514779705SSam Leffler #define	AR_D_TXPSE_RESV0	0x0000FC00	/* Reserved */
60614779705SSam Leffler #define	AR_D_TXPSE_STATUS	0x00010000	/* Transmit pause status */
60714779705SSam Leffler #define	AR_D_TXPSE_RESV1	0xFFFE0000	/* Reserved */
60814779705SSam Leffler 
60914779705SSam Leffler 	/* DMA & PCI Registers in PCI space (usable during sleep) */
61014779705SSam Leffler #define	AR_RC_MAC	0x00000001	/* MAC reset */
61114779705SSam Leffler #define	AR_RC_BB	0x00000002	/* Baseband reset */
61214779705SSam Leffler #define	AR_RC_RESV0	0x00000004	/* Reserved */
61314779705SSam Leffler #define	AR_RC_RESV1	0x00000008	/* Reserved */
61414779705SSam Leffler #define	AR_RC_PCI	0x00000010	/* PCI-core reset */
61514779705SSam Leffler #define	AR_RC_BITS	"\20\1MAC\2BB\3RESV0\4RESV1\5RPCI"
61614779705SSam Leffler 
61714779705SSam Leffler #define	AR_SCR_SLDUR	0x0000ffff	/* sleep duration mask, units of 128us */
61814779705SSam Leffler #define	AR_SCR_SLDUR_S	0
61914779705SSam Leffler #define	AR_SCR_SLE	0x00030000	/* sleep enable mask */
62014779705SSam Leffler #define	AR_SCR_SLE_S	16		/* sleep enable bits shift */
621a3388f6dSDimitry Andric /*
622a3388f6dSDimitry Andric  * The previous values for the following three defines were:
623a3388f6dSDimitry Andric  *
624a3388f6dSDimitry Andric  *	AR_SCR_SLE_WAKE	0x00000000
625a3388f6dSDimitry Andric  *	AR_SCR_SLE_SLP	0x00010000
626a3388f6dSDimitry Andric  *	AR_SCR_SLE_NORM	0x00020000
627a3388f6dSDimitry Andric  *
628a3388f6dSDimitry Andric  * However, these have been pre-shifted with AR_SCR_SLE_S.  The
629a3388f6dSDimitry Andric  * OS_REG_READ() macro would attempt to shift them again, effectively
630a3388f6dSDimitry Andric  * shifting out any of the set bits completely.
631a3388f6dSDimitry Andric  */
632a3388f6dSDimitry Andric #define	AR_SCR_SLE_WAKE	0		/* force wake */
633a3388f6dSDimitry Andric #define	AR_SCR_SLE_SLP	1		/* force sleep */
634a3388f6dSDimitry Andric #define	AR_SCR_SLE_NORM	2		/* sleep logic normal operation */
63514779705SSam Leffler #define	AR_SCR_SLE_UNITS	0x00000008	/* SCR units/TU */
63614779705SSam Leffler #define	AR_SCR_BITS	"\20\20SLE_SLP\21SLE"
63714779705SSam Leffler 
63814779705SSam Leffler #define	AR_INTPEND_TRUE	0x00000001	/* interrupt pending */
63914779705SSam Leffler #define	AR_INTPEND_BITS	"\20\1IP"
64014779705SSam Leffler 
64114779705SSam Leffler #define	AR_SFR_SLEEP	0x00000001	/* force sleep */
64214779705SSam Leffler 
64314779705SSam Leffler #define	AR_PCICFG_CLKRUNEN	0x00000004	/* enable PCI CLKRUN function */
64414779705SSam Leffler #define	AR_PCICFG_EEPROM_SIZE_M	0x00000018	/* Mask for EEPROM size */
64514779705SSam Leffler #define	AR_PCICFG_EEPROM_SIZE_S	  3	/* Mask for EEPROM size */
64614779705SSam Leffler #define	AR_PCICFG_EEPROM_SIZE_4K	 0	/* EEPROM size 4 Kbit */
64714779705SSam Leffler #define	AR_PCICFG_EEPROM_SIZE_8K	 1	/* EEPROM size 8 Kbit */
64814779705SSam Leffler #define	AR_PCICFG_EEPROM_SIZE_16K	2	/* EEPROM size 16 Kbit */
64914779705SSam Leffler #define	AR_PCICFG_EEPROM_SIZE_FAILED	3	/* Failure */
65014779705SSam Leffler #define	AR_PCICFG_LEDCTL	0x00000060 /* LED control Status */
65114779705SSam Leffler #define	AR_PCICFG_LEDCTL_NONE	0x00000000 /* STA is not associated or trying */
65214779705SSam Leffler #define	AR_PCICFG_LEDCTL_PEND	0x00000020 /* STA is trying to associate */
65314779705SSam Leffler #define	AR_PCICFG_LEDCTL_ASSOC	0x00000040 /* STA is associated */
65414779705SSam Leffler #define	AR_PCICFG_PCI_BUS_SEL_M	0x00000380	/* Mask for PCI observation bus mux select */
65514779705SSam Leffler #define	AR_PCICFG_DIS_CBE_FIX	0x00000400	/* Disable fix for bad PCI CBE# generation */
65614779705SSam Leffler #define	AR_PCICFG_SL_INTEN	0x00000800	/* enable interrupt line assertion when asleep */
65714779705SSam Leffler #define	AR_PCICFG_RESV0		0x00001000	/* Reserved */
65814779705SSam Leffler #define	AR_PCICFG_SL_INPEN	0x00002000	/* Force asleep when an interrupt is pending */
65914779705SSam Leffler #define	AR_PCICFG_RESV1		0x0000C000	/* Reserved */
66014779705SSam Leffler #define	AR_PCICFG_SPWR_DN	0x00010000	/* mask for sleep/awake indication */
66114779705SSam Leffler #define	AR_PCICFG_LEDMODE	0x000E0000 /* LED mode */
66214779705SSam Leffler #define	AR_PCICFG_LEDMODE_PROP	0x00000000 /* Blink prop to filtered tx/rx */
66314779705SSam Leffler #define	AR_PCICFG_LEDMODE_RPROP	0x00020000 /* Blink prop to unfiltered tx/rx */
66414779705SSam Leffler #define	AR_PCICFG_LEDMODE_SPLIT	0x00040000 /* Blink power for tx/net for rx */
66514779705SSam Leffler #define	AR_PCICFG_LEDMODE_RAND	0x00060000 /* Blink randomly */
66614779705SSam Leffler #define	AR_PCICFG_LEDBLINK	0x00700000 /* LED blink threshold select */
66714779705SSam Leffler #define	AR_PCICFG_LEDBLINK_S	20
66814779705SSam Leffler #define	AR_PCICFG_LEDSLOW	0x00800000 /* LED slowest blink rate mode */
66914779705SSam Leffler #define	AR_PCICFG_RESV2		0xFF000000	/* Reserved */
67014779705SSam Leffler #define	AR_PCICFG_BITS	"\20\3CLKRUNEN\13SL_INTEN"
67114779705SSam Leffler 
67214779705SSam Leffler #define	AR_GPIOCR_CR_SHIFT	2         	/* Each CR is 2 bits */
67314779705SSam Leffler #define	AR_GPIOCR_0_CR_N	0x00000000	/* Input only mode for GPIODO[0] */
67414779705SSam Leffler #define	AR_GPIOCR_0_CR_0	0x00000001	/* Output only if GPIODO[0] = 0 */
67514779705SSam Leffler #define	AR_GPIOCR_0_CR_1	0x00000002	/* Output only if GPIODO[0] = 1 */
67614779705SSam Leffler #define	AR_GPIOCR_0_CR_A	0x00000003	/* Always output */
67714779705SSam Leffler #define	AR_GPIOCR_1_CR_N	0x00000000	/* Input only mode for GPIODO[1] */
67814779705SSam Leffler #define	AR_GPIOCR_1_CR_0	0x00000004	/* Output only if GPIODO[1] = 0 */
67914779705SSam Leffler #define	AR_GPIOCR_1_CR_1	0x00000008	/* Output only if GPIODO[1] = 1 */
68014779705SSam Leffler #define	AR_GPIOCR_1_CR_A	0x0000000C	/* Always output */
68114779705SSam Leffler #define	AR_GPIOCR_2_CR_N	0x00000000	/* Input only mode for GPIODO[2] */
68214779705SSam Leffler #define	AR_GPIOCR_2_CR_0	0x00000010	/* Output only if GPIODO[2] = 0 */
68314779705SSam Leffler #define	AR_GPIOCR_2_CR_1	0x00000020	/* Output only if GPIODO[2] = 1 */
68414779705SSam Leffler #define	AR_GPIOCR_2_CR_A	0x00000030	/* Always output */
68514779705SSam Leffler #define	AR_GPIOCR_3_CR_N	0x00000000	/* Input only mode for GPIODO[3] */
68614779705SSam Leffler #define	AR_GPIOCR_3_CR_0	0x00000040	/* Output only if GPIODO[3] = 0 */
68714779705SSam Leffler #define	AR_GPIOCR_3_CR_1	0x00000080	/* Output only if GPIODO[3] = 1 */
68814779705SSam Leffler #define	AR_GPIOCR_3_CR_A	0x000000C0	/* Always output */
68914779705SSam Leffler #define	AR_GPIOCR_4_CR_N	0x00000000	/* Input only mode for GPIODO[4] */
69014779705SSam Leffler #define	AR_GPIOCR_4_CR_0	0x00000100	/* Output only if GPIODO[4] = 0 */
69114779705SSam Leffler #define	AR_GPIOCR_4_CR_1	0x00000200	/* Output only if GPIODO[4] = 1 */
69214779705SSam Leffler #define	AR_GPIOCR_4_CR_A	0x00000300	/* Always output */
69314779705SSam Leffler #define	AR_GPIOCR_5_CR_N	0x00000000	/* Input only mode for GPIODO[5] */
69414779705SSam Leffler #define	AR_GPIOCR_5_CR_0	0x00000400	/* Output only if GPIODO[5] = 0 */
69514779705SSam Leffler #define	AR_GPIOCR_5_CR_1	0x00000800	/* Output only if GPIODO[5] = 1 */
69614779705SSam Leffler #define	AR_GPIOCR_5_CR_A	0x00000C00	/* Always output */
69714779705SSam Leffler #define	AR_GPIOCR_INT_SHIFT	12        	/* Interrupt select field shifter */
69814779705SSam Leffler #define	AR_GPIOCR_INT_MASK	0x00007000	/* Interrupt select field mask */
69914779705SSam Leffler #define	AR_GPIOCR_INT_SEL0	0x00000000	/* Select Interrupt Pin GPIO_0 */
70014779705SSam Leffler #define	AR_GPIOCR_INT_SEL1	0x00001000	/* Select Interrupt Pin GPIO_1 */
70114779705SSam Leffler #define	AR_GPIOCR_INT_SEL2	0x00002000	/* Select Interrupt Pin GPIO_2 */
70214779705SSam Leffler #define	AR_GPIOCR_INT_SEL3	0x00003000	/* Select Interrupt Pin GPIO_3 */
70314779705SSam Leffler #define	AR_GPIOCR_INT_SEL4	0x00004000	/* Select Interrupt Pin GPIO_4 */
70414779705SSam Leffler #define	AR_GPIOCR_INT_SEL5	0x00005000	/* Select Interrupt Pin GPIO_5 */
70514779705SSam Leffler #define	AR_GPIOCR_INT_ENA	0x00008000	/* Enable GPIO Interrupt */
70614779705SSam Leffler #define	AR_GPIOCR_INT_SELL	0x00000000	/* Generate Interrupt if selected pin is low */
70714779705SSam Leffler #define	AR_GPIOCR_INT_SELH	0x00010000	/* Generate Interrupt if selected pin is high */
70814779705SSam Leffler 
70914779705SSam Leffler #define	AR_SREV_ID_M	0x000000FF	/* Mask to read SREV info */
71014779705SSam Leffler #define	AR_PCICFG_EEPROM_SIZE_16K	2	/* EEPROM size 16 Kbit */
71114779705SSam Leffler #define	AR_SREV_ID_S		4		/* Major Rev Info */
71214779705SSam Leffler #define	AR_SREV_REVISION_M	0x0000000F	/* Chip revision level */
71314779705SSam Leffler #define	AR_SREV_FPGA		1
71414779705SSam Leffler #define	AR_SREV_D2PLUS		2
71514779705SSam Leffler #define	AR_SREV_D2PLUS_MS	3		/* metal spin */
71614779705SSam Leffler #define	AR_SREV_CRETE		4
71714779705SSam Leffler #define	AR_SREV_CRETE_MS	5		/* FCS metal spin */
71814779705SSam Leffler #define	AR_SREV_CRETE_MS23	7		/* 2.3 metal spin (6 skipped) */
71914779705SSam Leffler #define	AR_SREV_CRETE_23	8		/* 2.3 full tape out */
72014779705SSam Leffler #define	AR_SREV_VERSION_M	0x000000F0	/* Chip version indication */
72114779705SSam Leffler #define	AR_SREV_VERSION_CRETE	0
72214779705SSam Leffler #define	AR_SREV_VERSION_MAUI_1	1
72314779705SSam Leffler #define	AR_SREV_VERSION_MAUI_2	2
72414779705SSam Leffler #define	AR_SREV_VERSION_SPIRIT	3
72514779705SSam Leffler #define	AR_SREV_VERSION_OAHU	4
72614779705SSam Leffler #define	AR_SREV_OAHU_ES		0	/* Engineering Sample */
72714779705SSam Leffler #define	AR_SREV_OAHU_PROD	2	/* Production */
72814779705SSam Leffler 
72914779705SSam Leffler #define	RAD5_SREV_MAJOR	0x10	/* All current supported ar5211 5 GHz radios are rev 0x10 */
73014779705SSam Leffler #define	RAD5_SREV_PROD	0x15	/* Current production level radios */
73114779705SSam Leffler #define	RAD2_SREV_MAJOR	0x20	/* All current supported ar5211 2 GHz radios are rev 0x10 */
73214779705SSam Leffler 
73314779705SSam Leffler 	/* EEPROM Registers in the MAC */
73414779705SSam Leffler #define	AR_EEPROM_CMD_READ	0x00000001
73514779705SSam Leffler #define	AR_EEPROM_CMD_WRITE	0x00000002
73614779705SSam Leffler #define	AR_EEPROM_CMD_RESET	0x00000004
73714779705SSam Leffler 
73814779705SSam Leffler #define	AR_EEPROM_STS_READ_ERROR	0x00000001
73914779705SSam Leffler #define	AR_EEPROM_STS_READ_COMPLETE	0x00000002
74014779705SSam Leffler #define	AR_EEPROM_STS_WRITE_ERROR	0x00000004
74114779705SSam Leffler #define	AR_EEPROM_STS_WRITE_COMPLETE	0x00000008
74214779705SSam Leffler 
74314779705SSam Leffler #define	AR_EEPROM_CFG_SIZE_M	0x00000003	/* Mask for EEPROM size determination override */
74414779705SSam Leffler #define	AR_EEPROM_CFG_SIZE_AUTO	0
74514779705SSam Leffler #define	AR_EEPROM_CFG_SIZE_4KBIT	1
74614779705SSam Leffler #define	AR_EEPROM_CFG_SIZE_8KBIT	2
74714779705SSam Leffler #define	AR_EEPROM_CFG_SIZE_16KBIT	3
74814779705SSam Leffler #define	AR_EEPROM_CFG_DIS_WAIT_WRITE_COMPL	0x00000004	/* Disable wait for write completion */
74914779705SSam Leffler #define	AR_EEPROM_CFG_CLOCK_M	0x00000018	/* Mask for EEPROM clock rate control */
75014779705SSam Leffler #define	AR_EEPROM_CFG_CLOCK_S	3        	/* Shift for EEPROM clock rate control */
75114779705SSam Leffler #define	AR_EEPROM_CFG_CLOCK_156KHZ	0
75214779705SSam Leffler #define	AR_EEPROM_CFG_CLOCK_312KHZ	1
75314779705SSam Leffler #define	AR_EEPROM_CFG_CLOCK_625KHZ	2
75414779705SSam Leffler #define	AR_EEPROM_CFG_RESV0	0x000000E0	/* Reserved */
75514779705SSam Leffler #define	AR_EEPROM_CFG_PROT_KEY_M	0x00FFFF00	/* Mask for EEPROM protection key */
75614779705SSam Leffler #define	AR_EEPROM_CFG_PROT_KEY_S	8          	/* Shift for EEPROM protection key */
75714779705SSam Leffler #define	AR_EEPROM_CFG_EN_L	0x01000000	/* EPRM_EN_L setting */
75814779705SSam Leffler 
75914779705SSam Leffler 	/* MAC PCU Registers */
76014779705SSam Leffler #define	AR_STA_ID1_SADH_MASK	0x0000FFFF	/* Mask for upper 16 bits of MAC addr */
76114779705SSam Leffler #define	AR_STA_ID1_STA_AP	0x00010000	/* Device is AP */
76214779705SSam Leffler #define	AR_STA_ID1_ADHOC	0x00020000	/* Device is ad-hoc */
76314779705SSam Leffler #define	AR_STA_ID1_PWR_SAV	0x00040000	/* Power save reporting in self-generated frames */
76414779705SSam Leffler #define	AR_STA_ID1_KSRCHDIS	0x00080000	/* Key search disable */
76514779705SSam Leffler #define	AR_STA_ID1_PCF	0x00100000	/* Observe PCF */
76614779705SSam Leffler #define	AR_STA_ID1_DEFAULT_ANTENNA	0x00200000	/* Use default antenna */
76714779705SSam Leffler #define	AR_STA_ID1_DESC_ANTENNA	0x00400000	/* Update default antenna w/ TX antenna */
76814779705SSam Leffler #define	AR_STA_ID1_RTS_USE_DEF	0x00800000	/* Use default antenna to send RTS */
76914779705SSam Leffler #define	AR_STA_ID1_ACKCTS_6MB	0x01000000	/* Use 6Mb/s rate for ACK & CTS */
77014779705SSam Leffler #define	AR_STA_ID1_BASE_RATE_11B	0x02000000	/* Use 11b base rate for ACK & CTS */
77114779705SSam Leffler #define	AR_STA_ID1_BITS \
77214779705SSam Leffler 	"\20\20AP\21ADHOC\22PWR_SAV\23KSRCHDIS\25PCF"
77314779705SSam Leffler 
77414779705SSam Leffler #define	AR_BSS_ID1_U16_M	0x0000FFFF	/* Mask for upper 16 bits of BSSID */
77514779705SSam Leffler #define	AR_BSS_ID1_AID_M	0xFFFF0000	/* Mask for association ID */
77614779705SSam Leffler #define	AR_BSS_ID1_AID_S	16       	/* Shift for association ID */
77714779705SSam Leffler 
77814779705SSam Leffler #define	AR_SLOT_TIME_MASK	0x000007FF	/* Slot time mask */
77914779705SSam Leffler 
78014779705SSam Leffler #define	AR_TIME_OUT_ACK		0x00001FFF	/* Mask for ACK time-out */
78114779705SSam Leffler #define	AR_TIME_OUT_ACK_S	0		/* Shift for ACK time-out */
78214779705SSam Leffler #define	AR_TIME_OUT_CTS		0x1FFF0000	/* Mask for CTS time-out */
78314779705SSam Leffler #define	AR_TIME_OUT_CTS_S	16       	/* Shift for CTS time-out */
78414779705SSam Leffler 
78514779705SSam Leffler #define	AR_RSSI_THR_MASK	0x000000FF	/* Mask for Beacon RSSI warning threshold */
78614779705SSam Leffler #define	AR_RSSI_THR_BM_THR	0x0000FF00	/* Mask for Missed beacon threshold */
78714779705SSam Leffler #define	AR_RSSI_THR_BM_THR_S	8        	/* Shift for Missed beacon threshold */
78814779705SSam Leffler 
78914779705SSam Leffler #define	AR_USEC_M	0x0000007F		/* Mask for clock cycles in 1 usec */
79014779705SSam Leffler #define	AR_USEC_32_M	0x00003F80		/* Mask for number of 32MHz clock cycles in 1 usec */
79114779705SSam Leffler #define	AR_USEC_32_S	7			/* Shift for number of 32MHz clock cycles in 1 usec */
79214779705SSam Leffler /*
79314779705SSam Leffler  * Tx/Rx latencies are to signal start and are in usecs.
79414779705SSam Leffler  *
79514779705SSam Leffler  * NOTE: AR5211/AR5311 difference: on Oahu, the TX latency field
79614779705SSam Leffler  *       has increased from 6 bits to 9 bits.  The RX latency field
79714779705SSam Leffler  *	 is unchanged, but is shifted over 3 bits.
79814779705SSam Leffler  */
79914779705SSam Leffler #define	AR5311_USEC_TX_LAT_M	0x000FC000	/* Tx latency */
80014779705SSam Leffler #define	AR5311_USEC_TX_LAT_S	14
80114779705SSam Leffler #define	AR5311_USEC_RX_LAT_M	0x03F00000	/* Rx latency */
80214779705SSam Leffler #define	AR5311_USEC_RX_LAT_S	20
80314779705SSam Leffler 
80414779705SSam Leffler #define	AR5211_USEC_TX_LAT_M	0x007FC000	/* Tx latency */
80514779705SSam Leffler #define	AR5211_USEC_TX_LAT_S	14
80614779705SSam Leffler #define	AR5211_USEC_RX_LAT_M	0x1F800000	/* Rx latency */
80714779705SSam Leffler #define	AR5211_USEC_RX_LAT_S	23
80814779705SSam Leffler 
80914779705SSam Leffler #define	AR_BEACON_PERIOD	0x0000FFFF	/* Beacon period in TU/msec */
81014779705SSam Leffler #define	AR_BEACON_PERIOD_S	0		/* Byte offset of PERIOD start*/
81114779705SSam Leffler #define	AR_BEACON_TIM		0x007F0000	/* Byte offset of TIM start */
81214779705SSam Leffler #define	AR_BEACON_TIM_S		16        	/* Byte offset of TIM start */
81314779705SSam Leffler #define	AR_BEACON_EN		0x00800000	/* beacon enable */
81414779705SSam Leffler #define	AR_BEACON_RESET_TSF	0x01000000	/* Clears TSF to 0 */
81514779705SSam Leffler #define	AR_BEACON_BITS	"\20\27ENABLE\30RESET_TSF"
81614779705SSam Leffler 
81714779705SSam Leffler #define	AR_RX_FILTER_ALL	0x00000000	/* Disallow all frames */
81814779705SSam Leffler #define	AR_RX_UCAST		0x00000001	/* Allow unicast frames */
81914779705SSam Leffler #define	AR_RX_MCAST		0x00000002	/* Allow multicast frames */
82014779705SSam Leffler #define	AR_RX_BCAST		0x00000004	/* Allow broadcast frames */
82114779705SSam Leffler #define	AR_RX_CONTROL		0x00000008	/* Allow control frames */
82214779705SSam Leffler #define	AR_RX_BEACON		0x00000010	/* Allow beacon frames */
82314779705SSam Leffler #define	AR_RX_PROM		0x00000020	/* Promiscuous mode */
82414779705SSam Leffler #define	AR_RX_PHY_ERR		0x00000040	/* Allow all phy errors */
82514779705SSam Leffler #define	AR_RX_PHY_RADAR		0x00000080	/* Allow radar phy errors */
82614779705SSam Leffler #define	AR_RX_FILTER_BITS \
82714779705SSam Leffler 	"\20\1UCAST\2MCAST\3BCAST\4CONTROL\5BEACON\6PROMISC\7PHY_ERR\10PHY_RADAR"
82814779705SSam Leffler 
82914779705SSam Leffler #define	AR_DIAG_SW_CACHE_ACK	0x00000001	/* disable ACK if no valid key*/
83014779705SSam Leffler #define	AR_DIAG_SW_DIS_ACK	0x00000002	/* disable ACK generation */
83114779705SSam Leffler #define	AR_DIAG_SW_DIS_CTS	0x00000004	/* disable CTS generation */
83214779705SSam Leffler #define	AR_DIAG_SW_DIS_ENCRYPT	0x00000008	/* disable encryption */
83314779705SSam Leffler #define	AR_DIAG_SW_DIS_DECRYPT	0x00000010	/* disable decryption */
83414779705SSam Leffler #define	AR_DIAG_SW_DIS_RX	0x00000020	/* disable receive */
83514779705SSam Leffler #define	AR_DIAG_SW_CORR_FCS	0x00000080	/* corrupt FCS */
83614779705SSam Leffler #define	AR_DIAG_SW_CHAN_INFO	0x00000100	/* dump channel info */
83714779705SSam Leffler #define	AR_DIAG_SW_EN_SCRAMSD	0x00000200	/* enable fixed scrambler seed*/
83814779705SSam Leffler #define	AR5311_DIAG_SW_USE_ECO	0x00000400	/* "super secret" use ECO enable bit */
83914779705SSam Leffler #define	AR_DIAG_SW_SCRAM_SEED_M	0x0001FC00	/* Fixed scrambler seed mask */
84014779705SSam Leffler #define	AR_DIAG_SW_SCRAM_SEED_S	10       	/* Fixed scrambler seed shfit */
84114779705SSam Leffler #define	AR_DIAG_SW_FRAME_NV0	0x00020000	/* accept frames of non-zero protocol version */
84214779705SSam Leffler #define	AR_DIAG_SW_OBS_PT_SEL_M	0x000C0000	/* Observation point select */
84314779705SSam Leffler #define	AR_DIAG_SW_OBS_PT_SEL_S	18       	/* Observation point select */
84414779705SSam Leffler #define	AR_DIAG_SW_BITS \
84514779705SSam Leffler 	"\20\1DIS_CACHE_ACK\2DIS_ACK\3DIS_CTS\4DIS_ENC\5DIS_DEC\6DIS_RX"\
84614779705SSam Leffler 	"\11CORR_FCS\12CHAN_INFO\13EN_SCRAM_SEED\14USE_ECO\24FRAME_NV0"
84714779705SSam Leffler 
84814779705SSam Leffler #define	AR_KEYTABLE_KEY0(n)	(AR_KEYTABLE(n) + 0)	/* key bit 0-31 */
84914779705SSam Leffler #define	AR_KEYTABLE_KEY1(n)	(AR_KEYTABLE(n) + 4)	/* key bit 32-47 */
85014779705SSam Leffler #define	AR_KEYTABLE_KEY2(n)	(AR_KEYTABLE(n) + 8)	/* key bit 48-79 */
85114779705SSam Leffler #define	AR_KEYTABLE_KEY3(n)	(AR_KEYTABLE(n) + 12)	/* key bit 80-95 */
85214779705SSam Leffler #define	AR_KEYTABLE_KEY4(n)	(AR_KEYTABLE(n) + 16)	/* key bit 96-127 */
85314779705SSam Leffler #define	AR_KEYTABLE_TYPE(n)	(AR_KEYTABLE(n) + 20)	/* key type */
85414779705SSam Leffler #define	AR_KEYTABLE_TYPE_40	0x00000000	/* WEP 40 bit key */
85514779705SSam Leffler #define	AR_KEYTABLE_TYPE_104	0x00000001	/* WEP 104 bit key */
85614779705SSam Leffler #define	AR_KEYTABLE_TYPE_128	0x00000003	/* WEP 128 bit key */
85714779705SSam Leffler #define	AR_KEYTABLE_TYPE_AES	0x00000005	/* AES 128 bit key */
85814779705SSam Leffler #define	AR_KEYTABLE_TYPE_CLR	0x00000007	/* no encryption */
85914779705SSam Leffler #define	AR_KEYTABLE_MAC0(n)	(AR_KEYTABLE(n) + 24)	/* MAC address 1-32 */
86014779705SSam Leffler #define	AR_KEYTABLE_MAC1(n)	(AR_KEYTABLE(n) + 28)	/* MAC address 33-47 */
86114779705SSam Leffler #define	AR_KEYTABLE_VALID	0x00008000	/* key and MAC address valid */
86214779705SSam Leffler 
86314779705SSam Leffler #endif /* _DEV_ATH_AR5211REG_H */
864