162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright (c) 2008-2011 Atheros Communications Inc. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 562306a36Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 662306a36Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 962306a36Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1062306a36Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1162306a36Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1262306a36Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1362306a36Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1462306a36Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1562306a36Sopenharmony_ci */ 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#ifndef REG_H 1862306a36Sopenharmony_ci#define REG_H 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#include "../reg.h" 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci#define AR_CR 0x0008 2362306a36Sopenharmony_ci#define AR_CR_RXE(_ah) (AR_SREV_9300_20_OR_LATER(_ah) ? 0x0000000c : 0x00000004) 2462306a36Sopenharmony_ci#define AR_CR_RXD 0x00000020 2562306a36Sopenharmony_ci#define AR_CR_SWI 0x00000040 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#define AR_RXDP 0x000C 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci#define AR_CFG 0x0014 3062306a36Sopenharmony_ci#define AR_CFG_SWTD 0x00000001 3162306a36Sopenharmony_ci#define AR_CFG_SWTB 0x00000002 3262306a36Sopenharmony_ci#define AR_CFG_SWRD 0x00000004 3362306a36Sopenharmony_ci#define AR_CFG_SWRB 0x00000008 3462306a36Sopenharmony_ci#define AR_CFG_SWRG 0x00000010 3562306a36Sopenharmony_ci#define AR_CFG_AP_ADHOC_INDICATION 0x00000020 3662306a36Sopenharmony_ci#define AR_CFG_PHOK 0x00000100 3762306a36Sopenharmony_ci#define AR_CFG_EEBS 0x00000200 3862306a36Sopenharmony_ci#define AR_CFG_CLK_GATE_DIS 0x00000400 3962306a36Sopenharmony_ci#define AR_CFG_HALT_REQ 0x00000800 4062306a36Sopenharmony_ci#define AR_CFG_HALT_ACK 0x00001000 4162306a36Sopenharmony_ci#define AR_CFG_PCI_MASTER_REQ_Q_THRESH 0x00060000 4262306a36Sopenharmony_ci#define AR_CFG_PCI_MASTER_REQ_Q_THRESH_S 17 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci#define AR_RXBP_THRESH 0x0018 4562306a36Sopenharmony_ci#define AR_RXBP_THRESH_HP 0x0000000f 4662306a36Sopenharmony_ci#define AR_RXBP_THRESH_HP_S 0 4762306a36Sopenharmony_ci#define AR_RXBP_THRESH_LP 0x00003f00 4862306a36Sopenharmony_ci#define AR_RXBP_THRESH_LP_S 8 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci#define AR_MIRT 0x0020 5162306a36Sopenharmony_ci#define AR_MIRT_VAL 0x0000ffff 5262306a36Sopenharmony_ci#define AR_MIRT_VAL_S 16 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci#define AR_IER 0x0024 5562306a36Sopenharmony_ci#define AR_IER_ENABLE 0x00000001 5662306a36Sopenharmony_ci#define AR_IER_DISABLE 0x00000000 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci#define AR_TIMT 0x0028 5962306a36Sopenharmony_ci#define AR_TIMT_LAST 0x0000ffff 6062306a36Sopenharmony_ci#define AR_TIMT_LAST_S 0 6162306a36Sopenharmony_ci#define AR_TIMT_FIRST 0xffff0000 6262306a36Sopenharmony_ci#define AR_TIMT_FIRST_S 16 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci#define AR_RIMT 0x002C 6562306a36Sopenharmony_ci#define AR_RIMT_LAST 0x0000ffff 6662306a36Sopenharmony_ci#define AR_RIMT_LAST_S 0 6762306a36Sopenharmony_ci#define AR_RIMT_FIRST 0xffff0000 6862306a36Sopenharmony_ci#define AR_RIMT_FIRST_S 16 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci#define AR_DMASIZE_4B 0x00000000 7162306a36Sopenharmony_ci#define AR_DMASIZE_8B 0x00000001 7262306a36Sopenharmony_ci#define AR_DMASIZE_16B 0x00000002 7362306a36Sopenharmony_ci#define AR_DMASIZE_32B 0x00000003 7462306a36Sopenharmony_ci#define AR_DMASIZE_64B 0x00000004 7562306a36Sopenharmony_ci#define AR_DMASIZE_128B 0x00000005 7662306a36Sopenharmony_ci#define AR_DMASIZE_256B 0x00000006 7762306a36Sopenharmony_ci#define AR_DMASIZE_512B 0x00000007 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ci#define AR_TXCFG 0x0030 8062306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_MASK 0x00000007 8162306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_4B 0 8262306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_8B 1 8362306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_16B 2 8462306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_32B 3 8562306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_64B 4 8662306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_128B 5 8762306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_256B 6 8862306a36Sopenharmony_ci#define AR_TXCFG_DMASZ_512B 7 8962306a36Sopenharmony_ci#define AR_FTRIG 0x000003F0 9062306a36Sopenharmony_ci#define AR_FTRIG_S 4 9162306a36Sopenharmony_ci#define AR_FTRIG_IMMED 0x00000000 9262306a36Sopenharmony_ci#define AR_FTRIG_64B 0x00000010 9362306a36Sopenharmony_ci#define AR_FTRIG_128B 0x00000020 9462306a36Sopenharmony_ci#define AR_FTRIG_192B 0x00000030 9562306a36Sopenharmony_ci#define AR_FTRIG_256B 0x00000040 9662306a36Sopenharmony_ci#define AR_FTRIG_512B 0x00000080 9762306a36Sopenharmony_ci#define AR_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY 0x00000800 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci#define AR_RXCFG 0x0034 10062306a36Sopenharmony_ci#define AR_RXCFG_CHIRP 0x00000008 10162306a36Sopenharmony_ci#define AR_RXCFG_ZLFDMA 0x00000010 10262306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_MASK 0x00000007 10362306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_4B 0 10462306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_8B 1 10562306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_16B 2 10662306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_32B 3 10762306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_64B 4 10862306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_128B 5 10962306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_256B 6 11062306a36Sopenharmony_ci#define AR_RXCFG_DMASZ_512B 7 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci#define AR_TOPS 0x0044 11362306a36Sopenharmony_ci#define AR_TOPS_MASK 0x0000FFFF 11462306a36Sopenharmony_ci 11562306a36Sopenharmony_ci#define AR_RXNPTO 0x0048 11662306a36Sopenharmony_ci#define AR_RXNPTO_MASK 0x000003FF 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci#define AR_TXNPTO 0x004C 11962306a36Sopenharmony_ci#define AR_TXNPTO_MASK 0x000003FF 12062306a36Sopenharmony_ci#define AR_TXNPTO_QCU_MASK 0x000FFC00 12162306a36Sopenharmony_ci 12262306a36Sopenharmony_ci#define AR_RPGTO 0x0050 12362306a36Sopenharmony_ci#define AR_RPGTO_MASK 0x000003FF 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ci#define AR_RPCNT 0x0054 12662306a36Sopenharmony_ci#define AR_RPCNT_MASK 0x0000001F 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci#define AR_MACMISC 0x0058 12962306a36Sopenharmony_ci#define AR_MACMISC_PCI_EXT_FORCE 0x00000010 13062306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS 0x000001E0 13162306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_S 5 13262306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_0 0 13362306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_1 1 13462306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_2 2 13562306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_3 3 13662306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_4 4 13762306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_5 5 13862306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_6 6 13962306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_7 7 14062306a36Sopenharmony_ci#define AR_MACMISC_DMA_OBS_LINE_8 8 14162306a36Sopenharmony_ci#define AR_MACMISC_MISC_OBS 0x00000E00 14262306a36Sopenharmony_ci#define AR_MACMISC_MISC_OBS_S 9 14362306a36Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_LSB 0x00007000 14462306a36Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_LSB_S 12 14562306a36Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_MSB 0x00038000 14662306a36Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_MSB_S 15 14762306a36Sopenharmony_ci#define AR_MACMISC_MISC_OBS_BUS_1 1 14862306a36Sopenharmony_ci 14962306a36Sopenharmony_ci#define AR_INTCFG 0x005C 15062306a36Sopenharmony_ci#define AR_INTCFG_MSI_RXOK 0x00000000 15162306a36Sopenharmony_ci#define AR_INTCFG_MSI_RXINTM 0x00000004 15262306a36Sopenharmony_ci#define AR_INTCFG_MSI_RXMINTR 0x00000006 15362306a36Sopenharmony_ci#define AR_INTCFG_MSI_TXOK 0x00000000 15462306a36Sopenharmony_ci#define AR_INTCFG_MSI_TXINTM 0x00000010 15562306a36Sopenharmony_ci#define AR_INTCFG_MSI_TXMINTR 0x00000018 15662306a36Sopenharmony_ci 15762306a36Sopenharmony_ci#define AR_DATABUF_SIZE 0x0060 15862306a36Sopenharmony_ci#define AR_DATABUF_SIZE_MASK 0x00000FFF 15962306a36Sopenharmony_ci 16062306a36Sopenharmony_ci#define AR_GTXTO 0x0064 16162306a36Sopenharmony_ci#define AR_GTXTO_TIMEOUT_COUNTER 0x0000FFFF 16262306a36Sopenharmony_ci#define AR_GTXTO_TIMEOUT_LIMIT 0xFFFF0000 16362306a36Sopenharmony_ci#define AR_GTXTO_TIMEOUT_LIMIT_S 16 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci#define AR_GTTM 0x0068 16662306a36Sopenharmony_ci#define AR_GTTM_USEC 0x00000001 16762306a36Sopenharmony_ci#define AR_GTTM_IGNORE_IDLE 0x00000002 16862306a36Sopenharmony_ci#define AR_GTTM_RESET_IDLE 0x00000004 16962306a36Sopenharmony_ci#define AR_GTTM_CST_USEC 0x00000008 17062306a36Sopenharmony_ci 17162306a36Sopenharmony_ci#define AR_CST 0x006C 17262306a36Sopenharmony_ci#define AR_CST_TIMEOUT_COUNTER 0x0000FFFF 17362306a36Sopenharmony_ci#define AR_CST_TIMEOUT_LIMIT 0xFFFF0000 17462306a36Sopenharmony_ci#define AR_CST_TIMEOUT_LIMIT_S 16 17562306a36Sopenharmony_ci 17662306a36Sopenharmony_ci#define AR_HP_RXDP 0x0074 17762306a36Sopenharmony_ci#define AR_LP_RXDP 0x0078 17862306a36Sopenharmony_ci 17962306a36Sopenharmony_ci#define AR_ISR 0x0080 18062306a36Sopenharmony_ci#define AR_ISR_RXOK 0x00000001 18162306a36Sopenharmony_ci#define AR_ISR_RXDESC 0x00000002 18262306a36Sopenharmony_ci#define AR_ISR_HP_RXOK 0x00000001 18362306a36Sopenharmony_ci#define AR_ISR_LP_RXOK 0x00000002 18462306a36Sopenharmony_ci#define AR_ISR_RXERR 0x00000004 18562306a36Sopenharmony_ci#define AR_ISR_RXNOPKT 0x00000008 18662306a36Sopenharmony_ci#define AR_ISR_RXEOL 0x00000010 18762306a36Sopenharmony_ci#define AR_ISR_RXORN 0x00000020 18862306a36Sopenharmony_ci#define AR_ISR_TXOK 0x00000040 18962306a36Sopenharmony_ci#define AR_ISR_TXDESC 0x00000080 19062306a36Sopenharmony_ci#define AR_ISR_TXERR 0x00000100 19162306a36Sopenharmony_ci#define AR_ISR_TXNOPKT 0x00000200 19262306a36Sopenharmony_ci#define AR_ISR_TXEOL 0x00000400 19362306a36Sopenharmony_ci#define AR_ISR_TXURN 0x00000800 19462306a36Sopenharmony_ci#define AR_ISR_MIB 0x00001000 19562306a36Sopenharmony_ci#define AR_ISR_SWI 0x00002000 19662306a36Sopenharmony_ci#define AR_ISR_RXPHY 0x00004000 19762306a36Sopenharmony_ci#define AR_ISR_RXKCM 0x00008000 19862306a36Sopenharmony_ci#define AR_ISR_SWBA 0x00010000 19962306a36Sopenharmony_ci#define AR_ISR_BRSSI 0x00020000 20062306a36Sopenharmony_ci#define AR_ISR_BMISS 0x00040000 20162306a36Sopenharmony_ci#define AR_ISR_BNR 0x00100000 20262306a36Sopenharmony_ci#define AR_ISR_RXCHIRP 0x00200000 20362306a36Sopenharmony_ci#define AR_ISR_BCNMISC 0x00800000 20462306a36Sopenharmony_ci#define AR_ISR_TIM 0x00800000 20562306a36Sopenharmony_ci#define AR_ISR_QCBROVF 0x02000000 20662306a36Sopenharmony_ci#define AR_ISR_QCBRURN 0x04000000 20762306a36Sopenharmony_ci#define AR_ISR_QTRIG 0x08000000 20862306a36Sopenharmony_ci#define AR_ISR_GENTMR 0x10000000 20962306a36Sopenharmony_ci 21062306a36Sopenharmony_ci#define AR_ISR_TXMINTR 0x00080000 21162306a36Sopenharmony_ci#define AR_ISR_RXMINTR 0x01000000 21262306a36Sopenharmony_ci#define AR_ISR_TXINTM 0x40000000 21362306a36Sopenharmony_ci#define AR_ISR_RXINTM 0x80000000 21462306a36Sopenharmony_ci 21562306a36Sopenharmony_ci#define AR_ISR_S0 0x0084 21662306a36Sopenharmony_ci#define AR_ISR_S0_QCU_TXOK 0x000003FF 21762306a36Sopenharmony_ci#define AR_ISR_S0_QCU_TXOK_S 0 21862306a36Sopenharmony_ci#define AR_ISR_S0_QCU_TXDESC 0x03FF0000 21962306a36Sopenharmony_ci#define AR_ISR_S0_QCU_TXDESC_S 16 22062306a36Sopenharmony_ci 22162306a36Sopenharmony_ci#define AR_ISR_S1 0x0088 22262306a36Sopenharmony_ci#define AR_ISR_S1_QCU_TXERR 0x000003FF 22362306a36Sopenharmony_ci#define AR_ISR_S1_QCU_TXERR_S 0 22462306a36Sopenharmony_ci#define AR_ISR_S1_QCU_TXEOL 0x03FF0000 22562306a36Sopenharmony_ci#define AR_ISR_S1_QCU_TXEOL_S 16 22662306a36Sopenharmony_ci 22762306a36Sopenharmony_ci#define AR_ISR_S2 0x008c 22862306a36Sopenharmony_ci#define AR_ISR_S2_QCU_TXURN 0x000003FF 22962306a36Sopenharmony_ci#define AR_ISR_S2_BB_WATCHDOG 0x00010000 23062306a36Sopenharmony_ci#define AR_ISR_S2_CST 0x00400000 23162306a36Sopenharmony_ci#define AR_ISR_S2_GTT 0x00800000 23262306a36Sopenharmony_ci#define AR_ISR_S2_TIM 0x01000000 23362306a36Sopenharmony_ci#define AR_ISR_S2_CABEND 0x02000000 23462306a36Sopenharmony_ci#define AR_ISR_S2_DTIMSYNC 0x04000000 23562306a36Sopenharmony_ci#define AR_ISR_S2_BCNTO 0x08000000 23662306a36Sopenharmony_ci#define AR_ISR_S2_CABTO 0x10000000 23762306a36Sopenharmony_ci#define AR_ISR_S2_DTIM 0x20000000 23862306a36Sopenharmony_ci#define AR_ISR_S2_TSFOOR 0x40000000 23962306a36Sopenharmony_ci#define AR_ISR_S2_TBTT_TIME 0x80000000 24062306a36Sopenharmony_ci 24162306a36Sopenharmony_ci#define AR_ISR_S3 0x0090 24262306a36Sopenharmony_ci#define AR_ISR_S3_QCU_QCBROVF 0x000003FF 24362306a36Sopenharmony_ci#define AR_ISR_S3_QCU_QCBRURN 0x03FF0000 24462306a36Sopenharmony_ci 24562306a36Sopenharmony_ci#define AR_ISR_S4 0x0094 24662306a36Sopenharmony_ci#define AR_ISR_S4_QCU_QTRIG 0x000003FF 24762306a36Sopenharmony_ci#define AR_ISR_S4_RESV0 0xFFFFFC00 24862306a36Sopenharmony_ci 24962306a36Sopenharmony_ci#define AR_ISR_S5 0x0098 25062306a36Sopenharmony_ci#define AR_ISR_S5_TIMER_TRIG 0x000000FF 25162306a36Sopenharmony_ci#define AR_ISR_S5_TIMER_THRESH 0x0007FE00 25262306a36Sopenharmony_ci#define AR_ISR_S5_TIM_TIMER 0x00000010 25362306a36Sopenharmony_ci#define AR_ISR_S5_DTIM_TIMER 0x00000020 25462306a36Sopenharmony_ci#define AR_IMR_S5 0x00b8 25562306a36Sopenharmony_ci#define AR_IMR_S5_TIM_TIMER 0x00000010 25662306a36Sopenharmony_ci#define AR_IMR_S5_DTIM_TIMER 0x00000020 25762306a36Sopenharmony_ci#define AR_ISR_S5_GENTIMER_TRIG 0x0000FF80 25862306a36Sopenharmony_ci#define AR_ISR_S5_GENTIMER_TRIG_S 0 25962306a36Sopenharmony_ci#define AR_ISR_S5_GENTIMER_THRESH 0xFF800000 26062306a36Sopenharmony_ci#define AR_ISR_S5_GENTIMER_THRESH_S 16 26162306a36Sopenharmony_ci#define AR_IMR_S5_GENTIMER_TRIG 0x0000FF80 26262306a36Sopenharmony_ci#define AR_IMR_S5_GENTIMER_TRIG_S 0 26362306a36Sopenharmony_ci#define AR_IMR_S5_GENTIMER_THRESH 0xFF800000 26462306a36Sopenharmony_ci#define AR_IMR_S5_GENTIMER_THRESH_S 16 26562306a36Sopenharmony_ci 26662306a36Sopenharmony_ci#define AR_IMR 0x00a0 26762306a36Sopenharmony_ci#define AR_IMR_RXOK 0x00000001 26862306a36Sopenharmony_ci#define AR_IMR_RXDESC 0x00000002 26962306a36Sopenharmony_ci#define AR_IMR_RXOK_HP 0x00000001 27062306a36Sopenharmony_ci#define AR_IMR_RXOK_LP 0x00000002 27162306a36Sopenharmony_ci#define AR_IMR_RXERR 0x00000004 27262306a36Sopenharmony_ci#define AR_IMR_RXNOPKT 0x00000008 27362306a36Sopenharmony_ci#define AR_IMR_RXEOL 0x00000010 27462306a36Sopenharmony_ci#define AR_IMR_RXORN 0x00000020 27562306a36Sopenharmony_ci#define AR_IMR_TXOK 0x00000040 27662306a36Sopenharmony_ci#define AR_IMR_TXDESC 0x00000080 27762306a36Sopenharmony_ci#define AR_IMR_TXERR 0x00000100 27862306a36Sopenharmony_ci#define AR_IMR_TXNOPKT 0x00000200 27962306a36Sopenharmony_ci#define AR_IMR_TXEOL 0x00000400 28062306a36Sopenharmony_ci#define AR_IMR_TXURN 0x00000800 28162306a36Sopenharmony_ci#define AR_IMR_MIB 0x00001000 28262306a36Sopenharmony_ci#define AR_IMR_SWI 0x00002000 28362306a36Sopenharmony_ci#define AR_IMR_RXPHY 0x00004000 28462306a36Sopenharmony_ci#define AR_IMR_RXKCM 0x00008000 28562306a36Sopenharmony_ci#define AR_IMR_SWBA 0x00010000 28662306a36Sopenharmony_ci#define AR_IMR_BRSSI 0x00020000 28762306a36Sopenharmony_ci#define AR_IMR_BMISS 0x00040000 28862306a36Sopenharmony_ci#define AR_IMR_BNR 0x00100000 28962306a36Sopenharmony_ci#define AR_IMR_RXCHIRP 0x00200000 29062306a36Sopenharmony_ci#define AR_IMR_BCNMISC 0x00800000 29162306a36Sopenharmony_ci#define AR_IMR_TIM 0x00800000 29262306a36Sopenharmony_ci#define AR_IMR_QCBROVF 0x02000000 29362306a36Sopenharmony_ci#define AR_IMR_QCBRURN 0x04000000 29462306a36Sopenharmony_ci#define AR_IMR_QTRIG 0x08000000 29562306a36Sopenharmony_ci#define AR_IMR_GENTMR 0x10000000 29662306a36Sopenharmony_ci 29762306a36Sopenharmony_ci#define AR_IMR_TXMINTR 0x00080000 29862306a36Sopenharmony_ci#define AR_IMR_RXMINTR 0x01000000 29962306a36Sopenharmony_ci#define AR_IMR_TXINTM 0x40000000 30062306a36Sopenharmony_ci#define AR_IMR_RXINTM 0x80000000 30162306a36Sopenharmony_ci 30262306a36Sopenharmony_ci#define AR_IMR_S0 0x00a4 30362306a36Sopenharmony_ci#define AR_IMR_S0_QCU_TXOK 0x000003FF 30462306a36Sopenharmony_ci#define AR_IMR_S0_QCU_TXOK_S 0 30562306a36Sopenharmony_ci#define AR_IMR_S0_QCU_TXDESC 0x03FF0000 30662306a36Sopenharmony_ci#define AR_IMR_S0_QCU_TXDESC_S 16 30762306a36Sopenharmony_ci 30862306a36Sopenharmony_ci#define AR_IMR_S1 0x00a8 30962306a36Sopenharmony_ci#define AR_IMR_S1_QCU_TXERR 0x000003FF 31062306a36Sopenharmony_ci#define AR_IMR_S1_QCU_TXERR_S 0 31162306a36Sopenharmony_ci#define AR_IMR_S1_QCU_TXEOL 0x03FF0000 31262306a36Sopenharmony_ci#define AR_IMR_S1_QCU_TXEOL_S 16 31362306a36Sopenharmony_ci 31462306a36Sopenharmony_ci#define AR_IMR_S2 0x00ac 31562306a36Sopenharmony_ci#define AR_IMR_S2_QCU_TXURN 0x000003FF 31662306a36Sopenharmony_ci#define AR_IMR_S2_QCU_TXURN_S 0 31762306a36Sopenharmony_ci#define AR_IMR_S2_BB_WATCHDOG 0x00010000 31862306a36Sopenharmony_ci#define AR_IMR_S2_CST 0x00400000 31962306a36Sopenharmony_ci#define AR_IMR_S2_GTT 0x00800000 32062306a36Sopenharmony_ci#define AR_IMR_S2_TIM 0x01000000 32162306a36Sopenharmony_ci#define AR_IMR_S2_CABEND 0x02000000 32262306a36Sopenharmony_ci#define AR_IMR_S2_DTIMSYNC 0x04000000 32362306a36Sopenharmony_ci#define AR_IMR_S2_BCNTO 0x08000000 32462306a36Sopenharmony_ci#define AR_IMR_S2_CABTO 0x10000000 32562306a36Sopenharmony_ci#define AR_IMR_S2_DTIM 0x20000000 32662306a36Sopenharmony_ci#define AR_IMR_S2_TSFOOR 0x40000000 32762306a36Sopenharmony_ci 32862306a36Sopenharmony_ci#define AR_IMR_S3 0x00b0 32962306a36Sopenharmony_ci#define AR_IMR_S3_QCU_QCBROVF 0x000003FF 33062306a36Sopenharmony_ci#define AR_IMR_S3_QCU_QCBRURN 0x03FF0000 33162306a36Sopenharmony_ci#define AR_IMR_S3_QCU_QCBRURN_S 16 33262306a36Sopenharmony_ci 33362306a36Sopenharmony_ci#define AR_IMR_S4 0x00b4 33462306a36Sopenharmony_ci#define AR_IMR_S4_QCU_QTRIG 0x000003FF 33562306a36Sopenharmony_ci#define AR_IMR_S4_RESV0 0xFFFFFC00 33662306a36Sopenharmony_ci 33762306a36Sopenharmony_ci#define AR_IMR_S5 0x00b8 33862306a36Sopenharmony_ci#define AR_IMR_S5_TIMER_TRIG 0x000000FF 33962306a36Sopenharmony_ci#define AR_IMR_S5_TIMER_THRESH 0x0000FF00 34062306a36Sopenharmony_ci 34162306a36Sopenharmony_ci 34262306a36Sopenharmony_ci#define AR_ISR_RAC 0x00c0 34362306a36Sopenharmony_ci#define AR_ISR_S0_S 0x00c4 34462306a36Sopenharmony_ci#define AR_ISR_S0_QCU_TXOK 0x000003FF 34562306a36Sopenharmony_ci#define AR_ISR_S0_QCU_TXOK_S 0 34662306a36Sopenharmony_ci#define AR_ISR_S0_QCU_TXDESC 0x03FF0000 34762306a36Sopenharmony_ci#define AR_ISR_S0_QCU_TXDESC_S 16 34862306a36Sopenharmony_ci 34962306a36Sopenharmony_ci#define AR_ISR_S1_S 0x00c8 35062306a36Sopenharmony_ci#define AR_ISR_S1_QCU_TXERR 0x000003FF 35162306a36Sopenharmony_ci#define AR_ISR_S1_QCU_TXERR_S 0 35262306a36Sopenharmony_ci#define AR_ISR_S1_QCU_TXEOL 0x03FF0000 35362306a36Sopenharmony_ci#define AR_ISR_S1_QCU_TXEOL_S 16 35462306a36Sopenharmony_ci 35562306a36Sopenharmony_ci#define AR_ISR_S2_S(_ah) (AR_SREV_9300_20_OR_LATER(_ah) ? 0x00d0 : 0x00cc) 35662306a36Sopenharmony_ci#define AR_ISR_S3_S(_ah) (AR_SREV_9300_20_OR_LATER(_ah) ? 0x00d4 : 0x00d0) 35762306a36Sopenharmony_ci#define AR_ISR_S4_S(_ah) (AR_SREV_9300_20_OR_LATER(_ah) ? 0x00d8 : 0x00d4) 35862306a36Sopenharmony_ci#define AR_ISR_S5_S(_ah) (AR_SREV_9300_20_OR_LATER(_ah) ? 0x00dc : 0x00d8) 35962306a36Sopenharmony_ci#define AR_DMADBG_0 0x00e0 36062306a36Sopenharmony_ci#define AR_DMADBG_1 0x00e4 36162306a36Sopenharmony_ci#define AR_DMADBG_2 0x00e8 36262306a36Sopenharmony_ci#define AR_DMADBG_3 0x00ec 36362306a36Sopenharmony_ci#define AR_DMADBG_4 0x00f0 36462306a36Sopenharmony_ci#define AR_DMADBG_5 0x00f4 36562306a36Sopenharmony_ci#define AR_DMADBG_6 0x00f8 36662306a36Sopenharmony_ci#define AR_DMADBG_7 0x00fc 36762306a36Sopenharmony_ci 36862306a36Sopenharmony_ci#define AR_NUM_QCU 10 36962306a36Sopenharmony_ci#define AR_QCU_0 0x0001 37062306a36Sopenharmony_ci#define AR_QCU_1 0x0002 37162306a36Sopenharmony_ci#define AR_QCU_2 0x0004 37262306a36Sopenharmony_ci#define AR_QCU_3 0x0008 37362306a36Sopenharmony_ci#define AR_QCU_4 0x0010 37462306a36Sopenharmony_ci#define AR_QCU_5 0x0020 37562306a36Sopenharmony_ci#define AR_QCU_6 0x0040 37662306a36Sopenharmony_ci#define AR_QCU_7 0x0080 37762306a36Sopenharmony_ci#define AR_QCU_8 0x0100 37862306a36Sopenharmony_ci#define AR_QCU_9 0x0200 37962306a36Sopenharmony_ci 38062306a36Sopenharmony_ci#define AR_Q0_TXDP 0x0800 38162306a36Sopenharmony_ci#define AR_Q1_TXDP 0x0804 38262306a36Sopenharmony_ci#define AR_Q2_TXDP 0x0808 38362306a36Sopenharmony_ci#define AR_Q3_TXDP 0x080c 38462306a36Sopenharmony_ci#define AR_Q4_TXDP 0x0810 38562306a36Sopenharmony_ci#define AR_Q5_TXDP 0x0814 38662306a36Sopenharmony_ci#define AR_Q6_TXDP 0x0818 38762306a36Sopenharmony_ci#define AR_Q7_TXDP 0x081c 38862306a36Sopenharmony_ci#define AR_Q8_TXDP 0x0820 38962306a36Sopenharmony_ci#define AR_Q9_TXDP 0x0824 39062306a36Sopenharmony_ci#define AR_QTXDP(_i) (AR_Q0_TXDP + ((_i)<<2)) 39162306a36Sopenharmony_ci 39262306a36Sopenharmony_ci#define AR_Q_STATUS_RING_START 0x830 39362306a36Sopenharmony_ci#define AR_Q_STATUS_RING_END 0x834 39462306a36Sopenharmony_ci 39562306a36Sopenharmony_ci#define AR_Q_TXE 0x0840 39662306a36Sopenharmony_ci#define AR_Q_TXE_M 0x000003FF 39762306a36Sopenharmony_ci 39862306a36Sopenharmony_ci#define AR_Q_TXD 0x0880 39962306a36Sopenharmony_ci#define AR_Q_TXD_M 0x000003FF 40062306a36Sopenharmony_ci 40162306a36Sopenharmony_ci#define AR_Q0_CBRCFG 0x08c0 40262306a36Sopenharmony_ci#define AR_Q1_CBRCFG 0x08c4 40362306a36Sopenharmony_ci#define AR_Q2_CBRCFG 0x08c8 40462306a36Sopenharmony_ci#define AR_Q3_CBRCFG 0x08cc 40562306a36Sopenharmony_ci#define AR_Q4_CBRCFG 0x08d0 40662306a36Sopenharmony_ci#define AR_Q5_CBRCFG 0x08d4 40762306a36Sopenharmony_ci#define AR_Q6_CBRCFG 0x08d8 40862306a36Sopenharmony_ci#define AR_Q7_CBRCFG 0x08dc 40962306a36Sopenharmony_ci#define AR_Q8_CBRCFG 0x08e0 41062306a36Sopenharmony_ci#define AR_Q9_CBRCFG 0x08e4 41162306a36Sopenharmony_ci#define AR_QCBRCFG(_i) (AR_Q0_CBRCFG + ((_i)<<2)) 41262306a36Sopenharmony_ci#define AR_Q_CBRCFG_INTERVAL 0x00FFFFFF 41362306a36Sopenharmony_ci#define AR_Q_CBRCFG_INTERVAL_S 0 41462306a36Sopenharmony_ci#define AR_Q_CBRCFG_OVF_THRESH 0xFF000000 41562306a36Sopenharmony_ci#define AR_Q_CBRCFG_OVF_THRESH_S 24 41662306a36Sopenharmony_ci 41762306a36Sopenharmony_ci#define AR_Q0_RDYTIMECFG 0x0900 41862306a36Sopenharmony_ci#define AR_Q1_RDYTIMECFG 0x0904 41962306a36Sopenharmony_ci#define AR_Q2_RDYTIMECFG 0x0908 42062306a36Sopenharmony_ci#define AR_Q3_RDYTIMECFG 0x090c 42162306a36Sopenharmony_ci#define AR_Q4_RDYTIMECFG 0x0910 42262306a36Sopenharmony_ci#define AR_Q5_RDYTIMECFG 0x0914 42362306a36Sopenharmony_ci#define AR_Q6_RDYTIMECFG 0x0918 42462306a36Sopenharmony_ci#define AR_Q7_RDYTIMECFG 0x091c 42562306a36Sopenharmony_ci#define AR_Q8_RDYTIMECFG 0x0920 42662306a36Sopenharmony_ci#define AR_Q9_RDYTIMECFG 0x0924 42762306a36Sopenharmony_ci#define AR_QRDYTIMECFG(_i) (AR_Q0_RDYTIMECFG + ((_i)<<2)) 42862306a36Sopenharmony_ci#define AR_Q_RDYTIMECFG_DURATION 0x00FFFFFF 42962306a36Sopenharmony_ci#define AR_Q_RDYTIMECFG_DURATION_S 0 43062306a36Sopenharmony_ci#define AR_Q_RDYTIMECFG_EN 0x01000000 43162306a36Sopenharmony_ci 43262306a36Sopenharmony_ci#define AR_Q_ONESHOTARM_SC 0x0940 43362306a36Sopenharmony_ci#define AR_Q_ONESHOTARM_SC_M 0x000003FF 43462306a36Sopenharmony_ci#define AR_Q_ONESHOTARM_SC_RESV0 0xFFFFFC00 43562306a36Sopenharmony_ci 43662306a36Sopenharmony_ci#define AR_Q_ONESHOTARM_CC 0x0980 43762306a36Sopenharmony_ci#define AR_Q_ONESHOTARM_CC_M 0x000003FF 43862306a36Sopenharmony_ci#define AR_Q_ONESHOTARM_CC_RESV0 0xFFFFFC00 43962306a36Sopenharmony_ci 44062306a36Sopenharmony_ci#define AR_Q0_MISC 0x09c0 44162306a36Sopenharmony_ci#define AR_Q1_MISC 0x09c4 44262306a36Sopenharmony_ci#define AR_Q2_MISC 0x09c8 44362306a36Sopenharmony_ci#define AR_Q3_MISC 0x09cc 44462306a36Sopenharmony_ci#define AR_Q4_MISC 0x09d0 44562306a36Sopenharmony_ci#define AR_Q5_MISC 0x09d4 44662306a36Sopenharmony_ci#define AR_Q6_MISC 0x09d8 44762306a36Sopenharmony_ci#define AR_Q7_MISC 0x09dc 44862306a36Sopenharmony_ci#define AR_Q8_MISC 0x09e0 44962306a36Sopenharmony_ci#define AR_Q9_MISC 0x09e4 45062306a36Sopenharmony_ci#define AR_QMISC(_i) (AR_Q0_MISC + ((_i)<<2)) 45162306a36Sopenharmony_ci#define AR_Q_MISC_FSP 0x0000000F 45262306a36Sopenharmony_ci#define AR_Q_MISC_FSP_ASAP 0 45362306a36Sopenharmony_ci#define AR_Q_MISC_FSP_CBR 1 45462306a36Sopenharmony_ci#define AR_Q_MISC_FSP_DBA_GATED 2 45562306a36Sopenharmony_ci#define AR_Q_MISC_FSP_TIM_GATED 3 45662306a36Sopenharmony_ci#define AR_Q_MISC_FSP_BEACON_SENT_GATED 4 45762306a36Sopenharmony_ci#define AR_Q_MISC_FSP_BEACON_RCVD_GATED 5 45862306a36Sopenharmony_ci#define AR_Q_MISC_ONE_SHOT_EN 0x00000010 45962306a36Sopenharmony_ci#define AR_Q_MISC_CBR_INCR_DIS1 0x00000020 46062306a36Sopenharmony_ci#define AR_Q_MISC_CBR_INCR_DIS0 0x00000040 46162306a36Sopenharmony_ci#define AR_Q_MISC_BEACON_USE 0x00000080 46262306a36Sopenharmony_ci#define AR_Q_MISC_CBR_EXP_CNTR_LIMIT_EN 0x00000100 46362306a36Sopenharmony_ci#define AR_Q_MISC_RDYTIME_EXP_POLICY 0x00000200 46462306a36Sopenharmony_ci#define AR_Q_MISC_RESET_CBR_EXP_CTR 0x00000400 46562306a36Sopenharmony_ci#define AR_Q_MISC_DCU_EARLY_TERM_REQ 0x00000800 46662306a36Sopenharmony_ci#define AR_Q_MISC_RESV0 0xFFFFF000 46762306a36Sopenharmony_ci 46862306a36Sopenharmony_ci#define AR_Q0_STS 0x0a00 46962306a36Sopenharmony_ci#define AR_Q1_STS 0x0a04 47062306a36Sopenharmony_ci#define AR_Q2_STS 0x0a08 47162306a36Sopenharmony_ci#define AR_Q3_STS 0x0a0c 47262306a36Sopenharmony_ci#define AR_Q4_STS 0x0a10 47362306a36Sopenharmony_ci#define AR_Q5_STS 0x0a14 47462306a36Sopenharmony_ci#define AR_Q6_STS 0x0a18 47562306a36Sopenharmony_ci#define AR_Q7_STS 0x0a1c 47662306a36Sopenharmony_ci#define AR_Q8_STS 0x0a20 47762306a36Sopenharmony_ci#define AR_Q9_STS 0x0a24 47862306a36Sopenharmony_ci#define AR_QSTS(_i) (AR_Q0_STS + ((_i)<<2)) 47962306a36Sopenharmony_ci#define AR_Q_STS_PEND_FR_CNT 0x00000003 48062306a36Sopenharmony_ci#define AR_Q_STS_RESV0 0x000000FC 48162306a36Sopenharmony_ci#define AR_Q_STS_CBR_EXP_CNT 0x0000FF00 48262306a36Sopenharmony_ci#define AR_Q_STS_RESV1 0xFFFF0000 48362306a36Sopenharmony_ci 48462306a36Sopenharmony_ci#define AR_Q_RDYTIMESHDN 0x0a40 48562306a36Sopenharmony_ci#define AR_Q_RDYTIMESHDN_M 0x000003FF 48662306a36Sopenharmony_ci 48762306a36Sopenharmony_ci/* MAC Descriptor CRC check */ 48862306a36Sopenharmony_ci#define AR_Q_DESC_CRCCHK 0xa44 48962306a36Sopenharmony_ci/* Enable CRC check on the descriptor fetched from host */ 49062306a36Sopenharmony_ci#define AR_Q_DESC_CRCCHK_EN 1 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_ci#define AR_NUM_DCU 10 49362306a36Sopenharmony_ci#define AR_DCU_0 0x0001 49462306a36Sopenharmony_ci#define AR_DCU_1 0x0002 49562306a36Sopenharmony_ci#define AR_DCU_2 0x0004 49662306a36Sopenharmony_ci#define AR_DCU_3 0x0008 49762306a36Sopenharmony_ci#define AR_DCU_4 0x0010 49862306a36Sopenharmony_ci#define AR_DCU_5 0x0020 49962306a36Sopenharmony_ci#define AR_DCU_6 0x0040 50062306a36Sopenharmony_ci#define AR_DCU_7 0x0080 50162306a36Sopenharmony_ci#define AR_DCU_8 0x0100 50262306a36Sopenharmony_ci#define AR_DCU_9 0x0200 50362306a36Sopenharmony_ci 50462306a36Sopenharmony_ci#define AR_D0_QCUMASK 0x1000 50562306a36Sopenharmony_ci#define AR_D1_QCUMASK 0x1004 50662306a36Sopenharmony_ci#define AR_D2_QCUMASK 0x1008 50762306a36Sopenharmony_ci#define AR_D3_QCUMASK 0x100c 50862306a36Sopenharmony_ci#define AR_D4_QCUMASK 0x1010 50962306a36Sopenharmony_ci#define AR_D5_QCUMASK 0x1014 51062306a36Sopenharmony_ci#define AR_D6_QCUMASK 0x1018 51162306a36Sopenharmony_ci#define AR_D7_QCUMASK 0x101c 51262306a36Sopenharmony_ci#define AR_D8_QCUMASK 0x1020 51362306a36Sopenharmony_ci#define AR_D9_QCUMASK 0x1024 51462306a36Sopenharmony_ci#define AR_DQCUMASK(_i) (AR_D0_QCUMASK + ((_i)<<2)) 51562306a36Sopenharmony_ci#define AR_D_QCUMASK 0x000003FF 51662306a36Sopenharmony_ci#define AR_D_QCUMASK_RESV0 0xFFFFFC00 51762306a36Sopenharmony_ci 51862306a36Sopenharmony_ci#define AR_D0_LCL_IFS 0x1040 51962306a36Sopenharmony_ci#define AR_D1_LCL_IFS 0x1044 52062306a36Sopenharmony_ci#define AR_D2_LCL_IFS 0x1048 52162306a36Sopenharmony_ci#define AR_D3_LCL_IFS 0x104c 52262306a36Sopenharmony_ci#define AR_D4_LCL_IFS 0x1050 52362306a36Sopenharmony_ci#define AR_D5_LCL_IFS 0x1054 52462306a36Sopenharmony_ci#define AR_D6_LCL_IFS 0x1058 52562306a36Sopenharmony_ci#define AR_D7_LCL_IFS 0x105c 52662306a36Sopenharmony_ci#define AR_D8_LCL_IFS 0x1060 52762306a36Sopenharmony_ci#define AR_D9_LCL_IFS 0x1064 52862306a36Sopenharmony_ci#define AR_DLCL_IFS(_i) (AR_D0_LCL_IFS + ((_i)<<2)) 52962306a36Sopenharmony_ci#define AR_D_LCL_IFS_CWMIN 0x000003FF 53062306a36Sopenharmony_ci#define AR_D_LCL_IFS_CWMIN_S 0 53162306a36Sopenharmony_ci#define AR_D_LCL_IFS_CWMAX 0x000FFC00 53262306a36Sopenharmony_ci#define AR_D_LCL_IFS_CWMAX_S 10 53362306a36Sopenharmony_ci#define AR_D_LCL_IFS_AIFS 0x0FF00000 53462306a36Sopenharmony_ci#define AR_D_LCL_IFS_AIFS_S 20 53562306a36Sopenharmony_ci 53662306a36Sopenharmony_ci#define AR_D_LCL_IFS_RESV0 0xF0000000 53762306a36Sopenharmony_ci 53862306a36Sopenharmony_ci#define AR_D0_RETRY_LIMIT 0x1080 53962306a36Sopenharmony_ci#define AR_D1_RETRY_LIMIT 0x1084 54062306a36Sopenharmony_ci#define AR_D2_RETRY_LIMIT 0x1088 54162306a36Sopenharmony_ci#define AR_D3_RETRY_LIMIT 0x108c 54262306a36Sopenharmony_ci#define AR_D4_RETRY_LIMIT 0x1090 54362306a36Sopenharmony_ci#define AR_D5_RETRY_LIMIT 0x1094 54462306a36Sopenharmony_ci#define AR_D6_RETRY_LIMIT 0x1098 54562306a36Sopenharmony_ci#define AR_D7_RETRY_LIMIT 0x109c 54662306a36Sopenharmony_ci#define AR_D8_RETRY_LIMIT 0x10a0 54762306a36Sopenharmony_ci#define AR_D9_RETRY_LIMIT 0x10a4 54862306a36Sopenharmony_ci#define AR_DRETRY_LIMIT(_i) (AR_D0_RETRY_LIMIT + ((_i)<<2)) 54962306a36Sopenharmony_ci#define AR_D_RETRY_LIMIT_FR_SH 0x0000000F 55062306a36Sopenharmony_ci#define AR_D_RETRY_LIMIT_FR_SH_S 0 55162306a36Sopenharmony_ci#define AR_D_RETRY_LIMIT_STA_SH 0x00003F00 55262306a36Sopenharmony_ci#define AR_D_RETRY_LIMIT_STA_SH_S 8 55362306a36Sopenharmony_ci#define AR_D_RETRY_LIMIT_STA_LG 0x000FC000 55462306a36Sopenharmony_ci#define AR_D_RETRY_LIMIT_STA_LG_S 14 55562306a36Sopenharmony_ci#define AR_D_RETRY_LIMIT_RESV0 0xFFF00000 55662306a36Sopenharmony_ci 55762306a36Sopenharmony_ci#define AR_D0_CHNTIME 0x10c0 55862306a36Sopenharmony_ci#define AR_D1_CHNTIME 0x10c4 55962306a36Sopenharmony_ci#define AR_D2_CHNTIME 0x10c8 56062306a36Sopenharmony_ci#define AR_D3_CHNTIME 0x10cc 56162306a36Sopenharmony_ci#define AR_D4_CHNTIME 0x10d0 56262306a36Sopenharmony_ci#define AR_D5_CHNTIME 0x10d4 56362306a36Sopenharmony_ci#define AR_D6_CHNTIME 0x10d8 56462306a36Sopenharmony_ci#define AR_D7_CHNTIME 0x10dc 56562306a36Sopenharmony_ci#define AR_D8_CHNTIME 0x10e0 56662306a36Sopenharmony_ci#define AR_D9_CHNTIME 0x10e4 56762306a36Sopenharmony_ci#define AR_DCHNTIME(_i) (AR_D0_CHNTIME + ((_i)<<2)) 56862306a36Sopenharmony_ci#define AR_D_CHNTIME_DUR 0x000FFFFF 56962306a36Sopenharmony_ci#define AR_D_CHNTIME_DUR_S 0 57062306a36Sopenharmony_ci#define AR_D_CHNTIME_EN 0x00100000 57162306a36Sopenharmony_ci#define AR_D_CHNTIME_RESV0 0xFFE00000 57262306a36Sopenharmony_ci 57362306a36Sopenharmony_ci#define AR_D0_MISC 0x1100 57462306a36Sopenharmony_ci#define AR_D1_MISC 0x1104 57562306a36Sopenharmony_ci#define AR_D2_MISC 0x1108 57662306a36Sopenharmony_ci#define AR_D3_MISC 0x110c 57762306a36Sopenharmony_ci#define AR_D4_MISC 0x1110 57862306a36Sopenharmony_ci#define AR_D5_MISC 0x1114 57962306a36Sopenharmony_ci#define AR_D6_MISC 0x1118 58062306a36Sopenharmony_ci#define AR_D7_MISC 0x111c 58162306a36Sopenharmony_ci#define AR_D8_MISC 0x1120 58262306a36Sopenharmony_ci#define AR_D9_MISC 0x1124 58362306a36Sopenharmony_ci#define AR_DMISC(_i) (AR_D0_MISC + ((_i)<<2)) 58462306a36Sopenharmony_ci#define AR_D_MISC_BKOFF_THRESH 0x0000003F 58562306a36Sopenharmony_ci#define AR_D_MISC_RETRY_CNT_RESET_EN 0x00000040 58662306a36Sopenharmony_ci#define AR_D_MISC_CW_RESET_EN 0x00000080 58762306a36Sopenharmony_ci#define AR_D_MISC_FRAG_WAIT_EN 0x00000100 58862306a36Sopenharmony_ci#define AR_D_MISC_FRAG_BKOFF_EN 0x00000200 58962306a36Sopenharmony_ci#define AR_D_MISC_CW_BKOFF_EN 0x00001000 59062306a36Sopenharmony_ci#define AR_D_MISC_VIR_COL_HANDLING 0x0000C000 59162306a36Sopenharmony_ci#define AR_D_MISC_VIR_COL_HANDLING_S 14 59262306a36Sopenharmony_ci#define AR_D_MISC_VIR_COL_HANDLING_DEFAULT 0 59362306a36Sopenharmony_ci#define AR_D_MISC_VIR_COL_HANDLING_IGNORE 1 59462306a36Sopenharmony_ci#define AR_D_MISC_BEACON_USE 0x00010000 59562306a36Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL 0x00060000 59662306a36Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL_S 17 59762306a36Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL_NONE 0 59862306a36Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL_INTRA_FR 1 59962306a36Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL 2 60062306a36Sopenharmony_ci#define AR_D_MISC_ARB_LOCKOUT_IGNORE 0x00080000 60162306a36Sopenharmony_ci#define AR_D_MISC_SEQ_NUM_INCR_DIS 0x00100000 60262306a36Sopenharmony_ci#define AR_D_MISC_POST_FR_BKOFF_DIS 0x00200000 60362306a36Sopenharmony_ci#define AR_D_MISC_VIT_COL_CW_BKOFF_EN 0x00400000 60462306a36Sopenharmony_ci#define AR_D_MISC_BLOWN_IFS_RETRY_EN 0x00800000 60562306a36Sopenharmony_ci#define AR_D_MISC_RESV0 0xFF000000 60662306a36Sopenharmony_ci 60762306a36Sopenharmony_ci#define AR_D_SEQNUM 0x1140 60862306a36Sopenharmony_ci 60962306a36Sopenharmony_ci#define AR_D_GBL_IFS_SIFS 0x1030 61062306a36Sopenharmony_ci#define AR_D_GBL_IFS_SIFS_M 0x0000FFFF 61162306a36Sopenharmony_ci#define AR_D_GBL_IFS_SIFS_RESV0 0xFFFFFFFF 61262306a36Sopenharmony_ci 61362306a36Sopenharmony_ci#define AR_D_TXBLK_BASE 0x1038 61462306a36Sopenharmony_ci#define AR_D_TXBLK_WRITE_BITMASK 0x0000FFFF 61562306a36Sopenharmony_ci#define AR_D_TXBLK_WRITE_BITMASK_S 0 61662306a36Sopenharmony_ci#define AR_D_TXBLK_WRITE_SLICE 0x000F0000 61762306a36Sopenharmony_ci#define AR_D_TXBLK_WRITE_SLICE_S 16 61862306a36Sopenharmony_ci#define AR_D_TXBLK_WRITE_DCU 0x00F00000 61962306a36Sopenharmony_ci#define AR_D_TXBLK_WRITE_DCU_S 20 62062306a36Sopenharmony_ci#define AR_D_TXBLK_WRITE_COMMAND 0x0F000000 62162306a36Sopenharmony_ci#define AR_D_TXBLK_WRITE_COMMAND_S 24 62262306a36Sopenharmony_ci 62362306a36Sopenharmony_ci#define AR_D_GBL_IFS_SLOT 0x1070 62462306a36Sopenharmony_ci#define AR_D_GBL_IFS_SLOT_M 0x0000FFFF 62562306a36Sopenharmony_ci#define AR_D_GBL_IFS_SLOT_RESV0 0xFFFF0000 62662306a36Sopenharmony_ci 62762306a36Sopenharmony_ci#define AR_D_GBL_IFS_EIFS 0x10b0 62862306a36Sopenharmony_ci#define AR_D_GBL_IFS_EIFS_M 0x0000FFFF 62962306a36Sopenharmony_ci#define AR_D_GBL_IFS_EIFS_RESV0 0xFFFF0000 63062306a36Sopenharmony_ci#define AR_D_GBL_IFS_EIFS_ASYNC_FIFO 363 63162306a36Sopenharmony_ci 63262306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC 0x10f0 63362306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC_LFSR_SLICE_SEL 0x00000007 63462306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC_TURBO_MODE 0x00000008 63562306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC_USEC_DURATION 0x000FFC00 63662306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC_DCU_ARBITER_DLY 0x00300000 63762306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC_RANDOM_LFSR_SLICE_DIS 0x01000000 63862306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC_SLOT_XMIT_WIND_LEN 0x06000000 63962306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC_FORCE_XMIT_SLOT_BOUND 0x08000000 64062306a36Sopenharmony_ci#define AR_D_GBL_IFS_MISC_IGNORE_BACKOFF 0x10000000 64162306a36Sopenharmony_ci 64262306a36Sopenharmony_ci#define AR_D_FPCTL 0x1230 64362306a36Sopenharmony_ci#define AR_D_FPCTL_DCU 0x0000000F 64462306a36Sopenharmony_ci#define AR_D_FPCTL_DCU_S 0 64562306a36Sopenharmony_ci#define AR_D_FPCTL_PREFETCH_EN 0x00000010 64662306a36Sopenharmony_ci#define AR_D_FPCTL_BURST_PREFETCH 0x00007FE0 64762306a36Sopenharmony_ci#define AR_D_FPCTL_BURST_PREFETCH_S 5 64862306a36Sopenharmony_ci 64962306a36Sopenharmony_ci#define AR_D_TXPSE 0x1270 65062306a36Sopenharmony_ci#define AR_D_TXPSE_CTRL 0x000003FF 65162306a36Sopenharmony_ci#define AR_D_TXPSE_RESV0 0x0000FC00 65262306a36Sopenharmony_ci#define AR_D_TXPSE_STATUS 0x00010000 65362306a36Sopenharmony_ci#define AR_D_TXPSE_RESV1 0xFFFE0000 65462306a36Sopenharmony_ci 65562306a36Sopenharmony_ci#define AR_D_TXSLOTMASK 0x12f0 65662306a36Sopenharmony_ci#define AR_D_TXSLOTMASK_NUM 0x0000000F 65762306a36Sopenharmony_ci 65862306a36Sopenharmony_ci#define AR_CFG_LED 0x1f04 65962306a36Sopenharmony_ci#define AR_CFG_SCLK_RATE_IND 0x00000003 66062306a36Sopenharmony_ci#define AR_CFG_SCLK_RATE_IND_S 0 66162306a36Sopenharmony_ci#define AR_CFG_SCLK_32MHZ 0x00000000 66262306a36Sopenharmony_ci#define AR_CFG_SCLK_4MHZ 0x00000001 66362306a36Sopenharmony_ci#define AR_CFG_SCLK_1MHZ 0x00000002 66462306a36Sopenharmony_ci#define AR_CFG_SCLK_32KHZ 0x00000003 66562306a36Sopenharmony_ci#define AR_CFG_LED_BLINK_SLOW 0x00000008 66662306a36Sopenharmony_ci#define AR_CFG_LED_BLINK_THRESH_SEL 0x00000070 66762306a36Sopenharmony_ci#define AR_CFG_LED_MODE_SEL 0x00000380 66862306a36Sopenharmony_ci#define AR_CFG_LED_MODE_SEL_S 7 66962306a36Sopenharmony_ci#define AR_CFG_LED_POWER 0x00000280 67062306a36Sopenharmony_ci#define AR_CFG_LED_POWER_S 7 67162306a36Sopenharmony_ci#define AR_CFG_LED_NETWORK 0x00000300 67262306a36Sopenharmony_ci#define AR_CFG_LED_NETWORK_S 7 67362306a36Sopenharmony_ci#define AR_CFG_LED_MODE_PROP 0x0 67462306a36Sopenharmony_ci#define AR_CFG_LED_MODE_RPROP 0x1 67562306a36Sopenharmony_ci#define AR_CFG_LED_MODE_SPLIT 0x2 67662306a36Sopenharmony_ci#define AR_CFG_LED_MODE_RAND 0x3 67762306a36Sopenharmony_ci#define AR_CFG_LED_MODE_POWER_OFF 0x4 67862306a36Sopenharmony_ci#define AR_CFG_LED_MODE_POWER_ON 0x5 67962306a36Sopenharmony_ci#define AR_CFG_LED_MODE_NETWORK_OFF 0x4 68062306a36Sopenharmony_ci#define AR_CFG_LED_MODE_NETWORK_ON 0x6 68162306a36Sopenharmony_ci#define AR_CFG_LED_ASSOC_CTL 0x00000c00 68262306a36Sopenharmony_ci#define AR_CFG_LED_ASSOC_CTL_S 10 68362306a36Sopenharmony_ci#define AR_CFG_LED_ASSOC_NONE 0x0 68462306a36Sopenharmony_ci#define AR_CFG_LED_ASSOC_ACTIVE 0x1 68562306a36Sopenharmony_ci#define AR_CFG_LED_ASSOC_PENDING 0x2 68662306a36Sopenharmony_ci 68762306a36Sopenharmony_ci#define AR_CFG_LED_BLINK_SLOW 0x00000008 68862306a36Sopenharmony_ci#define AR_CFG_LED_BLINK_SLOW_S 3 68962306a36Sopenharmony_ci 69062306a36Sopenharmony_ci#define AR_CFG_LED_BLINK_THRESH_SEL 0x00000070 69162306a36Sopenharmony_ci#define AR_CFG_LED_BLINK_THRESH_SEL_S 4 69262306a36Sopenharmony_ci 69362306a36Sopenharmony_ci#define AR_MAC_SLEEP 0x1f00 69462306a36Sopenharmony_ci#define AR_MAC_SLEEP_MAC_AWAKE 0x00000000 69562306a36Sopenharmony_ci#define AR_MAC_SLEEP_MAC_ASLEEP 0x00000001 69662306a36Sopenharmony_ci 69762306a36Sopenharmony_ci#define AR_RC 0x4000 69862306a36Sopenharmony_ci#define AR_RC_AHB 0x00000001 69962306a36Sopenharmony_ci#define AR_RC_APB 0x00000002 70062306a36Sopenharmony_ci#define AR_RC_HOSTIF 0x00000100 70162306a36Sopenharmony_ci 70262306a36Sopenharmony_ci#define AR_WA(_ah) (AR_SREV_9340(_ah) ? 0x40c4 : 0x4004) 70362306a36Sopenharmony_ci#define AR_WA_BIT6 (1 << 6) 70462306a36Sopenharmony_ci#define AR_WA_BIT7 (1 << 7) 70562306a36Sopenharmony_ci#define AR_WA_BIT23 (1 << 23) 70662306a36Sopenharmony_ci#define AR_WA_D3_L1_DISABLE (1 << 14) 70762306a36Sopenharmony_ci#define AR_WA_UNTIE_RESET_EN (1 << 15) /* Enable PCI Reset 70862306a36Sopenharmony_ci to POR (power-on-reset) */ 70962306a36Sopenharmony_ci#define AR_WA_D3_TO_L1_DISABLE_REAL (1 << 16) 71062306a36Sopenharmony_ci#define AR_WA_ASPM_TIMER_BASED_DISABLE (1 << 17) 71162306a36Sopenharmony_ci#define AR_WA_RESET_EN (1 << 18) /* Enable PCI-Reset to 71262306a36Sopenharmony_ci POR (bit 15) */ 71362306a36Sopenharmony_ci#define AR_WA_ANALOG_SHIFT (1 << 20) 71462306a36Sopenharmony_ci#define AR_WA_POR_SHORT (1 << 21) /* PCI-E Phy reset control */ 71562306a36Sopenharmony_ci#define AR_WA_BIT22 (1 << 22) 71662306a36Sopenharmony_ci#define AR9285_WA_DEFAULT 0x004a050b 71762306a36Sopenharmony_ci#define AR9280_WA_DEFAULT 0x0040073b 71862306a36Sopenharmony_ci#define AR_WA_DEFAULT 0x0000073f 71962306a36Sopenharmony_ci 72062306a36Sopenharmony_ci 72162306a36Sopenharmony_ci#define AR_PM_STATE 0x4008 72262306a36Sopenharmony_ci#define AR_PM_STATE_PME_D3COLD_VAUX 0x00100000 72362306a36Sopenharmony_ci 72462306a36Sopenharmony_ci#define AR_HOST_TIMEOUT(_ah) (AR_SREV_9340(_ah) ? 0x4008 : 0x4018) 72562306a36Sopenharmony_ci#define AR_HOST_TIMEOUT_APB_CNTR 0x0000FFFF 72662306a36Sopenharmony_ci#define AR_HOST_TIMEOUT_APB_CNTR_S 0 72762306a36Sopenharmony_ci#define AR_HOST_TIMEOUT_LCL_CNTR 0xFFFF0000 72862306a36Sopenharmony_ci#define AR_HOST_TIMEOUT_LCL_CNTR_S 16 72962306a36Sopenharmony_ci 73062306a36Sopenharmony_ci#define AR_EEPROM 0x401c 73162306a36Sopenharmony_ci#define AR_EEPROM_ABSENT 0x00000100 73262306a36Sopenharmony_ci#define AR_EEPROM_CORRUPT 0x00000200 73362306a36Sopenharmony_ci#define AR_EEPROM_PROT_MASK 0x03FFFC00 73462306a36Sopenharmony_ci#define AR_EEPROM_PROT_MASK_S 10 73562306a36Sopenharmony_ci 73662306a36Sopenharmony_ci#define EEPROM_PROTECT_RP_0_31 0x0001 73762306a36Sopenharmony_ci#define EEPROM_PROTECT_WP_0_31 0x0002 73862306a36Sopenharmony_ci#define EEPROM_PROTECT_RP_32_63 0x0004 73962306a36Sopenharmony_ci#define EEPROM_PROTECT_WP_32_63 0x0008 74062306a36Sopenharmony_ci#define EEPROM_PROTECT_RP_64_127 0x0010 74162306a36Sopenharmony_ci#define EEPROM_PROTECT_WP_64_127 0x0020 74262306a36Sopenharmony_ci#define EEPROM_PROTECT_RP_128_191 0x0040 74362306a36Sopenharmony_ci#define EEPROM_PROTECT_WP_128_191 0x0080 74462306a36Sopenharmony_ci#define EEPROM_PROTECT_RP_192_255 0x0100 74562306a36Sopenharmony_ci#define EEPROM_PROTECT_WP_192_255 0x0200 74662306a36Sopenharmony_ci#define EEPROM_PROTECT_RP_256_511 0x0400 74762306a36Sopenharmony_ci#define EEPROM_PROTECT_WP_256_511 0x0800 74862306a36Sopenharmony_ci#define EEPROM_PROTECT_RP_512_1023 0x1000 74962306a36Sopenharmony_ci#define EEPROM_PROTECT_WP_512_1023 0x2000 75062306a36Sopenharmony_ci#define EEPROM_PROTECT_RP_1024_2047 0x4000 75162306a36Sopenharmony_ci#define EEPROM_PROTECT_WP_1024_2047 0x8000 75262306a36Sopenharmony_ci 75362306a36Sopenharmony_ci#define AR_SREV(_ah) \ 75462306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? 0x0600 : (AR_SREV_9340(_ah) \ 75562306a36Sopenharmony_ci ? 0x400c : 0x4020)) 75662306a36Sopenharmony_ci 75762306a36Sopenharmony_ci#define AR_SREV_ID(_ah) \ 75862306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? 0x00000FFF : 0x000000FF) 75962306a36Sopenharmony_ci#define AR_SREV_VERSION 0x000000F0 76062306a36Sopenharmony_ci#define AR_SREV_VERSION_S 4 76162306a36Sopenharmony_ci#define AR_SREV_REVISION 0x00000007 76262306a36Sopenharmony_ci 76362306a36Sopenharmony_ci#define AR_SREV_ID2 0xFFFFFFFF 76462306a36Sopenharmony_ci#define AR_SREV_VERSION2 0xFFFC0000 76562306a36Sopenharmony_ci#define AR_SREV_VERSION2_S 18 76662306a36Sopenharmony_ci#define AR_SREV_TYPE2 0x0003F000 76762306a36Sopenharmony_ci#define AR_SREV_TYPE2_S 12 76862306a36Sopenharmony_ci#define AR_SREV_TYPE2_CHAIN 0x00001000 76962306a36Sopenharmony_ci#define AR_SREV_TYPE2_HOST_MODE 0x00002000 77062306a36Sopenharmony_ci#define AR_SREV_REVISION2 0x00000F00 77162306a36Sopenharmony_ci#define AR_SREV_REVISION2_S 8 77262306a36Sopenharmony_ci 77362306a36Sopenharmony_ci#define AR_SREV_VERSION_5416_PCI 0xD 77462306a36Sopenharmony_ci#define AR_SREV_VERSION_5416_PCIE 0xC 77562306a36Sopenharmony_ci#define AR_SREV_REVISION_5416_10 0 77662306a36Sopenharmony_ci#define AR_SREV_REVISION_5416_20 1 77762306a36Sopenharmony_ci#define AR_SREV_REVISION_5416_22 2 77862306a36Sopenharmony_ci#define AR_SREV_VERSION_9100 0x14 77962306a36Sopenharmony_ci#define AR_SREV_VERSION_9160 0x40 78062306a36Sopenharmony_ci#define AR_SREV_REVISION_9160_10 0 78162306a36Sopenharmony_ci#define AR_SREV_REVISION_9160_11 1 78262306a36Sopenharmony_ci#define AR_SREV_VERSION_9280 0x80 78362306a36Sopenharmony_ci#define AR_SREV_REVISION_9280_10 0 78462306a36Sopenharmony_ci#define AR_SREV_REVISION_9280_20 1 78562306a36Sopenharmony_ci#define AR_SREV_REVISION_9280_21 2 78662306a36Sopenharmony_ci#define AR_SREV_VERSION_9285 0xC0 78762306a36Sopenharmony_ci#define AR_SREV_REVISION_9285_10 0 78862306a36Sopenharmony_ci#define AR_SREV_REVISION_9285_11 1 78962306a36Sopenharmony_ci#define AR_SREV_REVISION_9285_12 2 79062306a36Sopenharmony_ci#define AR_SREV_VERSION_9287 0x180 79162306a36Sopenharmony_ci#define AR_SREV_REVISION_9287_10 0 79262306a36Sopenharmony_ci#define AR_SREV_REVISION_9287_11 1 79362306a36Sopenharmony_ci#define AR_SREV_REVISION_9287_12 2 79462306a36Sopenharmony_ci#define AR_SREV_REVISION_9287_13 3 79562306a36Sopenharmony_ci#define AR_SREV_VERSION_9271 0x140 79662306a36Sopenharmony_ci#define AR_SREV_REVISION_9271_10 0 79762306a36Sopenharmony_ci#define AR_SREV_REVISION_9271_11 1 79862306a36Sopenharmony_ci#define AR_SREV_VERSION_9300 0x1c0 79962306a36Sopenharmony_ci#define AR_SREV_REVISION_9300_20 2 /* 2.0 and 2.1 */ 80062306a36Sopenharmony_ci#define AR_SREV_REVISION_9300_22 3 80162306a36Sopenharmony_ci#define AR_SREV_VERSION_9330 0x200 80262306a36Sopenharmony_ci#define AR_SREV_REVISION_9330_10 0 80362306a36Sopenharmony_ci#define AR_SREV_REVISION_9330_11 1 80462306a36Sopenharmony_ci#define AR_SREV_REVISION_9330_12 2 80562306a36Sopenharmony_ci#define AR_SREV_VERSION_9485 0x240 80662306a36Sopenharmony_ci#define AR_SREV_REVISION_9485_10 0 80762306a36Sopenharmony_ci#define AR_SREV_REVISION_9485_11 1 80862306a36Sopenharmony_ci#define AR_SREV_VERSION_9340 0x300 80962306a36Sopenharmony_ci#define AR_SREV_REVISION_9340_10 0 81062306a36Sopenharmony_ci#define AR_SREV_REVISION_9340_11 1 81162306a36Sopenharmony_ci#define AR_SREV_REVISION_9340_12 2 81262306a36Sopenharmony_ci#define AR_SREV_REVISION_9340_13 3 81362306a36Sopenharmony_ci#define AR_SREV_VERSION_9580 0x1C0 81462306a36Sopenharmony_ci#define AR_SREV_REVISION_9580_10 4 /* AR9580 1.0 */ 81562306a36Sopenharmony_ci#define AR_SREV_VERSION_9462 0x280 81662306a36Sopenharmony_ci#define AR_SREV_REVISION_9462_20 2 81762306a36Sopenharmony_ci#define AR_SREV_REVISION_9462_21 3 81862306a36Sopenharmony_ci#define AR_SREV_VERSION_9565 0x2C0 81962306a36Sopenharmony_ci#define AR_SREV_REVISION_9565_10 0 82062306a36Sopenharmony_ci#define AR_SREV_REVISION_9565_101 1 82162306a36Sopenharmony_ci#define AR_SREV_REVISION_9565_11 2 82262306a36Sopenharmony_ci#define AR_SREV_VERSION_9550 0x400 82362306a36Sopenharmony_ci#define AR_SREV_VERSION_9531 0x500 82462306a36Sopenharmony_ci#define AR_SREV_REVISION_9531_10 0 82562306a36Sopenharmony_ci#define AR_SREV_REVISION_9531_11 1 82662306a36Sopenharmony_ci#define AR_SREV_REVISION_9531_20 2 82762306a36Sopenharmony_ci#define AR_SREV_VERSION_9561 0x600 82862306a36Sopenharmony_ci 82962306a36Sopenharmony_ci#define AR_SREV_5416(_ah) \ 83062306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \ 83162306a36Sopenharmony_ci ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE)) 83262306a36Sopenharmony_ci#define AR_SREV_5416_22_OR_LATER(_ah) \ 83362306a36Sopenharmony_ci (((AR_SREV_5416(_ah)) && \ 83462306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \ 83562306a36Sopenharmony_ci ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) 83662306a36Sopenharmony_ci 83762306a36Sopenharmony_ci#define AR_SREV_9100(_ah) \ 83862306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9100)) 83962306a36Sopenharmony_ci#define AR_SREV_9100_OR_LATER(_ah) \ 84062306a36Sopenharmony_ci (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) 84162306a36Sopenharmony_ci 84262306a36Sopenharmony_ci#define AR_SREV_9160(_ah) \ 84362306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160)) 84462306a36Sopenharmony_ci#define AR_SREV_9160_10_OR_LATER(_ah) \ 84562306a36Sopenharmony_ci (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160)) 84662306a36Sopenharmony_ci#define AR_SREV_9160_11(_ah) \ 84762306a36Sopenharmony_ci (AR_SREV_9160(_ah) && \ 84862306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9160_11)) 84962306a36Sopenharmony_ci#define AR_SREV_9280(_ah) \ 85062306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280)) 85162306a36Sopenharmony_ci#define AR_SREV_9280_20_OR_LATER(_ah) \ 85262306a36Sopenharmony_ci (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9280)) 85362306a36Sopenharmony_ci#define AR_SREV_9280_20(_ah) \ 85462306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280)) 85562306a36Sopenharmony_ci 85662306a36Sopenharmony_ci#define AR_SREV_9285(_ah) \ 85762306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285)) 85862306a36Sopenharmony_ci#define AR_SREV_9285_12_OR_LATER(_ah) \ 85962306a36Sopenharmony_ci (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285)) 86062306a36Sopenharmony_ci 86162306a36Sopenharmony_ci#define AR_SREV_9287(_ah) \ 86262306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287)) 86362306a36Sopenharmony_ci#define AR_SREV_9287_11_OR_LATER(_ah) \ 86462306a36Sopenharmony_ci (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9287)) 86562306a36Sopenharmony_ci#define AR_SREV_9287_11(_ah) \ 86662306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 86762306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_11)) 86862306a36Sopenharmony_ci#define AR_SREV_9287_12(_ah) \ 86962306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 87062306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_12)) 87162306a36Sopenharmony_ci#define AR_SREV_9287_12_OR_LATER(_ah) \ 87262306a36Sopenharmony_ci (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \ 87362306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 87462306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_12))) 87562306a36Sopenharmony_ci#define AR_SREV_9287_13_OR_LATER(_ah) \ 87662306a36Sopenharmony_ci (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \ 87762306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 87862306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_13))) 87962306a36Sopenharmony_ci 88062306a36Sopenharmony_ci#define AR_SREV_9271(_ah) \ 88162306a36Sopenharmony_ci (((_ah))->hw_version.macVersion == AR_SREV_VERSION_9271) 88262306a36Sopenharmony_ci#define AR_SREV_9271_10(_ah) \ 88362306a36Sopenharmony_ci (AR_SREV_9271(_ah) && \ 88462306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9271_10)) 88562306a36Sopenharmony_ci#define AR_SREV_9271_11(_ah) \ 88662306a36Sopenharmony_ci (AR_SREV_9271(_ah) && \ 88762306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9271_11)) 88862306a36Sopenharmony_ci 88962306a36Sopenharmony_ci#define AR_SREV_9300(_ah) \ 89062306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9300)) 89162306a36Sopenharmony_ci#define AR_SREV_9300_20_OR_LATER(_ah) \ 89262306a36Sopenharmony_ci ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9300) 89362306a36Sopenharmony_ci#define AR_SREV_9300_22(_ah) \ 89462306a36Sopenharmony_ci (AR_SREV_9300((_ah)) && \ 89562306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9300_22)) 89662306a36Sopenharmony_ci 89762306a36Sopenharmony_ci#define AR_SREV_9330(_ah) \ 89862306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9330)) 89962306a36Sopenharmony_ci#define AR_SREV_9330_11(_ah) \ 90062306a36Sopenharmony_ci (AR_SREV_9330((_ah)) && \ 90162306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_11)) 90262306a36Sopenharmony_ci#define AR_SREV_9330_12(_ah) \ 90362306a36Sopenharmony_ci (AR_SREV_9330((_ah)) && \ 90462306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_12)) 90562306a36Sopenharmony_ci 90662306a36Sopenharmony_ci#ifdef CONFIG_ATH9K_PCOEM 90762306a36Sopenharmony_ci#define AR_SREV_9462(_ah) \ 90862306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462)) 90962306a36Sopenharmony_ci#define AR_SREV_9485(_ah) \ 91062306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9485)) 91162306a36Sopenharmony_ci#define AR_SREV_9565(_ah) \ 91262306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565)) 91362306a36Sopenharmony_ci#define AR_SREV_9003_PCOEM(_ah) \ 91462306a36Sopenharmony_ci (AR_SREV_9462(_ah) || AR_SREV_9485(_ah) || AR_SREV_9565(_ah)) 91562306a36Sopenharmony_ci#else 91662306a36Sopenharmony_ci#define AR_SREV_9462(_ah) 0 91762306a36Sopenharmony_ci#define AR_SREV_9485(_ah) 0 91862306a36Sopenharmony_ci#define AR_SREV_9565(_ah) 0 91962306a36Sopenharmony_ci#define AR_SREV_9003_PCOEM(_ah) 0 92062306a36Sopenharmony_ci#endif 92162306a36Sopenharmony_ci 92262306a36Sopenharmony_ci#define AR_SREV_9485_11_OR_LATER(_ah) \ 92362306a36Sopenharmony_ci (AR_SREV_9485(_ah) && \ 92462306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9485_11)) 92562306a36Sopenharmony_ci#define AR_SREV_9485_OR_LATER(_ah) \ 92662306a36Sopenharmony_ci (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9485)) 92762306a36Sopenharmony_ci 92862306a36Sopenharmony_ci#define AR_SREV_9340(_ah) \ 92962306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340)) 93062306a36Sopenharmony_ci 93162306a36Sopenharmony_ci#define AR_SREV_9340_13(_ah) \ 93262306a36Sopenharmony_ci (AR_SREV_9340((_ah)) && \ 93362306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9340_13)) 93462306a36Sopenharmony_ci 93562306a36Sopenharmony_ci#define AR_SREV_9340_13_OR_LATER(_ah) \ 93662306a36Sopenharmony_ci (AR_SREV_9340((_ah)) && \ 93762306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9340_13)) 93862306a36Sopenharmony_ci 93962306a36Sopenharmony_ci#define AR_SREV_9285E_20(_ah) \ 94062306a36Sopenharmony_ci (AR_SREV_9285_12_OR_LATER(_ah) && \ 94162306a36Sopenharmony_ci ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1)) 94262306a36Sopenharmony_ci 94362306a36Sopenharmony_ci#define AR_SREV_9462_20(_ah) \ 94462306a36Sopenharmony_ci (AR_SREV_9462(_ah) && \ 94562306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_20)) 94662306a36Sopenharmony_ci#define AR_SREV_9462_21(_ah) \ 94762306a36Sopenharmony_ci (AR_SREV_9462(_ah) && \ 94862306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9462_21)) 94962306a36Sopenharmony_ci#define AR_SREV_9462_20_OR_LATER(_ah) \ 95062306a36Sopenharmony_ci (AR_SREV_9462(_ah) && \ 95162306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_20)) 95262306a36Sopenharmony_ci#define AR_SREV_9462_21_OR_LATER(_ah) \ 95362306a36Sopenharmony_ci (AR_SREV_9462(_ah) && \ 95462306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_21)) 95562306a36Sopenharmony_ci 95662306a36Sopenharmony_ci#define AR_SREV_9565_10(_ah) \ 95762306a36Sopenharmony_ci (AR_SREV_9565(_ah) && \ 95862306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_10)) 95962306a36Sopenharmony_ci#define AR_SREV_9565_101(_ah) \ 96062306a36Sopenharmony_ci (AR_SREV_9565(_ah) && \ 96162306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_101)) 96262306a36Sopenharmony_ci#define AR_SREV_9565_11(_ah) \ 96362306a36Sopenharmony_ci (AR_SREV_9565(_ah) && \ 96462306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_11)) 96562306a36Sopenharmony_ci#define AR_SREV_9565_11_OR_LATER(_ah) \ 96662306a36Sopenharmony_ci (AR_SREV_9565(_ah) && \ 96762306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9565_11)) 96862306a36Sopenharmony_ci 96962306a36Sopenharmony_ci#define AR_SREV_9550(_ah) \ 97062306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9550)) 97162306a36Sopenharmony_ci#define AR_SREV_9550_OR_LATER(_ah) \ 97262306a36Sopenharmony_ci (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9550)) 97362306a36Sopenharmony_ci 97462306a36Sopenharmony_ci#define AR_SREV_9580(_ah) \ 97562306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9580) && \ 97662306a36Sopenharmony_ci ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9580_10)) 97762306a36Sopenharmony_ci#define AR_SREV_9580_10(_ah) \ 97862306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9580) && \ 97962306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9580_10)) 98062306a36Sopenharmony_ci 98162306a36Sopenharmony_ci#define AR_SREV_9531(_ah) \ 98262306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531)) 98362306a36Sopenharmony_ci#define AR_SREV_9531_10(_ah) \ 98462306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531) && \ 98562306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9531_10)) 98662306a36Sopenharmony_ci#define AR_SREV_9531_11(_ah) \ 98762306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531) && \ 98862306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9531_11)) 98962306a36Sopenharmony_ci#define AR_SREV_9531_20(_ah) \ 99062306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9531) && \ 99162306a36Sopenharmony_ci ((_ah)->hw_version.macRev == AR_SREV_REVISION_9531_20)) 99262306a36Sopenharmony_ci 99362306a36Sopenharmony_ci#define AR_SREV_9561(_ah) \ 99462306a36Sopenharmony_ci (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9561)) 99562306a36Sopenharmony_ci 99662306a36Sopenharmony_ci#define AR_SREV_SOC(_ah) \ 99762306a36Sopenharmony_ci (AR_SREV_9340(_ah) || AR_SREV_9531(_ah) || AR_SREV_9550(_ah) || \ 99862306a36Sopenharmony_ci AR_SREV_9561(_ah)) 99962306a36Sopenharmony_ci 100062306a36Sopenharmony_ci/* NOTE: When adding chips newer than Peacock, add chip check here */ 100162306a36Sopenharmony_ci#define AR_SREV_9580_10_OR_LATER(_ah) \ 100262306a36Sopenharmony_ci (AR_SREV_9580(_ah)) 100362306a36Sopenharmony_ci 100462306a36Sopenharmony_cienum ath_usb_dev { 100562306a36Sopenharmony_ci AR9280_USB = 1, /* AR7010 + AR9280, UB94 */ 100662306a36Sopenharmony_ci AR9287_USB = 2, /* AR7010 + AR9287, UB95 */ 100762306a36Sopenharmony_ci STORAGE_DEVICE = 3, 100862306a36Sopenharmony_ci}; 100962306a36Sopenharmony_ci 101062306a36Sopenharmony_ci#define AR_DEVID_7010(_ah) \ 101162306a36Sopenharmony_ci (((_ah)->hw_version.usbdev == AR9280_USB) || \ 101262306a36Sopenharmony_ci ((_ah)->hw_version.usbdev == AR9287_USB)) 101362306a36Sopenharmony_ci 101462306a36Sopenharmony_ci#define AR_RADIO_SREV_MAJOR 0xf0 101562306a36Sopenharmony_ci#define AR_RAD5133_SREV_MAJOR 0xc0 101662306a36Sopenharmony_ci#define AR_RAD2133_SREV_MAJOR 0xd0 101762306a36Sopenharmony_ci#define AR_RAD5122_SREV_MAJOR 0xe0 101862306a36Sopenharmony_ci#define AR_RAD2122_SREV_MAJOR 0xf0 101962306a36Sopenharmony_ci 102062306a36Sopenharmony_ci#define AR_AHB_MODE 0x4024 102162306a36Sopenharmony_ci#define AR_AHB_EXACT_WR_EN 0x00000000 102262306a36Sopenharmony_ci#define AR_AHB_BUF_WR_EN 0x00000001 102362306a36Sopenharmony_ci#define AR_AHB_EXACT_RD_EN 0x00000000 102462306a36Sopenharmony_ci#define AR_AHB_CACHELINE_RD_EN 0x00000002 102562306a36Sopenharmony_ci#define AR_AHB_PREFETCH_RD_EN 0x00000004 102662306a36Sopenharmony_ci#define AR_AHB_PAGE_SIZE_1K 0x00000000 102762306a36Sopenharmony_ci#define AR_AHB_PAGE_SIZE_2K 0x00000008 102862306a36Sopenharmony_ci#define AR_AHB_PAGE_SIZE_4K 0x00000010 102962306a36Sopenharmony_ci#define AR_AHB_CUSTOM_BURST_EN 0x000000C0 103062306a36Sopenharmony_ci#define AR_AHB_CUSTOM_BURST_EN_S 6 103162306a36Sopenharmony_ci#define AR_AHB_CUSTOM_BURST_ASYNC_FIFO_VAL 3 103262306a36Sopenharmony_ci 103362306a36Sopenharmony_ci#define AR_INTR_RTC_IRQ 0x00000001 103462306a36Sopenharmony_ci#define AR_INTR_MAC_IRQ 0x00000002 103562306a36Sopenharmony_ci#define AR_INTR_EEP_PROT_ACCESS 0x00000004 103662306a36Sopenharmony_ci#define AR_INTR_MAC_AWAKE 0x00020000 103762306a36Sopenharmony_ci#define AR_INTR_MAC_ASLEEP 0x00040000 103862306a36Sopenharmony_ci#define AR_INTR_SPURIOUS 0xFFFFFFFF 103962306a36Sopenharmony_ci 104062306a36Sopenharmony_ci 104162306a36Sopenharmony_ci#define AR_INTR_SYNC_CAUSE(_ah) (AR_SREV_9340(_ah) ? 0x4010 : 0x4028) 104262306a36Sopenharmony_ci#define AR_INTR_SYNC_CAUSE_CLR(_ah) (AR_SREV_9340(_ah) ? 0x4010 : 0x4028) 104362306a36Sopenharmony_ci 104462306a36Sopenharmony_ci 104562306a36Sopenharmony_ci#define AR_INTR_SYNC_ENABLE(_ah) (AR_SREV_9340(_ah) ? 0x4014 : 0x402c) 104662306a36Sopenharmony_ci#define AR_INTR_SYNC_ENABLE_GPIO 0xFFFC0000 104762306a36Sopenharmony_ci#define AR_INTR_SYNC_ENABLE_GPIO_S 18 104862306a36Sopenharmony_ci 104962306a36Sopenharmony_cienum { 105062306a36Sopenharmony_ci AR_INTR_SYNC_RTC_IRQ = 0x00000001, 105162306a36Sopenharmony_ci AR_INTR_SYNC_MAC_IRQ = 0x00000002, 105262306a36Sopenharmony_ci AR_INTR_SYNC_EEPROM_ILLEGAL_ACCESS = 0x00000004, 105362306a36Sopenharmony_ci AR_INTR_SYNC_APB_TIMEOUT = 0x00000008, 105462306a36Sopenharmony_ci AR_INTR_SYNC_PCI_MODE_CONFLICT = 0x00000010, 105562306a36Sopenharmony_ci AR_INTR_SYNC_HOST1_FATAL = 0x00000020, 105662306a36Sopenharmony_ci AR_INTR_SYNC_HOST1_PERR = 0x00000040, 105762306a36Sopenharmony_ci AR_INTR_SYNC_TRCV_FIFO_PERR = 0x00000080, 105862306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_EP = 0x00000100, 105962306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_DLLP_ABORT = 0x00000200, 106062306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_TLP_ABORT = 0x00000400, 106162306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_ECRC_ERR = 0x00000800, 106262306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_TIMEOUT = 0x00001000, 106362306a36Sopenharmony_ci AR_INTR_SYNC_LOCAL_TIMEOUT = 0x00002000, 106462306a36Sopenharmony_ci AR_INTR_SYNC_PM_ACCESS = 0x00004000, 106562306a36Sopenharmony_ci AR_INTR_SYNC_MAC_AWAKE = 0x00008000, 106662306a36Sopenharmony_ci AR_INTR_SYNC_MAC_ASLEEP = 0x00010000, 106762306a36Sopenharmony_ci AR_INTR_SYNC_MAC_SLEEP_ACCESS = 0x00020000, 106862306a36Sopenharmony_ci AR_INTR_SYNC_ALL = 0x0003FFFF, 106962306a36Sopenharmony_ci 107062306a36Sopenharmony_ci 107162306a36Sopenharmony_ci AR_INTR_SYNC_DEFAULT = (AR_INTR_SYNC_HOST1_FATAL | 107262306a36Sopenharmony_ci AR_INTR_SYNC_HOST1_PERR | 107362306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_EP | 107462306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_DLLP_ABORT | 107562306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_TLP_ABORT | 107662306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_ECRC_ERR | 107762306a36Sopenharmony_ci AR_INTR_SYNC_RADM_CPL_TIMEOUT | 107862306a36Sopenharmony_ci AR_INTR_SYNC_LOCAL_TIMEOUT | 107962306a36Sopenharmony_ci AR_INTR_SYNC_MAC_SLEEP_ACCESS), 108062306a36Sopenharmony_ci 108162306a36Sopenharmony_ci AR9340_INTR_SYNC_LOCAL_TIMEOUT = 0x00000010, 108262306a36Sopenharmony_ci 108362306a36Sopenharmony_ci AR_INTR_SYNC_SPURIOUS = 0xFFFFFFFF, 108462306a36Sopenharmony_ci 108562306a36Sopenharmony_ci}; 108662306a36Sopenharmony_ci 108762306a36Sopenharmony_ci#define AR_INTR_ASYNC_MASK(_ah) (AR_SREV_9340(_ah) ? 0x4018 : 0x4030) 108862306a36Sopenharmony_ci#define AR_INTR_ASYNC_MASK_GPIO 0xFFFC0000 108962306a36Sopenharmony_ci#define AR_INTR_ASYNC_MASK_GPIO_S 18 109062306a36Sopenharmony_ci#define AR_INTR_ASYNC_MASK_MCI 0x00000080 109162306a36Sopenharmony_ci#define AR_INTR_ASYNC_MASK_MCI_S 7 109262306a36Sopenharmony_ci 109362306a36Sopenharmony_ci#define AR_INTR_SYNC_MASK(_ah) (AR_SREV_9340(_ah) ? 0x401c : 0x4034) 109462306a36Sopenharmony_ci#define AR_INTR_SYNC_MASK_GPIO 0xFFFC0000 109562306a36Sopenharmony_ci#define AR_INTR_SYNC_MASK_GPIO_S 18 109662306a36Sopenharmony_ci 109762306a36Sopenharmony_ci#define AR_INTR_ASYNC_CAUSE_CLR(_ah) (AR_SREV_9340(_ah) ? 0x4020 : 0x4038) 109862306a36Sopenharmony_ci#define AR_INTR_ASYNC_CAUSE(_ah) (AR_SREV_9340(_ah) ? 0x4020 : 0x4038) 109962306a36Sopenharmony_ci#define AR_INTR_ASYNC_CAUSE_MCI 0x00000080 110062306a36Sopenharmony_ci#define AR_INTR_ASYNC_USED (AR_INTR_MAC_IRQ | \ 110162306a36Sopenharmony_ci AR_INTR_ASYNC_CAUSE_MCI) 110262306a36Sopenharmony_ci 110362306a36Sopenharmony_ci/* Asynchronous Interrupt Enable Register */ 110462306a36Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE_MCI 0x00000080 110562306a36Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE_MCI_S 7 110662306a36Sopenharmony_ci 110762306a36Sopenharmony_ci 110862306a36Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE(_ah) (AR_SREV_9340(_ah) ? 0x4024 : 0x403c) 110962306a36Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE_GPIO 0xFFFC0000 111062306a36Sopenharmony_ci#define AR_INTR_ASYNC_ENABLE_GPIO_S 18 111162306a36Sopenharmony_ci 111262306a36Sopenharmony_ci#define AR_PCIE_SERDES 0x4040 111362306a36Sopenharmony_ci#define AR_PCIE_SERDES2 0x4044 111462306a36Sopenharmony_ci#define AR_PCIE_PM_CTRL(_ah) (AR_SREV_9340(_ah) ? 0x4004 : 0x4014) 111562306a36Sopenharmony_ci#define AR_PCIE_PM_CTRL_ENA 0x00080000 111662306a36Sopenharmony_ci 111762306a36Sopenharmony_ci#define AR_PCIE_PHY_REG3 0x18c08 111862306a36Sopenharmony_ci 111962306a36Sopenharmony_ci/* Define correct GPIO numbers and MASK bits to indicate the WMAC 112062306a36Sopenharmony_ci * GPIO resource. 112162306a36Sopenharmony_ci * Allow SOC chips(AR9340, AR9531, AR9550, AR9561) to access all GPIOs 112262306a36Sopenharmony_ci * which rely on gpiolib framework. But restrict SOC AR9330 only to 112362306a36Sopenharmony_ci * access WMAC GPIO which has the same design with the old chips. 112462306a36Sopenharmony_ci */ 112562306a36Sopenharmony_ci#define AR_NUM_GPIO 14 112662306a36Sopenharmony_ci#define AR9280_NUM_GPIO 10 112762306a36Sopenharmony_ci#define AR9285_NUM_GPIO 12 112862306a36Sopenharmony_ci#define AR9287_NUM_GPIO 10 112962306a36Sopenharmony_ci#define AR9271_NUM_GPIO 16 113062306a36Sopenharmony_ci#define AR9300_NUM_GPIO 16 113162306a36Sopenharmony_ci#define AR9330_NUM_GPIO 16 113262306a36Sopenharmony_ci#define AR9340_NUM_GPIO 23 113362306a36Sopenharmony_ci#define AR9462_NUM_GPIO 14 113462306a36Sopenharmony_ci#define AR9485_NUM_GPIO 12 113562306a36Sopenharmony_ci#define AR9531_NUM_GPIO 18 113662306a36Sopenharmony_ci#define AR9550_NUM_GPIO 24 113762306a36Sopenharmony_ci#define AR9561_NUM_GPIO 23 113862306a36Sopenharmony_ci#define AR9565_NUM_GPIO 14 113962306a36Sopenharmony_ci#define AR9580_NUM_GPIO 16 114062306a36Sopenharmony_ci#define AR7010_NUM_GPIO 16 114162306a36Sopenharmony_ci 114262306a36Sopenharmony_ci#define AR_GPIO_MASK 0x00003FFF 114362306a36Sopenharmony_ci#define AR9271_GPIO_MASK 0x0000FFFF 114462306a36Sopenharmony_ci#define AR9280_GPIO_MASK 0x000003FF 114562306a36Sopenharmony_ci#define AR9285_GPIO_MASK 0x00000FFF 114662306a36Sopenharmony_ci#define AR9287_GPIO_MASK 0x000003FF 114762306a36Sopenharmony_ci#define AR9300_GPIO_MASK 0x0000F4FF 114862306a36Sopenharmony_ci#define AR9330_GPIO_MASK 0x0000F4FF 114962306a36Sopenharmony_ci#define AR9340_GPIO_MASK 0x0000000F 115062306a36Sopenharmony_ci#define AR9462_GPIO_MASK 0x00003FFF 115162306a36Sopenharmony_ci#define AR9485_GPIO_MASK 0x00000FFF 115262306a36Sopenharmony_ci#define AR9531_GPIO_MASK 0x0000000F 115362306a36Sopenharmony_ci#define AR9550_GPIO_MASK 0x0000000F 115462306a36Sopenharmony_ci#define AR9561_GPIO_MASK 0x0000000F 115562306a36Sopenharmony_ci#define AR9565_GPIO_MASK 0x00003FFF 115662306a36Sopenharmony_ci#define AR9580_GPIO_MASK 0x0000F4FF 115762306a36Sopenharmony_ci#define AR7010_GPIO_MASK 0x0000FFFF 115862306a36Sopenharmony_ci 115962306a36Sopenharmony_ci#define AR_GPIO_IN_OUT(_ah) (AR_SREV_9340(_ah) ? 0x4028 : 0x4048) 116062306a36Sopenharmony_ci#define AR_GPIO_IN_VAL 0x0FFFC000 116162306a36Sopenharmony_ci#define AR_GPIO_IN_VAL_S 14 116262306a36Sopenharmony_ci#define AR928X_GPIO_IN_VAL 0x000FFC00 116362306a36Sopenharmony_ci#define AR928X_GPIO_IN_VAL_S 10 116462306a36Sopenharmony_ci#define AR9285_GPIO_IN_VAL 0x00FFF000 116562306a36Sopenharmony_ci#define AR9285_GPIO_IN_VAL_S 12 116662306a36Sopenharmony_ci#define AR9287_GPIO_IN_VAL 0x003FF800 116762306a36Sopenharmony_ci#define AR9287_GPIO_IN_VAL_S 11 116862306a36Sopenharmony_ci#define AR9271_GPIO_IN_VAL 0xFFFF0000 116962306a36Sopenharmony_ci#define AR9271_GPIO_IN_VAL_S 16 117062306a36Sopenharmony_ci#define AR7010_GPIO_IN_VAL 0x0000FFFF 117162306a36Sopenharmony_ci#define AR7010_GPIO_IN_VAL_S 0 117262306a36Sopenharmony_ci 117362306a36Sopenharmony_ci#define AR_GPIO_IN(_ah) (AR_SREV_9340(_ah) ? 0x402c : 0x404c) 117462306a36Sopenharmony_ci#define AR9300_GPIO_IN_VAL 0x0001FFFF 117562306a36Sopenharmony_ci#define AR9300_GPIO_IN_VAL_S 0 117662306a36Sopenharmony_ci 117762306a36Sopenharmony_ci#define AR_GPIO_OE_OUT(_ah) (AR_SREV_9340(_ah) ? 0x4030 : \ 117862306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4050 : 0x404c)) 117962306a36Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV 0x3 118062306a36Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV_NO 0x0 118162306a36Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV_LOW 0x1 118262306a36Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV_HI 0x2 118362306a36Sopenharmony_ci#define AR_GPIO_OE_OUT_DRV_ALL 0x3 118462306a36Sopenharmony_ci 118562306a36Sopenharmony_ci#define AR7010_GPIO_OE 0x52000 118662306a36Sopenharmony_ci#define AR7010_GPIO_OE_MASK 0x1 118762306a36Sopenharmony_ci#define AR7010_GPIO_OE_AS_OUTPUT 0x0 118862306a36Sopenharmony_ci#define AR7010_GPIO_OE_AS_INPUT 0x1 118962306a36Sopenharmony_ci#define AR7010_GPIO_IN 0x52004 119062306a36Sopenharmony_ci#define AR7010_GPIO_OUT 0x52008 119162306a36Sopenharmony_ci#define AR7010_GPIO_SET 0x5200C 119262306a36Sopenharmony_ci#define AR7010_GPIO_CLEAR 0x52010 119362306a36Sopenharmony_ci#define AR7010_GPIO_INT 0x52014 119462306a36Sopenharmony_ci#define AR7010_GPIO_INT_TYPE 0x52018 119562306a36Sopenharmony_ci#define AR7010_GPIO_INT_POLARITY 0x5201C 119662306a36Sopenharmony_ci#define AR7010_GPIO_PENDING 0x52020 119762306a36Sopenharmony_ci#define AR7010_GPIO_INT_MASK 0x52024 119862306a36Sopenharmony_ci#define AR7010_GPIO_FUNCTION 0x52028 119962306a36Sopenharmony_ci 120062306a36Sopenharmony_ci#define AR_GPIO_INTR_POL(_ah) (AR_SREV_9340(_ah) ? 0x4038 : \ 120162306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4058 : 0x4050)) 120262306a36Sopenharmony_ci#define AR_GPIO_INTR_POL_VAL 0x0001FFFF 120362306a36Sopenharmony_ci#define AR_GPIO_INTR_POL_VAL_S 0 120462306a36Sopenharmony_ci 120562306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL(_ah) (AR_SREV_9340(_ah) ? 0x403c : \ 120662306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x405c : 0x4054)) 120762306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF 0x00000004 120862306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_S 2 120962306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_FREQUENCY_DEF 0x00000008 121062306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_FREQUENCY_S 3 121162306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_DEF 0x00000010 121262306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_S 4 121362306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_RFSILENT_DEF 0x00000080 121462306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_RFSILENT_DEF_S 7 121562306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB 0x00000400 121662306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB_S 10 121762306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB 0x00001000 121862306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB_S 12 121962306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_RFSILENT_BB 0x00008000 122062306a36Sopenharmony_ci#define AR_GPIO_INPUT_EN_VAL_RFSILENT_BB_S 15 122162306a36Sopenharmony_ci#define AR_GPIO_RTC_RESET_OVERRIDE_ENABLE 0x00010000 122262306a36Sopenharmony_ci#define AR_GPIO_JTAG_DISABLE 0x00020000 122362306a36Sopenharmony_ci 122462306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX1(_ah) (AR_SREV_9340(_ah) ? 0x4040 : \ 122562306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4060 : 0x4058)) 122662306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX1_BT_ACTIVE 0x000f0000 122762306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX1_BT_ACTIVE_S 16 122862306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX1_BT_PRIORITY 0x00000f00 122962306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX1_BT_PRIORITY_S 8 123062306a36Sopenharmony_ci 123162306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX2(_ah) (AR_SREV_9340(_ah) ? 0x4044 : \ 123262306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4064 : 0x405c)) 123362306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_CLK25 0x0000000f 123462306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_CLK25_S 0 123562306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_RFSILENT 0x000000f0 123662306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_RFSILENT_S 4 123762306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_RTC_RESET 0x00000f00 123862306a36Sopenharmony_ci#define AR_GPIO_INPUT_MUX2_RTC_RESET_S 8 123962306a36Sopenharmony_ci 124062306a36Sopenharmony_ci#define AR_GPIO_OUTPUT_MUX1(_ah) (AR_SREV_9340(_ah) ? 0x4048 : \ 124162306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4068 : 0x4060)) 124262306a36Sopenharmony_ci#define AR_GPIO_OUTPUT_MUX2(_ah) (AR_SREV_9340(_ah) ? 0x404c : \ 124362306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x406c : 0x4064)) 124462306a36Sopenharmony_ci#define AR_GPIO_OUTPUT_MUX3(_ah) (AR_SREV_9340(_ah) ? 0x4050 : \ 124562306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4070 : 0x4068)) 124662306a36Sopenharmony_ci 124762306a36Sopenharmony_ci#define AR_INPUT_STATE(_ah) (AR_SREV_9340(_ah) ? 0x4054 : \ 124862306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4074 : 0x406c)) 124962306a36Sopenharmony_ci 125062306a36Sopenharmony_ci#define AR_EEPROM_STATUS_DATA(_ah) (AR_SREV_9340(_ah) ? 0x40c8 : \ 125162306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4084 : 0x407c)) 125262306a36Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_VAL 0x0000ffff 125362306a36Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_VAL_S 0 125462306a36Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_BUSY 0x00010000 125562306a36Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_BUSY_ACCESS 0x00020000 125662306a36Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_PROT_ACCESS 0x00040000 125762306a36Sopenharmony_ci#define AR_EEPROM_STATUS_DATA_ABSENT_ACCESS 0x00080000 125862306a36Sopenharmony_ci 125962306a36Sopenharmony_ci#define AR_OBS(_ah) (AR_SREV_9340(_ah) ? 0x405c : \ 126062306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4088 : 0x4080)) 126162306a36Sopenharmony_ci 126262306a36Sopenharmony_ci#define AR_GPIO_PDPU(_ah) (AR_SREV_9300_20_OR_LATER(_ah) ? 0x4090 : 0x4088) 126362306a36Sopenharmony_ci 126462306a36Sopenharmony_ci#define AR_PCIE_MSI(_ah) (AR_SREV_9340(_ah) ? 0x40d8 : \ 126562306a36Sopenharmony_ci (AR_SREV_9300_20_OR_LATER(_ah) ? 0x40a4 : 0x4094)) 126662306a36Sopenharmony_ci#define AR_PCIE_MSI_ENABLE 0x00000001 126762306a36Sopenharmony_ci#define AR_PCIE_MSI_HW_DBI_WR_EN 0x02000000 126862306a36Sopenharmony_ci#define AR_PCIE_MSI_HW_INT_PENDING_ADDR 0xFFA0C1FF /* bits 8..11: value must be 0x5060 */ 126962306a36Sopenharmony_ci#define AR_PCIE_MSI_HW_INT_PENDING_ADDR_MSI_64 0xFFA0C9FF /* bits 8..11: value must be 0x5064 */ 127062306a36Sopenharmony_ci 127162306a36Sopenharmony_ci#define AR_INTR_PRIO_TX 0x00000001 127262306a36Sopenharmony_ci#define AR_INTR_PRIO_RXLP 0x00000002 127362306a36Sopenharmony_ci#define AR_INTR_PRIO_RXHP 0x00000004 127462306a36Sopenharmony_ci 127562306a36Sopenharmony_ci#define AR_INTR_PRIO_SYNC_ENABLE(_ah) (AR_SREV_9340(_ah) ? 0x4088 : 0x40c4) 127662306a36Sopenharmony_ci#define AR_INTR_PRIO_ASYNC_MASK(_ah) (AR_SREV_9340(_ah) ? 0x408c : 0x40c8) 127762306a36Sopenharmony_ci#define AR_INTR_PRIO_SYNC_MASK(_ah) (AR_SREV_9340(_ah) ? 0x4090 : 0x40cc) 127862306a36Sopenharmony_ci#define AR_INTR_PRIO_ASYNC_ENABLE(_ah) (AR_SREV_9340(_ah) ? 0x4094 : 0x40d4) 127962306a36Sopenharmony_ci#define AR_ENT_OTP 0x40d8 128062306a36Sopenharmony_ci#define AR_ENT_OTP_CHAIN2_DISABLE 0x00020000 128162306a36Sopenharmony_ci#define AR_ENT_OTP_49GHZ_DISABLE 0x00100000 128262306a36Sopenharmony_ci#define AR_ENT_OTP_MIN_PKT_SIZE_DISABLE 0x00800000 128362306a36Sopenharmony_ci 128462306a36Sopenharmony_ci#define AR_CH0_BB_DPLL1 0x16180 128562306a36Sopenharmony_ci#define AR_CH0_BB_DPLL1_REFDIV 0xF8000000 128662306a36Sopenharmony_ci#define AR_CH0_BB_DPLL1_REFDIV_S 27 128762306a36Sopenharmony_ci#define AR_CH0_BB_DPLL1_NINI 0x07FC0000 128862306a36Sopenharmony_ci#define AR_CH0_BB_DPLL1_NINI_S 18 128962306a36Sopenharmony_ci#define AR_CH0_BB_DPLL1_NFRAC 0x0003FFFF 129062306a36Sopenharmony_ci#define AR_CH0_BB_DPLL1_NFRAC_S 0 129162306a36Sopenharmony_ci 129262306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2 0x16184 129362306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2_LOCAL_PLL 0x40000000 129462306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2_LOCAL_PLL_S 30 129562306a36Sopenharmony_ci#define AR_CH0_DPLL2_KI 0x3C000000 129662306a36Sopenharmony_ci#define AR_CH0_DPLL2_KI_S 26 129762306a36Sopenharmony_ci#define AR_CH0_DPLL2_KD 0x03F80000 129862306a36Sopenharmony_ci#define AR_CH0_DPLL2_KD_S 19 129962306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2_EN_NEGTRIG 0x00040000 130062306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2_EN_NEGTRIG_S 18 130162306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2_PLL_PWD 0x00010000 130262306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2_PLL_PWD_S 16 130362306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2_OUTDIV 0x0000E000 130462306a36Sopenharmony_ci#define AR_CH0_BB_DPLL2_OUTDIV_S 13 130562306a36Sopenharmony_ci 130662306a36Sopenharmony_ci#define AR_CH0_BB_DPLL3 0x16188 130762306a36Sopenharmony_ci#define AR_CH0_BB_DPLL3_PHASE_SHIFT 0x3F800000 130862306a36Sopenharmony_ci#define AR_CH0_BB_DPLL3_PHASE_SHIFT_S 23 130962306a36Sopenharmony_ci 131062306a36Sopenharmony_ci#define AR_CH0_DDR_DPLL2 0x16244 131162306a36Sopenharmony_ci#define AR_CH0_DDR_DPLL3 0x16248 131262306a36Sopenharmony_ci#define AR_CH0_DPLL3_PHASE_SHIFT 0x3F800000 131362306a36Sopenharmony_ci#define AR_CH0_DPLL3_PHASE_SHIFT_S 23 131462306a36Sopenharmony_ci#define AR_PHY_CCA_NOM_VAL_2GHZ -118 131562306a36Sopenharmony_ci 131662306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_DIV_INT 0x0000003f 131762306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_DIV_INT_S 0 131862306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_DIV_FRAC 0x000fffc0 131962306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_DIV_FRAC_S 6 132062306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_REFDIV 0x01f00000 132162306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_REFDIV_S 20 132262306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_CLKSEL 0x06000000 132362306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_CLKSEL_S 25 132462306a36Sopenharmony_ci#define AR_RTC_9300_SOC_PLL_BYPASS 0x08000000 132562306a36Sopenharmony_ci 132662306a36Sopenharmony_ci#define AR_RTC_9300_PLL_DIV 0x000003ff 132762306a36Sopenharmony_ci#define AR_RTC_9300_PLL_DIV_S 0 132862306a36Sopenharmony_ci#define AR_RTC_9300_PLL_REFDIV 0x00003C00 132962306a36Sopenharmony_ci#define AR_RTC_9300_PLL_REFDIV_S 10 133062306a36Sopenharmony_ci#define AR_RTC_9300_PLL_CLKSEL 0x0000C000 133162306a36Sopenharmony_ci#define AR_RTC_9300_PLL_CLKSEL_S 14 133262306a36Sopenharmony_ci#define AR_RTC_9300_PLL_BYPASS 0x00010000 133362306a36Sopenharmony_ci 133462306a36Sopenharmony_ci#define AR_RTC_9160_PLL_DIV 0x000003ff 133562306a36Sopenharmony_ci#define AR_RTC_9160_PLL_DIV_S 0 133662306a36Sopenharmony_ci#define AR_RTC_9160_PLL_REFDIV 0x00003C00 133762306a36Sopenharmony_ci#define AR_RTC_9160_PLL_REFDIV_S 10 133862306a36Sopenharmony_ci#define AR_RTC_9160_PLL_CLKSEL 0x0000C000 133962306a36Sopenharmony_ci#define AR_RTC_9160_PLL_CLKSEL_S 14 134062306a36Sopenharmony_ci 134162306a36Sopenharmony_ci#define AR_RTC_BASE 0x00020000 134262306a36Sopenharmony_ci#define AR_RTC_RC(_ah) \ 134362306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x0000) : 0x7000) 134462306a36Sopenharmony_ci#define AR_RTC_RC_M 0x00000003 134562306a36Sopenharmony_ci#define AR_RTC_RC_MAC_WARM 0x00000001 134662306a36Sopenharmony_ci#define AR_RTC_RC_MAC_COLD 0x00000002 134762306a36Sopenharmony_ci#define AR_RTC_RC_COLD_RESET 0x00000004 134862306a36Sopenharmony_ci#define AR_RTC_RC_WARM_RESET 0x00000008 134962306a36Sopenharmony_ci 135062306a36Sopenharmony_ci/* Crystal Control */ 135162306a36Sopenharmony_ci#define AR_RTC_XTAL_CONTROL 0x7004 135262306a36Sopenharmony_ci 135362306a36Sopenharmony_ci/* Reg Control 0 */ 135462306a36Sopenharmony_ci#define AR_RTC_REG_CONTROL0 0x7008 135562306a36Sopenharmony_ci 135662306a36Sopenharmony_ci/* Reg Control 1 */ 135762306a36Sopenharmony_ci#define AR_RTC_REG_CONTROL1 0x700c 135862306a36Sopenharmony_ci#define AR_RTC_REG_CONTROL1_SWREG_PROGRAM 0x00000001 135962306a36Sopenharmony_ci 136062306a36Sopenharmony_ci#define AR_RTC_PLL_CONTROL(_ah) \ 136162306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x0014) : 0x7014) 136262306a36Sopenharmony_ci 136362306a36Sopenharmony_ci#define AR_RTC_PLL_CONTROL2 0x703c 136462306a36Sopenharmony_ci 136562306a36Sopenharmony_ci#define AR_RTC_PLL_DIV 0x0000001f 136662306a36Sopenharmony_ci#define AR_RTC_PLL_DIV_S 0 136762306a36Sopenharmony_ci#define AR_RTC_PLL_DIV2 0x00000020 136862306a36Sopenharmony_ci#define AR_RTC_PLL_REFDIV_5 0x000000c0 136962306a36Sopenharmony_ci#define AR_RTC_PLL_CLKSEL 0x00000300 137062306a36Sopenharmony_ci#define AR_RTC_PLL_CLKSEL_S 8 137162306a36Sopenharmony_ci#define AR_RTC_PLL_BYPASS 0x00010000 137262306a36Sopenharmony_ci#define AR_RTC_PLL_NOPWD 0x00040000 137362306a36Sopenharmony_ci#define AR_RTC_PLL_NOPWD_S 18 137462306a36Sopenharmony_ci 137562306a36Sopenharmony_ci#define PLL3 0x16188 137662306a36Sopenharmony_ci#define PLL3_DO_MEAS_MASK 0x40000000 137762306a36Sopenharmony_ci#define PLL4 0x1618c 137862306a36Sopenharmony_ci#define PLL4_MEAS_DONE 0x8 137962306a36Sopenharmony_ci#define SQSUM_DVC_MASK 0x007ffff8 138062306a36Sopenharmony_ci 138162306a36Sopenharmony_ci#define AR_RTC_RESET(_ah) \ 138262306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x0040) : 0x7040) 138362306a36Sopenharmony_ci#define AR_RTC_RESET_EN (0x00000001) 138462306a36Sopenharmony_ci 138562306a36Sopenharmony_ci#define AR_RTC_STATUS(_ah) \ 138662306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x0044) : 0x7044) 138762306a36Sopenharmony_ci 138862306a36Sopenharmony_ci#define AR_RTC_STATUS_M(_ah) \ 138962306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? 0x0000003f : 0x0000000f) 139062306a36Sopenharmony_ci 139162306a36Sopenharmony_ci#define AR_RTC_PM_STATUS_M 0x0000000f 139262306a36Sopenharmony_ci 139362306a36Sopenharmony_ci#define AR_RTC_STATUS_SHUTDOWN 0x00000001 139462306a36Sopenharmony_ci#define AR_RTC_STATUS_ON 0x00000002 139562306a36Sopenharmony_ci#define AR_RTC_STATUS_SLEEP 0x00000004 139662306a36Sopenharmony_ci#define AR_RTC_STATUS_WAKEUP 0x00000008 139762306a36Sopenharmony_ci 139862306a36Sopenharmony_ci#define AR_RTC_SLEEP_CLK(_ah) \ 139962306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x0048) : 0x7048) 140062306a36Sopenharmony_ci#define AR_RTC_FORCE_DERIVED_CLK 0x2 140162306a36Sopenharmony_ci#define AR_RTC_FORCE_SWREG_PRD 0x00000004 140262306a36Sopenharmony_ci 140362306a36Sopenharmony_ci#define AR_RTC_FORCE_WAKE(_ah) \ 140462306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x004c) : 0x704c) 140562306a36Sopenharmony_ci#define AR_RTC_FORCE_WAKE_EN 0x00000001 140662306a36Sopenharmony_ci#define AR_RTC_FORCE_WAKE_ON_INT 0x00000002 140762306a36Sopenharmony_ci 140862306a36Sopenharmony_ci 140962306a36Sopenharmony_ci#define AR_RTC_INTR_CAUSE(_ah) \ 141062306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x0050) : 0x7050) 141162306a36Sopenharmony_ci 141262306a36Sopenharmony_ci#define AR_RTC_INTR_ENABLE(_ah) \ 141362306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x0054) : 0x7054) 141462306a36Sopenharmony_ci 141562306a36Sopenharmony_ci#define AR_RTC_INTR_MASK(_ah) \ 141662306a36Sopenharmony_ci ((AR_SREV_9100(_ah)) ? (AR_RTC_BASE + 0x0058) : 0x7058) 141762306a36Sopenharmony_ci 141862306a36Sopenharmony_ci#define AR_RTC_KEEP_AWAKE 0x7034 141962306a36Sopenharmony_ci 142062306a36Sopenharmony_ci/* RTC_DERIVED_* - only for AR9100 */ 142162306a36Sopenharmony_ci 142262306a36Sopenharmony_ci#define AR_RTC_DERIVED_CLK(_ah) \ 142362306a36Sopenharmony_ci (AR_SREV_9100(_ah) ? (AR_RTC_BASE + 0x0038) : 0x7038) 142462306a36Sopenharmony_ci#define AR_RTC_DERIVED_CLK_PERIOD 0x0000fffe 142562306a36Sopenharmony_ci#define AR_RTC_DERIVED_CLK_PERIOD_S 1 142662306a36Sopenharmony_ci 142762306a36Sopenharmony_ci#define AR_SEQ_MASK 0x8060 142862306a36Sopenharmony_ci 142962306a36Sopenharmony_ci#define AR_AN_RF2G1_CH0 0x7810 143062306a36Sopenharmony_ci#define AR_AN_RF2G1_CH0_OB 0x03800000 143162306a36Sopenharmony_ci#define AR_AN_RF2G1_CH0_OB_S 23 143262306a36Sopenharmony_ci#define AR_AN_RF2G1_CH0_DB 0x1C000000 143362306a36Sopenharmony_ci#define AR_AN_RF2G1_CH0_DB_S 26 143462306a36Sopenharmony_ci 143562306a36Sopenharmony_ci#define AR_AN_RF5G1_CH0 0x7818 143662306a36Sopenharmony_ci#define AR_AN_RF5G1_CH0_OB5 0x00070000 143762306a36Sopenharmony_ci#define AR_AN_RF5G1_CH0_OB5_S 16 143862306a36Sopenharmony_ci#define AR_AN_RF5G1_CH0_DB5 0x00380000 143962306a36Sopenharmony_ci#define AR_AN_RF5G1_CH0_DB5_S 19 144062306a36Sopenharmony_ci 144162306a36Sopenharmony_ci#define AR_AN_RF2G1_CH1 0x7834 144262306a36Sopenharmony_ci#define AR_AN_RF2G1_CH1_OB 0x03800000 144362306a36Sopenharmony_ci#define AR_AN_RF2G1_CH1_OB_S 23 144462306a36Sopenharmony_ci#define AR_AN_RF2G1_CH1_DB 0x1C000000 144562306a36Sopenharmony_ci#define AR_AN_RF2G1_CH1_DB_S 26 144662306a36Sopenharmony_ci 144762306a36Sopenharmony_ci#define AR_AN_RF5G1_CH1 0x783C 144862306a36Sopenharmony_ci#define AR_AN_RF5G1_CH1_OB5 0x00070000 144962306a36Sopenharmony_ci#define AR_AN_RF5G1_CH1_OB5_S 16 145062306a36Sopenharmony_ci#define AR_AN_RF5G1_CH1_DB5 0x00380000 145162306a36Sopenharmony_ci#define AR_AN_RF5G1_CH1_DB5_S 19 145262306a36Sopenharmony_ci 145362306a36Sopenharmony_ci#define AR_AN_TOP1 0x7890 145462306a36Sopenharmony_ci#define AR_AN_TOP1_DACIPMODE 0x00040000 145562306a36Sopenharmony_ci#define AR_AN_TOP1_DACIPMODE_S 18 145662306a36Sopenharmony_ci 145762306a36Sopenharmony_ci#define AR_AN_TOP2 0x7894 145862306a36Sopenharmony_ci#define AR_AN_TOP2_XPABIAS_LVL 0xC0000000 145962306a36Sopenharmony_ci#define AR_AN_TOP2_XPABIAS_LVL_S 30 146062306a36Sopenharmony_ci#define AR_AN_TOP2_LOCALBIAS 0x00200000 146162306a36Sopenharmony_ci#define AR_AN_TOP2_LOCALBIAS_S 21 146262306a36Sopenharmony_ci#define AR_AN_TOP2_PWDCLKIND 0x00400000 146362306a36Sopenharmony_ci#define AR_AN_TOP2_PWDCLKIND_S 22 146462306a36Sopenharmony_ci 146562306a36Sopenharmony_ci#define AR_AN_SYNTH9 0x7868 146662306a36Sopenharmony_ci#define AR_AN_SYNTH9_REFDIVA 0xf8000000 146762306a36Sopenharmony_ci#define AR_AN_SYNTH9_REFDIVA_S 27 146862306a36Sopenharmony_ci 146962306a36Sopenharmony_ci#define AR9285_AN_RF2G1 0x7820 147062306a36Sopenharmony_ci#define AR9285_AN_RF2G1_ENPACAL 0x00000800 147162306a36Sopenharmony_ci#define AR9285_AN_RF2G1_ENPACAL_S 11 147262306a36Sopenharmony_ci#define AR9285_AN_RF2G1_PDPADRV1 0x02000000 147362306a36Sopenharmony_ci#define AR9285_AN_RF2G1_PDPADRV1_S 25 147462306a36Sopenharmony_ci#define AR9285_AN_RF2G1_PDPADRV2 0x01000000 147562306a36Sopenharmony_ci#define AR9285_AN_RF2G1_PDPADRV2_S 24 147662306a36Sopenharmony_ci#define AR9285_AN_RF2G1_PDPAOUT 0x00800000 147762306a36Sopenharmony_ci#define AR9285_AN_RF2G1_PDPAOUT_S 23 147862306a36Sopenharmony_ci 147962306a36Sopenharmony_ci 148062306a36Sopenharmony_ci#define AR9285_AN_RF2G2 0x7824 148162306a36Sopenharmony_ci#define AR9285_AN_RF2G2_OFFCAL 0x00001000 148262306a36Sopenharmony_ci#define AR9285_AN_RF2G2_OFFCAL_S 12 148362306a36Sopenharmony_ci 148462306a36Sopenharmony_ci#define AR9285_AN_RF2G3 0x7828 148562306a36Sopenharmony_ci#define AR9285_AN_RF2G3_PDVCCOMP 0x02000000 148662306a36Sopenharmony_ci#define AR9285_AN_RF2G3_PDVCCOMP_S 25 148762306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_0 0x00E00000 148862306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_0_S 21 148962306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_1 0x001C0000 149062306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_1_S 18 149162306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_2 0x00038000 149262306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_2_S 15 149362306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_3 0x00007000 149462306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_3_S 12 149562306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_4 0x00000E00 149662306a36Sopenharmony_ci#define AR9285_AN_RF2G3_OB_4_S 9 149762306a36Sopenharmony_ci 149862306a36Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_0 0x000001C0 149962306a36Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_0_S 6 150062306a36Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_1 0x00000038 150162306a36Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_1_S 3 150262306a36Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_2 0x00000007 150362306a36Sopenharmony_ci#define AR9285_AN_RF2G3_DB1_2_S 0 150462306a36Sopenharmony_ci#define AR9285_AN_RF2G4 0x782C 150562306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB1_3 0xE0000000 150662306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB1_3_S 29 150762306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB1_4 0x1C000000 150862306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB1_4_S 26 150962306a36Sopenharmony_ci 151062306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_0 0x03800000 151162306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_0_S 23 151262306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_1 0x00700000 151362306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_1_S 20 151462306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_2 0x000E0000 151562306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_2_S 17 151662306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_3 0x0001C000 151762306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_3_S 14 151862306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_4 0x00003800 151962306a36Sopenharmony_ci#define AR9285_AN_RF2G4_DB2_4_S 11 152062306a36Sopenharmony_ci 152162306a36Sopenharmony_ci#define AR9285_RF2G5 0x7830 152262306a36Sopenharmony_ci#define AR9285_RF2G5_IC50TX 0xfffff8ff 152362306a36Sopenharmony_ci#define AR9285_RF2G5_IC50TX_SET 0x00000400 152462306a36Sopenharmony_ci#define AR9285_RF2G5_IC50TX_XE_SET 0x00000500 152562306a36Sopenharmony_ci#define AR9285_RF2G5_IC50TX_CLEAR 0x00000700 152662306a36Sopenharmony_ci#define AR9285_RF2G5_IC50TX_CLEAR_S 8 152762306a36Sopenharmony_ci 152862306a36Sopenharmony_ci/* AR9271 : 0x7828, 0x782c different setting from AR9285 */ 152962306a36Sopenharmony_ci#define AR9271_AN_RF2G3_OB_cck 0x001C0000 153062306a36Sopenharmony_ci#define AR9271_AN_RF2G3_OB_cck_S 18 153162306a36Sopenharmony_ci#define AR9271_AN_RF2G3_OB_psk 0x00038000 153262306a36Sopenharmony_ci#define AR9271_AN_RF2G3_OB_psk_S 15 153362306a36Sopenharmony_ci#define AR9271_AN_RF2G3_OB_qam 0x00007000 153462306a36Sopenharmony_ci#define AR9271_AN_RF2G3_OB_qam_S 12 153562306a36Sopenharmony_ci 153662306a36Sopenharmony_ci#define AR9271_AN_RF2G3_DB_1 0x00E00000 153762306a36Sopenharmony_ci#define AR9271_AN_RF2G3_DB_1_S 21 153862306a36Sopenharmony_ci 153962306a36Sopenharmony_ci#define AR9271_AN_RF2G3_CCOMP 0xFFF 154062306a36Sopenharmony_ci#define AR9271_AN_RF2G3_CCOMP_S 0 154162306a36Sopenharmony_ci 154262306a36Sopenharmony_ci#define AR9271_AN_RF2G4_DB_2 0xE0000000 154362306a36Sopenharmony_ci#define AR9271_AN_RF2G4_DB_2_S 29 154462306a36Sopenharmony_ci 154562306a36Sopenharmony_ci#define AR9285_AN_RF2G6 0x7834 154662306a36Sopenharmony_ci#define AR9285_AN_RF2G6_CCOMP 0x00007800 154762306a36Sopenharmony_ci#define AR9285_AN_RF2G6_CCOMP_S 11 154862306a36Sopenharmony_ci#define AR9285_AN_RF2G6_OFFS 0x03f00000 154962306a36Sopenharmony_ci#define AR9285_AN_RF2G6_OFFS_S 20 155062306a36Sopenharmony_ci 155162306a36Sopenharmony_ci#define AR9271_AN_RF2G6_OFFS 0x07f00000 155262306a36Sopenharmony_ci#define AR9271_AN_RF2G6_OFFS_S 20 155362306a36Sopenharmony_ci 155462306a36Sopenharmony_ci#define AR9285_AN_RF2G7 0x7838 155562306a36Sopenharmony_ci#define AR9285_AN_RF2G7_PWDDB 0x00000002 155662306a36Sopenharmony_ci#define AR9285_AN_RF2G7_PWDDB_S 1 155762306a36Sopenharmony_ci#define AR9285_AN_RF2G7_PADRVGN2TAB0 0xE0000000 155862306a36Sopenharmony_ci#define AR9285_AN_RF2G7_PADRVGN2TAB0_S 29 155962306a36Sopenharmony_ci 156062306a36Sopenharmony_ci#define AR9285_AN_RF2G8 0x783C 156162306a36Sopenharmony_ci#define AR9285_AN_RF2G8_PADRVGN2TAB0 0x0001C000 156262306a36Sopenharmony_ci#define AR9285_AN_RF2G8_PADRVGN2TAB0_S 14 156362306a36Sopenharmony_ci 156462306a36Sopenharmony_ci 156562306a36Sopenharmony_ci#define AR9285_AN_RF2G9 0x7840 156662306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1 0x7854 156762306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDRXTXBB1 0x00000020 156862306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDRXTXBB1_S 5 156962306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDV2I 0x00000080 157062306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDV2I_S 7 157162306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDDACIF 0x00000100 157262306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1_PDDACIF_S 8 157362306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1_SPARE9 0x00000001 157462306a36Sopenharmony_ci#define AR9285_AN_RXTXBB1_SPARE9_S 0 157562306a36Sopenharmony_ci 157662306a36Sopenharmony_ci#define AR9285_AN_TOP2 0x7868 157762306a36Sopenharmony_ci 157862306a36Sopenharmony_ci#define AR9285_AN_TOP3 0x786c 157962306a36Sopenharmony_ci#define AR9285_AN_TOP3_XPABIAS_LVL 0x0000000C 158062306a36Sopenharmony_ci#define AR9285_AN_TOP3_XPABIAS_LVL_S 2 158162306a36Sopenharmony_ci#define AR9285_AN_TOP3_PWDDAC 0x00800000 158262306a36Sopenharmony_ci#define AR9285_AN_TOP3_PWDDAC_S 23 158362306a36Sopenharmony_ci 158462306a36Sopenharmony_ci#define AR9285_AN_TOP4 0x7870 158562306a36Sopenharmony_ci#define AR9285_AN_TOP4_DEFAULT 0x10142c00 158662306a36Sopenharmony_ci 158762306a36Sopenharmony_ci#define AR9287_AN_RF2G3_CH0 0x7808 158862306a36Sopenharmony_ci#define AR9287_AN_RF2G3_CH1 0x785c 158962306a36Sopenharmony_ci#define AR9287_AN_RF2G3_DB1 0xE0000000 159062306a36Sopenharmony_ci#define AR9287_AN_RF2G3_DB1_S 29 159162306a36Sopenharmony_ci#define AR9287_AN_RF2G3_DB2 0x1C000000 159262306a36Sopenharmony_ci#define AR9287_AN_RF2G3_DB2_S 26 159362306a36Sopenharmony_ci#define AR9287_AN_RF2G3_OB_CCK 0x03800000 159462306a36Sopenharmony_ci#define AR9287_AN_RF2G3_OB_CCK_S 23 159562306a36Sopenharmony_ci#define AR9287_AN_RF2G3_OB_PSK 0x00700000 159662306a36Sopenharmony_ci#define AR9287_AN_RF2G3_OB_PSK_S 20 159762306a36Sopenharmony_ci#define AR9287_AN_RF2G3_OB_QAM 0x000E0000 159862306a36Sopenharmony_ci#define AR9287_AN_RF2G3_OB_QAM_S 17 159962306a36Sopenharmony_ci#define AR9287_AN_RF2G3_OB_PAL_OFF 0x0001C000 160062306a36Sopenharmony_ci#define AR9287_AN_RF2G3_OB_PAL_OFF_S 14 160162306a36Sopenharmony_ci 160262306a36Sopenharmony_ci#define AR9287_AN_TXPC0 0x7898 160362306a36Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE 0x0000C000 160462306a36Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_S 14 160562306a36Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_NORMAL 0 160662306a36Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_TEST 1 160762306a36Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_TEMPSENSE 2 160862306a36Sopenharmony_ci#define AR9287_AN_TXPC0_TXPCMODE_ATBTEST 3 160962306a36Sopenharmony_ci 161062306a36Sopenharmony_ci#define AR9287_AN_TOP2 0x78b4 161162306a36Sopenharmony_ci#define AR9287_AN_TOP2_XPABIAS_LVL 0xC0000000 161262306a36Sopenharmony_ci#define AR9287_AN_TOP2_XPABIAS_LVL_S 30 161362306a36Sopenharmony_ci 161462306a36Sopenharmony_ci/* AR9271 specific stuff */ 161562306a36Sopenharmony_ci#define AR9271_RESET_POWER_DOWN_CONTROL 0x50044 161662306a36Sopenharmony_ci#define AR9271_RADIO_RF_RST 0x20 161762306a36Sopenharmony_ci#define AR9271_GATE_MAC_CTL 0x4000 161862306a36Sopenharmony_ci 161962306a36Sopenharmony_ci#define AR_STA_ID1_STA_AP 0x00010000 162062306a36Sopenharmony_ci#define AR_STA_ID1_ADHOC 0x00020000 162162306a36Sopenharmony_ci#define AR_STA_ID1_PWR_SAV 0x00040000 162262306a36Sopenharmony_ci#define AR_STA_ID1_KSRCHDIS 0x00080000 162362306a36Sopenharmony_ci#define AR_STA_ID1_PCF 0x00100000 162462306a36Sopenharmony_ci#define AR_STA_ID1_USE_DEFANT 0x00200000 162562306a36Sopenharmony_ci#define AR_STA_ID1_DEFANT_UPDATE 0x00400000 162662306a36Sopenharmony_ci#define AR_STA_ID1_AR9100_BA_FIX 0x00400000 162762306a36Sopenharmony_ci#define AR_STA_ID1_RTS_USE_DEF 0x00800000 162862306a36Sopenharmony_ci#define AR_STA_ID1_ACKCTS_6MB 0x01000000 162962306a36Sopenharmony_ci#define AR_STA_ID1_BASE_RATE_11B 0x02000000 163062306a36Sopenharmony_ci#define AR_STA_ID1_SECTOR_SELF_GEN 0x04000000 163162306a36Sopenharmony_ci#define AR_STA_ID1_CRPT_MIC_ENABLE 0x08000000 163262306a36Sopenharmony_ci#define AR_STA_ID1_KSRCH_MODE 0x10000000 163362306a36Sopenharmony_ci#define AR_STA_ID1_PRESERVE_SEQNUM 0x20000000 163462306a36Sopenharmony_ci#define AR_STA_ID1_CBCIV_ENDIAN 0x40000000 163562306a36Sopenharmony_ci#define AR_STA_ID1_MCAST_KSRCH 0x80000000 163662306a36Sopenharmony_ci 163762306a36Sopenharmony_ci#define AR_BSS_ID0 0x8008 163862306a36Sopenharmony_ci#define AR_BSS_ID1 0x800C 163962306a36Sopenharmony_ci#define AR_BSS_ID1_U16 0x0000FFFF 164062306a36Sopenharmony_ci#define AR_BSS_ID1_AID 0x07FF0000 164162306a36Sopenharmony_ci#define AR_BSS_ID1_AID_S 16 164262306a36Sopenharmony_ci 164362306a36Sopenharmony_ci#define AR_BCN_RSSI_AVE 0x8010 164462306a36Sopenharmony_ci#define AR_BCN_RSSI_AVE_MASK 0x00000FFF 164562306a36Sopenharmony_ci 164662306a36Sopenharmony_ci#define AR_TIME_OUT 0x8014 164762306a36Sopenharmony_ci#define AR_TIME_OUT_ACK 0x00003FFF 164862306a36Sopenharmony_ci#define AR_TIME_OUT_ACK_S 0 164962306a36Sopenharmony_ci#define AR_TIME_OUT_CTS 0x3FFF0000 165062306a36Sopenharmony_ci#define AR_TIME_OUT_CTS_S 16 165162306a36Sopenharmony_ci 165262306a36Sopenharmony_ci#define AR_RSSI_THR 0x8018 165362306a36Sopenharmony_ci#define AR_RSSI_THR_MASK 0x000000FF 165462306a36Sopenharmony_ci#define AR_RSSI_THR_BM_THR 0x0000FF00 165562306a36Sopenharmony_ci#define AR_RSSI_THR_BM_THR_S 8 165662306a36Sopenharmony_ci#define AR_RSSI_BCN_WEIGHT 0x1F000000 165762306a36Sopenharmony_ci#define AR_RSSI_BCN_WEIGHT_S 24 165862306a36Sopenharmony_ci#define AR_RSSI_BCN_RSSI_RST 0x20000000 165962306a36Sopenharmony_ci 166062306a36Sopenharmony_ci#define AR_USEC 0x801c 166162306a36Sopenharmony_ci#define AR_USEC_USEC 0x0000007F 166262306a36Sopenharmony_ci#define AR_USEC_TX_LAT 0x007FC000 166362306a36Sopenharmony_ci#define AR_USEC_TX_LAT_S 14 166462306a36Sopenharmony_ci#define AR_USEC_RX_LAT 0x1F800000 166562306a36Sopenharmony_ci#define AR_USEC_RX_LAT_S 23 166662306a36Sopenharmony_ci#define AR_USEC_ASYNC_FIFO 0x12E00074 166762306a36Sopenharmony_ci 166862306a36Sopenharmony_ci#define AR_RESET_TSF 0x8020 166962306a36Sopenharmony_ci#define AR_RESET_TSF_ONCE 0x01000000 167062306a36Sopenharmony_ci#define AR_RESET_TSF2_ONCE 0x02000000 167162306a36Sopenharmony_ci 167262306a36Sopenharmony_ci#define AR_MAX_CFP_DUR 0x8038 167362306a36Sopenharmony_ci#define AR_CFP_VAL 0x0000FFFF 167462306a36Sopenharmony_ci 167562306a36Sopenharmony_ci#define AR_RX_FILTER 0x803C 167662306a36Sopenharmony_ci 167762306a36Sopenharmony_ci#define AR_MCAST_FIL0 0x8040 167862306a36Sopenharmony_ci#define AR_MCAST_FIL1 0x8044 167962306a36Sopenharmony_ci 168062306a36Sopenharmony_ci/* 168162306a36Sopenharmony_ci * AR_DIAG_SW - Register which can be used for diagnostics and testing purposes. 168262306a36Sopenharmony_ci * 168362306a36Sopenharmony_ci * The force RX abort (AR_DIAG_RX_ABORT, bit 25) can be used in conjunction with 168462306a36Sopenharmony_ci * RX block (AR_DIAG_RX_DIS, bit 5) to help fast channel change to shut down 168562306a36Sopenharmony_ci * receive. The force RX abort bit will kill any frame which is currently being 168662306a36Sopenharmony_ci * transferred between the MAC and baseband. The RX block bit (AR_DIAG_RX_DIS) 168762306a36Sopenharmony_ci * will prevent any new frames from getting started. 168862306a36Sopenharmony_ci */ 168962306a36Sopenharmony_ci#define AR_DIAG_SW 0x8048 169062306a36Sopenharmony_ci#define AR_DIAG_CACHE_ACK 0x00000001 169162306a36Sopenharmony_ci#define AR_DIAG_ACK_DIS 0x00000002 169262306a36Sopenharmony_ci#define AR_DIAG_CTS_DIS 0x00000004 169362306a36Sopenharmony_ci#define AR_DIAG_ENCRYPT_DIS 0x00000008 169462306a36Sopenharmony_ci#define AR_DIAG_DECRYPT_DIS 0x00000010 169562306a36Sopenharmony_ci#define AR_DIAG_RX_DIS 0x00000020 /* RX block */ 169662306a36Sopenharmony_ci#define AR_DIAG_LOOP_BACK 0x00000040 169762306a36Sopenharmony_ci#define AR_DIAG_CORR_FCS 0x00000080 169862306a36Sopenharmony_ci#define AR_DIAG_CHAN_INFO 0x00000100 169962306a36Sopenharmony_ci#define AR_DIAG_SCRAM_SEED 0x0001FE00 170062306a36Sopenharmony_ci#define AR_DIAG_SCRAM_SEED_S 8 170162306a36Sopenharmony_ci#define AR_DIAG_FRAME_NV0 0x00020000 170262306a36Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL1 0x000C0000 170362306a36Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL1_S 18 170462306a36Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL2 0x08000000 170562306a36Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL2_S 27 170662306a36Sopenharmony_ci#define AR_DIAG_FORCE_RX_CLEAR 0x00100000 /* force rx_clear high */ 170762306a36Sopenharmony_ci#define AR_DIAG_IGNORE_VIRT_CS 0x00200000 170862306a36Sopenharmony_ci#define AR_DIAG_FORCE_CH_IDLE_HIGH 0x00400000 170962306a36Sopenharmony_ci#define AR_DIAG_EIFS_CTRL_ENA 0x00800000 171062306a36Sopenharmony_ci#define AR_DIAG_DUAL_CHAIN_INFO 0x01000000 171162306a36Sopenharmony_ci#define AR_DIAG_RX_ABORT 0x02000000 /* Force RX abort */ 171262306a36Sopenharmony_ci#define AR_DIAG_SATURATE_CYCLE_CNT 0x04000000 171362306a36Sopenharmony_ci#define AR_DIAG_OBS_PT_SEL2 0x08000000 171462306a36Sopenharmony_ci#define AR_DIAG_RX_CLEAR_CTL_LOW 0x10000000 171562306a36Sopenharmony_ci#define AR_DIAG_RX_CLEAR_EXT_LOW 0x20000000 171662306a36Sopenharmony_ci 171762306a36Sopenharmony_ci#define AR_TSF_L32 0x804c 171862306a36Sopenharmony_ci#define AR_TSF_U32 0x8050 171962306a36Sopenharmony_ci 172062306a36Sopenharmony_ci#define AR_TST_ADDAC 0x8054 172162306a36Sopenharmony_ci#define AR_DEF_ANTENNA 0x8058 172262306a36Sopenharmony_ci 172362306a36Sopenharmony_ci#define AR_AES_MUTE_MASK0 0x805c 172462306a36Sopenharmony_ci#define AR_AES_MUTE_MASK0_FC 0x0000FFFF 172562306a36Sopenharmony_ci#define AR_AES_MUTE_MASK0_QOS 0xFFFF0000 172662306a36Sopenharmony_ci#define AR_AES_MUTE_MASK0_QOS_S 16 172762306a36Sopenharmony_ci 172862306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1 0x8060 172962306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1_SEQ 0x0000FFFF 173062306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1_FC_MGMT 0xFFFF0000 173162306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1_FC_MGMT_S 16 173262306a36Sopenharmony_ci 173362306a36Sopenharmony_ci#define AR_GATED_CLKS 0x8064 173462306a36Sopenharmony_ci#define AR_GATED_CLKS_TX 0x00000002 173562306a36Sopenharmony_ci#define AR_GATED_CLKS_RX 0x00000004 173662306a36Sopenharmony_ci#define AR_GATED_CLKS_REG 0x00000008 173762306a36Sopenharmony_ci 173862306a36Sopenharmony_ci#define AR_OBS_BUS_CTRL 0x8068 173962306a36Sopenharmony_ci#define AR_OBS_BUS_SEL_1 0x00040000 174062306a36Sopenharmony_ci#define AR_OBS_BUS_SEL_2 0x00080000 174162306a36Sopenharmony_ci#define AR_OBS_BUS_SEL_3 0x000C0000 174262306a36Sopenharmony_ci#define AR_OBS_BUS_SEL_4 0x08040000 174362306a36Sopenharmony_ci#define AR_OBS_BUS_SEL_5 0x08080000 174462306a36Sopenharmony_ci 174562306a36Sopenharmony_ci#define AR_OBS_BUS_1 0x806c 174662306a36Sopenharmony_ci#define AR_OBS_BUS_1_PCU 0x00000001 174762306a36Sopenharmony_ci#define AR_OBS_BUS_1_RX_END 0x00000002 174862306a36Sopenharmony_ci#define AR_OBS_BUS_1_RX_WEP 0x00000004 174962306a36Sopenharmony_ci#define AR_OBS_BUS_1_RX_BEACON 0x00000008 175062306a36Sopenharmony_ci#define AR_OBS_BUS_1_RX_FILTER 0x00000010 175162306a36Sopenharmony_ci#define AR_OBS_BUS_1_TX_HCF 0x00000020 175262306a36Sopenharmony_ci#define AR_OBS_BUS_1_QUIET_TIME 0x00000040 175362306a36Sopenharmony_ci#define AR_OBS_BUS_1_CHAN_IDLE 0x00000080 175462306a36Sopenharmony_ci#define AR_OBS_BUS_1_TX_HOLD 0x00000100 175562306a36Sopenharmony_ci#define AR_OBS_BUS_1_TX_FRAME 0x00000200 175662306a36Sopenharmony_ci#define AR_OBS_BUS_1_RX_FRAME 0x00000400 175762306a36Sopenharmony_ci#define AR_OBS_BUS_1_RX_CLEAR 0x00000800 175862306a36Sopenharmony_ci#define AR_OBS_BUS_1_WEP_STATE 0x0003F000 175962306a36Sopenharmony_ci#define AR_OBS_BUS_1_WEP_STATE_S 12 176062306a36Sopenharmony_ci#define AR_OBS_BUS_1_RX_STATE 0x01F00000 176162306a36Sopenharmony_ci#define AR_OBS_BUS_1_RX_STATE_S 20 176262306a36Sopenharmony_ci#define AR_OBS_BUS_1_TX_STATE 0x7E000000 176362306a36Sopenharmony_ci#define AR_OBS_BUS_1_TX_STATE_S 25 176462306a36Sopenharmony_ci 176562306a36Sopenharmony_ci#define AR_LAST_TSTP 0x8080 176662306a36Sopenharmony_ci#define AR_NAV 0x8084 176762306a36Sopenharmony_ci#define AR_RTS_OK 0x8088 176862306a36Sopenharmony_ci#define AR_RTS_FAIL 0x808c 176962306a36Sopenharmony_ci#define AR_ACK_FAIL 0x8090 177062306a36Sopenharmony_ci#define AR_FCS_FAIL 0x8094 177162306a36Sopenharmony_ci#define AR_BEACON_CNT 0x8098 177262306a36Sopenharmony_ci 177362306a36Sopenharmony_ci#define AR_SLEEP1 0x80d4 177462306a36Sopenharmony_ci#define AR_SLEEP1_ASSUME_DTIM 0x00080000 177562306a36Sopenharmony_ci#define AR_SLEEP1_CAB_TIMEOUT 0xFFE00000 177662306a36Sopenharmony_ci#define AR_SLEEP1_CAB_TIMEOUT_S 21 177762306a36Sopenharmony_ci 177862306a36Sopenharmony_ci#define AR_SLEEP2 0x80d8 177962306a36Sopenharmony_ci#define AR_SLEEP2_BEACON_TIMEOUT 0xFFE00000 178062306a36Sopenharmony_ci#define AR_SLEEP2_BEACON_TIMEOUT_S 21 178162306a36Sopenharmony_ci 178262306a36Sopenharmony_ci#define AR_TPC 0x80e8 178362306a36Sopenharmony_ci#define AR_TPC_ACK 0x0000003f 178462306a36Sopenharmony_ci#define AR_TPC_ACK_S 0 178562306a36Sopenharmony_ci#define AR_TPC_CTS 0x00003f00 178662306a36Sopenharmony_ci#define AR_TPC_CTS_S 8 178762306a36Sopenharmony_ci#define AR_TPC_CHIRP 0x003f0000 178862306a36Sopenharmony_ci#define AR_TPC_CHIRP_S 16 178962306a36Sopenharmony_ci#define AR_TPC_RPT 0x3f000000 179062306a36Sopenharmony_ci#define AR_TPC_RPT_S 24 179162306a36Sopenharmony_ci 179262306a36Sopenharmony_ci#define AR_QUIET1 0x80fc 179362306a36Sopenharmony_ci#define AR_QUIET1_NEXT_QUIET_S 0 179462306a36Sopenharmony_ci#define AR_QUIET1_NEXT_QUIET_M 0x0000ffff 179562306a36Sopenharmony_ci#define AR_QUIET1_QUIET_ENABLE 0x00010000 179662306a36Sopenharmony_ci#define AR_QUIET1_QUIET_ACK_CTS_ENABLE 0x00020000 179762306a36Sopenharmony_ci#define AR_QUIET1_QUIET_ACK_CTS_ENABLE_S 17 179862306a36Sopenharmony_ci#define AR_QUIET2 0x8100 179962306a36Sopenharmony_ci#define AR_QUIET2_QUIET_PERIOD_S 0 180062306a36Sopenharmony_ci#define AR_QUIET2_QUIET_PERIOD_M 0x0000ffff 180162306a36Sopenharmony_ci#define AR_QUIET2_QUIET_DUR_S 16 180262306a36Sopenharmony_ci#define AR_QUIET2_QUIET_DUR 0xffff0000 180362306a36Sopenharmony_ci 180462306a36Sopenharmony_ci#define AR_TSF_PARM 0x8104 180562306a36Sopenharmony_ci#define AR_TSF_INCREMENT_M 0x000000ff 180662306a36Sopenharmony_ci#define AR_TSF_INCREMENT_S 0x00 180762306a36Sopenharmony_ci 180862306a36Sopenharmony_ci#define AR_QOS_NO_ACK 0x8108 180962306a36Sopenharmony_ci#define AR_QOS_NO_ACK_TWO_BIT 0x0000000f 181062306a36Sopenharmony_ci#define AR_QOS_NO_ACK_TWO_BIT_S 0 181162306a36Sopenharmony_ci#define AR_QOS_NO_ACK_BIT_OFF 0x00000070 181262306a36Sopenharmony_ci#define AR_QOS_NO_ACK_BIT_OFF_S 4 181362306a36Sopenharmony_ci#define AR_QOS_NO_ACK_BYTE_OFF 0x00000180 181462306a36Sopenharmony_ci#define AR_QOS_NO_ACK_BYTE_OFF_S 7 181562306a36Sopenharmony_ci 181662306a36Sopenharmony_ci#define AR_PHY_ERR 0x810c 181762306a36Sopenharmony_ci 181862306a36Sopenharmony_ci#define AR_PHY_ERR_DCHIRP 0x00000008 181962306a36Sopenharmony_ci#define AR_PHY_ERR_RADAR 0x00000020 182062306a36Sopenharmony_ci#define AR_PHY_ERR_OFDM_TIMING 0x00020000 182162306a36Sopenharmony_ci#define AR_PHY_ERR_CCK_TIMING 0x02000000 182262306a36Sopenharmony_ci 182362306a36Sopenharmony_ci#define AR_RXFIFO_CFG 0x8114 182462306a36Sopenharmony_ci 182562306a36Sopenharmony_ci 182662306a36Sopenharmony_ci#define AR_MIC_QOS_CONTROL 0x8118 182762306a36Sopenharmony_ci#define AR_MIC_QOS_SELECT 0x811c 182862306a36Sopenharmony_ci 182962306a36Sopenharmony_ci#define AR_PCU_MISC 0x8120 183062306a36Sopenharmony_ci#define AR_PCU_FORCE_BSSID_MATCH 0x00000001 183162306a36Sopenharmony_ci#define AR_PCU_MIC_NEW_LOC_ENA 0x00000004 183262306a36Sopenharmony_ci#define AR_PCU_TX_ADD_TSF 0x00000008 183362306a36Sopenharmony_ci#define AR_PCU_CCK_SIFS_MODE 0x00000010 183462306a36Sopenharmony_ci#define AR_PCU_RX_ANT_UPDT 0x00000800 183562306a36Sopenharmony_ci#define AR_PCU_TXOP_TBTT_LIMIT_ENA 0x00001000 183662306a36Sopenharmony_ci#define AR_PCU_MISS_BCN_IN_SLEEP 0x00004000 183762306a36Sopenharmony_ci#define AR_PCU_BUG_12306_FIX_ENA 0x00020000 183862306a36Sopenharmony_ci#define AR_PCU_FORCE_QUIET_COLL 0x00040000 183962306a36Sopenharmony_ci#define AR_PCU_TBTT_PROTECT 0x00200000 184062306a36Sopenharmony_ci#define AR_PCU_CLEAR_VMF 0x01000000 184162306a36Sopenharmony_ci#define AR_PCU_CLEAR_BA_VALID 0x04000000 184262306a36Sopenharmony_ci#define AR_PCU_ALWAYS_PERFORM_KEYSEARCH 0x10000000 184362306a36Sopenharmony_ci 184462306a36Sopenharmony_ci#define AR_PCU_BT_ANT_PREVENT_RX 0x00100000 184562306a36Sopenharmony_ci#define AR_PCU_BT_ANT_PREVENT_RX_S 20 184662306a36Sopenharmony_ci 184762306a36Sopenharmony_ci#define AR_FILT_OFDM 0x8124 184862306a36Sopenharmony_ci#define AR_FILT_OFDM_COUNT 0x00FFFFFF 184962306a36Sopenharmony_ci 185062306a36Sopenharmony_ci#define AR_FILT_CCK 0x8128 185162306a36Sopenharmony_ci#define AR_FILT_CCK_COUNT 0x00FFFFFF 185262306a36Sopenharmony_ci 185362306a36Sopenharmony_ci#define AR_PHY_ERR_1 0x812c 185462306a36Sopenharmony_ci#define AR_PHY_ERR_1_COUNT 0x00FFFFFF 185562306a36Sopenharmony_ci#define AR_PHY_ERR_MASK_1 0x8130 185662306a36Sopenharmony_ci 185762306a36Sopenharmony_ci#define AR_PHY_ERR_2 0x8134 185862306a36Sopenharmony_ci#define AR_PHY_ERR_2_COUNT 0x00FFFFFF 185962306a36Sopenharmony_ci#define AR_PHY_ERR_MASK_2 0x8138 186062306a36Sopenharmony_ci 186162306a36Sopenharmony_ci#define AR_PHY_COUNTMAX (3 << 22) 186262306a36Sopenharmony_ci#define AR_MIBCNT_INTRMASK (3 << 22) 186362306a36Sopenharmony_ci 186462306a36Sopenharmony_ci#define AR_TSFOOR_THRESHOLD 0x813c 186562306a36Sopenharmony_ci#define AR_TSFOOR_THRESHOLD_VAL 0x0000FFFF 186662306a36Sopenharmony_ci 186762306a36Sopenharmony_ci#define AR_PHY_ERR_EIFS_MASK 0x8144 186862306a36Sopenharmony_ci 186962306a36Sopenharmony_ci#define AR_PHY_ERR_3 0x8168 187062306a36Sopenharmony_ci#define AR_PHY_ERR_3_COUNT 0x00FFFFFF 187162306a36Sopenharmony_ci#define AR_PHY_ERR_MASK_3 0x816c 187262306a36Sopenharmony_ci 187362306a36Sopenharmony_ci#define AR_BT_COEX_MODE 0x8170 187462306a36Sopenharmony_ci#define AR_BT_TIME_EXTEND 0x000000ff 187562306a36Sopenharmony_ci#define AR_BT_TIME_EXTEND_S 0 187662306a36Sopenharmony_ci#define AR_BT_TXSTATE_EXTEND 0x00000100 187762306a36Sopenharmony_ci#define AR_BT_TXSTATE_EXTEND_S 8 187862306a36Sopenharmony_ci#define AR_BT_TX_FRAME_EXTEND 0x00000200 187962306a36Sopenharmony_ci#define AR_BT_TX_FRAME_EXTEND_S 9 188062306a36Sopenharmony_ci#define AR_BT_MODE 0x00000c00 188162306a36Sopenharmony_ci#define AR_BT_MODE_S 10 188262306a36Sopenharmony_ci#define AR_BT_QUIET 0x00001000 188362306a36Sopenharmony_ci#define AR_BT_QUIET_S 12 188462306a36Sopenharmony_ci#define AR_BT_QCU_THRESH 0x0001e000 188562306a36Sopenharmony_ci#define AR_BT_QCU_THRESH_S 13 188662306a36Sopenharmony_ci#define AR_BT_RX_CLEAR_POLARITY 0x00020000 188762306a36Sopenharmony_ci#define AR_BT_RX_CLEAR_POLARITY_S 17 188862306a36Sopenharmony_ci#define AR_BT_PRIORITY_TIME 0x00fc0000 188962306a36Sopenharmony_ci#define AR_BT_PRIORITY_TIME_S 18 189062306a36Sopenharmony_ci#define AR_BT_FIRST_SLOT_TIME 0xff000000 189162306a36Sopenharmony_ci#define AR_BT_FIRST_SLOT_TIME_S 24 189262306a36Sopenharmony_ci 189362306a36Sopenharmony_ci#define AR_BT_COEX_WEIGHT 0x8174 189462306a36Sopenharmony_ci#define AR_BT_COEX_WGHT 0xff55 189562306a36Sopenharmony_ci#define AR_STOMP_ALL_WLAN_WGHT 0xfcfc 189662306a36Sopenharmony_ci#define AR_STOMP_LOW_WLAN_WGHT 0xa8a8 189762306a36Sopenharmony_ci#define AR_STOMP_NONE_WLAN_WGHT 0x0000 189862306a36Sopenharmony_ci#define AR_BTCOEX_BT_WGHT 0x0000ffff 189962306a36Sopenharmony_ci#define AR_BTCOEX_BT_WGHT_S 0 190062306a36Sopenharmony_ci#define AR_BTCOEX_WL_WGHT 0xffff0000 190162306a36Sopenharmony_ci#define AR_BTCOEX_WL_WGHT_S 16 190262306a36Sopenharmony_ci 190362306a36Sopenharmony_ci#define AR_BT_COEX_WL_WEIGHTS0 0x8174 190462306a36Sopenharmony_ci#define AR_BT_COEX_WL_WEIGHTS1 0x81c4 190562306a36Sopenharmony_ci#define AR_MCI_COEX_WL_WEIGHTS(_i) (0x18b0 + (_i << 2)) 190662306a36Sopenharmony_ci#define AR_BT_COEX_BT_WEIGHTS(_i) (0x83ac + (_i << 2)) 190762306a36Sopenharmony_ci 190862306a36Sopenharmony_ci#define AR9300_BT_WGHT 0xcccc4444 190962306a36Sopenharmony_ci 191062306a36Sopenharmony_ci#define AR_BT_COEX_MODE2 0x817c 191162306a36Sopenharmony_ci#define AR_BT_BCN_MISS_THRESH 0x000000ff 191262306a36Sopenharmony_ci#define AR_BT_BCN_MISS_THRESH_S 0 191362306a36Sopenharmony_ci#define AR_BT_BCN_MISS_CNT 0x0000ff00 191462306a36Sopenharmony_ci#define AR_BT_BCN_MISS_CNT_S 8 191562306a36Sopenharmony_ci#define AR_BT_HOLD_RX_CLEAR 0x00010000 191662306a36Sopenharmony_ci#define AR_BT_HOLD_RX_CLEAR_S 16 191762306a36Sopenharmony_ci#define AR_BT_PROTECT_BT_AFTER_WAKEUP 0x00080000 191862306a36Sopenharmony_ci#define AR_BT_PROTECT_BT_AFTER_WAKEUP_S 19 191962306a36Sopenharmony_ci#define AR_BT_DISABLE_BT_ANT 0x00100000 192062306a36Sopenharmony_ci#define AR_BT_DISABLE_BT_ANT_S 20 192162306a36Sopenharmony_ci#define AR_BT_QUIET_2_WIRE 0x00200000 192262306a36Sopenharmony_ci#define AR_BT_QUIET_2_WIRE_S 21 192362306a36Sopenharmony_ci#define AR_BT_WL_ACTIVE_MODE 0x00c00000 192462306a36Sopenharmony_ci#define AR_BT_WL_ACTIVE_MODE_S 22 192562306a36Sopenharmony_ci#define AR_BT_WL_TXRX_SEPARATE 0x01000000 192662306a36Sopenharmony_ci#define AR_BT_WL_TXRX_SEPARATE_S 24 192762306a36Sopenharmony_ci#define AR_BT_RS_DISCARD_EXTEND 0x02000000 192862306a36Sopenharmony_ci#define AR_BT_RS_DISCARD_EXTEND_S 25 192962306a36Sopenharmony_ci#define AR_BT_TSF_BT_ACTIVE_CTRL 0x0c000000 193062306a36Sopenharmony_ci#define AR_BT_TSF_BT_ACTIVE_CTRL_S 26 193162306a36Sopenharmony_ci#define AR_BT_TSF_BT_PRIORITY_CTRL 0x30000000 193262306a36Sopenharmony_ci#define AR_BT_TSF_BT_PRIORITY_CTRL_S 28 193362306a36Sopenharmony_ci#define AR_BT_INTERRUPT_ENABLE 0x40000000 193462306a36Sopenharmony_ci#define AR_BT_INTERRUPT_ENABLE_S 30 193562306a36Sopenharmony_ci#define AR_BT_PHY_ERR_BT_COLL_ENABLE 0x80000000 193662306a36Sopenharmony_ci#define AR_BT_PHY_ERR_BT_COLL_ENABLE_S 31 193762306a36Sopenharmony_ci 193862306a36Sopenharmony_ci#define AR_TXSIFS 0x81d0 193962306a36Sopenharmony_ci#define AR_TXSIFS_TIME 0x000000FF 194062306a36Sopenharmony_ci#define AR_TXSIFS_TX_LATENCY 0x00000F00 194162306a36Sopenharmony_ci#define AR_TXSIFS_TX_LATENCY_S 8 194262306a36Sopenharmony_ci#define AR_TXSIFS_ACK_SHIFT 0x00007000 194362306a36Sopenharmony_ci#define AR_TXSIFS_ACK_SHIFT_S 12 194462306a36Sopenharmony_ci 194562306a36Sopenharmony_ci#define AR_BT_COEX_MODE3 0x81d4 194662306a36Sopenharmony_ci#define AR_BT_WL_ACTIVE_TIME 0x000000ff 194762306a36Sopenharmony_ci#define AR_BT_WL_ACTIVE_TIME_S 0 194862306a36Sopenharmony_ci#define AR_BT_WL_QC_TIME 0x0000ff00 194962306a36Sopenharmony_ci#define AR_BT_WL_QC_TIME_S 8 195062306a36Sopenharmony_ci#define AR_BT_ALLOW_CONCURRENT_ACCESS 0x000f0000 195162306a36Sopenharmony_ci#define AR_BT_ALLOW_CONCURRENT_ACCESS_S 16 195262306a36Sopenharmony_ci#define AR_BT_AGC_SATURATION_CNT_ENABLE 0x00100000 195362306a36Sopenharmony_ci#define AR_BT_AGC_SATURATION_CNT_ENABLE_S 20 195462306a36Sopenharmony_ci 195562306a36Sopenharmony_ci#define AR_TXOP_X 0x81ec 195662306a36Sopenharmony_ci#define AR_TXOP_X_VAL 0x000000FF 195762306a36Sopenharmony_ci 195862306a36Sopenharmony_ci 195962306a36Sopenharmony_ci#define AR_TXOP_0_3 0x81f0 196062306a36Sopenharmony_ci#define AR_TXOP_4_7 0x81f4 196162306a36Sopenharmony_ci#define AR_TXOP_8_11 0x81f8 196262306a36Sopenharmony_ci#define AR_TXOP_12_15 0x81fc 196362306a36Sopenharmony_ci 196462306a36Sopenharmony_ci#define AR_NEXT_NDP2_TIMER 0x8180 196562306a36Sopenharmony_ci#define AR_GEN_TIMER_BANK_1_LEN 8 196662306a36Sopenharmony_ci#define AR_FIRST_NDP_TIMER 7 196762306a36Sopenharmony_ci#define AR_NDP2_PERIOD 0x81a0 196862306a36Sopenharmony_ci#define AR_NDP2_TIMER_MODE 0x81c0 196962306a36Sopenharmony_ci#define AR_GEN_TIMERS2_MODE_ENABLE_MASK 0x000000FF 197062306a36Sopenharmony_ci 197162306a36Sopenharmony_ci#define AR_GEN_TIMERS(_i) (0x8200 + ((_i) << 2)) 197262306a36Sopenharmony_ci#define AR_NEXT_TBTT_TIMER AR_GEN_TIMERS(0) 197362306a36Sopenharmony_ci#define AR_NEXT_DMA_BEACON_ALERT AR_GEN_TIMERS(1) 197462306a36Sopenharmony_ci#define AR_NEXT_SWBA AR_GEN_TIMERS(2) 197562306a36Sopenharmony_ci#define AR_NEXT_CFP AR_GEN_TIMERS(2) 197662306a36Sopenharmony_ci#define AR_NEXT_HCF AR_GEN_TIMERS(3) 197762306a36Sopenharmony_ci#define AR_NEXT_TIM AR_GEN_TIMERS(4) 197862306a36Sopenharmony_ci#define AR_NEXT_DTIM AR_GEN_TIMERS(5) 197962306a36Sopenharmony_ci#define AR_NEXT_QUIET_TIMER AR_GEN_TIMERS(6) 198062306a36Sopenharmony_ci#define AR_NEXT_NDP_TIMER AR_GEN_TIMERS(7) 198162306a36Sopenharmony_ci 198262306a36Sopenharmony_ci#define AR_BEACON_PERIOD AR_GEN_TIMERS(8) 198362306a36Sopenharmony_ci#define AR_DMA_BEACON_PERIOD AR_GEN_TIMERS(9) 198462306a36Sopenharmony_ci#define AR_SWBA_PERIOD AR_GEN_TIMERS(10) 198562306a36Sopenharmony_ci#define AR_HCF_PERIOD AR_GEN_TIMERS(11) 198662306a36Sopenharmony_ci#define AR_TIM_PERIOD AR_GEN_TIMERS(12) 198762306a36Sopenharmony_ci#define AR_DTIM_PERIOD AR_GEN_TIMERS(13) 198862306a36Sopenharmony_ci#define AR_QUIET_PERIOD AR_GEN_TIMERS(14) 198962306a36Sopenharmony_ci#define AR_NDP_PERIOD AR_GEN_TIMERS(15) 199062306a36Sopenharmony_ci 199162306a36Sopenharmony_ci#define AR_TIMER_MODE 0x8240 199262306a36Sopenharmony_ci#define AR_TBTT_TIMER_EN 0x00000001 199362306a36Sopenharmony_ci#define AR_DBA_TIMER_EN 0x00000002 199462306a36Sopenharmony_ci#define AR_SWBA_TIMER_EN 0x00000004 199562306a36Sopenharmony_ci#define AR_HCF_TIMER_EN 0x00000008 199662306a36Sopenharmony_ci#define AR_TIM_TIMER_EN 0x00000010 199762306a36Sopenharmony_ci#define AR_DTIM_TIMER_EN 0x00000020 199862306a36Sopenharmony_ci#define AR_QUIET_TIMER_EN 0x00000040 199962306a36Sopenharmony_ci#define AR_NDP_TIMER_EN 0x00000080 200062306a36Sopenharmony_ci#define AR_TIMER_OVERFLOW_INDEX 0x00000700 200162306a36Sopenharmony_ci#define AR_TIMER_OVERFLOW_INDEX_S 8 200262306a36Sopenharmony_ci#define AR_TIMER_THRESH 0xFFFFF000 200362306a36Sopenharmony_ci#define AR_TIMER_THRESH_S 12 200462306a36Sopenharmony_ci 200562306a36Sopenharmony_ci#define AR_SLP32_MODE 0x8244 200662306a36Sopenharmony_ci#define AR_SLP32_HALF_CLK_LATENCY 0x000FFFFF 200762306a36Sopenharmony_ci#define AR_SLP32_ENA 0x00100000 200862306a36Sopenharmony_ci#define AR_SLP32_TSF_WRITE_STATUS 0x00200000 200962306a36Sopenharmony_ci 201062306a36Sopenharmony_ci#define AR_SLP32_WAKE 0x8248 201162306a36Sopenharmony_ci#define AR_SLP32_WAKE_XTL_TIME 0x0000FFFF 201262306a36Sopenharmony_ci 201362306a36Sopenharmony_ci#define AR_SLP32_INC 0x824c 201462306a36Sopenharmony_ci#define AR_SLP32_TST_INC 0x000FFFFF 201562306a36Sopenharmony_ci 201662306a36Sopenharmony_ci#define AR_SLP_CNT 0x8250 201762306a36Sopenharmony_ci#define AR_SLP_CYCLE_CNT 0x8254 201862306a36Sopenharmony_ci 201962306a36Sopenharmony_ci#define AR_SLP_MIB_CTRL 0x8258 202062306a36Sopenharmony_ci#define AR_SLP_MIB_CLEAR 0x00000001 202162306a36Sopenharmony_ci#define AR_SLP_MIB_PENDING 0x00000002 202262306a36Sopenharmony_ci 202362306a36Sopenharmony_ci#define AR_MAC_PCU_LOGIC_ANALYZER 0x8264 202462306a36Sopenharmony_ci#define AR_MAC_PCU_LOGIC_ANALYZER_DISBUG20768 0x20000000 202562306a36Sopenharmony_ci 202662306a36Sopenharmony_ci 202762306a36Sopenharmony_ci#define AR_2040_MODE 0x8318 202862306a36Sopenharmony_ci#define AR_2040_JOINED_RX_CLEAR 0x00000001 202962306a36Sopenharmony_ci 203062306a36Sopenharmony_ci 203162306a36Sopenharmony_ci#define AR_EXTRCCNT 0x8328 203262306a36Sopenharmony_ci 203362306a36Sopenharmony_ci#define AR_SELFGEN_MASK 0x832c 203462306a36Sopenharmony_ci 203562306a36Sopenharmony_ci#define AR_PCU_TXBUF_CTRL 0x8340 203662306a36Sopenharmony_ci#define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF 203762306a36Sopenharmony_ci#define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700 203862306a36Sopenharmony_ci#define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380 203962306a36Sopenharmony_ci#define AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE 0x500 204062306a36Sopenharmony_ci 204162306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2 0x8344 204262306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002 204362306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT 0x00000004 204462306a36Sopenharmony_ci 204562306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_RESERVED 0x00000038 204662306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE 0x00000040 204762306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_CFP_IGNORE 0x00000080 204862306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_MGMT_QOS 0x0000FF00 204962306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_MGMT_QOS_S 8 205062306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_ENABLE_LOAD_NAV_BEACON_DURATION 0x00010000 205162306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_ENABLE_AGGWEP 0x00020000 205262306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_HWWAR1 0x00100000 205362306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_HWWAR2 0x02000000 205462306a36Sopenharmony_ci#define AR_PCU_MISC_MODE2_RESERVED2 0xFFFE0000 205562306a36Sopenharmony_ci 205662306a36Sopenharmony_ci#define AR_PCU_MISC_MODE3 0x83d0 205762306a36Sopenharmony_ci 205862306a36Sopenharmony_ci#define AR_MAC_PCU_ASYNC_FIFO_REG3 0x8358 205962306a36Sopenharmony_ci#define AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL 0x00000400 206062306a36Sopenharmony_ci#define AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET 0x80000000 206162306a36Sopenharmony_ci#define AR_MAC_PCU_GEN_TIMER_TSF_SEL 0x83d8 206262306a36Sopenharmony_ci 206362306a36Sopenharmony_ci#define AR_DIRECT_CONNECT 0x83a0 206462306a36Sopenharmony_ci#define AR_DC_AP_STA_EN 0x00000001 206562306a36Sopenharmony_ci#define AR_DC_TSF2_ENABLE 0x00000001 206662306a36Sopenharmony_ci 206762306a36Sopenharmony_ci#define AR_AES_MUTE_MASK0 0x805c 206862306a36Sopenharmony_ci#define AR_AES_MUTE_MASK0_FC 0x0000FFFF 206962306a36Sopenharmony_ci#define AR_AES_MUTE_MASK0_QOS 0xFFFF0000 207062306a36Sopenharmony_ci#define AR_AES_MUTE_MASK0_QOS_S 16 207162306a36Sopenharmony_ci 207262306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1 0x8060 207362306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1_SEQ 0x0000FFFF 207462306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1_SEQ_S 0 207562306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1_FC_MGMT 0xFFFF0000 207662306a36Sopenharmony_ci#define AR_AES_MUTE_MASK1_FC_MGMT_S 16 207762306a36Sopenharmony_ci 207862306a36Sopenharmony_ci#define AR_RATE_DURATION_0 0x8700 207962306a36Sopenharmony_ci#define AR_RATE_DURATION_31 0x87CC 208062306a36Sopenharmony_ci#define AR_RATE_DURATION_32 0x8780 208162306a36Sopenharmony_ci#define AR_RATE_DURATION(_n) (AR_RATE_DURATION_0 + ((_n)<<2)) 208262306a36Sopenharmony_ci 208362306a36Sopenharmony_ci/* WoW - Wake On Wireless */ 208462306a36Sopenharmony_ci 208562306a36Sopenharmony_ci#define AR_PMCTRL_AUX_PWR_DET 0x10000000 /* Puts Chip in L2 state */ 208662306a36Sopenharmony_ci#define AR_PMCTRL_D3COLD_VAUX 0x00800000 208762306a36Sopenharmony_ci#define AR_PMCTRL_HOST_PME_EN 0x00400000 /* Send OOB WAKE_L on WoW 208862306a36Sopenharmony_ci event */ 208962306a36Sopenharmony_ci#define AR_PMCTRL_WOW_PME_CLR 0x00200000 /* Clear WoW event */ 209062306a36Sopenharmony_ci#define AR_PMCTRL_PWR_STATE_MASK 0x0f000000 /* Power State Mask */ 209162306a36Sopenharmony_ci#define AR_PMCTRL_PWR_STATE_D1D3 0x0f000000 /* Activate D1 and D3 */ 209262306a36Sopenharmony_ci#define AR_PMCTRL_PWR_STATE_D1D3_REAL 0x0f000000 /* Activate D1 and D3 */ 209362306a36Sopenharmony_ci#define AR_PMCTRL_PWR_STATE_D0 0x08000000 /* Activate D0 */ 209462306a36Sopenharmony_ci#define AR_PMCTRL_PWR_PM_CTRL_ENA 0x00008000 /* Enable power mgmt */ 209562306a36Sopenharmony_ci 209662306a36Sopenharmony_ci#define AR_WOW_BEACON_TIMO_MAX 0xffffffff 209762306a36Sopenharmony_ci 209862306a36Sopenharmony_ci#define AR9271_CORE_CLOCK 117 /* clock to 117Mhz */ 209962306a36Sopenharmony_ci#define AR9271_TARGET_BAUD_RATE 19200 /* 115200 */ 210062306a36Sopenharmony_ci 210162306a36Sopenharmony_ci#define AR_AGG_WEP_ENABLE_FIX 0x00000008 /* This allows the use of AR_AGG_WEP_ENABLE */ 210262306a36Sopenharmony_ci#define AR_ADHOC_MCAST_KEYID_ENABLE 0x00000040 /* This bit enables the Multicast search 210362306a36Sopenharmony_ci * based on both MAC Address and Key ID. 210462306a36Sopenharmony_ci * If bit is 0, then Multicast search is 210562306a36Sopenharmony_ci * based on MAC address only. 210662306a36Sopenharmony_ci * For Merlin and above only. 210762306a36Sopenharmony_ci */ 210862306a36Sopenharmony_ci#define AR_AGG_WEP_ENABLE 0x00020000 /* This field enables AGG_WEP feature, 210962306a36Sopenharmony_ci * when it is enable, AGG_WEP would takes 211062306a36Sopenharmony_ci * charge of the encryption interface of 211162306a36Sopenharmony_ci * pcu_txsm. 211262306a36Sopenharmony_ci */ 211362306a36Sopenharmony_ci 211462306a36Sopenharmony_ci#define AR9300_SM_BASE 0xa200 211562306a36Sopenharmony_ci#define AR9002_PHY_AGC_CONTROL 0x9860 211662306a36Sopenharmony_ci#define AR9003_PHY_AGC_CONTROL AR9300_SM_BASE + 0xc4 211762306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL(_ah) (AR_SREV_9300_20_OR_LATER(_ah) ? AR9003_PHY_AGC_CONTROL : AR9002_PHY_AGC_CONTROL) 211862306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_CAL 0x00000001 /* do internal calibration */ 211962306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_NF 0x00000002 /* do noise-floor calibration */ 212062306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_OFFSET_CAL 0x00000800 /* allow offset calibration */ 212162306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_ENABLE_NF 0x00008000 /* enable noise floor calibration to happen */ 212262306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_FLTR_CAL 0x00010000 /* allow tx filter calibration */ 212362306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_NO_UPDATE_NF 0x00020000 /* don't update noise floor automatically */ 212462306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_EXT_NF_PWR_MEAS 0x00040000 /* extend noise floor power measurement */ 212562306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_CLC_SUCCESS 0x00080000 /* carrier leak calibration done */ 212662306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_PKDET_CAL 0x00100000 212762306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_YCOK_MAX 0x000003c0 212862306a36Sopenharmony_ci#define AR_PHY_AGC_CONTROL_YCOK_MAX_S 6 212962306a36Sopenharmony_ci 213062306a36Sopenharmony_ci#endif 2131