18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2008-2011 Atheros Communications Inc.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any
58c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above
68c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
98c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
108c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
118c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
128c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
138c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
148c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#ifndef REG_H
188c2ecf20Sopenharmony_ci#define REG_H
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#include "../reg.h"
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define AR_CR                0x0008
238c2ecf20Sopenharmony_ci#define AR_CR_RXE            (AR_SREV_9300_20_OR_LATER(ah) ? 0x0000000c : 0x00000004)
248c2ecf20Sopenharmony_ci#define AR_CR_RXD            0x00000020
258c2ecf20Sopenharmony_ci#define AR_CR_SWI            0x00000040
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define AR_RXDP              0x000C
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#define AR_CFG               0x0014
308c2ecf20Sopenharmony_ci#define AR_CFG_SWTD          0x00000001
318c2ecf20Sopenharmony_ci#define AR_CFG_SWTB          0x00000002
328c2ecf20Sopenharmony_ci#define AR_CFG_SWRD          0x00000004
338c2ecf20Sopenharmony_ci#define AR_CFG_SWRB          0x00000008
348c2ecf20Sopenharmony_ci#define AR_CFG_SWRG          0x00000010
358c2ecf20Sopenharmony_ci#define AR_CFG_AP_ADHOC_INDICATION 0x00000020
368c2ecf20Sopenharmony_ci#define AR_CFG_PHOK          0x00000100
378c2ecf20Sopenharmony_ci#define AR_CFG_EEBS          0x00000200
388c2ecf20Sopenharmony_ci#define AR_CFG_CLK_GATE_DIS  0x00000400
398c2ecf20Sopenharmony_ci#define AR_CFG_HALT_REQ	     0x00000800
408c2ecf20Sopenharmony_ci#define AR_CFG_HALT_ACK	     0x00001000
418c2ecf20Sopenharmony_ci#define AR_CFG_PCI_MASTER_REQ_Q_THRESH         0x00060000
428c2ecf20Sopenharmony_ci#define AR_CFG_PCI_MASTER_REQ_Q_THRESH_S       17
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define AR_RXBP_THRESH       0x0018
458c2ecf20Sopenharmony_ci#define AR_RXBP_THRESH_HP    0x0000000f
468c2ecf20Sopenharmony_ci#define AR_RXBP_THRESH_HP_S  0
478c2ecf20Sopenharmony_ci#define AR_RXBP_THRESH_LP    0x00003f00
488c2ecf20Sopenharmony_ci#define AR_RXBP_THRESH_LP_S  8
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define AR_MIRT              0x0020
518c2ecf20Sopenharmony_ci#define AR_MIRT_VAL          0x0000ffff
528c2ecf20Sopenharmony_ci#define AR_MIRT_VAL_S        16
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#define AR_IER               0x0024
558c2ecf20Sopenharmony_ci#define AR_IER_ENABLE        0x00000001
568c2ecf20Sopenharmony_ci#define AR_IER_DISABLE       0x00000000
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define AR_TIMT              0x0028
598c2ecf20Sopenharmony_ci#define AR_TIMT_LAST         0x0000ffff
608c2ecf20Sopenharmony_ci#define AR_TIMT_LAST_S       0
618c2ecf20Sopenharmony_ci#define AR_TIMT_FIRST        0xffff0000
628c2ecf20Sopenharmony_ci#define AR_TIMT_FIRST_S      16
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define AR_RIMT              0x002C
658c2ecf20Sopenharmony_ci#define AR_RIMT_LAST         0x0000ffff
668c2ecf20Sopenharmony_ci#define AR_RIMT_LAST_S       0
678c2ecf20Sopenharmony_ci#define AR_RIMT_FIRST        0xffff0000
688c2ecf20Sopenharmony_ci#define AR_RIMT_FIRST_S      16
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define AR_DMASIZE_4B        0x00000000
718c2ecf20Sopenharmony_ci#define AR_DMASIZE_8B        0x00000001
728c2ecf20Sopenharmony_ci#define AR_DMASIZE_16B       0x00000002
738c2ecf20Sopenharmony_ci#define AR_DMASIZE_32B       0x00000003
748c2ecf20Sopenharmony_ci#define AR_DMASIZE_64B       0x00000004
758c2ecf20Sopenharmony_ci#define AR_DMASIZE_128B      0x00000005
768c2ecf20Sopenharmony_ci#define AR_DMASIZE_256B      0x00000006
778c2ecf20Sopenharmony_ci#define AR_DMASIZE_512B      0x00000007
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci#define AR_TXCFG             0x0030
808c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_MASK  0x00000007
818c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_4B    0
828c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_8B    1
838c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_16B   2
848c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_32B   3
858c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_64B   4
868c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_128B  5
878c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_256B  6
888c2ecf20Sopenharmony_ci#define AR_TXCFG_DMASZ_512B  7
898c2ecf20Sopenharmony_ci#define AR_FTRIG             0x000003F0
908c2ecf20Sopenharmony_ci#define AR_FTRIG_S           4
918c2ecf20Sopenharmony_ci#define AR_FTRIG_IMMED       0x00000000
928c2ecf20Sopenharmony_ci#define AR_FTRIG_64B         0x00000010
938c2ecf20Sopenharmony_ci#define AR_FTRIG_128B        0x00000020
948c2ecf20Sopenharmony_ci#define AR_FTRIG_192B        0x00000030
958c2ecf20Sopenharmony_ci#define AR_FTRIG_256B        0x00000040
968c2ecf20Sopenharmony_ci#define AR_FTRIG_512B        0x00000080
978c2ecf20Sopenharmony_ci#define AR_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY 0x00000800
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci#define AR_RXCFG             0x0034
1008c2ecf20Sopenharmony_ci#define AR_RXCFG_CHIRP       0x00000008
1018c2ecf20Sopenharmony_ci#define AR_RXCFG_ZLFDMA      0x00000010
1028c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_MASK  0x00000007
1038c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_4B    0
1048c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_8B    1
1058c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_16B   2
1068c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_32B   3
1078c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_64B   4
1088c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_128B  5
1098c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_256B  6
1108c2ecf20Sopenharmony_ci#define AR_RXCFG_DMASZ_512B  7
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define AR_TOPS              0x0044
1138c2ecf20Sopenharmony_ci#define AR_TOPS_MASK         0x0000FFFF
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci#define AR_RXNPTO            0x0048
1168c2ecf20Sopenharmony_ci#define AR_RXNPTO_MASK       0x000003FF
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define AR_TXNPTO            0x004C
1198c2ecf20Sopenharmony_ci#define AR_TXNPTO_MASK       0x000003FF
1208c2ecf20Sopenharmony_ci#define AR_TXNPTO_QCU_MASK   0x000FFC00
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci#define AR_RPGTO             0x0050
1238c2ecf20Sopenharmony_ci#define AR_RPGTO_MASK        0x000003FF
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define AR_RPCNT             0x0054
1268c2ecf20Sopenharmony_ci#define AR_RPCNT_MASK        0x0000001F
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci#define AR_MACMISC           0x0058
1298c2ecf20Sopenharmony_ci#define AR_MACMISC_PCI_EXT_FORCE        0x00000010
1308c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS              0x000001E0
1318c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_S            5
1328c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_0       0
1338c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_1       1
1348c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_2       2
1358c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_3       3
1368c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_4       4
1378c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_5       5
1388c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_6       6
1398c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_7       7
1408c2ecf20Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_8       8
1418c2ecf20Sopenharmony_ci#define AR_MACMISC_MISC_OBS             0x00000E00
1428c2ecf20Sopenharmony_ci#define AR_MACMISC_MISC_OBS_S           9
1438c2ecf20Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_LSB     0x00007000
1448c2ecf20Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_LSB_S   12
1458c2ecf20Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_MSB     0x00038000
1468c2ecf20Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_MSB_S   15
1478c2ecf20Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_1       1
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci#define AR_INTCFG               0x005C
1508c2ecf20Sopenharmony_ci#define AR_INTCFG_MSI_RXOK      0x00000000
1518c2ecf20Sopenharmony_ci#define AR_INTCFG_MSI_RXINTM    0x00000004
1528c2ecf20Sopenharmony_ci#define AR_INTCFG_MSI_RXMINTR   0x00000006
1538c2ecf20Sopenharmony_ci#define AR_INTCFG_MSI_TXOK      0x00000000
1548c2ecf20Sopenharmony_ci#define AR_INTCFG_MSI_TXINTM    0x00000010
1558c2ecf20Sopenharmony_ci#define AR_INTCFG_MSI_TXMINTR   0x00000018
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci#define AR_DATABUF_SIZE		0x0060
1588c2ecf20Sopenharmony_ci#define AR_DATABUF_SIZE_MASK	0x00000FFF
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#define AR_GTXTO    0x0064
1618c2ecf20Sopenharmony_ci#define AR_GTXTO_TIMEOUT_COUNTER    0x0000FFFF
1628c2ecf20Sopenharmony_ci#define AR_GTXTO_TIMEOUT_LIMIT      0xFFFF0000
1638c2ecf20Sopenharmony_ci#define AR_GTXTO_TIMEOUT_LIMIT_S    16
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci#define AR_GTTM     0x0068
1668c2ecf20Sopenharmony_ci#define AR_GTTM_USEC          0x00000001
1678c2ecf20Sopenharmony_ci#define AR_GTTM_IGNORE_IDLE   0x00000002
1688c2ecf20Sopenharmony_ci#define AR_GTTM_RESET_IDLE    0x00000004
1698c2ecf20Sopenharmony_ci#define AR_GTTM_CST_USEC      0x00000008
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci#define AR_CST         0x006C
1728c2ecf20Sopenharmony_ci#define AR_CST_TIMEOUT_COUNTER    0x0000FFFF
1738c2ecf20Sopenharmony_ci#define AR_CST_TIMEOUT_LIMIT      0xFFFF0000
1748c2ecf20Sopenharmony_ci#define AR_CST_TIMEOUT_LIMIT_S    16
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci#define AR_HP_RXDP 0x0074
1778c2ecf20Sopenharmony_ci#define AR_LP_RXDP 0x0078
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci#define AR_ISR               0x0080
1808c2ecf20Sopenharmony_ci#define AR_ISR_RXOK          0x00000001
1818c2ecf20Sopenharmony_ci#define AR_ISR_RXDESC        0x00000002
1828c2ecf20Sopenharmony_ci#define AR_ISR_HP_RXOK	     0x00000001
1838c2ecf20Sopenharmony_ci#define AR_ISR_LP_RXOK	     0x00000002
1848c2ecf20Sopenharmony_ci#define AR_ISR_RXERR         0x00000004
1858c2ecf20Sopenharmony_ci#define AR_ISR_RXNOPKT       0x00000008
1868c2ecf20Sopenharmony_ci#define AR_ISR_RXEOL         0x00000010
1878c2ecf20Sopenharmony_ci#define AR_ISR_RXORN         0x00000020
1888c2ecf20Sopenharmony_ci#define AR_ISR_TXOK          0x00000040
1898c2ecf20Sopenharmony_ci#define AR_ISR_TXDESC        0x00000080
1908c2ecf20Sopenharmony_ci#define AR_ISR_TXERR         0x00000100
1918c2ecf20Sopenharmony_ci#define AR_ISR_TXNOPKT       0x00000200
1928c2ecf20Sopenharmony_ci#define AR_ISR_TXEOL         0x00000400
1938c2ecf20Sopenharmony_ci#define AR_ISR_TXURN         0x00000800
1948c2ecf20Sopenharmony_ci#define AR_ISR_MIB           0x00001000
1958c2ecf20Sopenharmony_ci#define AR_ISR_SWI           0x00002000
1968c2ecf20Sopenharmony_ci#define AR_ISR_RXPHY         0x00004000
1978c2ecf20Sopenharmony_ci#define AR_ISR_RXKCM         0x00008000
1988c2ecf20Sopenharmony_ci#define AR_ISR_SWBA          0x00010000
1998c2ecf20Sopenharmony_ci#define AR_ISR_BRSSI         0x00020000
2008c2ecf20Sopenharmony_ci#define AR_ISR_BMISS         0x00040000
2018c2ecf20Sopenharmony_ci#define AR_ISR_BNR           0x00100000
2028c2ecf20Sopenharmony_ci#define AR_ISR_RXCHIRP       0x00200000
2038c2ecf20Sopenharmony_ci#define AR_ISR_BCNMISC       0x00800000
2048c2ecf20Sopenharmony_ci#define AR_ISR_TIM           0x00800000
2058c2ecf20Sopenharmony_ci#define AR_ISR_QCBROVF       0x02000000
2068c2ecf20Sopenharmony_ci#define AR_ISR_QCBRURN       0x04000000
2078c2ecf20Sopenharmony_ci#define AR_ISR_QTRIG         0x08000000
2088c2ecf20Sopenharmony_ci#define AR_ISR_GENTMR        0x10000000
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci#define AR_ISR_TXMINTR       0x00080000
2118c2ecf20Sopenharmony_ci#define AR_ISR_RXMINTR       0x01000000
2128c2ecf20Sopenharmony_ci#define AR_ISR_TXINTM        0x40000000
2138c2ecf20Sopenharmony_ci#define AR_ISR_RXINTM        0x80000000
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci#define AR_ISR_S0               0x0084
2168c2ecf20Sopenharmony_ci#define AR_ISR_S0_QCU_TXOK      0x000003FF
2178c2ecf20Sopenharmony_ci#define AR_ISR_S0_QCU_TXOK_S    0
2188c2ecf20Sopenharmony_ci#define AR_ISR_S0_QCU_TXDESC    0x03FF0000
2198c2ecf20Sopenharmony_ci#define AR_ISR_S0_QCU_TXDESC_S  16
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci#define AR_ISR_S1              0x0088
2228c2ecf20Sopenharmony_ci#define AR_ISR_S1_QCU_TXERR    0x000003FF
2238c2ecf20Sopenharmony_ci#define AR_ISR_S1_QCU_TXERR_S  0
2248c2ecf20Sopenharmony_ci#define AR_ISR_S1_QCU_TXEOL    0x03FF0000
2258c2ecf20Sopenharmony_ci#define AR_ISR_S1_QCU_TXEOL_S  16
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci#define AR_ISR_S2              0x008c
2288c2ecf20Sopenharmony_ci#define AR_ISR_S2_QCU_TXURN    0x000003FF
2298c2ecf20Sopenharmony_ci#define AR_ISR_S2_BB_WATCHDOG  0x00010000
2308c2ecf20Sopenharmony_ci#define AR_ISR_S2_CST          0x00400000
2318c2ecf20Sopenharmony_ci#define AR_ISR_S2_GTT          0x00800000
2328c2ecf20Sopenharmony_ci#define AR_ISR_S2_TIM          0x01000000
2338c2ecf20Sopenharmony_ci#define AR_ISR_S2_CABEND       0x02000000
2348c2ecf20Sopenharmony_ci#define AR_ISR_S2_DTIMSYNC     0x04000000
2358c2ecf20Sopenharmony_ci#define AR_ISR_S2_BCNTO        0x08000000
2368c2ecf20Sopenharmony_ci#define AR_ISR_S2_CABTO        0x10000000
2378c2ecf20Sopenharmony_ci#define AR_ISR_S2_DTIM         0x20000000
2388c2ecf20Sopenharmony_ci#define AR_ISR_S2_TSFOOR       0x40000000
2398c2ecf20Sopenharmony_ci#define AR_ISR_S2_TBTT_TIME    0x80000000
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci#define AR_ISR_S3             0x0090
2428c2ecf20Sopenharmony_ci#define AR_ISR_S3_QCU_QCBROVF    0x000003FF
2438c2ecf20Sopenharmony_ci#define AR_ISR_S3_QCU_QCBRURN    0x03FF0000
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci#define AR_ISR_S4              0x0094
2468c2ecf20Sopenharmony_ci#define AR_ISR_S4_QCU_QTRIG    0x000003FF
2478c2ecf20Sopenharmony_ci#define AR_ISR_S4_RESV0        0xFFFFFC00
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci#define AR_ISR_S5                   0x0098
2508c2ecf20Sopenharmony_ci#define AR_ISR_S5_TIMER_TRIG        0x000000FF
2518c2ecf20Sopenharmony_ci#define AR_ISR_S5_TIMER_THRESH      0x0007FE00
2528c2ecf20Sopenharmony_ci#define AR_ISR_S5_TIM_TIMER         0x00000010
2538c2ecf20Sopenharmony_ci#define AR_ISR_S5_DTIM_TIMER        0x00000020
2548c2ecf20Sopenharmony_ci#define AR_IMR_S5                   0x00b8
2558c2ecf20Sopenharmony_ci#define AR_IMR_S5_TIM_TIMER         0x00000010
2568c2ecf20Sopenharmony_ci#define AR_IMR_S5_DTIM_TIMER        0x00000020
2578c2ecf20Sopenharmony_ci#define AR_ISR_S5_GENTIMER_TRIG     0x0000FF80
2588c2ecf20Sopenharmony_ci#define AR_ISR_S5_GENTIMER_TRIG_S   0
2598c2ecf20Sopenharmony_ci#define AR_ISR_S5_GENTIMER_THRESH   0xFF800000
2608c2ecf20Sopenharmony_ci#define AR_ISR_S5_GENTIMER_THRESH_S 16
2618c2ecf20Sopenharmony_ci#define AR_IMR_S5_GENTIMER_TRIG     0x0000FF80
2628c2ecf20Sopenharmony_ci#define AR_IMR_S5_GENTIMER_TRIG_S   0
2638c2ecf20Sopenharmony_ci#define AR_IMR_S5_GENTIMER_THRESH   0xFF800000
2648c2ecf20Sopenharmony_ci#define AR_IMR_S5_GENTIMER_THRESH_S 16
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci#define AR_IMR               0x00a0
2678c2ecf20Sopenharmony_ci#define AR_IMR_RXOK          0x00000001
2688c2ecf20Sopenharmony_ci#define AR_IMR_RXDESC        0x00000002
2698c2ecf20Sopenharmony_ci#define AR_IMR_RXOK_HP	     0x00000001
2708c2ecf20Sopenharmony_ci#define AR_IMR_RXOK_LP	     0x00000002
2718c2ecf20Sopenharmony_ci#define AR_IMR_RXERR         0x00000004
2728c2ecf20Sopenharmony_ci#define AR_IMR_RXNOPKT       0x00000008
2738c2ecf20Sopenharmony_ci#define AR_IMR_RXEOL         0x00000010
2748c2ecf20Sopenharmony_ci#define AR_IMR_RXORN         0x00000020
2758c2ecf20Sopenharmony_ci#define AR_IMR_TXOK          0x00000040
2768c2ecf20Sopenharmony_ci#define AR_IMR_TXDESC        0x00000080
2778c2ecf20Sopenharmony_ci#define AR_IMR_TXERR         0x00000100
2788c2ecf20Sopenharmony_ci#define AR_IMR_TXNOPKT       0x00000200
2798c2ecf20Sopenharmony_ci#define AR_IMR_TXEOL         0x00000400
2808c2ecf20Sopenharmony_ci#define AR_IMR_TXURN         0x00000800
2818c2ecf20Sopenharmony_ci#define AR_IMR_MIB           0x00001000
2828c2ecf20Sopenharmony_ci#define AR_IMR_SWI           0x00002000
2838c2ecf20Sopenharmony_ci#define AR_IMR_RXPHY         0x00004000
2848c2ecf20Sopenharmony_ci#define AR_IMR_RXKCM         0x00008000
2858c2ecf20Sopenharmony_ci#define AR_IMR_SWBA          0x00010000
2868c2ecf20Sopenharmony_ci#define AR_IMR_BRSSI         0x00020000
2878c2ecf20Sopenharmony_ci#define AR_IMR_BMISS         0x00040000
2888c2ecf20Sopenharmony_ci#define AR_IMR_BNR           0x00100000
2898c2ecf20Sopenharmony_ci#define AR_IMR_RXCHIRP       0x00200000
2908c2ecf20Sopenharmony_ci#define AR_IMR_BCNMISC       0x00800000
2918c2ecf20Sopenharmony_ci#define AR_IMR_TIM           0x00800000
2928c2ecf20Sopenharmony_ci#define AR_IMR_QCBROVF       0x02000000
2938c2ecf20Sopenharmony_ci#define AR_IMR_QCBRURN       0x04000000
2948c2ecf20Sopenharmony_ci#define AR_IMR_QTRIG         0x08000000
2958c2ecf20Sopenharmony_ci#define AR_IMR_GENTMR        0x10000000
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ci#define AR_IMR_TXMINTR       0x00080000
2988c2ecf20Sopenharmony_ci#define AR_IMR_RXMINTR       0x01000000
2998c2ecf20Sopenharmony_ci#define AR_IMR_TXINTM        0x40000000
3008c2ecf20Sopenharmony_ci#define AR_IMR_RXINTM        0x80000000
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci#define AR_IMR_S0               0x00a4
3038c2ecf20Sopenharmony_ci#define AR_IMR_S0_QCU_TXOK      0x000003FF
3048c2ecf20Sopenharmony_ci#define AR_IMR_S0_QCU_TXOK_S    0
3058c2ecf20Sopenharmony_ci#define AR_IMR_S0_QCU_TXDESC    0x03FF0000
3068c2ecf20Sopenharmony_ci#define AR_IMR_S0_QCU_TXDESC_S  16
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci#define AR_IMR_S1              0x00a8
3098c2ecf20Sopenharmony_ci#define AR_IMR_S1_QCU_TXERR    0x000003FF
3108c2ecf20Sopenharmony_ci#define AR_IMR_S1_QCU_TXERR_S  0
3118c2ecf20Sopenharmony_ci#define AR_IMR_S1_QCU_TXEOL    0x03FF0000
3128c2ecf20Sopenharmony_ci#define AR_IMR_S1_QCU_TXEOL_S  16
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_ci#define AR_IMR_S2              0x00ac
3158c2ecf20Sopenharmony_ci#define AR_IMR_S2_QCU_TXURN    0x000003FF
3168c2ecf20Sopenharmony_ci#define AR_IMR_S2_QCU_TXURN_S  0
3178c2ecf20Sopenharmony_ci#define AR_IMR_S2_BB_WATCHDOG  0x00010000
3188c2ecf20Sopenharmony_ci#define AR_IMR_S2_CST          0x00400000
3198c2ecf20Sopenharmony_ci#define AR_IMR_S2_GTT          0x00800000
3208c2ecf20Sopenharmony_ci#define AR_IMR_S2_TIM          0x01000000
3218c2ecf20Sopenharmony_ci#define AR_IMR_S2_CABEND       0x02000000
3228c2ecf20Sopenharmony_ci#define AR_IMR_S2_DTIMSYNC     0x04000000
3238c2ecf20Sopenharmony_ci#define AR_IMR_S2_BCNTO        0x08000000
3248c2ecf20Sopenharmony_ci#define AR_IMR_S2_CABTO        0x10000000
3258c2ecf20Sopenharmony_ci#define AR_IMR_S2_DTIM         0x20000000
3268c2ecf20Sopenharmony_ci#define AR_IMR_S2_TSFOOR       0x40000000
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci#define AR_IMR_S3                0x00b0
3298c2ecf20Sopenharmony_ci#define AR_IMR_S3_QCU_QCBROVF    0x000003FF
3308c2ecf20Sopenharmony_ci#define AR_IMR_S3_QCU_QCBRURN    0x03FF0000
3318c2ecf20Sopenharmony_ci#define AR_IMR_S3_QCU_QCBRURN_S  16
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci#define AR_IMR_S4              0x00b4
3348c2ecf20Sopenharmony_ci#define AR_IMR_S4_QCU_QTRIG    0x000003FF
3358c2ecf20Sopenharmony_ci#define AR_IMR_S4_RESV0        0xFFFFFC00
3368c2ecf20Sopenharmony_ci
3378c2ecf20Sopenharmony_ci#define AR_IMR_S5              0x00b8
3388c2ecf20Sopenharmony_ci#define AR_IMR_S5_TIMER_TRIG        0x000000FF
3398c2ecf20Sopenharmony_ci#define AR_IMR_S5_TIMER_THRESH      0x0000FF00
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ci#define AR_ISR_RAC            0x00c0
3438c2ecf20Sopenharmony_ci#define AR_ISR_S0_S           0x00c4
3448c2ecf20Sopenharmony_ci#define AR_ISR_S0_QCU_TXOK      0x000003FF
3458c2ecf20Sopenharmony_ci#define AR_ISR_S0_QCU_TXOK_S    0
3468c2ecf20Sopenharmony_ci#define AR_ISR_S0_QCU_TXDESC    0x03FF0000
3478c2ecf20Sopenharmony_ci#define AR_ISR_S0_QCU_TXDESC_S  16
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci#define AR_ISR_S1_S           0x00c8
3508c2ecf20Sopenharmony_ci#define AR_ISR_S1_QCU_TXERR    0x000003FF
3518c2ecf20Sopenharmony_ci#define AR_ISR_S1_QCU_TXERR_S  0
3528c2ecf20Sopenharmony_ci#define AR_ISR_S1_QCU_TXEOL    0x03FF0000
3538c2ecf20Sopenharmony_ci#define AR_ISR_S1_QCU_TXEOL_S  16
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci#define AR_ISR_S2_S           (AR_SREV_9300_20_OR_LATER(ah) ? 0x00d0 : 0x00cc)
3568c2ecf20Sopenharmony_ci#define AR_ISR_S3_S           (AR_SREV_9300_20_OR_LATER(ah) ? 0x00d4 : 0x00d0)
3578c2ecf20Sopenharmony_ci#define AR_ISR_S4_S           (AR_SREV_9300_20_OR_LATER(ah) ? 0x00d8 : 0x00d4)
3588c2ecf20Sopenharmony_ci#define AR_ISR_S5_S           (AR_SREV_9300_20_OR_LATER(ah) ? 0x00dc : 0x00d8)
3598c2ecf20Sopenharmony_ci#define AR_DMADBG_0           0x00e0
3608c2ecf20Sopenharmony_ci#define AR_DMADBG_1           0x00e4
3618c2ecf20Sopenharmony_ci#define AR_DMADBG_2           0x00e8
3628c2ecf20Sopenharmony_ci#define AR_DMADBG_3           0x00ec
3638c2ecf20Sopenharmony_ci#define AR_DMADBG_4           0x00f0
3648c2ecf20Sopenharmony_ci#define AR_DMADBG_5           0x00f4
3658c2ecf20Sopenharmony_ci#define AR_DMADBG_6           0x00f8
3668c2ecf20Sopenharmony_ci#define AR_DMADBG_7           0x00fc
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci#define AR_NUM_QCU      10
3698c2ecf20Sopenharmony_ci#define AR_QCU_0        0x0001
3708c2ecf20Sopenharmony_ci#define AR_QCU_1        0x0002
3718c2ecf20Sopenharmony_ci#define AR_QCU_2        0x0004
3728c2ecf20Sopenharmony_ci#define AR_QCU_3        0x0008
3738c2ecf20Sopenharmony_ci#define AR_QCU_4        0x0010
3748c2ecf20Sopenharmony_ci#define AR_QCU_5        0x0020
3758c2ecf20Sopenharmony_ci#define AR_QCU_6        0x0040
3768c2ecf20Sopenharmony_ci#define AR_QCU_7        0x0080
3778c2ecf20Sopenharmony_ci#define AR_QCU_8        0x0100
3788c2ecf20Sopenharmony_ci#define AR_QCU_9        0x0200
3798c2ecf20Sopenharmony_ci
3808c2ecf20Sopenharmony_ci#define AR_Q0_TXDP           0x0800
3818c2ecf20Sopenharmony_ci#define AR_Q1_TXDP           0x0804
3828c2ecf20Sopenharmony_ci#define AR_Q2_TXDP           0x0808
3838c2ecf20Sopenharmony_ci#define AR_Q3_TXDP           0x080c
3848c2ecf20Sopenharmony_ci#define AR_Q4_TXDP           0x0810
3858c2ecf20Sopenharmony_ci#define AR_Q5_TXDP           0x0814
3868c2ecf20Sopenharmony_ci#define AR_Q6_TXDP           0x0818
3878c2ecf20Sopenharmony_ci#define AR_Q7_TXDP           0x081c
3888c2ecf20Sopenharmony_ci#define AR_Q8_TXDP           0x0820
3898c2ecf20Sopenharmony_ci#define AR_Q9_TXDP           0x0824
3908c2ecf20Sopenharmony_ci#define AR_QTXDP(_i)    (AR_Q0_TXDP + ((_i)<<2))
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci#define AR_Q_STATUS_RING_START	0x830
3938c2ecf20Sopenharmony_ci#define AR_Q_STATUS_RING_END	0x834
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_ci#define AR_Q_TXE             0x0840
3968c2ecf20Sopenharmony_ci#define AR_Q_TXE_M           0x000003FF
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_ci#define AR_Q_TXD             0x0880
3998c2ecf20Sopenharmony_ci#define AR_Q_TXD_M           0x000003FF
4008c2ecf20Sopenharmony_ci
4018c2ecf20Sopenharmony_ci#define AR_Q0_CBRCFG         0x08c0
4028c2ecf20Sopenharmony_ci#define AR_Q1_CBRCFG         0x08c4
4038c2ecf20Sopenharmony_ci#define AR_Q2_CBRCFG         0x08c8
4048c2ecf20Sopenharmony_ci#define AR_Q3_CBRCFG         0x08cc
4058c2ecf20Sopenharmony_ci#define AR_Q4_CBRCFG         0x08d0
4068c2ecf20Sopenharmony_ci#define AR_Q5_CBRCFG         0x08d4
4078c2ecf20Sopenharmony_ci#define AR_Q6_CBRCFG         0x08d8
4088c2ecf20Sopenharmony_ci#define AR_Q7_CBRCFG         0x08dc
4098c2ecf20Sopenharmony_ci#define AR_Q8_CBRCFG         0x08e0
4108c2ecf20Sopenharmony_ci#define AR_Q9_CBRCFG         0x08e4
4118c2ecf20Sopenharmony_ci#define AR_QCBRCFG(_i)      (AR_Q0_CBRCFG + ((_i)<<2))
4128c2ecf20Sopenharmony_ci#define AR_Q_CBRCFG_INTERVAL     0x00FFFFFF
4138c2ecf20Sopenharmony_ci#define AR_Q_CBRCFG_INTERVAL_S   0
4148c2ecf20Sopenharmony_ci#define AR_Q_CBRCFG_OVF_THRESH   0xFF000000
4158c2ecf20Sopenharmony_ci#define AR_Q_CBRCFG_OVF_THRESH_S 24
4168c2ecf20Sopenharmony_ci
4178c2ecf20Sopenharmony_ci#define AR_Q0_RDYTIMECFG         0x0900
4188c2ecf20Sopenharmony_ci#define AR_Q1_RDYTIMECFG         0x0904
4198c2ecf20Sopenharmony_ci#define AR_Q2_RDYTIMECFG         0x0908
4208c2ecf20Sopenharmony_ci#define AR_Q3_RDYTIMECFG         0x090c
4218c2ecf20Sopenharmony_ci#define AR_Q4_RDYTIMECFG         0x0910
4228c2ecf20Sopenharmony_ci#define AR_Q5_RDYTIMECFG         0x0914
4238c2ecf20Sopenharmony_ci#define AR_Q6_RDYTIMECFG         0x0918
4248c2ecf20Sopenharmony_ci#define AR_Q7_RDYTIMECFG         0x091c
4258c2ecf20Sopenharmony_ci#define AR_Q8_RDYTIMECFG         0x0920
4268c2ecf20Sopenharmony_ci#define AR_Q9_RDYTIMECFG         0x0924
4278c2ecf20Sopenharmony_ci#define AR_QRDYTIMECFG(_i)       (AR_Q0_RDYTIMECFG + ((_i)<<2))
4288c2ecf20Sopenharmony_ci#define AR_Q_RDYTIMECFG_DURATION   0x00FFFFFF
4298c2ecf20Sopenharmony_ci#define AR_Q_RDYTIMECFG_DURATION_S 0
4308c2ecf20Sopenharmony_ci#define AR_Q_RDYTIMECFG_EN         0x01000000
4318c2ecf20Sopenharmony_ci
4328c2ecf20Sopenharmony_ci#define AR_Q_ONESHOTARM_SC       0x0940
4338c2ecf20Sopenharmony_ci#define AR_Q_ONESHOTARM_SC_M     0x000003FF
4348c2ecf20Sopenharmony_ci#define AR_Q_ONESHOTARM_SC_RESV0 0xFFFFFC00
4358c2ecf20Sopenharmony_ci
4368c2ecf20Sopenharmony_ci#define AR_Q_ONESHOTARM_CC       0x0980
4378c2ecf20Sopenharmony_ci#define AR_Q_ONESHOTARM_CC_M     0x000003FF
4388c2ecf20Sopenharmony_ci#define AR_Q_ONESHOTARM_CC_RESV0 0xFFFFFC00
4398c2ecf20Sopenharmony_ci
4408c2ecf20Sopenharmony_ci#define AR_Q0_MISC         0x09c0
4418c2ecf20Sopenharmony_ci#define AR_Q1_MISC         0x09c4
4428c2ecf20Sopenharmony_ci#define AR_Q2_MISC         0x09c8
4438c2ecf20Sopenharmony_ci#define AR_Q3_MISC         0x09cc
4448c2ecf20Sopenharmony_ci#define AR_Q4_MISC         0x09d0
4458c2ecf20Sopenharmony_ci#define AR_Q5_MISC         0x09d4
4468c2ecf20Sopenharmony_ci#define AR_Q6_MISC         0x09d8
4478c2ecf20Sopenharmony_ci#define AR_Q7_MISC         0x09dc
4488c2ecf20Sopenharmony_ci#define AR_Q8_MISC         0x09e0
4498c2ecf20Sopenharmony_ci#define AR_Q9_MISC         0x09e4
4508c2ecf20Sopenharmony_ci#define AR_QMISC(_i)       (AR_Q0_MISC + ((_i)<<2))
4518c2ecf20Sopenharmony_ci#define AR_Q_MISC_FSP                     0x0000000F
4528c2ecf20Sopenharmony_ci#define AR_Q_MISC_FSP_ASAP                0
4538c2ecf20Sopenharmony_ci#define AR_Q_MISC_FSP_CBR                 1
4548c2ecf20Sopenharmony_ci#define AR_Q_MISC_FSP_DBA_GATED           2
4558c2ecf20Sopenharmony_ci#define AR_Q_MISC_FSP_TIM_GATED           3
4568c2ecf20Sopenharmony_ci#define AR_Q_MISC_FSP_BEACON_SENT_GATED   4
4578c2ecf20Sopenharmony_ci#define AR_Q_MISC_FSP_BEACON_RCVD_GATED   5
4588c2ecf20Sopenharmony_ci#define AR_Q_MISC_ONE_SHOT_EN             0x00000010
4598c2ecf20Sopenharmony_ci#define AR_Q_MISC_CBR_INCR_DIS1           0x00000020
4608c2ecf20Sopenharmony_ci#define AR_Q_MISC_CBR_INCR_DIS0           0x00000040
4618c2ecf20Sopenharmony_ci#define AR_Q_MISC_BEACON_USE              0x00000080
4628c2ecf20Sopenharmony_ci#define AR_Q_MISC_CBR_EXP_CNTR_LIMIT_EN   0x00000100
4638c2ecf20Sopenharmony_ci#define AR_Q_MISC_RDYTIME_EXP_POLICY      0x00000200
4648c2ecf20Sopenharmony_ci#define AR_Q_MISC_RESET_CBR_EXP_CTR       0x00000400
4658c2ecf20Sopenharmony_ci#define AR_Q_MISC_DCU_EARLY_TERM_REQ      0x00000800
4668c2ecf20Sopenharmony_ci#define AR_Q_MISC_RESV0                   0xFFFFF000
4678c2ecf20Sopenharmony_ci
4688c2ecf20Sopenharmony_ci#define AR_Q0_STS         0x0a00
4698c2ecf20Sopenharmony_ci#define AR_Q1_STS         0x0a04
4708c2ecf20Sopenharmony_ci#define AR_Q2_STS         0x0a08
4718c2ecf20Sopenharmony_ci#define AR_Q3_STS         0x0a0c
4728c2ecf20Sopenharmony_ci#define AR_Q4_STS         0x0a10
4738c2ecf20Sopenharmony_ci#define AR_Q5_STS         0x0a14
4748c2ecf20Sopenharmony_ci#define AR_Q6_STS         0x0a18
4758c2ecf20Sopenharmony_ci#define AR_Q7_STS         0x0a1c
4768c2ecf20Sopenharmony_ci#define AR_Q8_STS         0x0a20
4778c2ecf20Sopenharmony_ci#define AR_Q9_STS         0x0a24
4788c2ecf20Sopenharmony_ci#define AR_QSTS(_i)       (AR_Q0_STS + ((_i)<<2))
4798c2ecf20Sopenharmony_ci#define AR_Q_STS_PEND_FR_CNT          0x00000003
4808c2ecf20Sopenharmony_ci#define AR_Q_STS_RESV0                0x000000FC
4818c2ecf20Sopenharmony_ci#define AR_Q_STS_CBR_EXP_CNT          0x0000FF00
4828c2ecf20Sopenharmony_ci#define AR_Q_STS_RESV1                0xFFFF0000
4838c2ecf20Sopenharmony_ci
4848c2ecf20Sopenharmony_ci#define AR_Q_RDYTIMESHDN    0x0a40
4858c2ecf20Sopenharmony_ci#define AR_Q_RDYTIMESHDN_M  0x000003FF
4868c2ecf20Sopenharmony_ci
4878c2ecf20Sopenharmony_ci/* MAC Descriptor CRC check */
4888c2ecf20Sopenharmony_ci#define AR_Q_DESC_CRCCHK    0xa44
4898c2ecf20Sopenharmony_ci/* Enable CRC check on the descriptor fetched from host */
4908c2ecf20Sopenharmony_ci#define AR_Q_DESC_CRCCHK_EN 1
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ci#define AR_NUM_DCU      10
4938c2ecf20Sopenharmony_ci#define AR_DCU_0        0x0001
4948c2ecf20Sopenharmony_ci#define AR_DCU_1        0x0002
4958c2ecf20Sopenharmony_ci#define AR_DCU_2        0x0004
4968c2ecf20Sopenharmony_ci#define AR_DCU_3        0x0008
4978c2ecf20Sopenharmony_ci#define AR_DCU_4        0x0010
4988c2ecf20Sopenharmony_ci#define AR_DCU_5        0x0020
4998c2ecf20Sopenharmony_ci#define AR_DCU_6        0x0040
5008c2ecf20Sopenharmony_ci#define AR_DCU_7        0x0080
5018c2ecf20Sopenharmony_ci#define AR_DCU_8        0x0100
5028c2ecf20Sopenharmony_ci#define AR_DCU_9        0x0200
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci#define AR_D0_QCUMASK     0x1000
5058c2ecf20Sopenharmony_ci#define AR_D1_QCUMASK     0x1004
5068c2ecf20Sopenharmony_ci#define AR_D2_QCUMASK     0x1008
5078c2ecf20Sopenharmony_ci#define AR_D3_QCUMASK     0x100c
5088c2ecf20Sopenharmony_ci#define AR_D4_QCUMASK     0x1010
5098c2ecf20Sopenharmony_ci#define AR_D5_QCUMASK     0x1014
5108c2ecf20Sopenharmony_ci#define AR_D6_QCUMASK     0x1018
5118c2ecf20Sopenharmony_ci#define AR_D7_QCUMASK     0x101c
5128c2ecf20Sopenharmony_ci#define AR_D8_QCUMASK     0x1020
5138c2ecf20Sopenharmony_ci#define AR_D9_QCUMASK     0x1024
5148c2ecf20Sopenharmony_ci#define AR_DQCUMASK(_i)   (AR_D0_QCUMASK + ((_i)<<2))
5158c2ecf20Sopenharmony_ci#define AR_D_QCUMASK         0x000003FF
5168c2ecf20Sopenharmony_ci#define AR_D_QCUMASK_RESV0   0xFFFFFC00
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_ci#define AR_D0_LCL_IFS     0x1040
5198c2ecf20Sopenharmony_ci#define AR_D1_LCL_IFS     0x1044
5208c2ecf20Sopenharmony_ci#define AR_D2_LCL_IFS     0x1048
5218c2ecf20Sopenharmony_ci#define AR_D3_LCL_IFS     0x104c
5228c2ecf20Sopenharmony_ci#define AR_D4_LCL_IFS     0x1050
5238c2ecf20Sopenharmony_ci#define AR_D5_LCL_IFS     0x1054
5248c2ecf20Sopenharmony_ci#define AR_D6_LCL_IFS     0x1058
5258c2ecf20Sopenharmony_ci#define AR_D7_LCL_IFS     0x105c
5268c2ecf20Sopenharmony_ci#define AR_D8_LCL_IFS     0x1060
5278c2ecf20Sopenharmony_ci#define AR_D9_LCL_IFS     0x1064
5288c2ecf20Sopenharmony_ci#define AR_DLCL_IFS(_i)   (AR_D0_LCL_IFS + ((_i)<<2))
5298c2ecf20Sopenharmony_ci#define AR_D_LCL_IFS_CWMIN       0x000003FF
5308c2ecf20Sopenharmony_ci#define AR_D_LCL_IFS_CWMIN_S     0
5318c2ecf20Sopenharmony_ci#define AR_D_LCL_IFS_CWMAX       0x000FFC00
5328c2ecf20Sopenharmony_ci#define AR_D_LCL_IFS_CWMAX_S     10
5338c2ecf20Sopenharmony_ci#define AR_D_LCL_IFS_AIFS        0x0FF00000
5348c2ecf20Sopenharmony_ci#define AR_D_LCL_IFS_AIFS_S      20
5358c2ecf20Sopenharmony_ci
5368c2ecf20Sopenharmony_ci#define AR_D_LCL_IFS_RESV0    0xF0000000
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci#define AR_D0_RETRY_LIMIT     0x1080
5398c2ecf20Sopenharmony_ci#define AR_D1_RETRY_LIMIT     0x1084
5408c2ecf20Sopenharmony_ci#define AR_D2_RETRY_LIMIT     0x1088
5418c2ecf20Sopenharmony_ci#define AR_D3_RETRY_LIMIT     0x108c
5428c2ecf20Sopenharmony_ci#define AR_D4_RETRY_LIMIT     0x1090
5438c2ecf20Sopenharmony_ci#define AR_D5_RETRY_LIMIT     0x1094
5448c2ecf20Sopenharmony_ci#define AR_D6_RETRY_LIMIT     0x1098
5458c2ecf20Sopenharmony_ci#define AR_D7_RETRY_LIMIT     0x109c
5468c2ecf20Sopenharmony_ci#define AR_D8_RETRY_LIMIT     0x10a0
5478c2ecf20Sopenharmony_ci#define AR_D9_RETRY_LIMIT     0x10a4
5488c2ecf20Sopenharmony_ci#define AR_DRETRY_LIMIT(_i)   (AR_D0_RETRY_LIMIT + ((_i)<<2))
5498c2ecf20Sopenharmony_ci#define AR_D_RETRY_LIMIT_FR_SH       0x0000000F
5508c2ecf20Sopenharmony_ci#define AR_D_RETRY_LIMIT_FR_SH_S     0
5518c2ecf20Sopenharmony_ci#define AR_D_RETRY_LIMIT_STA_SH      0x00003F00
5528c2ecf20Sopenharmony_ci#define AR_D_RETRY_LIMIT_STA_SH_S    8
5538c2ecf20Sopenharmony_ci#define AR_D_RETRY_LIMIT_STA_LG      0x000FC000
5548c2ecf20Sopenharmony_ci#define AR_D_RETRY_LIMIT_STA_LG_S    14
5558c2ecf20Sopenharmony_ci#define AR_D_RETRY_LIMIT_RESV0       0xFFF00000
5568c2ecf20Sopenharmony_ci
5578c2ecf20Sopenharmony_ci#define AR_D0_CHNTIME     0x10c0
5588c2ecf20Sopenharmony_ci#define AR_D1_CHNTIME     0x10c4
5598c2ecf20Sopenharmony_ci#define AR_D2_CHNTIME     0x10c8
5608c2ecf20Sopenharmony_ci#define AR_D3_CHNTIME     0x10cc
5618c2ecf20Sopenharmony_ci#define AR_D4_CHNTIME     0x10d0
5628c2ecf20Sopenharmony_ci#define AR_D5_CHNTIME     0x10d4
5638c2ecf20Sopenharmony_ci#define AR_D6_CHNTIME     0x10d8
5648c2ecf20Sopenharmony_ci#define AR_D7_CHNTIME     0x10dc
5658c2ecf20Sopenharmony_ci#define AR_D8_CHNTIME     0x10e0
5668c2ecf20Sopenharmony_ci#define AR_D9_CHNTIME     0x10e4
5678c2ecf20Sopenharmony_ci#define AR_DCHNTIME(_i)   (AR_D0_CHNTIME + ((_i)<<2))
5688c2ecf20Sopenharmony_ci#define AR_D_CHNTIME_DUR         0x000FFFFF
5698c2ecf20Sopenharmony_ci#define AR_D_CHNTIME_DUR_S       0
5708c2ecf20Sopenharmony_ci#define AR_D_CHNTIME_EN          0x00100000
5718c2ecf20Sopenharmony_ci#define AR_D_CHNTIME_RESV0       0xFFE00000
5728c2ecf20Sopenharmony_ci
5738c2ecf20Sopenharmony_ci#define AR_D0_MISC        0x1100
5748c2ecf20Sopenharmony_ci#define AR_D1_MISC        0x1104
5758c2ecf20Sopenharmony_ci#define AR_D2_MISC        0x1108
5768c2ecf20Sopenharmony_ci#define AR_D3_MISC        0x110c
5778c2ecf20Sopenharmony_ci#define AR_D4_MISC        0x1110
5788c2ecf20Sopenharmony_ci#define AR_D5_MISC        0x1114
5798c2ecf20Sopenharmony_ci#define AR_D6_MISC        0x1118
5808c2ecf20Sopenharmony_ci#define AR_D7_MISC        0x111c
5818c2ecf20Sopenharmony_ci#define AR_D8_MISC        0x1120
5828c2ecf20Sopenharmony_ci#define AR_D9_MISC        0x1124
5838c2ecf20Sopenharmony_ci#define AR_DMISC(_i)      (AR_D0_MISC + ((_i)<<2))
5848c2ecf20Sopenharmony_ci#define AR_D_MISC_BKOFF_THRESH        0x0000003F
5858c2ecf20Sopenharmony_ci#define AR_D_MISC_RETRY_CNT_RESET_EN  0x00000040
5868c2ecf20Sopenharmony_ci#define AR_D_MISC_CW_RESET_EN         0x00000080
5878c2ecf20Sopenharmony_ci#define AR_D_MISC_FRAG_WAIT_EN        0x00000100
5888c2ecf20Sopenharmony_ci#define AR_D_MISC_FRAG_BKOFF_EN       0x00000200
5898c2ecf20Sopenharmony_ci#define AR_D_MISC_CW_BKOFF_EN         0x00001000
5908c2ecf20Sopenharmony_ci#define AR_D_MISC_VIR_COL_HANDLING    0x0000C000
5918c2ecf20Sopenharmony_ci#define AR_D_MISC_VIR_COL_HANDLING_S  14
5928c2ecf20Sopenharmony_ci#define AR_D_MISC_VIR_COL_HANDLING_DEFAULT 0
5938c2ecf20Sopenharmony_ci#define AR_D_MISC_VIR_COL_HANDLING_IGNORE  1
5948c2ecf20Sopenharmony_ci#define AR_D_MISC_BEACON_USE          0x00010000
5958c2ecf20Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL   0x00060000
5968c2ecf20Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL_S 17
5978c2ecf20Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL_NONE     0
5988c2ecf20Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL_INTRA_FR 1
5998c2ecf20Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL   2
6008c2ecf20Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_IGNORE  0x00080000
6018c2ecf20Sopenharmony_ci#define AR_D_MISC_SEQ_NUM_INCR_DIS    0x00100000
6028c2ecf20Sopenharmony_ci#define AR_D_MISC_POST_FR_BKOFF_DIS   0x00200000
6038c2ecf20Sopenharmony_ci#define AR_D_MISC_VIT_COL_CW_BKOFF_EN 0x00400000
6048c2ecf20Sopenharmony_ci#define AR_D_MISC_BLOWN_IFS_RETRY_EN  0x00800000
6058c2ecf20Sopenharmony_ci#define AR_D_MISC_RESV0               0xFF000000
6068c2ecf20Sopenharmony_ci
6078c2ecf20Sopenharmony_ci#define AR_D_SEQNUM      0x1140
6088c2ecf20Sopenharmony_ci
6098c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_SIFS         0x1030
6108c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_SIFS_M       0x0000FFFF
6118c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_SIFS_RESV0   0xFFFFFFFF
6128c2ecf20Sopenharmony_ci
6138c2ecf20Sopenharmony_ci#define AR_D_TXBLK_BASE            0x1038
6148c2ecf20Sopenharmony_ci#define AR_D_TXBLK_WRITE_BITMASK    0x0000FFFF
6158c2ecf20Sopenharmony_ci#define AR_D_TXBLK_WRITE_BITMASK_S  0
6168c2ecf20Sopenharmony_ci#define AR_D_TXBLK_WRITE_SLICE      0x000F0000
6178c2ecf20Sopenharmony_ci#define AR_D_TXBLK_WRITE_SLICE_S    16
6188c2ecf20Sopenharmony_ci#define AR_D_TXBLK_WRITE_DCU        0x00F00000
6198c2ecf20Sopenharmony_ci#define AR_D_TXBLK_WRITE_DCU_S      20
6208c2ecf20Sopenharmony_ci#define AR_D_TXBLK_WRITE_COMMAND    0x0F000000
6218c2ecf20Sopenharmony_ci#define AR_D_TXBLK_WRITE_COMMAND_S      24
6228c2ecf20Sopenharmony_ci
6238c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_SLOT         0x1070
6248c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_SLOT_M       0x0000FFFF
6258c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_SLOT_RESV0   0xFFFF0000
6268c2ecf20Sopenharmony_ci
6278c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_EIFS         0x10b0
6288c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_EIFS_M       0x0000FFFF
6298c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_EIFS_RESV0   0xFFFF0000
6308c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_EIFS_ASYNC_FIFO 363
6318c2ecf20Sopenharmony_ci
6328c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC        0x10f0
6338c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC_LFSR_SLICE_SEL        0x00000007
6348c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC_TURBO_MODE            0x00000008
6358c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC_USEC_DURATION         0x000FFC00
6368c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC_DCU_ARBITER_DLY       0x00300000
6378c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC_RANDOM_LFSR_SLICE_DIS 0x01000000
6388c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC_SLOT_XMIT_WIND_LEN    0x06000000
6398c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC_FORCE_XMIT_SLOT_BOUND 0x08000000
6408c2ecf20Sopenharmony_ci#define AR_D_GBL_IFS_MISC_IGNORE_BACKOFF        0x10000000
6418c2ecf20Sopenharmony_ci
6428c2ecf20Sopenharmony_ci#define AR_D_FPCTL                  0x1230
6438c2ecf20Sopenharmony_ci#define AR_D_FPCTL_DCU              0x0000000F
6448c2ecf20Sopenharmony_ci#define AR_D_FPCTL_DCU_S            0
6458c2ecf20Sopenharmony_ci#define AR_D_FPCTL_PREFETCH_EN      0x00000010
6468c2ecf20Sopenharmony_ci#define AR_D_FPCTL_BURST_PREFETCH   0x00007FE0
6478c2ecf20Sopenharmony_ci#define AR_D_FPCTL_BURST_PREFETCH_S 5
6488c2ecf20Sopenharmony_ci
6498c2ecf20Sopenharmony_ci#define AR_D_TXPSE                 0x1270
6508c2ecf20Sopenharmony_ci#define AR_D_TXPSE_CTRL            0x000003FF
6518c2ecf20Sopenharmony_ci#define AR_D_TXPSE_RESV0           0x0000FC00
6528c2ecf20Sopenharmony_ci#define AR_D_TXPSE_STATUS          0x00010000
6538c2ecf20Sopenharmony_ci#define AR_D_TXPSE_RESV1           0xFFFE0000
6548c2ecf20Sopenharmony_ci
6558c2ecf20Sopenharmony_ci#define AR_D_TXSLOTMASK            0x12f0
6568c2ecf20Sopenharmony_ci#define AR_D_TXSLOTMASK_NUM        0x0000000F
6578c2ecf20Sopenharmony_ci
6588c2ecf20Sopenharmony_ci#define AR_CFG_LED                     0x1f04
6598c2ecf20Sopenharmony_ci#define AR_CFG_SCLK_RATE_IND           0x00000003
6608c2ecf20Sopenharmony_ci#define AR_CFG_SCLK_RATE_IND_S         0
6618c2ecf20Sopenharmony_ci#define AR_CFG_SCLK_32MHZ              0x00000000
6628c2ecf20Sopenharmony_ci#define AR_CFG_SCLK_4MHZ               0x00000001
6638c2ecf20Sopenharmony_ci#define AR_CFG_SCLK_1MHZ               0x00000002
6648c2ecf20Sopenharmony_ci#define AR_CFG_SCLK_32KHZ              0x00000003
6658c2ecf20Sopenharmony_ci#define AR_CFG_LED_BLINK_SLOW          0x00000008
6668c2ecf20Sopenharmony_ci#define AR_CFG_LED_BLINK_THRESH_SEL    0x00000070
6678c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_SEL            0x00000380
6688c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_SEL_S          7
6698c2ecf20Sopenharmony_ci#define AR_CFG_LED_POWER               0x00000280
6708c2ecf20Sopenharmony_ci#define AR_CFG_LED_POWER_S             7
6718c2ecf20Sopenharmony_ci#define AR_CFG_LED_NETWORK             0x00000300
6728c2ecf20Sopenharmony_ci#define AR_CFG_LED_NETWORK_S           7
6738c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_PROP           0x0
6748c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_RPROP          0x1
6758c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_SPLIT          0x2
6768c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_RAND           0x3
6778c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_POWER_OFF      0x4
6788c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_POWER_ON       0x5
6798c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_NETWORK_OFF    0x4
6808c2ecf20Sopenharmony_ci#define AR_CFG_LED_MODE_NETWORK_ON     0x6
6818c2ecf20Sopenharmony_ci#define AR_CFG_LED_ASSOC_CTL           0x00000c00
6828c2ecf20Sopenharmony_ci#define AR_CFG_LED_ASSOC_CTL_S         10
6838c2ecf20Sopenharmony_ci#define AR_CFG_LED_ASSOC_NONE          0x0
6848c2ecf20Sopenharmony_ci#define AR_CFG_LED_ASSOC_ACTIVE        0x1
6858c2ecf20Sopenharmony_ci#define AR_CFG_LED_ASSOC_PENDING       0x2
6868c2ecf20Sopenharmony_ci
6878c2ecf20Sopenharmony_ci#define AR_CFG_LED_BLINK_SLOW          0x00000008
6888c2ecf20Sopenharmony_ci#define AR_CFG_LED_BLINK_SLOW_S        3
6898c2ecf20Sopenharmony_ci
6908c2ecf20Sopenharmony_ci#define AR_CFG_LED_BLINK_THRESH_SEL    0x00000070
6918c2ecf20Sopenharmony_ci#define AR_CFG_LED_BLINK_THRESH_SEL_S  4
6928c2ecf20Sopenharmony_ci
6938c2ecf20Sopenharmony_ci#define AR_MAC_SLEEP                0x1f00
6948c2ecf20Sopenharmony_ci#define AR_MAC_SLEEP_MAC_AWAKE      0x00000000
6958c2ecf20Sopenharmony_ci#define AR_MAC_SLEEP_MAC_ASLEEP     0x00000001
6968c2ecf20Sopenharmony_ci
6978c2ecf20Sopenharmony_ci#define AR_RC                0x4000
6988c2ecf20Sopenharmony_ci#define AR_RC_AHB            0x00000001
6998c2ecf20Sopenharmony_ci#define AR_RC_APB            0x00000002
7008c2ecf20Sopenharmony_ci#define AR_RC_HOSTIF         0x00000100
7018c2ecf20Sopenharmony_ci
7028c2ecf20Sopenharmony_ci#define AR_WA			(AR_SREV_9340(ah) ? 0x40c4 : 0x4004)
7038c2ecf20Sopenharmony_ci#define AR_WA_BIT6			(1 << 6)
7048c2ecf20Sopenharmony_ci#define AR_WA_BIT7			(1 << 7)
7058c2ecf20Sopenharmony_ci#define AR_WA_BIT23			(1 << 23)
7068c2ecf20Sopenharmony_ci#define AR_WA_D3_L1_DISABLE		(1 << 14)
7078c2ecf20Sopenharmony_ci#define AR_WA_UNTIE_RESET_EN		(1 << 15) /* Enable PCI Reset
7088c2ecf20Sopenharmony_ci						     to POR (power-on-reset) */
7098c2ecf20Sopenharmony_ci#define AR_WA_D3_TO_L1_DISABLE_REAL     (1 << 16)
7108c2ecf20Sopenharmony_ci#define AR_WA_ASPM_TIMER_BASED_DISABLE  (1 << 17)
7118c2ecf20Sopenharmony_ci#define AR_WA_RESET_EN                  (1 << 18) /* Enable PCI-Reset to
7128c2ecf20Sopenharmony_ci						     POR (bit 15) */
7138c2ecf20Sopenharmony_ci#define AR_WA_ANALOG_SHIFT              (1 << 20)
7148c2ecf20Sopenharmony_ci#define AR_WA_POR_SHORT                 (1 << 21) /* PCI-E Phy reset control */
7158c2ecf20Sopenharmony_ci#define AR_WA_BIT22			(1 << 22)
7168c2ecf20Sopenharmony_ci#define AR9285_WA_DEFAULT		0x004a050b
7178c2ecf20Sopenharmony_ci#define AR9280_WA_DEFAULT           	0x0040073b
7188c2ecf20Sopenharmony_ci#define AR_WA_DEFAULT               	0x0000073f
7198c2ecf20Sopenharmony_ci
7208c2ecf20Sopenharmony_ci
7218c2ecf20Sopenharmony_ci#define AR_PM_STATE                 0x4008
7228c2ecf20Sopenharmony_ci#define AR_PM_STATE_PME_D3COLD_VAUX 0x00100000
7238c2ecf20Sopenharmony_ci
7248c2ecf20Sopenharmony_ci#define AR_HOST_TIMEOUT             (AR_SREV_9340(ah) ? 0x4008 : 0x4018)
7258c2ecf20Sopenharmony_ci#define AR_HOST_TIMEOUT_APB_CNTR    0x0000FFFF
7268c2ecf20Sopenharmony_ci#define AR_HOST_TIMEOUT_APB_CNTR_S  0
7278c2ecf20Sopenharmony_ci#define AR_HOST_TIMEOUT_LCL_CNTR    0xFFFF0000
7288c2ecf20Sopenharmony_ci#define AR_HOST_TIMEOUT_LCL_CNTR_S  16
7298c2ecf20Sopenharmony_ci
7308c2ecf20Sopenharmony_ci#define AR_EEPROM                0x401c
7318c2ecf20Sopenharmony_ci#define AR_EEPROM_ABSENT         0x00000100
7328c2ecf20Sopenharmony_ci#define AR_EEPROM_CORRUPT        0x00000200
7338c2ecf20Sopenharmony_ci#define AR_EEPROM_PROT_MASK      0x03FFFC00
7348c2ecf20Sopenharmony_ci#define AR_EEPROM_PROT_MASK_S    10
7358c2ecf20Sopenharmony_ci
7368c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_RP_0_31        0x0001
7378c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_WP_0_31        0x0002
7388c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_RP_32_63       0x0004
7398c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_WP_32_63       0x0008
7408c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_RP_64_127      0x0010
7418c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_WP_64_127      0x0020
7428c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_RP_128_191     0x0040
7438c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_WP_128_191     0x0080
7448c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_RP_192_255     0x0100
7458c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_WP_192_255     0x0200
7468c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_RP_256_511     0x0400
7478c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_WP_256_511     0x0800
7488c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_RP_512_1023    0x1000
7498c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_WP_512_1023    0x2000
7508c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_RP_1024_2047   0x4000
7518c2ecf20Sopenharmony_ci#define EEPROM_PROTECT_WP_1024_2047   0x8000
7528c2ecf20Sopenharmony_ci
7538c2ecf20Sopenharmony_ci#define AR_SREV \
7548c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? 0x0600 : (AR_SREV_9340(ah) \
7558c2ecf20Sopenharmony_ci					? 0x400c : 0x4020))
7568c2ecf20Sopenharmony_ci
7578c2ecf20Sopenharmony_ci#define AR_SREV_ID \
7588c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? 0x00000FFF : 0x000000FF)
7598c2ecf20Sopenharmony_ci#define AR_SREV_VERSION                       0x000000F0
7608c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_S                     4
7618c2ecf20Sopenharmony_ci#define AR_SREV_REVISION                      0x00000007
7628c2ecf20Sopenharmony_ci
7638c2ecf20Sopenharmony_ci#define AR_SREV_ID2                           0xFFFFFFFF
7648c2ecf20Sopenharmony_ci#define AR_SREV_VERSION2        	      0xFFFC0000
7658c2ecf20Sopenharmony_ci#define AR_SREV_VERSION2_S                    18
7668c2ecf20Sopenharmony_ci#define AR_SREV_TYPE2        	      	      0x0003F000
7678c2ecf20Sopenharmony_ci#define AR_SREV_TYPE2_S                       12
7688c2ecf20Sopenharmony_ci#define AR_SREV_TYPE2_CHAIN		      0x00001000
7698c2ecf20Sopenharmony_ci#define AR_SREV_TYPE2_HOST_MODE		      0x00002000
7708c2ecf20Sopenharmony_ci#define AR_SREV_REVISION2        	      0x00000F00
7718c2ecf20Sopenharmony_ci#define AR_SREV_REVISION2_S     	      8
7728c2ecf20Sopenharmony_ci
7738c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_5416_PCI	0xD
7748c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_5416_PCIE	0xC
7758c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_5416_10	0
7768c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_5416_20	1
7778c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_5416_22	2
7788c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9100		0x14
7798c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9160		0x40
7808c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9160_10	0
7818c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9160_11	1
7828c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9280		0x80
7838c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9280_10	0
7848c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9280_20	1
7858c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9280_21	2
7868c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9285		0xC0
7878c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9285_10	0
7888c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9285_11	1
7898c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9285_12	2
7908c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9287		0x180
7918c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9287_10	0
7928c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9287_11	1
7938c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9287_12	2
7948c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9287_13	3
7958c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9271		0x140
7968c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9271_10	0
7978c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9271_11	1
7988c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9300		0x1c0
7998c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9300_20	2 /* 2.0 and 2.1 */
8008c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9300_22	3
8018c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9330		0x200
8028c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9330_10	0
8038c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9330_11	1
8048c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9330_12	2
8058c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9485		0x240
8068c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9485_10	0
8078c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9485_11        1
8088c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9340		0x300
8098c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9340_10	0
8108c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9340_11	1
8118c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9340_12	2
8128c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9340_13	3
8138c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9580		0x1C0
8148c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9580_10	4 /* AR9580 1.0 */
8158c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9462		0x280
8168c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9462_20	2
8178c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9462_21	3
8188c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9565            0x2C0
8198c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9565_10        0
8208c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9565_101       1
8218c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9565_11        2
8228c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9550		0x400
8238c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9531            0x500
8248c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9531_10        0
8258c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9531_11        1
8268c2ecf20Sopenharmony_ci#define AR_SREV_REVISION_9531_20        2
8278c2ecf20Sopenharmony_ci#define AR_SREV_VERSION_9561            0x600
8288c2ecf20Sopenharmony_ci
8298c2ecf20Sopenharmony_ci#define AR_SREV_5416(_ah) \
8308c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \
8318c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE))
8328c2ecf20Sopenharmony_ci#define AR_SREV_5416_22_OR_LATER(_ah) \
8338c2ecf20Sopenharmony_ci	(((AR_SREV_5416(_ah)) && \
8348c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \
8358c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))
8368c2ecf20Sopenharmony_ci
8378c2ecf20Sopenharmony_ci#define AR_SREV_9100(ah) \
8388c2ecf20Sopenharmony_ci	((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
8398c2ecf20Sopenharmony_ci#define AR_SREV_9100_OR_LATER(_ah) \
8408c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))
8418c2ecf20Sopenharmony_ci
8428c2ecf20Sopenharmony_ci#define AR_SREV_9160(_ah) \
8438c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
8448c2ecf20Sopenharmony_ci#define AR_SREV_9160_10_OR_LATER(_ah) \
8458c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160))
8468c2ecf20Sopenharmony_ci#define AR_SREV_9160_11(_ah) \
8478c2ecf20Sopenharmony_ci	(AR_SREV_9160(_ah) && \
8488c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9160_11))
8498c2ecf20Sopenharmony_ci#define AR_SREV_9280(_ah) \
8508c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280))
8518c2ecf20Sopenharmony_ci#define AR_SREV_9280_20_OR_LATER(_ah) \
8528c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9280))
8538c2ecf20Sopenharmony_ci#define AR_SREV_9280_20(_ah) \
8548c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280))
8558c2ecf20Sopenharmony_ci
8568c2ecf20Sopenharmony_ci#define AR_SREV_9285(_ah) \
8578c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285))
8588c2ecf20Sopenharmony_ci#define AR_SREV_9285_12_OR_LATER(_ah) \
8598c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285))
8608c2ecf20Sopenharmony_ci
8618c2ecf20Sopenharmony_ci#define AR_SREV_9287(_ah) \
8628c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287))
8638c2ecf20Sopenharmony_ci#define AR_SREV_9287_11_OR_LATER(_ah) \
8648c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9287))
8658c2ecf20Sopenharmony_ci#define AR_SREV_9287_11(_ah) \
8668c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \
8678c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_11))
8688c2ecf20Sopenharmony_ci#define AR_SREV_9287_12(_ah) \
8698c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \
8708c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_12))
8718c2ecf20Sopenharmony_ci#define AR_SREV_9287_12_OR_LATER(_ah) \
8728c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \
8738c2ecf20Sopenharmony_ci	 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \
8748c2ecf20Sopenharmony_ci	  ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_12)))
8758c2ecf20Sopenharmony_ci#define AR_SREV_9287_13_OR_LATER(_ah) \
8768c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \
8778c2ecf20Sopenharmony_ci	 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \
8788c2ecf20Sopenharmony_ci	  ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_13)))
8798c2ecf20Sopenharmony_ci
8808c2ecf20Sopenharmony_ci#define AR_SREV_9271(_ah) \
8818c2ecf20Sopenharmony_ci    (((_ah))->hw_version.macVersion == AR_SREV_VERSION_9271)
8828c2ecf20Sopenharmony_ci#define AR_SREV_9271_10(_ah) \
8838c2ecf20Sopenharmony_ci    (AR_SREV_9271(_ah) && \
8848c2ecf20Sopenharmony_ci     ((_ah)->hw_version.macRev == AR_SREV_REVISION_9271_10))
8858c2ecf20Sopenharmony_ci#define AR_SREV_9271_11(_ah) \
8868c2ecf20Sopenharmony_ci    (AR_SREV_9271(_ah) && \
8878c2ecf20Sopenharmony_ci     ((_ah)->hw_version.macRev == AR_SREV_REVISION_9271_11))
8888c2ecf20Sopenharmony_ci
8898c2ecf20Sopenharmony_ci#define AR_SREV_9300(_ah) \
8908c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9300))
8918c2ecf20Sopenharmony_ci#define AR_SREV_9300_20_OR_LATER(_ah) \
8928c2ecf20Sopenharmony_ci	((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9300)
8938c2ecf20Sopenharmony_ci#define AR_SREV_9300_22(_ah) \
8948c2ecf20Sopenharmony_ci	(AR_SREV_9300(ah) && \
8958c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9300_22))
8968c2ecf20Sopenharmony_ci
8978c2ecf20Sopenharmony_ci#define AR_SREV_9330(_ah) \
8988c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9330))
8998c2ecf20Sopenharmony_ci#define AR_SREV_9330_11(_ah) \
9008c2ecf20Sopenharmony_ci	(AR_SREV_9330((_ah)) && \
9018c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_11))
9028c2ecf20Sopenharmony_ci#define AR_SREV_9330_12(_ah) \
9038c2ecf20Sopenharmony_ci	(AR_SREV_9330((_ah)) && \
9048c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_12))
9058c2ecf20Sopenharmony_ci
9068c2ecf20Sopenharmony_ci#ifdef CONFIG_ATH9K_PCOEM
9078c2ecf20Sopenharmony_ci#define AR_SREV_9462(_ah) \
9088c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462))
9098c2ecf20Sopenharmony_ci#define AR_SREV_9485(_ah) \
9108c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9485))
9118c2ecf20Sopenharmony_ci#define AR_SREV_9565(_ah) \
9128c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565))
9138c2ecf20Sopenharmony_ci#define AR_SREV_9003_PCOEM(_ah) \
9148c2ecf20Sopenharmony_ci	(AR_SREV_9462(_ah) || AR_SREV_9485(_ah) || AR_SREV_9565(_ah))
9158c2ecf20Sopenharmony_ci#else
9168c2ecf20Sopenharmony_ci#define AR_SREV_9462(_ah) 0
9178c2ecf20Sopenharmony_ci#define AR_SREV_9485(_ah) 0
9188c2ecf20Sopenharmony_ci#define AR_SREV_9565(_ah) 0
9198c2ecf20Sopenharmony_ci#define AR_SREV_9003_PCOEM(_ah) 0
9208c2ecf20Sopenharmony_ci#endif
9218c2ecf20Sopenharmony_ci
9228c2ecf20Sopenharmony_ci#define AR_SREV_9485_11_OR_LATER(_ah) \
9238c2ecf20Sopenharmony_ci	(AR_SREV_9485(_ah) && \
9248c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9485_11))
9258c2ecf20Sopenharmony_ci#define AR_SREV_9485_OR_LATER(_ah) \
9268c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9485))
9278c2ecf20Sopenharmony_ci
9288c2ecf20Sopenharmony_ci#define AR_SREV_9340(_ah) \
9298c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340))
9308c2ecf20Sopenharmony_ci
9318c2ecf20Sopenharmony_ci#define AR_SREV_9340_13(_ah) \
9328c2ecf20Sopenharmony_ci	(AR_SREV_9340((_ah)) && \
9338c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9340_13))
9348c2ecf20Sopenharmony_ci
9358c2ecf20Sopenharmony_ci#define AR_SREV_9340_13_OR_LATER(_ah) \
9368c2ecf20Sopenharmony_ci	(AR_SREV_9340((_ah)) && \
9378c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9340_13))
9388c2ecf20Sopenharmony_ci
9398c2ecf20Sopenharmony_ci#define AR_SREV_9285E_20(_ah) \
9408c2ecf20Sopenharmony_ci    (AR_SREV_9285_12_OR_LATER(_ah) && \
9418c2ecf20Sopenharmony_ci     ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1))
9428c2ecf20Sopenharmony_ci
9438c2ecf20Sopenharmony_ci#define AR_SREV_9462_20(_ah) \
9448c2ecf20Sopenharmony_ci	(AR_SREV_9462(_ah) && \
9458c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_20))
9468c2ecf20Sopenharmony_ci#define AR_SREV_9462_21(_ah) \
9478c2ecf20Sopenharmony_ci	(AR_SREV_9462(_ah) && \
9488c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_21))
9498c2ecf20Sopenharmony_ci#define AR_SREV_9462_20_OR_LATER(_ah) \
9508c2ecf20Sopenharmony_ci	(AR_SREV_9462(_ah) && \
9518c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_20))
9528c2ecf20Sopenharmony_ci#define AR_SREV_9462_21_OR_LATER(_ah) \
9538c2ecf20Sopenharmony_ci	(AR_SREV_9462(_ah) && \
9548c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_21))
9558c2ecf20Sopenharmony_ci
9568c2ecf20Sopenharmony_ci#define AR_SREV_9565_10(_ah) \
9578c2ecf20Sopenharmony_ci	(AR_SREV_9565(_ah) && \
9588c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_10))
9598c2ecf20Sopenharmony_ci#define AR_SREV_9565_101(_ah) \
9608c2ecf20Sopenharmony_ci	(AR_SREV_9565(_ah) && \
9618c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_101))
9628c2ecf20Sopenharmony_ci#define AR_SREV_9565_11(_ah) \
9638c2ecf20Sopenharmony_ci	(AR_SREV_9565(_ah) && \
9648c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_11))
9658c2ecf20Sopenharmony_ci#define AR_SREV_9565_11_OR_LATER(_ah) \
9668c2ecf20Sopenharmony_ci	(AR_SREV_9565(_ah) && \
9678c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9565_11))
9688c2ecf20Sopenharmony_ci
9698c2ecf20Sopenharmony_ci#define AR_SREV_9550(_ah) \
9708c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9550))
9718c2ecf20Sopenharmony_ci#define AR_SREV_9550_OR_LATER(_ah) \
9728c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9550))
9738c2ecf20Sopenharmony_ci
9748c2ecf20Sopenharmony_ci#define AR_SREV_9580(_ah) \
9758c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9580) && \
9768c2ecf20Sopenharmony_ci	((_ah)->hw_version.macRev >= AR_SREV_REVISION_9580_10))
9778c2ecf20Sopenharmony_ci#define AR_SREV_9580_10(_ah) \
9788c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9580) && \
9798c2ecf20Sopenharmony_ci	((_ah)->hw_version.macRev == AR_SREV_REVISION_9580_10))
9808c2ecf20Sopenharmony_ci
9818c2ecf20Sopenharmony_ci#define AR_SREV_9531(_ah) \
9828c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531))
9838c2ecf20Sopenharmony_ci#define AR_SREV_9531_10(_ah) \
9848c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531) && \
9858c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9531_10))
9868c2ecf20Sopenharmony_ci#define AR_SREV_9531_11(_ah) \
9878c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531) && \
9888c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9531_11))
9898c2ecf20Sopenharmony_ci#define AR_SREV_9531_20(_ah) \
9908c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531) && \
9918c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9531_20))
9928c2ecf20Sopenharmony_ci
9938c2ecf20Sopenharmony_ci#define AR_SREV_9561(_ah) \
9948c2ecf20Sopenharmony_ci	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9561))
9958c2ecf20Sopenharmony_ci
9968c2ecf20Sopenharmony_ci#define AR_SREV_SOC(_ah) \
9978c2ecf20Sopenharmony_ci	(AR_SREV_9340(_ah) || AR_SREV_9531(_ah) || AR_SREV_9550(ah) || \
9988c2ecf20Sopenharmony_ci	 AR_SREV_9561(ah))
9998c2ecf20Sopenharmony_ci
10008c2ecf20Sopenharmony_ci/* NOTE: When adding chips newer than Peacock, add chip check here */
10018c2ecf20Sopenharmony_ci#define AR_SREV_9580_10_OR_LATER(_ah) \
10028c2ecf20Sopenharmony_ci	(AR_SREV_9580(_ah))
10038c2ecf20Sopenharmony_ci
10048c2ecf20Sopenharmony_cienum ath_usb_dev {
10058c2ecf20Sopenharmony_ci	AR9280_USB = 1, /* AR7010 + AR9280, UB94 */
10068c2ecf20Sopenharmony_ci	AR9287_USB = 2, /* AR7010 + AR9287, UB95 */
10078c2ecf20Sopenharmony_ci	STORAGE_DEVICE = 3,
10088c2ecf20Sopenharmony_ci};
10098c2ecf20Sopenharmony_ci
10108c2ecf20Sopenharmony_ci#define AR_DEVID_7010(_ah) \
10118c2ecf20Sopenharmony_ci	(((_ah)->hw_version.usbdev == AR9280_USB) || \
10128c2ecf20Sopenharmony_ci	 ((_ah)->hw_version.usbdev == AR9287_USB))
10138c2ecf20Sopenharmony_ci
10148c2ecf20Sopenharmony_ci#define AR_RADIO_SREV_MAJOR                   0xf0
10158c2ecf20Sopenharmony_ci#define AR_RAD5133_SREV_MAJOR                 0xc0
10168c2ecf20Sopenharmony_ci#define AR_RAD2133_SREV_MAJOR                 0xd0
10178c2ecf20Sopenharmony_ci#define AR_RAD5122_SREV_MAJOR                 0xe0
10188c2ecf20Sopenharmony_ci#define AR_RAD2122_SREV_MAJOR                 0xf0
10198c2ecf20Sopenharmony_ci
10208c2ecf20Sopenharmony_ci#define AR_AHB_MODE                           0x4024
10218c2ecf20Sopenharmony_ci#define AR_AHB_EXACT_WR_EN                    0x00000000
10228c2ecf20Sopenharmony_ci#define AR_AHB_BUF_WR_EN                      0x00000001
10238c2ecf20Sopenharmony_ci#define AR_AHB_EXACT_RD_EN                    0x00000000
10248c2ecf20Sopenharmony_ci#define AR_AHB_CACHELINE_RD_EN                0x00000002
10258c2ecf20Sopenharmony_ci#define AR_AHB_PREFETCH_RD_EN                 0x00000004
10268c2ecf20Sopenharmony_ci#define AR_AHB_PAGE_SIZE_1K                   0x00000000
10278c2ecf20Sopenharmony_ci#define AR_AHB_PAGE_SIZE_2K                   0x00000008
10288c2ecf20Sopenharmony_ci#define AR_AHB_PAGE_SIZE_4K                   0x00000010
10298c2ecf20Sopenharmony_ci#define AR_AHB_CUSTOM_BURST_EN                0x000000C0
10308c2ecf20Sopenharmony_ci#define AR_AHB_CUSTOM_BURST_EN_S              6
10318c2ecf20Sopenharmony_ci#define AR_AHB_CUSTOM_BURST_ASYNC_FIFO_VAL    3
10328c2ecf20Sopenharmony_ci
10338c2ecf20Sopenharmony_ci#define AR_INTR_RTC_IRQ                       0x00000001
10348c2ecf20Sopenharmony_ci#define AR_INTR_MAC_IRQ                       0x00000002
10358c2ecf20Sopenharmony_ci#define AR_INTR_EEP_PROT_ACCESS               0x00000004
10368c2ecf20Sopenharmony_ci#define AR_INTR_MAC_AWAKE                     0x00020000
10378c2ecf20Sopenharmony_ci#define AR_INTR_MAC_ASLEEP                    0x00040000
10388c2ecf20Sopenharmony_ci#define AR_INTR_SPURIOUS                      0xFFFFFFFF
10398c2ecf20Sopenharmony_ci
10408c2ecf20Sopenharmony_ci
10418c2ecf20Sopenharmony_ci#define AR_INTR_SYNC_CAUSE                    (AR_SREV_9340(ah) ? 0x4010 : 0x4028)
10428c2ecf20Sopenharmony_ci#define AR_INTR_SYNC_CAUSE_CLR                (AR_SREV_9340(ah) ? 0x4010 : 0x4028)
10438c2ecf20Sopenharmony_ci
10448c2ecf20Sopenharmony_ci
10458c2ecf20Sopenharmony_ci#define AR_INTR_SYNC_ENABLE                   (AR_SREV_9340(ah) ? 0x4014 : 0x402c)
10468c2ecf20Sopenharmony_ci#define AR_INTR_SYNC_ENABLE_GPIO              0xFFFC0000
10478c2ecf20Sopenharmony_ci#define AR_INTR_SYNC_ENABLE_GPIO_S            18
10488c2ecf20Sopenharmony_ci
10498c2ecf20Sopenharmony_cienum {
10508c2ecf20Sopenharmony_ci	AR_INTR_SYNC_RTC_IRQ = 0x00000001,
10518c2ecf20Sopenharmony_ci	AR_INTR_SYNC_MAC_IRQ = 0x00000002,
10528c2ecf20Sopenharmony_ci	AR_INTR_SYNC_EEPROM_ILLEGAL_ACCESS = 0x00000004,
10538c2ecf20Sopenharmony_ci	AR_INTR_SYNC_APB_TIMEOUT = 0x00000008,
10548c2ecf20Sopenharmony_ci	AR_INTR_SYNC_PCI_MODE_CONFLICT = 0x00000010,
10558c2ecf20Sopenharmony_ci	AR_INTR_SYNC_HOST1_FATAL = 0x00000020,
10568c2ecf20Sopenharmony_ci	AR_INTR_SYNC_HOST1_PERR = 0x00000040,
10578c2ecf20Sopenharmony_ci	AR_INTR_SYNC_TRCV_FIFO_PERR = 0x00000080,
10588c2ecf20Sopenharmony_ci	AR_INTR_SYNC_RADM_CPL_EP = 0x00000100,
10598c2ecf20Sopenharmony_ci	AR_INTR_SYNC_RADM_CPL_DLLP_ABORT = 0x00000200,
10608c2ecf20Sopenharmony_ci	AR_INTR_SYNC_RADM_CPL_TLP_ABORT = 0x00000400,
10618c2ecf20Sopenharmony_ci	AR_INTR_SYNC_RADM_CPL_ECRC_ERR = 0x00000800,
10628c2ecf20Sopenharmony_ci	AR_INTR_SYNC_RADM_CPL_TIMEOUT = 0x00001000,
10638c2ecf20Sopenharmony_ci	AR_INTR_SYNC_LOCAL_TIMEOUT = 0x00002000,
10648c2ecf20Sopenharmony_ci	AR_INTR_SYNC_PM_ACCESS = 0x00004000,
10658c2ecf20Sopenharmony_ci	AR_INTR_SYNC_MAC_AWAKE = 0x00008000,
10668c2ecf20Sopenharmony_ci	AR_INTR_SYNC_MAC_ASLEEP = 0x00010000,
10678c2ecf20Sopenharmony_ci	AR_INTR_SYNC_MAC_SLEEP_ACCESS = 0x00020000,
10688c2ecf20Sopenharmony_ci	AR_INTR_SYNC_ALL = 0x0003FFFF,
10698c2ecf20Sopenharmony_ci
10708c2ecf20Sopenharmony_ci
10718c2ecf20Sopenharmony_ci	AR_INTR_SYNC_DEFAULT = (AR_INTR_SYNC_HOST1_FATAL |
10728c2ecf20Sopenharmony_ci				AR_INTR_SYNC_HOST1_PERR |
10738c2ecf20Sopenharmony_ci				AR_INTR_SYNC_RADM_CPL_EP |
10748c2ecf20Sopenharmony_ci				AR_INTR_SYNC_RADM_CPL_DLLP_ABORT |
10758c2ecf20Sopenharmony_ci				AR_INTR_SYNC_RADM_CPL_TLP_ABORT |
10768c2ecf20Sopenharmony_ci				AR_INTR_SYNC_RADM_CPL_ECRC_ERR |
10778c2ecf20Sopenharmony_ci				AR_INTR_SYNC_RADM_CPL_TIMEOUT |
10788c2ecf20Sopenharmony_ci				AR_INTR_SYNC_LOCAL_TIMEOUT |
10798c2ecf20Sopenharmony_ci				AR_INTR_SYNC_MAC_SLEEP_ACCESS),
10808c2ecf20Sopenharmony_ci
10818c2ecf20Sopenharmony_ci	AR9340_INTR_SYNC_LOCAL_TIMEOUT = 0x00000010,
10828c2ecf20Sopenharmony_ci
10838c2ecf20Sopenharmony_ci	AR_INTR_SYNC_SPURIOUS = 0xFFFFFFFF,
10848c2ecf20Sopenharmony_ci
10858c2ecf20Sopenharmony_ci};
10868c2ecf20Sopenharmony_ci
10878c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_MASK                       (AR_SREV_9340(ah) ? 0x4018 : 0x4030)
10888c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_MASK_GPIO                  0xFFFC0000
10898c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_MASK_GPIO_S                18
10908c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_MASK_MCI                   0x00000080
10918c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_MASK_MCI_S                 7
10928c2ecf20Sopenharmony_ci
10938c2ecf20Sopenharmony_ci#define AR_INTR_SYNC_MASK                        (AR_SREV_9340(ah) ? 0x401c : 0x4034)
10948c2ecf20Sopenharmony_ci#define AR_INTR_SYNC_MASK_GPIO                   0xFFFC0000
10958c2ecf20Sopenharmony_ci#define AR_INTR_SYNC_MASK_GPIO_S                 18
10968c2ecf20Sopenharmony_ci
10978c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_CAUSE_CLR                  (AR_SREV_9340(ah) ? 0x4020 : 0x4038)
10988c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_CAUSE                      (AR_SREV_9340(ah) ? 0x4020 : 0x4038)
10998c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_CAUSE_MCI			 0x00000080
11008c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_USED			 (AR_INTR_MAC_IRQ | \
11018c2ecf20Sopenharmony_ci						  AR_INTR_ASYNC_CAUSE_MCI)
11028c2ecf20Sopenharmony_ci
11038c2ecf20Sopenharmony_ci/* Asynchronous Interrupt Enable Register */
11048c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE_MCI         0x00000080
11058c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE_MCI_S       7
11068c2ecf20Sopenharmony_ci
11078c2ecf20Sopenharmony_ci
11088c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE                     (AR_SREV_9340(ah) ? 0x4024 : 0x403c)
11098c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE_GPIO                0xFFFC0000
11108c2ecf20Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE_GPIO_S              18
11118c2ecf20Sopenharmony_ci
11128c2ecf20Sopenharmony_ci#define AR_PCIE_SERDES                           0x4040
11138c2ecf20Sopenharmony_ci#define AR_PCIE_SERDES2                          0x4044
11148c2ecf20Sopenharmony_ci#define AR_PCIE_PM_CTRL                          (AR_SREV_9340(ah) ? 0x4004 : 0x4014)
11158c2ecf20Sopenharmony_ci#define AR_PCIE_PM_CTRL_ENA                      0x00080000
11168c2ecf20Sopenharmony_ci
11178c2ecf20Sopenharmony_ci#define AR_PCIE_PHY_REG3			 0x18c08
11188c2ecf20Sopenharmony_ci
11198c2ecf20Sopenharmony_ci/* Define correct GPIO numbers and MASK bits to indicate the WMAC
11208c2ecf20Sopenharmony_ci * GPIO resource.
11218c2ecf20Sopenharmony_ci * Allow SOC chips(AR9340, AR9531, AR9550, AR9561) to access all GPIOs
11228c2ecf20Sopenharmony_ci * which rely on gpiolib framework. But restrict SOC AR9330 only to
11238c2ecf20Sopenharmony_ci * access WMAC GPIO which has the same design with the old chips.
11248c2ecf20Sopenharmony_ci */
11258c2ecf20Sopenharmony_ci#define AR_NUM_GPIO                              14
11268c2ecf20Sopenharmony_ci#define AR9280_NUM_GPIO                          10
11278c2ecf20Sopenharmony_ci#define AR9285_NUM_GPIO                          12
11288c2ecf20Sopenharmony_ci#define AR9287_NUM_GPIO                          10
11298c2ecf20Sopenharmony_ci#define AR9271_NUM_GPIO                          16
11308c2ecf20Sopenharmony_ci#define AR9300_NUM_GPIO                          16
11318c2ecf20Sopenharmony_ci#define AR9330_NUM_GPIO				 16
11328c2ecf20Sopenharmony_ci#define AR9340_NUM_GPIO				 23
11338c2ecf20Sopenharmony_ci#define AR9462_NUM_GPIO				 14
11348c2ecf20Sopenharmony_ci#define AR9485_NUM_GPIO				 12
11358c2ecf20Sopenharmony_ci#define AR9531_NUM_GPIO				 18
11368c2ecf20Sopenharmony_ci#define AR9550_NUM_GPIO				 24
11378c2ecf20Sopenharmony_ci#define AR9561_NUM_GPIO				 23
11388c2ecf20Sopenharmony_ci#define AR9565_NUM_GPIO				 14
11398c2ecf20Sopenharmony_ci#define AR9580_NUM_GPIO				 16
11408c2ecf20Sopenharmony_ci#define AR7010_NUM_GPIO                          16
11418c2ecf20Sopenharmony_ci
11428c2ecf20Sopenharmony_ci#define AR_GPIO_MASK				 0x00003FFF
11438c2ecf20Sopenharmony_ci#define AR9271_GPIO_MASK			 0x0000FFFF
11448c2ecf20Sopenharmony_ci#define AR9280_GPIO_MASK			 0x000003FF
11458c2ecf20Sopenharmony_ci#define AR9285_GPIO_MASK			 0x00000FFF
11468c2ecf20Sopenharmony_ci#define AR9287_GPIO_MASK			 0x000003FF
11478c2ecf20Sopenharmony_ci#define AR9300_GPIO_MASK			 0x0000F4FF
11488c2ecf20Sopenharmony_ci#define AR9330_GPIO_MASK			 0x0000F4FF
11498c2ecf20Sopenharmony_ci#define AR9340_GPIO_MASK			 0x0000000F
11508c2ecf20Sopenharmony_ci#define AR9462_GPIO_MASK			 0x00003FFF
11518c2ecf20Sopenharmony_ci#define AR9485_GPIO_MASK			 0x00000FFF
11528c2ecf20Sopenharmony_ci#define AR9531_GPIO_MASK			 0x0000000F
11538c2ecf20Sopenharmony_ci#define AR9550_GPIO_MASK			 0x0000000F
11548c2ecf20Sopenharmony_ci#define AR9561_GPIO_MASK			 0x0000000F
11558c2ecf20Sopenharmony_ci#define AR9565_GPIO_MASK			 0x00003FFF
11568c2ecf20Sopenharmony_ci#define AR9580_GPIO_MASK			 0x0000F4FF
11578c2ecf20Sopenharmony_ci#define AR7010_GPIO_MASK			 0x0000FFFF
11588c2ecf20Sopenharmony_ci
11598c2ecf20Sopenharmony_ci#define AR_GPIO_IN_OUT                           (AR_SREV_9340(ah) ? 0x4028 : 0x4048)
11608c2ecf20Sopenharmony_ci#define AR_GPIO_IN_VAL                           0x0FFFC000
11618c2ecf20Sopenharmony_ci#define AR_GPIO_IN_VAL_S                         14
11628c2ecf20Sopenharmony_ci#define AR928X_GPIO_IN_VAL                       0x000FFC00
11638c2ecf20Sopenharmony_ci#define AR928X_GPIO_IN_VAL_S                     10
11648c2ecf20Sopenharmony_ci#define AR9285_GPIO_IN_VAL                       0x00FFF000
11658c2ecf20Sopenharmony_ci#define AR9285_GPIO_IN_VAL_S                     12
11668c2ecf20Sopenharmony_ci#define AR9287_GPIO_IN_VAL                       0x003FF800
11678c2ecf20Sopenharmony_ci#define AR9287_GPIO_IN_VAL_S                     11
11688c2ecf20Sopenharmony_ci#define AR9271_GPIO_IN_VAL                       0xFFFF0000
11698c2ecf20Sopenharmony_ci#define AR9271_GPIO_IN_VAL_S                     16
11708c2ecf20Sopenharmony_ci#define AR7010_GPIO_IN_VAL                       0x0000FFFF
11718c2ecf20Sopenharmony_ci#define AR7010_GPIO_IN_VAL_S                     0
11728c2ecf20Sopenharmony_ci
11738c2ecf20Sopenharmony_ci#define AR_GPIO_IN				 (AR_SREV_9340(ah) ? 0x402c : 0x404c)
11748c2ecf20Sopenharmony_ci#define AR9300_GPIO_IN_VAL                       0x0001FFFF
11758c2ecf20Sopenharmony_ci#define AR9300_GPIO_IN_VAL_S                     0
11768c2ecf20Sopenharmony_ci
11778c2ecf20Sopenharmony_ci#define AR_GPIO_OE_OUT                           (AR_SREV_9340(ah) ? 0x4030 : \
11788c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c))
11798c2ecf20Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV                       0x3
11808c2ecf20Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV_NO                    0x0
11818c2ecf20Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV_LOW                   0x1
11828c2ecf20Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV_HI                    0x2
11838c2ecf20Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV_ALL                   0x3
11848c2ecf20Sopenharmony_ci
11858c2ecf20Sopenharmony_ci#define AR7010_GPIO_OE                           0x52000
11868c2ecf20Sopenharmony_ci#define AR7010_GPIO_OE_MASK                      0x1
11878c2ecf20Sopenharmony_ci#define AR7010_GPIO_OE_AS_OUTPUT                 0x0
11888c2ecf20Sopenharmony_ci#define AR7010_GPIO_OE_AS_INPUT                  0x1
11898c2ecf20Sopenharmony_ci#define AR7010_GPIO_IN                           0x52004
11908c2ecf20Sopenharmony_ci#define AR7010_GPIO_OUT                          0x52008
11918c2ecf20Sopenharmony_ci#define AR7010_GPIO_SET                          0x5200C
11928c2ecf20Sopenharmony_ci#define AR7010_GPIO_CLEAR                        0x52010
11938c2ecf20Sopenharmony_ci#define AR7010_GPIO_INT                          0x52014
11948c2ecf20Sopenharmony_ci#define AR7010_GPIO_INT_TYPE                     0x52018
11958c2ecf20Sopenharmony_ci#define AR7010_GPIO_INT_POLARITY                 0x5201C
11968c2ecf20Sopenharmony_ci#define AR7010_GPIO_PENDING                      0x52020
11978c2ecf20Sopenharmony_ci#define AR7010_GPIO_INT_MASK                     0x52024
11988c2ecf20Sopenharmony_ci#define AR7010_GPIO_FUNCTION                     0x52028
11998c2ecf20Sopenharmony_ci
12008c2ecf20Sopenharmony_ci#define AR_GPIO_INTR_POL                         (AR_SREV_9340(ah) ? 0x4038 : \
12018c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x4058 : 0x4050))
12028c2ecf20Sopenharmony_ci#define AR_GPIO_INTR_POL_VAL                     0x0001FFFF
12038c2ecf20Sopenharmony_ci#define AR_GPIO_INTR_POL_VAL_S                   0
12048c2ecf20Sopenharmony_ci
12058c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL                     (AR_SREV_9340(ah) ? 0x403c : \
12068c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x405c : 0x4054))
12078c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF     0x00000004
12088c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_S       2
12098c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_FREQUENCY_DEF    0x00000008
12108c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_FREQUENCY_S      3
12118c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_DEF       0x00000010
12128c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_S         4
12138c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_RFSILENT_DEF        0x00000080
12148c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_RFSILENT_DEF_S      7
12158c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB      0x00000400
12168c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB_S    10
12178c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB        0x00001000
12188c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB_S      12
12198c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_RFSILENT_BB         0x00008000
12208c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_RFSILENT_BB_S       15
12218c2ecf20Sopenharmony_ci#define AR_GPIO_RTC_RESET_OVERRIDE_ENABLE        0x00010000
12228c2ecf20Sopenharmony_ci#define AR_GPIO_JTAG_DISABLE                     0x00020000
12238c2ecf20Sopenharmony_ci
12248c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX1                       (AR_SREV_9340(ah) ? 0x4040 : \
12258c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x4060 : 0x4058))
12268c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX1_BT_ACTIVE             0x000f0000
12278c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX1_BT_ACTIVE_S           16
12288c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX1_BT_PRIORITY           0x00000f00
12298c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX1_BT_PRIORITY_S         8
12308c2ecf20Sopenharmony_ci
12318c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX2                       (AR_SREV_9340(ah) ? 0x4044 : \
12328c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x4064 : 0x405c))
12338c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_CLK25                 0x0000000f
12348c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_CLK25_S               0
12358c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_RFSILENT              0x000000f0
12368c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_RFSILENT_S            4
12378c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_RTC_RESET             0x00000f00
12388c2ecf20Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_RTC_RESET_S           8
12398c2ecf20Sopenharmony_ci
12408c2ecf20Sopenharmony_ci#define AR_GPIO_OUTPUT_MUX1                      (AR_SREV_9340(ah) ? 0x4048 : \
12418c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x4068 : 0x4060))
12428c2ecf20Sopenharmony_ci#define AR_GPIO_OUTPUT_MUX2                      (AR_SREV_9340(ah) ? 0x404c : \
12438c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x406c : 0x4064))
12448c2ecf20Sopenharmony_ci#define AR_GPIO_OUTPUT_MUX3                      (AR_SREV_9340(ah) ? 0x4050 : \
12458c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x4070 : 0x4068))
12468c2ecf20Sopenharmony_ci
12478c2ecf20Sopenharmony_ci#define AR_INPUT_STATE                           (AR_SREV_9340(ah) ? 0x4054 : \
12488c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x4074 : 0x406c))
12498c2ecf20Sopenharmony_ci
12508c2ecf20Sopenharmony_ci#define AR_EEPROM_STATUS_DATA                    (AR_SREV_9340(ah) ? 0x40c8 : \
12518c2ecf20Sopenharmony_ci						  (AR_SREV_9300_20_OR_LATER(ah) ? 0x4084 : 0x407c))
12528c2ecf20Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_VAL                0x0000ffff
12538c2ecf20Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_VAL_S              0
12548c2ecf20Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_BUSY               0x00010000
12558c2ecf20Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_BUSY_ACCESS        0x00020000
12568c2ecf20Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_PROT_ACCESS        0x00040000
12578c2ecf20Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_ABSENT_ACCESS      0x00080000
12588c2ecf20Sopenharmony_ci
12598c2ecf20Sopenharmony_ci#define AR_OBS                  (AR_SREV_9340(ah) ? 0x405c : \
12608c2ecf20Sopenharmony_ci				 (AR_SREV_9300_20_OR_LATER(ah) ? 0x4088 : 0x4080))
12618c2ecf20Sopenharmony_ci
12628c2ecf20Sopenharmony_ci#define AR_GPIO_PDPU                             (AR_SREV_9300_20_OR_LATER(ah) ? 0x4090 : 0x4088)
12638c2ecf20Sopenharmony_ci
12648c2ecf20Sopenharmony_ci#define AR_PCIE_MSI                             (AR_SREV_9340(ah) ? 0x40d8 : \
12658c2ecf20Sopenharmony_ci						 (AR_SREV_9300_20_OR_LATER(ah) ? 0x40a4 : 0x4094))
12668c2ecf20Sopenharmony_ci#define AR_PCIE_MSI_ENABLE                       0x00000001
12678c2ecf20Sopenharmony_ci#define AR_PCIE_MSI_HW_DBI_WR_EN                 0x02000000
12688c2ecf20Sopenharmony_ci#define AR_PCIE_MSI_HW_INT_PENDING_ADDR          0xFFA0C1FF /* bits 8..11: value must be 0x5060 */
12698c2ecf20Sopenharmony_ci#define AR_PCIE_MSI_HW_INT_PENDING_ADDR_MSI_64   0xFFA0C9FF /* bits 8..11: value must be 0x5064 */
12708c2ecf20Sopenharmony_ci
12718c2ecf20Sopenharmony_ci#define AR_INTR_PRIO_TX               0x00000001
12728c2ecf20Sopenharmony_ci#define AR_INTR_PRIO_RXLP             0x00000002
12738c2ecf20Sopenharmony_ci#define AR_INTR_PRIO_RXHP             0x00000004
12748c2ecf20Sopenharmony_ci
12758c2ecf20Sopenharmony_ci#define AR_INTR_PRIO_SYNC_ENABLE  (AR_SREV_9340(ah) ? 0x4088 : 0x40c4)
12768c2ecf20Sopenharmony_ci#define AR_INTR_PRIO_ASYNC_MASK   (AR_SREV_9340(ah) ? 0x408c : 0x40c8)
12778c2ecf20Sopenharmony_ci#define AR_INTR_PRIO_SYNC_MASK    (AR_SREV_9340(ah) ? 0x4090 : 0x40cc)
12788c2ecf20Sopenharmony_ci#define AR_INTR_PRIO_ASYNC_ENABLE (AR_SREV_9340(ah) ? 0x4094 : 0x40d4)
12798c2ecf20Sopenharmony_ci#define AR_ENT_OTP		  0x40d8
12808c2ecf20Sopenharmony_ci#define AR_ENT_OTP_CHAIN2_DISABLE               0x00020000
12818c2ecf20Sopenharmony_ci#define AR_ENT_OTP_49GHZ_DISABLE		0x00100000
12828c2ecf20Sopenharmony_ci#define AR_ENT_OTP_MIN_PKT_SIZE_DISABLE		0x00800000
12838c2ecf20Sopenharmony_ci
12848c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL1		 0x16180
12858c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL1_REFDIV	 0xF8000000
12868c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL1_REFDIV_S 27
12878c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL1_NINI	 0x07FC0000
12888c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL1_NINI_S	 18
12898c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL1_NFRAC	 0x0003FFFF
12908c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL1_NFRAC_S	 0
12918c2ecf20Sopenharmony_ci
12928c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2		     0x16184
12938c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2_LOCAL_PLL       0x40000000
12948c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2_LOCAL_PLL_S     30
12958c2ecf20Sopenharmony_ci#define AR_CH0_DPLL2_KI              0x3C000000
12968c2ecf20Sopenharmony_ci#define AR_CH0_DPLL2_KI_S            26
12978c2ecf20Sopenharmony_ci#define AR_CH0_DPLL2_KD              0x03F80000
12988c2ecf20Sopenharmony_ci#define AR_CH0_DPLL2_KD_S            19
12998c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2_EN_NEGTRIG   0x00040000
13008c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2_EN_NEGTRIG_S 18
13018c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2_PLL_PWD	     0x00010000
13028c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2_PLL_PWD_S    16
13038c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2_OUTDIV	     0x0000E000
13048c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL2_OUTDIV_S     13
13058c2ecf20Sopenharmony_ci
13068c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL3          0x16188
13078c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL3_PHASE_SHIFT	0x3F800000
13088c2ecf20Sopenharmony_ci#define AR_CH0_BB_DPLL3_PHASE_SHIFT_S	23
13098c2ecf20Sopenharmony_ci
13108c2ecf20Sopenharmony_ci#define AR_CH0_DDR_DPLL2         0x16244
13118c2ecf20Sopenharmony_ci#define AR_CH0_DDR_DPLL3         0x16248
13128c2ecf20Sopenharmony_ci#define AR_CH0_DPLL3_PHASE_SHIFT     0x3F800000
13138c2ecf20Sopenharmony_ci#define AR_CH0_DPLL3_PHASE_SHIFT_S   23
13148c2ecf20Sopenharmony_ci#define AR_PHY_CCA_NOM_VAL_2GHZ      -118
13158c2ecf20Sopenharmony_ci
13168c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_DIV_INT          0x0000003f
13178c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_DIV_INT_S        0
13188c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_DIV_FRAC         0x000fffc0
13198c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_DIV_FRAC_S       6
13208c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_REFDIV           0x01f00000
13218c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_REFDIV_S         20
13228c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_CLKSEL           0x06000000
13238c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_CLKSEL_S         25
13248c2ecf20Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_BYPASS           0x08000000
13258c2ecf20Sopenharmony_ci
13268c2ecf20Sopenharmony_ci#define AR_RTC_9300_PLL_DIV          0x000003ff
13278c2ecf20Sopenharmony_ci#define AR_RTC_9300_PLL_DIV_S        0
13288c2ecf20Sopenharmony_ci#define AR_RTC_9300_PLL_REFDIV       0x00003C00
13298c2ecf20Sopenharmony_ci#define AR_RTC_9300_PLL_REFDIV_S     10
13308c2ecf20Sopenharmony_ci#define AR_RTC_9300_PLL_CLKSEL       0x0000C000
13318c2ecf20Sopenharmony_ci#define AR_RTC_9300_PLL_CLKSEL_S     14
13328c2ecf20Sopenharmony_ci#define AR_RTC_9300_PLL_BYPASS       0x00010000
13338c2ecf20Sopenharmony_ci
13348c2ecf20Sopenharmony_ci#define AR_RTC_9160_PLL_DIV	0x000003ff
13358c2ecf20Sopenharmony_ci#define AR_RTC_9160_PLL_DIV_S   0
13368c2ecf20Sopenharmony_ci#define AR_RTC_9160_PLL_REFDIV  0x00003C00
13378c2ecf20Sopenharmony_ci#define AR_RTC_9160_PLL_REFDIV_S 10
13388c2ecf20Sopenharmony_ci#define AR_RTC_9160_PLL_CLKSEL	0x0000C000
13398c2ecf20Sopenharmony_ci#define AR_RTC_9160_PLL_CLKSEL_S 14
13408c2ecf20Sopenharmony_ci
13418c2ecf20Sopenharmony_ci#define AR_RTC_BASE             0x00020000
13428c2ecf20Sopenharmony_ci#define AR_RTC_RC \
13438c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0000) : 0x7000)
13448c2ecf20Sopenharmony_ci#define AR_RTC_RC_M		0x00000003
13458c2ecf20Sopenharmony_ci#define AR_RTC_RC_MAC_WARM      0x00000001
13468c2ecf20Sopenharmony_ci#define AR_RTC_RC_MAC_COLD      0x00000002
13478c2ecf20Sopenharmony_ci#define AR_RTC_RC_COLD_RESET    0x00000004
13488c2ecf20Sopenharmony_ci#define AR_RTC_RC_WARM_RESET    0x00000008
13498c2ecf20Sopenharmony_ci
13508c2ecf20Sopenharmony_ci/* Crystal Control */
13518c2ecf20Sopenharmony_ci#define AR_RTC_XTAL_CONTROL     0x7004
13528c2ecf20Sopenharmony_ci
13538c2ecf20Sopenharmony_ci/* Reg Control 0 */
13548c2ecf20Sopenharmony_ci#define AR_RTC_REG_CONTROL0     0x7008
13558c2ecf20Sopenharmony_ci
13568c2ecf20Sopenharmony_ci/* Reg Control 1 */
13578c2ecf20Sopenharmony_ci#define AR_RTC_REG_CONTROL1     0x700c
13588c2ecf20Sopenharmony_ci#define AR_RTC_REG_CONTROL1_SWREG_PROGRAM       0x00000001
13598c2ecf20Sopenharmony_ci
13608c2ecf20Sopenharmony_ci#define AR_RTC_PLL_CONTROL \
13618c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0014) : 0x7014)
13628c2ecf20Sopenharmony_ci
13638c2ecf20Sopenharmony_ci#define AR_RTC_PLL_CONTROL2	0x703c
13648c2ecf20Sopenharmony_ci
13658c2ecf20Sopenharmony_ci#define AR_RTC_PLL_DIV          0x0000001f
13668c2ecf20Sopenharmony_ci#define AR_RTC_PLL_DIV_S        0
13678c2ecf20Sopenharmony_ci#define AR_RTC_PLL_DIV2         0x00000020
13688c2ecf20Sopenharmony_ci#define AR_RTC_PLL_REFDIV_5     0x000000c0
13698c2ecf20Sopenharmony_ci#define AR_RTC_PLL_CLKSEL       0x00000300
13708c2ecf20Sopenharmony_ci#define AR_RTC_PLL_CLKSEL_S     8
13718c2ecf20Sopenharmony_ci#define AR_RTC_PLL_BYPASS	0x00010000
13728c2ecf20Sopenharmony_ci#define AR_RTC_PLL_NOPWD	0x00040000
13738c2ecf20Sopenharmony_ci#define AR_RTC_PLL_NOPWD_S	18
13748c2ecf20Sopenharmony_ci
13758c2ecf20Sopenharmony_ci#define PLL3 0x16188
13768c2ecf20Sopenharmony_ci#define PLL3_DO_MEAS_MASK 0x40000000
13778c2ecf20Sopenharmony_ci#define PLL4 0x1618c
13788c2ecf20Sopenharmony_ci#define PLL4_MEAS_DONE    0x8
13798c2ecf20Sopenharmony_ci#define SQSUM_DVC_MASK 0x007ffff8
13808c2ecf20Sopenharmony_ci
13818c2ecf20Sopenharmony_ci#define AR_RTC_RESET \
13828c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0040) : 0x7040)
13838c2ecf20Sopenharmony_ci#define AR_RTC_RESET_EN		(0x00000001)
13848c2ecf20Sopenharmony_ci
13858c2ecf20Sopenharmony_ci#define AR_RTC_STATUS \
13868c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0044) : 0x7044)
13878c2ecf20Sopenharmony_ci
13888c2ecf20Sopenharmony_ci#define AR_RTC_STATUS_M \
13898c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? 0x0000003f : 0x0000000f)
13908c2ecf20Sopenharmony_ci
13918c2ecf20Sopenharmony_ci#define AR_RTC_PM_STATUS_M      0x0000000f
13928c2ecf20Sopenharmony_ci
13938c2ecf20Sopenharmony_ci#define AR_RTC_STATUS_SHUTDOWN  0x00000001
13948c2ecf20Sopenharmony_ci#define AR_RTC_STATUS_ON        0x00000002
13958c2ecf20Sopenharmony_ci#define AR_RTC_STATUS_SLEEP     0x00000004
13968c2ecf20Sopenharmony_ci#define AR_RTC_STATUS_WAKEUP    0x00000008
13978c2ecf20Sopenharmony_ci
13988c2ecf20Sopenharmony_ci#define AR_RTC_SLEEP_CLK \
13998c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0048) : 0x7048)
14008c2ecf20Sopenharmony_ci#define AR_RTC_FORCE_DERIVED_CLK    0x2
14018c2ecf20Sopenharmony_ci#define AR_RTC_FORCE_SWREG_PRD      0x00000004
14028c2ecf20Sopenharmony_ci
14038c2ecf20Sopenharmony_ci#define AR_RTC_FORCE_WAKE \
14048c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x004c) : 0x704c)
14058c2ecf20Sopenharmony_ci#define AR_RTC_FORCE_WAKE_EN        0x00000001
14068c2ecf20Sopenharmony_ci#define AR_RTC_FORCE_WAKE_ON_INT    0x00000002
14078c2ecf20Sopenharmony_ci
14088c2ecf20Sopenharmony_ci
14098c2ecf20Sopenharmony_ci#define AR_RTC_INTR_CAUSE \
14108c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0050) : 0x7050)
14118c2ecf20Sopenharmony_ci
14128c2ecf20Sopenharmony_ci#define AR_RTC_INTR_ENABLE \
14138c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0054) : 0x7054)
14148c2ecf20Sopenharmony_ci
14158c2ecf20Sopenharmony_ci#define AR_RTC_INTR_MASK \
14168c2ecf20Sopenharmony_ci	((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0058) : 0x7058)
14178c2ecf20Sopenharmony_ci
14188c2ecf20Sopenharmony_ci#define AR_RTC_KEEP_AWAKE	0x7034
14198c2ecf20Sopenharmony_ci
14208c2ecf20Sopenharmony_ci/* RTC_DERIVED_* - only for AR9100 */
14218c2ecf20Sopenharmony_ci
14228c2ecf20Sopenharmony_ci#define AR_RTC_DERIVED_CLK \
14238c2ecf20Sopenharmony_ci	(AR_SREV_9100(ah) ? (AR_RTC_BASE + 0x0038) : 0x7038)
14248c2ecf20Sopenharmony_ci#define AR_RTC_DERIVED_CLK_PERIOD    0x0000fffe
14258c2ecf20Sopenharmony_ci#define AR_RTC_DERIVED_CLK_PERIOD_S  1
14268c2ecf20Sopenharmony_ci
14278c2ecf20Sopenharmony_ci#define	AR_SEQ_MASK	0x8060
14288c2ecf20Sopenharmony_ci
14298c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH0         0x7810
14308c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH0_OB      0x03800000
14318c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH0_OB_S    23
14328c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH0_DB      0x1C000000
14338c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH0_DB_S    26
14348c2ecf20Sopenharmony_ci
14358c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH0         0x7818
14368c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH0_OB5     0x00070000
14378c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH0_OB5_S   16
14388c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH0_DB5     0x00380000
14398c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH0_DB5_S   19
14408c2ecf20Sopenharmony_ci
14418c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH1         0x7834
14428c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH1_OB      0x03800000
14438c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH1_OB_S    23
14448c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH1_DB      0x1C000000
14458c2ecf20Sopenharmony_ci#define AR_AN_RF2G1_CH1_DB_S    26
14468c2ecf20Sopenharmony_ci
14478c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH1         0x783C
14488c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH1_OB5     0x00070000
14498c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH1_OB5_S   16
14508c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH1_DB5     0x00380000
14518c2ecf20Sopenharmony_ci#define AR_AN_RF5G1_CH1_DB5_S   19
14528c2ecf20Sopenharmony_ci
14538c2ecf20Sopenharmony_ci#define AR_AN_TOP1                  0x7890
14548c2ecf20Sopenharmony_ci#define AR_AN_TOP1_DACIPMODE	    0x00040000
14558c2ecf20Sopenharmony_ci#define AR_AN_TOP1_DACIPMODE_S	    18
14568c2ecf20Sopenharmony_ci
14578c2ecf20Sopenharmony_ci#define AR_AN_TOP2                  0x7894
14588c2ecf20Sopenharmony_ci#define AR_AN_TOP2_XPABIAS_LVL      0xC0000000
14598c2ecf20Sopenharmony_ci#define AR_AN_TOP2_XPABIAS_LVL_S    30
14608c2ecf20Sopenharmony_ci#define AR_AN_TOP2_LOCALBIAS        0x00200000
14618c2ecf20Sopenharmony_ci#define AR_AN_TOP2_LOCALBIAS_S      21
14628c2ecf20Sopenharmony_ci#define AR_AN_TOP2_PWDCLKIND        0x00400000
14638c2ecf20Sopenharmony_ci#define AR_AN_TOP2_PWDCLKIND_S      22
14648c2ecf20Sopenharmony_ci
14658c2ecf20Sopenharmony_ci#define AR_AN_SYNTH9            0x7868
14668c2ecf20Sopenharmony_ci#define AR_AN_SYNTH9_REFDIVA    0xf8000000
14678c2ecf20Sopenharmony_ci#define AR_AN_SYNTH9_REFDIVA_S  27
14688c2ecf20Sopenharmony_ci
14698c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1              0x7820
14708c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1_ENPACAL      0x00000800
14718c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1_ENPACAL_S    11
14728c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1_PDPADRV1     0x02000000
14738c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1_PDPADRV1_S   25
14748c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1_PDPADRV2     0x01000000
14758c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1_PDPADRV2_S   24
14768c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1_PDPAOUT      0x00800000
14778c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G1_PDPAOUT_S    23
14788c2ecf20Sopenharmony_ci
14798c2ecf20Sopenharmony_ci
14808c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G2              0x7824
14818c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G2_OFFCAL       0x00001000
14828c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G2_OFFCAL_S     12
14838c2ecf20Sopenharmony_ci
14848c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3             0x7828
14858c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_PDVCCOMP    0x02000000
14868c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_PDVCCOMP_S  25
14878c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_0    0x00E00000
14888c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_0_S    21
14898c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_1    0x001C0000
14908c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_1_S    18
14918c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_2    0x00038000
14928c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_2_S    15
14938c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_3    0x00007000
14948c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_3_S    12
14958c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_4    0x00000E00
14968c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_OB_4_S    9
14978c2ecf20Sopenharmony_ci
14988c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_0    0x000001C0
14998c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_0_S    6
15008c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_1    0x00000038
15018c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_1_S    3
15028c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_2    0x00000007
15038c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_2_S    0
15048c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4         0x782C
15058c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB1_3    0xE0000000
15068c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB1_3_S    29
15078c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB1_4    0x1C000000
15088c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB1_4_S    26
15098c2ecf20Sopenharmony_ci
15108c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_0    0x03800000
15118c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_0_S    23
15128c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_1    0x00700000
15138c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_1_S    20
15148c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_2    0x000E0000
15158c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_2_S    17
15168c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_3    0x0001C000
15178c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_3_S    14
15188c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_4    0x00003800
15198c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_4_S    11
15208c2ecf20Sopenharmony_ci
15218c2ecf20Sopenharmony_ci#define AR9285_RF2G5			0x7830
15228c2ecf20Sopenharmony_ci#define AR9285_RF2G5_IC50TX		0xfffff8ff
15238c2ecf20Sopenharmony_ci#define AR9285_RF2G5_IC50TX_SET		0x00000400
15248c2ecf20Sopenharmony_ci#define AR9285_RF2G5_IC50TX_XE_SET	0x00000500
15258c2ecf20Sopenharmony_ci#define AR9285_RF2G5_IC50TX_CLEAR	0x00000700
15268c2ecf20Sopenharmony_ci#define AR9285_RF2G5_IC50TX_CLEAR_S	8
15278c2ecf20Sopenharmony_ci
15288c2ecf20Sopenharmony_ci/* AR9271 : 0x7828, 0x782c different setting from AR9285 */
15298c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_OB_cck		0x001C0000
15308c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_OB_cck_S	18
15318c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_OB_psk		0x00038000
15328c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_OB_psk_S	15
15338c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_OB_qam		0x00007000
15348c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_OB_qam_S	12
15358c2ecf20Sopenharmony_ci
15368c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_DB_1		0x00E00000
15378c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_DB_1_S		21
15388c2ecf20Sopenharmony_ci
15398c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_CCOMP		0xFFF
15408c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G3_CCOMP_S		0
15418c2ecf20Sopenharmony_ci
15428c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G4_DB_2		0xE0000000
15438c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G4_DB_2_S		29
15448c2ecf20Sopenharmony_ci
15458c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G6                 0x7834
15468c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G6_CCOMP           0x00007800
15478c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G6_CCOMP_S         11
15488c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G6_OFFS            0x03f00000
15498c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G6_OFFS_S          20
15508c2ecf20Sopenharmony_ci
15518c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G6_OFFS            0x07f00000
15528c2ecf20Sopenharmony_ci#define AR9271_AN_RF2G6_OFFS_S            20
15538c2ecf20Sopenharmony_ci
15548c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G7                 0x7838
15558c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G7_PWDDB           0x00000002
15568c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G7_PWDDB_S         1
15578c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G7_PADRVGN2TAB0    0xE0000000
15588c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G7_PADRVGN2TAB0_S  29
15598c2ecf20Sopenharmony_ci
15608c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G8                  0x783C
15618c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G8_PADRVGN2TAB0     0x0001C000
15628c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G8_PADRVGN2TAB0_S   14
15638c2ecf20Sopenharmony_ci
15648c2ecf20Sopenharmony_ci
15658c2ecf20Sopenharmony_ci#define AR9285_AN_RF2G9          0x7840
15668c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1              0x7854
15678c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDRXTXBB1    0x00000020
15688c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDRXTXBB1_S  5
15698c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDV2I        0x00000080
15708c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDV2I_S      7
15718c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDDACIF      0x00000100
15728c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDDACIF_S    8
15738c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1_SPARE9       0x00000001
15748c2ecf20Sopenharmony_ci#define AR9285_AN_RXTXBB1_SPARE9_S     0
15758c2ecf20Sopenharmony_ci
15768c2ecf20Sopenharmony_ci#define AR9285_AN_TOP2           0x7868
15778c2ecf20Sopenharmony_ci
15788c2ecf20Sopenharmony_ci#define AR9285_AN_TOP3                  0x786c
15798c2ecf20Sopenharmony_ci#define AR9285_AN_TOP3_XPABIAS_LVL      0x0000000C
15808c2ecf20Sopenharmony_ci#define AR9285_AN_TOP3_XPABIAS_LVL_S    2
15818c2ecf20Sopenharmony_ci#define AR9285_AN_TOP3_PWDDAC           0x00800000
15828c2ecf20Sopenharmony_ci#define AR9285_AN_TOP3_PWDDAC_S    23
15838c2ecf20Sopenharmony_ci
15848c2ecf20Sopenharmony_ci#define AR9285_AN_TOP4           0x7870
15858c2ecf20Sopenharmony_ci#define AR9285_AN_TOP4_DEFAULT   0x10142c00
15868c2ecf20Sopenharmony_ci
15878c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_CH0             0x7808
15888c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_CH1             0x785c
15898c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_DB1             0xE0000000
15908c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_DB1_S           29
15918c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_DB2             0x1C000000
15928c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_DB2_S           26
15938c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_OB_CCK          0x03800000
15948c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_OB_CCK_S        23
15958c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_OB_PSK          0x00700000
15968c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_OB_PSK_S        20
15978c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_OB_QAM          0x000E0000
15988c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_OB_QAM_S        17
15998c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_OB_PAL_OFF      0x0001C000
16008c2ecf20Sopenharmony_ci#define AR9287_AN_RF2G3_OB_PAL_OFF_S    14
16018c2ecf20Sopenharmony_ci
16028c2ecf20Sopenharmony_ci#define AR9287_AN_TXPC0                 0x7898
16038c2ecf20Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE        0x0000C000
16048c2ecf20Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_S      14
16058c2ecf20Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_NORMAL    0
16068c2ecf20Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_TEST      1
16078c2ecf20Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_TEMPSENSE 2
16088c2ecf20Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_ATBTEST   3
16098c2ecf20Sopenharmony_ci
16108c2ecf20Sopenharmony_ci#define AR9287_AN_TOP2                  0x78b4
16118c2ecf20Sopenharmony_ci#define AR9287_AN_TOP2_XPABIAS_LVL      0xC0000000
16128c2ecf20Sopenharmony_ci#define AR9287_AN_TOP2_XPABIAS_LVL_S    30
16138c2ecf20Sopenharmony_ci
16148c2ecf20Sopenharmony_ci/* AR9271 specific stuff */
16158c2ecf20Sopenharmony_ci#define AR9271_RESET_POWER_DOWN_CONTROL		0x50044
16168c2ecf20Sopenharmony_ci#define AR9271_RADIO_RF_RST			0x20
16178c2ecf20Sopenharmony_ci#define AR9271_GATE_MAC_CTL			0x4000
16188c2ecf20Sopenharmony_ci
16198c2ecf20Sopenharmony_ci#define AR_STA_ID1_STA_AP          0x00010000
16208c2ecf20Sopenharmony_ci#define AR_STA_ID1_ADHOC           0x00020000
16218c2ecf20Sopenharmony_ci#define AR_STA_ID1_PWR_SAV         0x00040000
16228c2ecf20Sopenharmony_ci#define AR_STA_ID1_KSRCHDIS        0x00080000
16238c2ecf20Sopenharmony_ci#define AR_STA_ID1_PCF             0x00100000
16248c2ecf20Sopenharmony_ci#define AR_STA_ID1_USE_DEFANT      0x00200000
16258c2ecf20Sopenharmony_ci#define AR_STA_ID1_DEFANT_UPDATE   0x00400000
16268c2ecf20Sopenharmony_ci#define AR_STA_ID1_AR9100_BA_FIX   0x00400000
16278c2ecf20Sopenharmony_ci#define AR_STA_ID1_RTS_USE_DEF     0x00800000
16288c2ecf20Sopenharmony_ci#define AR_STA_ID1_ACKCTS_6MB      0x01000000
16298c2ecf20Sopenharmony_ci#define AR_STA_ID1_BASE_RATE_11B   0x02000000
16308c2ecf20Sopenharmony_ci#define AR_STA_ID1_SECTOR_SELF_GEN 0x04000000
16318c2ecf20Sopenharmony_ci#define AR_STA_ID1_CRPT_MIC_ENABLE 0x08000000
16328c2ecf20Sopenharmony_ci#define AR_STA_ID1_KSRCH_MODE      0x10000000
16338c2ecf20Sopenharmony_ci#define AR_STA_ID1_PRESERVE_SEQNUM 0x20000000
16348c2ecf20Sopenharmony_ci#define AR_STA_ID1_CBCIV_ENDIAN    0x40000000
16358c2ecf20Sopenharmony_ci#define AR_STA_ID1_MCAST_KSRCH     0x80000000
16368c2ecf20Sopenharmony_ci
16378c2ecf20Sopenharmony_ci#define AR_BSS_ID0          0x8008
16388c2ecf20Sopenharmony_ci#define AR_BSS_ID1          0x800C
16398c2ecf20Sopenharmony_ci#define AR_BSS_ID1_U16       0x0000FFFF
16408c2ecf20Sopenharmony_ci#define AR_BSS_ID1_AID       0x07FF0000
16418c2ecf20Sopenharmony_ci#define AR_BSS_ID1_AID_S     16
16428c2ecf20Sopenharmony_ci
16438c2ecf20Sopenharmony_ci#define AR_BCN_RSSI_AVE      0x8010
16448c2ecf20Sopenharmony_ci#define AR_BCN_RSSI_AVE_MASK 0x00000FFF
16458c2ecf20Sopenharmony_ci
16468c2ecf20Sopenharmony_ci#define AR_TIME_OUT         0x8014
16478c2ecf20Sopenharmony_ci#define AR_TIME_OUT_ACK      0x00003FFF
16488c2ecf20Sopenharmony_ci#define AR_TIME_OUT_ACK_S    0
16498c2ecf20Sopenharmony_ci#define AR_TIME_OUT_CTS      0x3FFF0000
16508c2ecf20Sopenharmony_ci#define AR_TIME_OUT_CTS_S    16
16518c2ecf20Sopenharmony_ci
16528c2ecf20Sopenharmony_ci#define AR_RSSI_THR          0x8018
16538c2ecf20Sopenharmony_ci#define AR_RSSI_THR_MASK     0x000000FF
16548c2ecf20Sopenharmony_ci#define AR_RSSI_THR_BM_THR   0x0000FF00
16558c2ecf20Sopenharmony_ci#define AR_RSSI_THR_BM_THR_S 8
16568c2ecf20Sopenharmony_ci#define AR_RSSI_BCN_WEIGHT   0x1F000000
16578c2ecf20Sopenharmony_ci#define AR_RSSI_BCN_WEIGHT_S 24
16588c2ecf20Sopenharmony_ci#define AR_RSSI_BCN_RSSI_RST 0x20000000
16598c2ecf20Sopenharmony_ci
16608c2ecf20Sopenharmony_ci#define AR_USEC              0x801c
16618c2ecf20Sopenharmony_ci#define AR_USEC_USEC         0x0000007F
16628c2ecf20Sopenharmony_ci#define AR_USEC_TX_LAT       0x007FC000
16638c2ecf20Sopenharmony_ci#define AR_USEC_TX_LAT_S     14
16648c2ecf20Sopenharmony_ci#define AR_USEC_RX_LAT       0x1F800000
16658c2ecf20Sopenharmony_ci#define AR_USEC_RX_LAT_S     23
16668c2ecf20Sopenharmony_ci#define AR_USEC_ASYNC_FIFO   0x12E00074
16678c2ecf20Sopenharmony_ci
16688c2ecf20Sopenharmony_ci#define AR_RESET_TSF        0x8020
16698c2ecf20Sopenharmony_ci#define AR_RESET_TSF_ONCE   0x01000000
16708c2ecf20Sopenharmony_ci#define AR_RESET_TSF2_ONCE  0x02000000
16718c2ecf20Sopenharmony_ci
16728c2ecf20Sopenharmony_ci#define AR_MAX_CFP_DUR      0x8038
16738c2ecf20Sopenharmony_ci#define AR_CFP_VAL          0x0000FFFF
16748c2ecf20Sopenharmony_ci
16758c2ecf20Sopenharmony_ci#define AR_RX_FILTER        0x803C
16768c2ecf20Sopenharmony_ci
16778c2ecf20Sopenharmony_ci#define AR_MCAST_FIL0       0x8040
16788c2ecf20Sopenharmony_ci#define AR_MCAST_FIL1       0x8044
16798c2ecf20Sopenharmony_ci
16808c2ecf20Sopenharmony_ci/*
16818c2ecf20Sopenharmony_ci * AR_DIAG_SW - Register which can be used for diagnostics and testing purposes.
16828c2ecf20Sopenharmony_ci *
16838c2ecf20Sopenharmony_ci * The force RX abort (AR_DIAG_RX_ABORT, bit 25) can be used in conjunction with
16848c2ecf20Sopenharmony_ci * RX block (AR_DIAG_RX_DIS, bit 5) to help fast channel change to shut down
16858c2ecf20Sopenharmony_ci * receive. The force RX abort bit will kill any frame which is currently being
16868c2ecf20Sopenharmony_ci * transferred between the MAC and baseband. The RX block bit (AR_DIAG_RX_DIS)
16878c2ecf20Sopenharmony_ci * will prevent any new frames from getting started.
16888c2ecf20Sopenharmony_ci */
16898c2ecf20Sopenharmony_ci#define AR_DIAG_SW                  0x8048
16908c2ecf20Sopenharmony_ci#define AR_DIAG_CACHE_ACK           0x00000001
16918c2ecf20Sopenharmony_ci#define AR_DIAG_ACK_DIS             0x00000002
16928c2ecf20Sopenharmony_ci#define AR_DIAG_CTS_DIS             0x00000004
16938c2ecf20Sopenharmony_ci#define AR_DIAG_ENCRYPT_DIS         0x00000008
16948c2ecf20Sopenharmony_ci#define AR_DIAG_DECRYPT_DIS         0x00000010
16958c2ecf20Sopenharmony_ci#define AR_DIAG_RX_DIS              0x00000020 /* RX block */
16968c2ecf20Sopenharmony_ci#define AR_DIAG_LOOP_BACK           0x00000040
16978c2ecf20Sopenharmony_ci#define AR_DIAG_CORR_FCS            0x00000080
16988c2ecf20Sopenharmony_ci#define AR_DIAG_CHAN_INFO           0x00000100
16998c2ecf20Sopenharmony_ci#define AR_DIAG_SCRAM_SEED          0x0001FE00
17008c2ecf20Sopenharmony_ci#define AR_DIAG_SCRAM_SEED_S        8
17018c2ecf20Sopenharmony_ci#define AR_DIAG_FRAME_NV0           0x00020000
17028c2ecf20Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL1         0x000C0000
17038c2ecf20Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL1_S       18
17048c2ecf20Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL2         0x08000000
17058c2ecf20Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL2_S       27
17068c2ecf20Sopenharmony_ci#define AR_DIAG_FORCE_RX_CLEAR      0x00100000 /* force rx_clear high */
17078c2ecf20Sopenharmony_ci#define AR_DIAG_IGNORE_VIRT_CS      0x00200000
17088c2ecf20Sopenharmony_ci#define AR_DIAG_FORCE_CH_IDLE_HIGH  0x00400000
17098c2ecf20Sopenharmony_ci#define AR_DIAG_EIFS_CTRL_ENA       0x00800000
17108c2ecf20Sopenharmony_ci#define AR_DIAG_DUAL_CHAIN_INFO     0x01000000
17118c2ecf20Sopenharmony_ci#define AR_DIAG_RX_ABORT            0x02000000 /* Force RX abort */
17128c2ecf20Sopenharmony_ci#define AR_DIAG_SATURATE_CYCLE_CNT  0x04000000
17138c2ecf20Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL2         0x08000000
17148c2ecf20Sopenharmony_ci#define AR_DIAG_RX_CLEAR_CTL_LOW    0x10000000
17158c2ecf20Sopenharmony_ci#define AR_DIAG_RX_CLEAR_EXT_LOW    0x20000000
17168c2ecf20Sopenharmony_ci
17178c2ecf20Sopenharmony_ci#define AR_TSF_L32          0x804c
17188c2ecf20Sopenharmony_ci#define AR_TSF_U32          0x8050
17198c2ecf20Sopenharmony_ci
17208c2ecf20Sopenharmony_ci#define AR_TST_ADDAC        0x8054
17218c2ecf20Sopenharmony_ci#define AR_DEF_ANTENNA      0x8058
17228c2ecf20Sopenharmony_ci
17238c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK0       0x805c
17248c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK0_FC    0x0000FFFF
17258c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK0_QOS   0xFFFF0000
17268c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK0_QOS_S 16
17278c2ecf20Sopenharmony_ci
17288c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1       0x8060
17298c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1_SEQ   0x0000FFFF
17308c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1_FC_MGMT 0xFFFF0000
17318c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1_FC_MGMT_S 16
17328c2ecf20Sopenharmony_ci
17338c2ecf20Sopenharmony_ci#define AR_GATED_CLKS       0x8064
17348c2ecf20Sopenharmony_ci#define AR_GATED_CLKS_TX    0x00000002
17358c2ecf20Sopenharmony_ci#define AR_GATED_CLKS_RX    0x00000004
17368c2ecf20Sopenharmony_ci#define AR_GATED_CLKS_REG   0x00000008
17378c2ecf20Sopenharmony_ci
17388c2ecf20Sopenharmony_ci#define AR_OBS_BUS_CTRL     0x8068
17398c2ecf20Sopenharmony_ci#define AR_OBS_BUS_SEL_1    0x00040000
17408c2ecf20Sopenharmony_ci#define AR_OBS_BUS_SEL_2    0x00080000
17418c2ecf20Sopenharmony_ci#define AR_OBS_BUS_SEL_3    0x000C0000
17428c2ecf20Sopenharmony_ci#define AR_OBS_BUS_SEL_4    0x08040000
17438c2ecf20Sopenharmony_ci#define AR_OBS_BUS_SEL_5    0x08080000
17448c2ecf20Sopenharmony_ci
17458c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1               0x806c
17468c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_PCU           0x00000001
17478c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_RX_END        0x00000002
17488c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_RX_WEP        0x00000004
17498c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_RX_BEACON     0x00000008
17508c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_RX_FILTER     0x00000010
17518c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_TX_HCF        0x00000020
17528c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_QUIET_TIME    0x00000040
17538c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_CHAN_IDLE     0x00000080
17548c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_TX_HOLD       0x00000100
17558c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_TX_FRAME      0x00000200
17568c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_RX_FRAME      0x00000400
17578c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_RX_CLEAR      0x00000800
17588c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_WEP_STATE     0x0003F000
17598c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_WEP_STATE_S   12
17608c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_RX_STATE      0x01F00000
17618c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_RX_STATE_S    20
17628c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_TX_STATE      0x7E000000
17638c2ecf20Sopenharmony_ci#define AR_OBS_BUS_1_TX_STATE_S    25
17648c2ecf20Sopenharmony_ci
17658c2ecf20Sopenharmony_ci#define AR_LAST_TSTP        0x8080
17668c2ecf20Sopenharmony_ci#define AR_NAV              0x8084
17678c2ecf20Sopenharmony_ci#define AR_RTS_OK           0x8088
17688c2ecf20Sopenharmony_ci#define AR_RTS_FAIL         0x808c
17698c2ecf20Sopenharmony_ci#define AR_ACK_FAIL         0x8090
17708c2ecf20Sopenharmony_ci#define AR_FCS_FAIL         0x8094
17718c2ecf20Sopenharmony_ci#define AR_BEACON_CNT       0x8098
17728c2ecf20Sopenharmony_ci
17738c2ecf20Sopenharmony_ci#define AR_SLEEP1               0x80d4
17748c2ecf20Sopenharmony_ci#define AR_SLEEP1_ASSUME_DTIM   0x00080000
17758c2ecf20Sopenharmony_ci#define AR_SLEEP1_CAB_TIMEOUT   0xFFE00000
17768c2ecf20Sopenharmony_ci#define AR_SLEEP1_CAB_TIMEOUT_S 21
17778c2ecf20Sopenharmony_ci
17788c2ecf20Sopenharmony_ci#define AR_SLEEP2                   0x80d8
17798c2ecf20Sopenharmony_ci#define AR_SLEEP2_BEACON_TIMEOUT    0xFFE00000
17808c2ecf20Sopenharmony_ci#define AR_SLEEP2_BEACON_TIMEOUT_S  21
17818c2ecf20Sopenharmony_ci
17828c2ecf20Sopenharmony_ci#define AR_TPC                 0x80e8
17838c2ecf20Sopenharmony_ci#define AR_TPC_ACK             0x0000003f
17848c2ecf20Sopenharmony_ci#define AR_TPC_ACK_S           0
17858c2ecf20Sopenharmony_ci#define AR_TPC_CTS             0x00003f00
17868c2ecf20Sopenharmony_ci#define AR_TPC_CTS_S           8
17878c2ecf20Sopenharmony_ci#define AR_TPC_CHIRP           0x003f0000
17888c2ecf20Sopenharmony_ci#define AR_TPC_CHIRP_S         16
17898c2ecf20Sopenharmony_ci#define AR_TPC_RPT	       0x3f000000
17908c2ecf20Sopenharmony_ci#define AR_TPC_RPT_S	       24
17918c2ecf20Sopenharmony_ci
17928c2ecf20Sopenharmony_ci#define AR_QUIET1          0x80fc
17938c2ecf20Sopenharmony_ci#define AR_QUIET1_NEXT_QUIET_S         0
17948c2ecf20Sopenharmony_ci#define AR_QUIET1_NEXT_QUIET_M         0x0000ffff
17958c2ecf20Sopenharmony_ci#define AR_QUIET1_QUIET_ENABLE         0x00010000
17968c2ecf20Sopenharmony_ci#define AR_QUIET1_QUIET_ACK_CTS_ENABLE 0x00020000
17978c2ecf20Sopenharmony_ci#define AR_QUIET1_QUIET_ACK_CTS_ENABLE_S 17
17988c2ecf20Sopenharmony_ci#define AR_QUIET2          0x8100
17998c2ecf20Sopenharmony_ci#define AR_QUIET2_QUIET_PERIOD_S       0
18008c2ecf20Sopenharmony_ci#define AR_QUIET2_QUIET_PERIOD_M       0x0000ffff
18018c2ecf20Sopenharmony_ci#define AR_QUIET2_QUIET_DUR_S     16
18028c2ecf20Sopenharmony_ci#define AR_QUIET2_QUIET_DUR       0xffff0000
18038c2ecf20Sopenharmony_ci
18048c2ecf20Sopenharmony_ci#define AR_TSF_PARM        0x8104
18058c2ecf20Sopenharmony_ci#define AR_TSF_INCREMENT_M     0x000000ff
18068c2ecf20Sopenharmony_ci#define AR_TSF_INCREMENT_S     0x00
18078c2ecf20Sopenharmony_ci
18088c2ecf20Sopenharmony_ci#define AR_QOS_NO_ACK              0x8108
18098c2ecf20Sopenharmony_ci#define AR_QOS_NO_ACK_TWO_BIT      0x0000000f
18108c2ecf20Sopenharmony_ci#define AR_QOS_NO_ACK_TWO_BIT_S    0
18118c2ecf20Sopenharmony_ci#define AR_QOS_NO_ACK_BIT_OFF      0x00000070
18128c2ecf20Sopenharmony_ci#define AR_QOS_NO_ACK_BIT_OFF_S    4
18138c2ecf20Sopenharmony_ci#define AR_QOS_NO_ACK_BYTE_OFF     0x00000180
18148c2ecf20Sopenharmony_ci#define AR_QOS_NO_ACK_BYTE_OFF_S   7
18158c2ecf20Sopenharmony_ci
18168c2ecf20Sopenharmony_ci#define AR_PHY_ERR         0x810c
18178c2ecf20Sopenharmony_ci
18188c2ecf20Sopenharmony_ci#define AR_PHY_ERR_DCHIRP      0x00000008
18198c2ecf20Sopenharmony_ci#define AR_PHY_ERR_RADAR       0x00000020
18208c2ecf20Sopenharmony_ci#define AR_PHY_ERR_OFDM_TIMING 0x00020000
18218c2ecf20Sopenharmony_ci#define AR_PHY_ERR_CCK_TIMING  0x02000000
18228c2ecf20Sopenharmony_ci
18238c2ecf20Sopenharmony_ci#define AR_RXFIFO_CFG          0x8114
18248c2ecf20Sopenharmony_ci
18258c2ecf20Sopenharmony_ci
18268c2ecf20Sopenharmony_ci#define AR_MIC_QOS_CONTROL 0x8118
18278c2ecf20Sopenharmony_ci#define AR_MIC_QOS_SELECT  0x811c
18288c2ecf20Sopenharmony_ci
18298c2ecf20Sopenharmony_ci#define AR_PCU_MISC                0x8120
18308c2ecf20Sopenharmony_ci#define AR_PCU_FORCE_BSSID_MATCH   0x00000001
18318c2ecf20Sopenharmony_ci#define AR_PCU_MIC_NEW_LOC_ENA     0x00000004
18328c2ecf20Sopenharmony_ci#define AR_PCU_TX_ADD_TSF          0x00000008
18338c2ecf20Sopenharmony_ci#define AR_PCU_CCK_SIFS_MODE       0x00000010
18348c2ecf20Sopenharmony_ci#define AR_PCU_RX_ANT_UPDT         0x00000800
18358c2ecf20Sopenharmony_ci#define AR_PCU_TXOP_TBTT_LIMIT_ENA 0x00001000
18368c2ecf20Sopenharmony_ci#define AR_PCU_MISS_BCN_IN_SLEEP   0x00004000
18378c2ecf20Sopenharmony_ci#define AR_PCU_BUG_12306_FIX_ENA   0x00020000
18388c2ecf20Sopenharmony_ci#define AR_PCU_FORCE_QUIET_COLL    0x00040000
18398c2ecf20Sopenharmony_ci#define AR_PCU_TBTT_PROTECT        0x00200000
18408c2ecf20Sopenharmony_ci#define AR_PCU_CLEAR_VMF           0x01000000
18418c2ecf20Sopenharmony_ci#define AR_PCU_CLEAR_BA_VALID      0x04000000
18428c2ecf20Sopenharmony_ci#define AR_PCU_ALWAYS_PERFORM_KEYSEARCH 0x10000000
18438c2ecf20Sopenharmony_ci
18448c2ecf20Sopenharmony_ci#define AR_PCU_BT_ANT_PREVENT_RX   0x00100000
18458c2ecf20Sopenharmony_ci#define AR_PCU_BT_ANT_PREVENT_RX_S 20
18468c2ecf20Sopenharmony_ci
18478c2ecf20Sopenharmony_ci#define AR_FILT_OFDM           0x8124
18488c2ecf20Sopenharmony_ci#define AR_FILT_OFDM_COUNT     0x00FFFFFF
18498c2ecf20Sopenharmony_ci
18508c2ecf20Sopenharmony_ci#define AR_FILT_CCK            0x8128
18518c2ecf20Sopenharmony_ci#define AR_FILT_CCK_COUNT      0x00FFFFFF
18528c2ecf20Sopenharmony_ci
18538c2ecf20Sopenharmony_ci#define AR_PHY_ERR_1           0x812c
18548c2ecf20Sopenharmony_ci#define AR_PHY_ERR_1_COUNT     0x00FFFFFF
18558c2ecf20Sopenharmony_ci#define AR_PHY_ERR_MASK_1      0x8130
18568c2ecf20Sopenharmony_ci
18578c2ecf20Sopenharmony_ci#define AR_PHY_ERR_2           0x8134
18588c2ecf20Sopenharmony_ci#define AR_PHY_ERR_2_COUNT     0x00FFFFFF
18598c2ecf20Sopenharmony_ci#define AR_PHY_ERR_MASK_2      0x8138
18608c2ecf20Sopenharmony_ci
18618c2ecf20Sopenharmony_ci#define AR_PHY_COUNTMAX        (3 << 22)
18628c2ecf20Sopenharmony_ci#define AR_MIBCNT_INTRMASK     (3 << 22)
18638c2ecf20Sopenharmony_ci
18648c2ecf20Sopenharmony_ci#define AR_TSFOOR_THRESHOLD       0x813c
18658c2ecf20Sopenharmony_ci#define AR_TSFOOR_THRESHOLD_VAL   0x0000FFFF
18668c2ecf20Sopenharmony_ci
18678c2ecf20Sopenharmony_ci#define AR_PHY_ERR_EIFS_MASK   0x8144
18688c2ecf20Sopenharmony_ci
18698c2ecf20Sopenharmony_ci#define AR_PHY_ERR_3           0x8168
18708c2ecf20Sopenharmony_ci#define AR_PHY_ERR_3_COUNT     0x00FFFFFF
18718c2ecf20Sopenharmony_ci#define AR_PHY_ERR_MASK_3      0x816c
18728c2ecf20Sopenharmony_ci
18738c2ecf20Sopenharmony_ci#define AR_BT_COEX_MODE            0x8170
18748c2ecf20Sopenharmony_ci#define AR_BT_TIME_EXTEND          0x000000ff
18758c2ecf20Sopenharmony_ci#define AR_BT_TIME_EXTEND_S        0
18768c2ecf20Sopenharmony_ci#define AR_BT_TXSTATE_EXTEND       0x00000100
18778c2ecf20Sopenharmony_ci#define AR_BT_TXSTATE_EXTEND_S     8
18788c2ecf20Sopenharmony_ci#define AR_BT_TX_FRAME_EXTEND      0x00000200
18798c2ecf20Sopenharmony_ci#define AR_BT_TX_FRAME_EXTEND_S    9
18808c2ecf20Sopenharmony_ci#define AR_BT_MODE                 0x00000c00
18818c2ecf20Sopenharmony_ci#define AR_BT_MODE_S               10
18828c2ecf20Sopenharmony_ci#define AR_BT_QUIET                0x00001000
18838c2ecf20Sopenharmony_ci#define AR_BT_QUIET_S              12
18848c2ecf20Sopenharmony_ci#define AR_BT_QCU_THRESH           0x0001e000
18858c2ecf20Sopenharmony_ci#define AR_BT_QCU_THRESH_S         13
18868c2ecf20Sopenharmony_ci#define AR_BT_RX_CLEAR_POLARITY    0x00020000
18878c2ecf20Sopenharmony_ci#define AR_BT_RX_CLEAR_POLARITY_S  17
18888c2ecf20Sopenharmony_ci#define AR_BT_PRIORITY_TIME        0x00fc0000
18898c2ecf20Sopenharmony_ci#define AR_BT_PRIORITY_TIME_S      18
18908c2ecf20Sopenharmony_ci#define AR_BT_FIRST_SLOT_TIME      0xff000000
18918c2ecf20Sopenharmony_ci#define AR_BT_FIRST_SLOT_TIME_S    24
18928c2ecf20Sopenharmony_ci
18938c2ecf20Sopenharmony_ci#define AR_BT_COEX_WEIGHT          0x8174
18948c2ecf20Sopenharmony_ci#define AR_BT_COEX_WGHT		   0xff55
18958c2ecf20Sopenharmony_ci#define AR_STOMP_ALL_WLAN_WGHT	   0xfcfc
18968c2ecf20Sopenharmony_ci#define AR_STOMP_LOW_WLAN_WGHT	   0xa8a8
18978c2ecf20Sopenharmony_ci#define AR_STOMP_NONE_WLAN_WGHT	   0x0000
18988c2ecf20Sopenharmony_ci#define AR_BTCOEX_BT_WGHT          0x0000ffff
18998c2ecf20Sopenharmony_ci#define AR_BTCOEX_BT_WGHT_S        0
19008c2ecf20Sopenharmony_ci#define AR_BTCOEX_WL_WGHT          0xffff0000
19018c2ecf20Sopenharmony_ci#define AR_BTCOEX_WL_WGHT_S        16
19028c2ecf20Sopenharmony_ci
19038c2ecf20Sopenharmony_ci#define AR_BT_COEX_WL_WEIGHTS0     0x8174
19048c2ecf20Sopenharmony_ci#define AR_BT_COEX_WL_WEIGHTS1     0x81c4
19058c2ecf20Sopenharmony_ci#define AR_MCI_COEX_WL_WEIGHTS(_i) (0x18b0 + (_i << 2))
19068c2ecf20Sopenharmony_ci#define AR_BT_COEX_BT_WEIGHTS(_i)  (0x83ac + (_i << 2))
19078c2ecf20Sopenharmony_ci
19088c2ecf20Sopenharmony_ci#define AR9300_BT_WGHT             0xcccc4444
19098c2ecf20Sopenharmony_ci
19108c2ecf20Sopenharmony_ci#define AR_BT_COEX_MODE2		0x817c
19118c2ecf20Sopenharmony_ci#define AR_BT_BCN_MISS_THRESH		0x000000ff
19128c2ecf20Sopenharmony_ci#define AR_BT_BCN_MISS_THRESH_S		0
19138c2ecf20Sopenharmony_ci#define AR_BT_BCN_MISS_CNT		0x0000ff00
19148c2ecf20Sopenharmony_ci#define AR_BT_BCN_MISS_CNT_S		8
19158c2ecf20Sopenharmony_ci#define AR_BT_HOLD_RX_CLEAR		0x00010000
19168c2ecf20Sopenharmony_ci#define AR_BT_HOLD_RX_CLEAR_S		16
19178c2ecf20Sopenharmony_ci#define AR_BT_PROTECT_BT_AFTER_WAKEUP	0x00080000
19188c2ecf20Sopenharmony_ci#define AR_BT_PROTECT_BT_AFTER_WAKEUP_S 19
19198c2ecf20Sopenharmony_ci#define AR_BT_DISABLE_BT_ANT		0x00100000
19208c2ecf20Sopenharmony_ci#define AR_BT_DISABLE_BT_ANT_S		20
19218c2ecf20Sopenharmony_ci#define AR_BT_QUIET_2_WIRE		0x00200000
19228c2ecf20Sopenharmony_ci#define AR_BT_QUIET_2_WIRE_S		21
19238c2ecf20Sopenharmony_ci#define AR_BT_WL_ACTIVE_MODE		0x00c00000
19248c2ecf20Sopenharmony_ci#define AR_BT_WL_ACTIVE_MODE_S		22
19258c2ecf20Sopenharmony_ci#define AR_BT_WL_TXRX_SEPARATE		0x01000000
19268c2ecf20Sopenharmony_ci#define AR_BT_WL_TXRX_SEPARATE_S	24
19278c2ecf20Sopenharmony_ci#define AR_BT_RS_DISCARD_EXTEND		0x02000000
19288c2ecf20Sopenharmony_ci#define AR_BT_RS_DISCARD_EXTEND_S	25
19298c2ecf20Sopenharmony_ci#define AR_BT_TSF_BT_ACTIVE_CTRL	0x0c000000
19308c2ecf20Sopenharmony_ci#define AR_BT_TSF_BT_ACTIVE_CTRL_S	26
19318c2ecf20Sopenharmony_ci#define AR_BT_TSF_BT_PRIORITY_CTRL	0x30000000
19328c2ecf20Sopenharmony_ci#define AR_BT_TSF_BT_PRIORITY_CTRL_S	28
19338c2ecf20Sopenharmony_ci#define AR_BT_INTERRUPT_ENABLE		0x40000000
19348c2ecf20Sopenharmony_ci#define AR_BT_INTERRUPT_ENABLE_S	30
19358c2ecf20Sopenharmony_ci#define AR_BT_PHY_ERR_BT_COLL_ENABLE	0x80000000
19368c2ecf20Sopenharmony_ci#define AR_BT_PHY_ERR_BT_COLL_ENABLE_S	31
19378c2ecf20Sopenharmony_ci
19388c2ecf20Sopenharmony_ci#define AR_TXSIFS              0x81d0
19398c2ecf20Sopenharmony_ci#define AR_TXSIFS_TIME         0x000000FF
19408c2ecf20Sopenharmony_ci#define AR_TXSIFS_TX_LATENCY   0x00000F00
19418c2ecf20Sopenharmony_ci#define AR_TXSIFS_TX_LATENCY_S 8
19428c2ecf20Sopenharmony_ci#define AR_TXSIFS_ACK_SHIFT    0x00007000
19438c2ecf20Sopenharmony_ci#define AR_TXSIFS_ACK_SHIFT_S  12
19448c2ecf20Sopenharmony_ci
19458c2ecf20Sopenharmony_ci#define AR_BT_COEX_MODE3			0x81d4
19468c2ecf20Sopenharmony_ci#define AR_BT_WL_ACTIVE_TIME			0x000000ff
19478c2ecf20Sopenharmony_ci#define AR_BT_WL_ACTIVE_TIME_S			0
19488c2ecf20Sopenharmony_ci#define AR_BT_WL_QC_TIME			0x0000ff00
19498c2ecf20Sopenharmony_ci#define AR_BT_WL_QC_TIME_S			8
19508c2ecf20Sopenharmony_ci#define AR_BT_ALLOW_CONCURRENT_ACCESS		0x000f0000
19518c2ecf20Sopenharmony_ci#define AR_BT_ALLOW_CONCURRENT_ACCESS_S		16
19528c2ecf20Sopenharmony_ci#define AR_BT_AGC_SATURATION_CNT_ENABLE		0x00100000
19538c2ecf20Sopenharmony_ci#define AR_BT_AGC_SATURATION_CNT_ENABLE_S	20
19548c2ecf20Sopenharmony_ci
19558c2ecf20Sopenharmony_ci#define AR_TXOP_X          0x81ec
19568c2ecf20Sopenharmony_ci#define AR_TXOP_X_VAL      0x000000FF
19578c2ecf20Sopenharmony_ci
19588c2ecf20Sopenharmony_ci
19598c2ecf20Sopenharmony_ci#define AR_TXOP_0_3    0x81f0
19608c2ecf20Sopenharmony_ci#define AR_TXOP_4_7    0x81f4
19618c2ecf20Sopenharmony_ci#define AR_TXOP_8_11   0x81f8
19628c2ecf20Sopenharmony_ci#define AR_TXOP_12_15  0x81fc
19638c2ecf20Sopenharmony_ci
19648c2ecf20Sopenharmony_ci#define AR_NEXT_NDP2_TIMER                  0x8180
19658c2ecf20Sopenharmony_ci#define AR_GEN_TIMER_BANK_1_LEN			8
19668c2ecf20Sopenharmony_ci#define AR_FIRST_NDP_TIMER                  7
19678c2ecf20Sopenharmony_ci#define AR_NDP2_PERIOD                      0x81a0
19688c2ecf20Sopenharmony_ci#define AR_NDP2_TIMER_MODE                  0x81c0
19698c2ecf20Sopenharmony_ci#define AR_GEN_TIMERS2_MODE_ENABLE_MASK     0x000000FF
19708c2ecf20Sopenharmony_ci
19718c2ecf20Sopenharmony_ci#define AR_GEN_TIMERS(_i)                   (0x8200 + ((_i) << 2))
19728c2ecf20Sopenharmony_ci#define AR_NEXT_TBTT_TIMER                  AR_GEN_TIMERS(0)
19738c2ecf20Sopenharmony_ci#define AR_NEXT_DMA_BEACON_ALERT            AR_GEN_TIMERS(1)
19748c2ecf20Sopenharmony_ci#define AR_NEXT_SWBA                        AR_GEN_TIMERS(2)
19758c2ecf20Sopenharmony_ci#define AR_NEXT_CFP                         AR_GEN_TIMERS(2)
19768c2ecf20Sopenharmony_ci#define AR_NEXT_HCF                         AR_GEN_TIMERS(3)
19778c2ecf20Sopenharmony_ci#define AR_NEXT_TIM                         AR_GEN_TIMERS(4)
19788c2ecf20Sopenharmony_ci#define AR_NEXT_DTIM                        AR_GEN_TIMERS(5)
19798c2ecf20Sopenharmony_ci#define AR_NEXT_QUIET_TIMER                 AR_GEN_TIMERS(6)
19808c2ecf20Sopenharmony_ci#define AR_NEXT_NDP_TIMER                   AR_GEN_TIMERS(7)
19818c2ecf20Sopenharmony_ci
19828c2ecf20Sopenharmony_ci#define AR_BEACON_PERIOD                    AR_GEN_TIMERS(8)
19838c2ecf20Sopenharmony_ci#define AR_DMA_BEACON_PERIOD                AR_GEN_TIMERS(9)
19848c2ecf20Sopenharmony_ci#define AR_SWBA_PERIOD                      AR_GEN_TIMERS(10)
19858c2ecf20Sopenharmony_ci#define AR_HCF_PERIOD                       AR_GEN_TIMERS(11)
19868c2ecf20Sopenharmony_ci#define AR_TIM_PERIOD                       AR_GEN_TIMERS(12)
19878c2ecf20Sopenharmony_ci#define AR_DTIM_PERIOD                      AR_GEN_TIMERS(13)
19888c2ecf20Sopenharmony_ci#define AR_QUIET_PERIOD                     AR_GEN_TIMERS(14)
19898c2ecf20Sopenharmony_ci#define AR_NDP_PERIOD                       AR_GEN_TIMERS(15)
19908c2ecf20Sopenharmony_ci
19918c2ecf20Sopenharmony_ci#define AR_TIMER_MODE                       0x8240
19928c2ecf20Sopenharmony_ci#define AR_TBTT_TIMER_EN                    0x00000001
19938c2ecf20Sopenharmony_ci#define AR_DBA_TIMER_EN                     0x00000002
19948c2ecf20Sopenharmony_ci#define AR_SWBA_TIMER_EN                    0x00000004
19958c2ecf20Sopenharmony_ci#define AR_HCF_TIMER_EN                     0x00000008
19968c2ecf20Sopenharmony_ci#define AR_TIM_TIMER_EN                     0x00000010
19978c2ecf20Sopenharmony_ci#define AR_DTIM_TIMER_EN                    0x00000020
19988c2ecf20Sopenharmony_ci#define AR_QUIET_TIMER_EN                   0x00000040
19998c2ecf20Sopenharmony_ci#define AR_NDP_TIMER_EN                     0x00000080
20008c2ecf20Sopenharmony_ci#define AR_TIMER_OVERFLOW_INDEX             0x00000700
20018c2ecf20Sopenharmony_ci#define AR_TIMER_OVERFLOW_INDEX_S           8
20028c2ecf20Sopenharmony_ci#define AR_TIMER_THRESH                     0xFFFFF000
20038c2ecf20Sopenharmony_ci#define AR_TIMER_THRESH_S                   12
20048c2ecf20Sopenharmony_ci
20058c2ecf20Sopenharmony_ci#define AR_SLP32_MODE                  0x8244
20068c2ecf20Sopenharmony_ci#define AR_SLP32_HALF_CLK_LATENCY      0x000FFFFF
20078c2ecf20Sopenharmony_ci#define AR_SLP32_ENA                   0x00100000
20088c2ecf20Sopenharmony_ci#define AR_SLP32_TSF_WRITE_STATUS      0x00200000
20098c2ecf20Sopenharmony_ci
20108c2ecf20Sopenharmony_ci#define AR_SLP32_WAKE              0x8248
20118c2ecf20Sopenharmony_ci#define AR_SLP32_WAKE_XTL_TIME     0x0000FFFF
20128c2ecf20Sopenharmony_ci
20138c2ecf20Sopenharmony_ci#define AR_SLP32_INC               0x824c
20148c2ecf20Sopenharmony_ci#define AR_SLP32_TST_INC           0x000FFFFF
20158c2ecf20Sopenharmony_ci
20168c2ecf20Sopenharmony_ci#define AR_SLP_CNT         0x8250
20178c2ecf20Sopenharmony_ci#define AR_SLP_CYCLE_CNT   0x8254
20188c2ecf20Sopenharmony_ci
20198c2ecf20Sopenharmony_ci#define AR_SLP_MIB_CTRL    0x8258
20208c2ecf20Sopenharmony_ci#define AR_SLP_MIB_CLEAR   0x00000001
20218c2ecf20Sopenharmony_ci#define AR_SLP_MIB_PENDING 0x00000002
20228c2ecf20Sopenharmony_ci
20238c2ecf20Sopenharmony_ci#define AR_MAC_PCU_LOGIC_ANALYZER               0x8264
20248c2ecf20Sopenharmony_ci#define AR_MAC_PCU_LOGIC_ANALYZER_DISBUG20768   0x20000000
20258c2ecf20Sopenharmony_ci
20268c2ecf20Sopenharmony_ci
20278c2ecf20Sopenharmony_ci#define AR_2040_MODE                0x8318
20288c2ecf20Sopenharmony_ci#define AR_2040_JOINED_RX_CLEAR 0x00000001
20298c2ecf20Sopenharmony_ci
20308c2ecf20Sopenharmony_ci
20318c2ecf20Sopenharmony_ci#define AR_EXTRCCNT         0x8328
20328c2ecf20Sopenharmony_ci
20338c2ecf20Sopenharmony_ci#define AR_SELFGEN_MASK         0x832c
20348c2ecf20Sopenharmony_ci
20358c2ecf20Sopenharmony_ci#define AR_PCU_TXBUF_CTRL               0x8340
20368c2ecf20Sopenharmony_ci#define AR_PCU_TXBUF_CTRL_SIZE_MASK     0x7FF
20378c2ecf20Sopenharmony_ci#define AR_PCU_TXBUF_CTRL_USABLE_SIZE   0x700
20388c2ecf20Sopenharmony_ci#define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE   0x380
20398c2ecf20Sopenharmony_ci#define AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE   0x500
20408c2ecf20Sopenharmony_ci
20418c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2               0x8344
20428c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE           0x00000002
20438c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT   0x00000004
20448c2ecf20Sopenharmony_ci
20458c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_RESERVED                     0x00000038
20468c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE     0x00000040
20478c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_CFP_IGNORE                   0x00000080
20488c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_MGMT_QOS                     0x0000FF00
20498c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_MGMT_QOS_S                   8
20508c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION 0x00010000
20518c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_ENABLE_AGGWEP                0x00020000
20528c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_HWWAR1                       0x00100000
20538c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_HWWAR2                       0x02000000
20548c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE2_RESERVED2                    0xFFFE0000
20558c2ecf20Sopenharmony_ci
20568c2ecf20Sopenharmony_ci#define AR_PCU_MISC_MODE3			       0x83d0
20578c2ecf20Sopenharmony_ci
20588c2ecf20Sopenharmony_ci#define AR_MAC_PCU_ASYNC_FIFO_REG3			0x8358
20598c2ecf20Sopenharmony_ci#define AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL		0x00000400
20608c2ecf20Sopenharmony_ci#define AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET		0x80000000
20618c2ecf20Sopenharmony_ci#define AR_MAC_PCU_GEN_TIMER_TSF_SEL			0x83d8
20628c2ecf20Sopenharmony_ci
20638c2ecf20Sopenharmony_ci#define AR_DIRECT_CONNECT                              0x83a0
20648c2ecf20Sopenharmony_ci#define AR_DC_AP_STA_EN                                0x00000001
20658c2ecf20Sopenharmony_ci#define AR_DC_TSF2_ENABLE                              0x00000001
20668c2ecf20Sopenharmony_ci
20678c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK0       0x805c
20688c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK0_FC    0x0000FFFF
20698c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK0_QOS   0xFFFF0000
20708c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK0_QOS_S 16
20718c2ecf20Sopenharmony_ci
20728c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1              0x8060
20738c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1_SEQ          0x0000FFFF
20748c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1_SEQ_S        0
20758c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1_FC_MGMT      0xFFFF0000
20768c2ecf20Sopenharmony_ci#define AR_AES_MUTE_MASK1_FC_MGMT_S    16
20778c2ecf20Sopenharmony_ci
20788c2ecf20Sopenharmony_ci#define AR_RATE_DURATION_0      0x8700
20798c2ecf20Sopenharmony_ci#define AR_RATE_DURATION_31     0x87CC
20808c2ecf20Sopenharmony_ci#define AR_RATE_DURATION_32     0x8780
20818c2ecf20Sopenharmony_ci#define AR_RATE_DURATION(_n)    (AR_RATE_DURATION_0 + ((_n)<<2))
20828c2ecf20Sopenharmony_ci
20838c2ecf20Sopenharmony_ci/* WoW - Wake On Wireless */
20848c2ecf20Sopenharmony_ci
20858c2ecf20Sopenharmony_ci#define AR_PMCTRL_AUX_PWR_DET		0x10000000 /* Puts Chip in L2 state */
20868c2ecf20Sopenharmony_ci#define AR_PMCTRL_D3COLD_VAUX		0x00800000
20878c2ecf20Sopenharmony_ci#define AR_PMCTRL_HOST_PME_EN		0x00400000 /* Send OOB WAKE_L on WoW
20888c2ecf20Sopenharmony_ci						      event */
20898c2ecf20Sopenharmony_ci#define AR_PMCTRL_WOW_PME_CLR		0x00200000 /* Clear WoW event */
20908c2ecf20Sopenharmony_ci#define AR_PMCTRL_PWR_STATE_MASK	0x0f000000 /* Power State Mask */
20918c2ecf20Sopenharmony_ci#define AR_PMCTRL_PWR_STATE_D1D3	0x0f000000 /* Activate D1 and D3 */
20928c2ecf20Sopenharmony_ci#define AR_PMCTRL_PWR_STATE_D1D3_REAL	0x0f000000 /* Activate D1 and D3 */
20938c2ecf20Sopenharmony_ci#define AR_PMCTRL_PWR_STATE_D0		0x08000000 /* Activate D0 */
20948c2ecf20Sopenharmony_ci#define AR_PMCTRL_PWR_PM_CTRL_ENA	0x00008000 /* Enable power mgmt */
20958c2ecf20Sopenharmony_ci
20968c2ecf20Sopenharmony_ci#define AR_WOW_BEACON_TIMO_MAX		0xffffffff
20978c2ecf20Sopenharmony_ci
20988c2ecf20Sopenharmony_ci#define AR9271_CORE_CLOCK	117   /* clock to 117Mhz */
20998c2ecf20Sopenharmony_ci#define AR9271_TARGET_BAUD_RATE	19200 /* 115200 */
21008c2ecf20Sopenharmony_ci
21018c2ecf20Sopenharmony_ci#define AR_AGG_WEP_ENABLE_FIX		0x00000008  /* This allows the use of AR_AGG_WEP_ENABLE */
21028c2ecf20Sopenharmony_ci#define AR_ADHOC_MCAST_KEYID_ENABLE     0x00000040  /* This bit enables the Multicast search
21038c2ecf20Sopenharmony_ci						     * based on both MAC Address and Key ID.
21048c2ecf20Sopenharmony_ci						     * If bit is 0, then Multicast search is
21058c2ecf20Sopenharmony_ci						     * based on MAC address only.
21068c2ecf20Sopenharmony_ci						     * For Merlin and above only.
21078c2ecf20Sopenharmony_ci						     */
21088c2ecf20Sopenharmony_ci#define AR_AGG_WEP_ENABLE               0x00020000  /* This field enables AGG_WEP feature,
21098c2ecf20Sopenharmony_ci						     * when it is enable, AGG_WEP would takes
21108c2ecf20Sopenharmony_ci						     * charge of the encryption interface of
21118c2ecf20Sopenharmony_ci						     * pcu_txsm.
21128c2ecf20Sopenharmony_ci						     */
21138c2ecf20Sopenharmony_ci
21148c2ecf20Sopenharmony_ci#define AR9300_SM_BASE				0xa200
21158c2ecf20Sopenharmony_ci#define AR9002_PHY_AGC_CONTROL			0x9860
21168c2ecf20Sopenharmony_ci#define AR9003_PHY_AGC_CONTROL			AR9300_SM_BASE + 0xc4
21178c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL			(AR_SREV_9300_20_OR_LATER(ah) ? AR9003_PHY_AGC_CONTROL : AR9002_PHY_AGC_CONTROL)
21188c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_CAL			0x00000001  /* do internal calibration */
21198c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_NF			0x00000002  /* do noise-floor calibration */
21208c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_OFFSET_CAL		0x00000800  /* allow offset calibration */
21218c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_ENABLE_NF		0x00008000  /* enable noise floor calibration to happen */
21228c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_FLTR_CAL		0x00010000  /* allow tx filter calibration */
21238c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_NO_UPDATE_NF		0x00020000  /* don't update noise floor automatically */
21248c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_EXT_NF_PWR_MEAS	0x00040000  /* extend noise floor power measurement */
21258c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_CLC_SUCCESS		0x00080000  /* carrier leak calibration done */
21268c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_PKDET_CAL		0x00100000
21278c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_YCOK_MAX		0x000003c0
21288c2ecf20Sopenharmony_ci#define AR_PHY_AGC_CONTROL_YCOK_MAX_S		6
21298c2ecf20Sopenharmony_ci
21308c2ecf20Sopenharmony_ci#endif
2131