xref: /linux/drivers/net/wireless/ath/carl9170/phy.h (revision e5451c8f8330e03ad3cfa16048b4daf961af434f)
1aae9af60SChristian Lamparter /*
2aae9af60SChristian Lamparter  * Shared Atheros AR9170 Header
3aae9af60SChristian Lamparter  *
4aae9af60SChristian Lamparter  * PHY register map
5aae9af60SChristian Lamparter  *
6aae9af60SChristian Lamparter  * Copyright (c) 2008-2009 Atheros Communications Inc.
7aae9af60SChristian Lamparter  *
8aae9af60SChristian Lamparter  * Permission to use, copy, modify, and/or distribute this software for any
9aae9af60SChristian Lamparter  * purpose with or without fee is hereby granted, provided that the above
10aae9af60SChristian Lamparter  * copyright notice and this permission notice appear in all copies.
11aae9af60SChristian Lamparter  *
12aae9af60SChristian Lamparter  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13aae9af60SChristian Lamparter  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14aae9af60SChristian Lamparter  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15aae9af60SChristian Lamparter  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16aae9af60SChristian Lamparter  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17aae9af60SChristian Lamparter  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18aae9af60SChristian Lamparter  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19aae9af60SChristian Lamparter  */
20aae9af60SChristian Lamparter 
21aae9af60SChristian Lamparter #ifndef __CARL9170_SHARED_PHY_H
22aae9af60SChristian Lamparter #define __CARL9170_SHARED_PHY_H
23aae9af60SChristian Lamparter 
24aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BASE			(0x1bc000 + 0x9800)
25aae9af60SChristian Lamparter #define	AR9170_PHY_REG(_n)			(AR9170_PHY_REG_BASE + \
26aae9af60SChristian Lamparter 						 ((_n) << 2))
27aae9af60SChristian Lamparter 
28aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TEST			(AR9170_PHY_REG_BASE + 0x0000)
29aae9af60SChristian Lamparter #define		AR9170_PHY_TEST_AGC_CLR			0x10000000
30aae9af60SChristian Lamparter #define		AR9170_PHY_TEST_RFSILENT_BB		0x00002000
31aae9af60SChristian Lamparter 
32aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TURBO			(AR9170_PHY_REG_BASE + 0x0004)
33aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_TURBO_MODE		0x00000001
34aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_TURBO_SHORT		0x00000002
35aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_DYN2040_EN		0x00000004
36aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_DYN2040_PRI_ONLY	0x00000008
37aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_DYN2040_PRI_CH	0x00000010
38aae9af60SChristian Lamparter /* For 25 MHz channel spacing -- not used but supported by hw */
39aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_DYN2040_EXT_CH	0x00000020
40aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_HT_EN		0x00000040
41aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_SHORT_GI_40		0x00000080
42aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_WALSH		0x00000100
43aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_SINGLE_HT_LTF1	0x00000200
44aae9af60SChristian Lamparter #define		AR9170_PHY_TURBO_FC_ENABLE_DAC_FIFO	0x00000800
45aae9af60SChristian Lamparter 
46aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TEST2			(AR9170_PHY_REG_BASE + 0x0008)
47aae9af60SChristian Lamparter 
48aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING2			(AR9170_PHY_REG_BASE + 0x0010)
49aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING2_USE_FORCE		0x00001000
50aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING2_FORCE		0x00000fff
51aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING2_FORCE_S			 0
52aae9af60SChristian Lamparter 
53aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING3			(AR9170_PHY_REG_BASE + 0x0014)
54aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING3_DSC_EXP		0x0001e000
55aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING3_DSC_EXP_S		13
56aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING3_DSC_MAN		0xfffe0000
57aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING3_DSC_MAN_S		17
58aae9af60SChristian Lamparter 
59aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CHIP_ID			(AR9170_PHY_REG_BASE + 0x0018)
60aae9af60SChristian Lamparter #define		AR9170_PHY_CHIP_ID_REV_0		0x80
61aae9af60SChristian Lamparter #define		AR9170_PHY_CHIP_ID_REV_1		0x81
62aae9af60SChristian Lamparter #define		AR9170_PHY_CHIP_ID_9160_REV_0		0xb0
63aae9af60SChristian Lamparter 
64aae9af60SChristian Lamparter #define	AR9170_PHY_REG_ACTIVE			(AR9170_PHY_REG_BASE + 0x001c)
65aae9af60SChristian Lamparter #define		AR9170_PHY_ACTIVE_EN			0x00000001
66aae9af60SChristian Lamparter #define		AR9170_PHY_ACTIVE_DIS			0x00000000
67aae9af60SChristian Lamparter 
68aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RF_CTL2			(AR9170_PHY_REG_BASE + 0x0024)
69aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL2_TX_END_DATA_START	0x000000ff
70aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL2_TX_END_DATA_START_S	0
71aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL2_TX_END_PA_ON		0x0000ff00
72aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL2_TX_END_PA_ON_S	8
73aae9af60SChristian Lamparter 
74aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RF_CTL3                  (AR9170_PHY_REG_BASE + 0x0028)
75aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL3_TX_END_TO_A2_RX_ON	0x00ff0000
76aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL3_TX_END_TO_A2_RX_ON_S	16
77aae9af60SChristian Lamparter 
78aae9af60SChristian Lamparter #define	AR9170_PHY_REG_ADC_CTL			(AR9170_PHY_REG_BASE + 0x002c)
79aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_CTL_OFF_INBUFGAIN	0x00000003
80aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_CTL_OFF_INBUFGAIN_S	0
81aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_CTL_OFF_PWDDAC		0x00002000
82aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_CTL_OFF_PWDBANDGAP	0x00004000
83aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_CTL_OFF_PWDADC		0x00008000
84aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_CTL_ON_INBUFGAIN		0x00030000
85aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_CTL_ON_INBUFGAIN_S	16
86aae9af60SChristian Lamparter 
87aae9af60SChristian Lamparter #define	AR9170_PHY_REG_ADC_SERIAL_CTL		(AR9170_PHY_REG_BASE + 0x0030)
88aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_SCTL_SEL_INTERNAL_ADDAC	0x00000000
89aae9af60SChristian Lamparter #define		AR9170_PHY_ADC_SCTL_SEL_EXTERNAL_RADIO	0x00000001
90aae9af60SChristian Lamparter 
91aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RF_CTL4			(AR9170_PHY_REG_BASE + 0x0034)
92aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL4_TX_END_XPAB_OFF	0xff000000
93aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL4_TX_END_XPAB_OFF_S	24
94aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL4_TX_END_XPAA_OFF	0x00ff0000
95aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL4_TX_END_XPAA_OFF_S	16
96aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL4_FRAME_XPAB_ON	0x0000ff00
97aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL4_FRAME_XPAB_ON_S	8
98aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL4_FRAME_XPAA_ON	0x000000ff
99aae9af60SChristian Lamparter #define		AR9170_PHY_RF_CTL4_FRAME_XPAA_ON_S	0
100aae9af60SChristian Lamparter 
101aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TSTDAC_CONST		(AR9170_PHY_REG_BASE + 0x003c)
102aae9af60SChristian Lamparter 
103aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SETTLING			(AR9170_PHY_REG_BASE + 0x0044)
104aae9af60SChristian Lamparter #define		AR9170_PHY_SETTLING_SWITCH		0x00003f80
105aae9af60SChristian Lamparter #define		AR9170_PHY_SETTLING_SWITCH_S		7
106aae9af60SChristian Lamparter 
107aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RXGAIN			(AR9170_PHY_REG_BASE + 0x0048)
108aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RXGAIN_CHAIN_2		(AR9170_PHY_REG_BASE + 0x2048)
109aae9af60SChristian Lamparter #define		AR9170_PHY_RXGAIN_TXRX_ATTEN		0x0003f000
110aae9af60SChristian Lamparter #define		AR9170_PHY_RXGAIN_TXRX_ATTEN_S		12
111aae9af60SChristian Lamparter #define		AR9170_PHY_RXGAIN_TXRX_RF_MAX		0x007c0000
112aae9af60SChristian Lamparter #define		AR9170_PHY_RXGAIN_TXRX_RF_MAX_S		18
113aae9af60SChristian Lamparter 
114aae9af60SChristian Lamparter #define	AR9170_PHY_REG_DESIRED_SZ		(AR9170_PHY_REG_BASE + 0x0050)
115aae9af60SChristian Lamparter #define		AR9170_PHY_DESIRED_SZ_ADC		0x000000ff
116aae9af60SChristian Lamparter #define		AR9170_PHY_DESIRED_SZ_ADC_S		0
117aae9af60SChristian Lamparter #define		AR9170_PHY_DESIRED_SZ_PGA		0x0000ff00
118aae9af60SChristian Lamparter #define		AR9170_PHY_DESIRED_SZ_PGA_S		8
119aae9af60SChristian Lamparter #define		AR9170_PHY_DESIRED_SZ_TOT_DES		0x0ff00000
120aae9af60SChristian Lamparter #define		AR9170_PHY_DESIRED_SZ_TOT_DES_S		20
121aae9af60SChristian Lamparter 
122aae9af60SChristian Lamparter #define	AR9170_PHY_REG_FIND_SIG			(AR9170_PHY_REG_BASE + 0x0058)
123aae9af60SChristian Lamparter #define		AR9170_PHY_FIND_SIG_FIRSTEP		0x0003f000
124aae9af60SChristian Lamparter #define		AR9170_PHY_FIND_SIG_FIRSTEP_S		12
125aae9af60SChristian Lamparter #define		AR9170_PHY_FIND_SIG_FIRPWR		0x03fc0000
126aae9af60SChristian Lamparter #define		AR9170_PHY_FIND_SIG_FIRPWR_S		18
127aae9af60SChristian Lamparter 
128aae9af60SChristian Lamparter #define	AR9170_PHY_REG_AGC_CTL1			(AR9170_PHY_REG_BASE + 0x005c)
129aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CTL1_COARSE_LOW		0x00007f80
130aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CTL1_COARSE_LOW_S	7
131aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CTL1_COARSE_HIGH		0x003f8000
132aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CTL1_COARSE_HIGH_S	15
133aae9af60SChristian Lamparter 
134aae9af60SChristian Lamparter #define	AR9170_PHY_REG_AGC_CONTROL		(AR9170_PHY_REG_BASE + 0x0060)
135aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CONTROL_CAL		0x00000001
136aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CONTROL_NF		0x00000002
137aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CONTROL_ENABLE_NF	0x00008000
138aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CONTROL_FLTR_CAL		0x00010000
139aae9af60SChristian Lamparter #define		AR9170_PHY_AGC_CONTROL_NO_UPDATE_NF	0x00020000
140aae9af60SChristian Lamparter 
141aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CCA			(AR9170_PHY_REG_BASE + 0x0064)
142*3f1240e4SChristian Lamparter #define		AR9170_PHY_CCA_MIN_PWR			0x0ff80000
143*3f1240e4SChristian Lamparter #define		AR9170_PHY_CCA_MIN_PWR_S		19
144aae9af60SChristian Lamparter #define		AR9170_PHY_CCA_THRESH62			0x0007f000
145aae9af60SChristian Lamparter #define		AR9170_PHY_CCA_THRESH62_S		12
146aae9af60SChristian Lamparter 
147aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SFCORR			(AR9170_PHY_REG_BASE + 0x0068)
148aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_M2COUNT_THR		0x0000001f
149aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_M2COUNT_THR_S		0
150aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_M1_THRESH		0x00fe0000
151aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_M1_THRESH_S		17
152aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_M2_THRESH		0x7f000000
153aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_M2_THRESH_S		24
154aae9af60SChristian Lamparter 
155aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SFCORR_LOW		(AR9170_PHY_REG_BASE + 0x006c)
156aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_LOW_USE_SELF_CORR_LOW	0x00000001
157aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_LOW_M2COUNT_THR_LOW	0x00003f00
158aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_LOW_M2COUNT_THR_LOW_S	8
159aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_LOW_M1_THRESH_LOW	0x001fc000
160aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_LOW_M1_THRESH_LOW_S	14
161aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_LOW_M2_THRESH_LOW	0x0fe00000
162aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_LOW_M2_THRESH_LOW_S	21
163aae9af60SChristian Lamparter 
164aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SLEEP_CTR_CONTROL	(AR9170_PHY_REG_BASE + 0x0070)
165aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SLEEP_CTR_LIMIT		(AR9170_PHY_REG_BASE + 0x0074)
166aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SLEEP_SCAL		(AR9170_PHY_REG_BASE + 0x0078)
167aae9af60SChristian Lamparter 
168aae9af60SChristian Lamparter #define	AR9170_PHY_REG_PLL_CTL			(AR9170_PHY_REG_BASE + 0x007c)
169aae9af60SChristian Lamparter #define		AR9170_PHY_PLL_CTL_40			0xaa
170aae9af60SChristian Lamparter #define		AR9170_PHY_PLL_CTL_40_5413		0x04
171aae9af60SChristian Lamparter #define		AR9170_PHY_PLL_CTL_44			0xab
172aae9af60SChristian Lamparter #define		AR9170_PHY_PLL_CTL_44_2133		0xeb
173aae9af60SChristian Lamparter #define		AR9170_PHY_PLL_CTL_40_2133		0xea
174aae9af60SChristian Lamparter 
175aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BIN_MASK_1		(AR9170_PHY_REG_BASE + 0x0100)
176aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BIN_MASK_2		(AR9170_PHY_REG_BASE + 0x0104)
177aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BIN_MASK_3		(AR9170_PHY_REG_BASE + 0x0108)
178aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MASK_CTL			(AR9170_PHY_REG_BASE + 0x010c)
179aae9af60SChristian Lamparter 
180aae9af60SChristian Lamparter /* analogue power on time (100ns) */
181aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RX_DELAY			(AR9170_PHY_REG_BASE + 0x0114)
182aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SEARCH_START_DELAY	(AR9170_PHY_REG_BASE + 0x0118)
183aae9af60SChristian Lamparter #define		AR9170_PHY_RX_DELAY_DELAY		0x00003fff
184aae9af60SChristian Lamparter 
185aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING_CTRL4(_i)		(AR9170_PHY_REG_BASE + \
186aae9af60SChristian Lamparter 						(0x0120 + ((_i) << 12)))
187aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF		0x01f
188aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF_S	0
189aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF		0x7e0
190aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF_S	5
191aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_IQCORR_ENABLE		0x800
192aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX	0xf000
193aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX_S	12
194aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_DO_IQCAL		0x10000
195aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_ENABLE_SPUR_RSSI	0x80000000
196aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_ENABLE_SPUR_FILTER	0x40000000
197aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_ENABLE_CHAN_MASK	0x20000000
198aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING_CTRL4_ENABLE_PILOT_MASK	0x10000000
199aae9af60SChristian Lamparter 
200aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING5			(AR9170_PHY_REG_BASE + 0x0124)
201aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING5_CYCPWR_THR1		0x000000fe
202aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING5_CYCPWR_THR1_S	1
203aae9af60SChristian Lamparter 
204aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE1		(AR9170_PHY_REG_BASE + 0x0134)
205aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE2		(AR9170_PHY_REG_BASE + 0x0138)
206aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE_MAX	(AR9170_PHY_REG_BASE + 0x013c)
207aae9af60SChristian Lamparter #define		AR9170_PHY_POWER_TX_RATE_MAX_TPC_ENABLE	0x00000040
208aae9af60SChristian Lamparter 
209aae9af60SChristian Lamparter #define	AR9170_PHY_REG_FRAME_CTL		(AR9170_PHY_REG_BASE + 0x0144)
210aae9af60SChristian Lamparter #define		AR9170_PHY_FRAME_CTL_TX_CLIP		0x00000038
211aae9af60SChristian Lamparter #define		AR9170_PHY_FRAME_CTL_TX_CLIP_S		3
212aae9af60SChristian Lamparter 
213aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SPUR_REG			(AR9170_PHY_REG_BASE + 0x014c)
214aae9af60SChristian Lamparter #define		AR9170_PHY_SPUR_REG_MASK_RATE_CNTL	(0xff << 18)
215aae9af60SChristian Lamparter #define		AR9170_PHY_SPUR_REG_MASK_RATE_CNTL_S	18
216aae9af60SChristian Lamparter #define		AR9170_PHY_SPUR_REG_ENABLE_MASK_PPM	0x20000
217aae9af60SChristian Lamparter #define		AR9170_PHY_SPUR_REG_MASK_RATE_SELECT	(0xff << 9)
218aae9af60SChristian Lamparter #define		AR9170_PHY_SPUR_REG_MASK_RATE_SELECT_S	9
219aae9af60SChristian Lamparter #define		AR9170_PHY_SPUR_REG_ENABLE_VIT_SPUR_RSSI	0x100
220aae9af60SChristian Lamparter #define		AR9170_PHY_SPUR_REG_SPUR_RSSI_THRESH	0x7f
221aae9af60SChristian Lamparter #define		AR9170_PHY_SPUR_REG_SPUR_RSSI_THRESH_S	0
222aae9af60SChristian Lamparter 
223aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RADAR_EXT		(AR9170_PHY_REG_BASE + 0x0140)
224aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_EXT_ENA		0x00004000
225aae9af60SChristian Lamparter 
226aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RADAR_0			(AR9170_PHY_REG_BASE + 0x0154)
227aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_ENA			0x00000001
228aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_FFT_ENA		0x80000000
229aae9af60SChristian Lamparter /* inband pulse threshold */
230aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_INBAND		0x0000003e
231aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_INBAND_S		1
232aae9af60SChristian Lamparter /* pulse RSSI threshold */
233aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_PRSSI		0x00000fc0
234aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_PRSSI_S		6
235aae9af60SChristian Lamparter /* pulse height threshold */
236aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_HEIGHT		0x0003f000
237aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_HEIGHT_S		12
238aae9af60SChristian Lamparter /* radar RSSI threshold */
239aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_RRSSI		0x00fc0000
240aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_RRSSI_S		18
241aae9af60SChristian Lamparter /* radar firepower threshold */
242aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_FIRPWR		0x7f000000
243aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_0_FIRPWR_S		24
244aae9af60SChristian Lamparter 
245aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RADAR_1			(AR9170_PHY_REG_BASE + 0x0158)
246aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_RELPWR_ENA		0x00800000
247aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_USE_FIR128		0x00400000
248aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_RELPWR_THRESH	0x003f0000
249aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_RELPWR_THRESH_S	16
250aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_BLOCK_CHECK		0x00008000
251aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_MAX_RRSSI		0x00004000
252aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_RELSTEP_CHECK	0x00002000
253aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_RELSTEP_THRESH	0x00001f00
254aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_RELSTEP_THRESH_S	8
255aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_MAXLEN		0x000000ff
256aae9af60SChristian Lamparter #define		AR9170_PHY_RADAR_1_MAXLEN_S		0
257aae9af60SChristian Lamparter 
258aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SWITCH_CHAIN_0		(AR9170_PHY_REG_BASE + 0x0160)
259aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SWITCH_CHAIN_2		(AR9170_PHY_REG_BASE + 0x2160)
260aae9af60SChristian Lamparter 
261aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SWITCH_COM		(AR9170_PHY_REG_BASE + 0x0164)
262aae9af60SChristian Lamparter 
263aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CCA_THRESHOLD		(AR9170_PHY_REG_BASE + 0x0168)
264aae9af60SChristian Lamparter 
265aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SIGMA_DELTA		(AR9170_PHY_REG_BASE + 0x016c)
266aae9af60SChristian Lamparter #define		AR9170_PHY_SIGMA_DELTA_ADC_SEL		0x00000003
267aae9af60SChristian Lamparter #define		AR9170_PHY_SIGMA_DELTA_ADC_SEL_S	0
268aae9af60SChristian Lamparter #define		AR9170_PHY_SIGMA_DELTA_FILT2		0x000000f8
269aae9af60SChristian Lamparter #define		AR9170_PHY_SIGMA_DELTA_FILT2_S		3
270aae9af60SChristian Lamparter #define		AR9170_PHY_SIGMA_DELTA_FILT1		0x00001f00
271aae9af60SChristian Lamparter #define		AR9170_PHY_SIGMA_DELTA_FILT1_S		8
272aae9af60SChristian Lamparter #define		AR9170_PHY_SIGMA_DELTA_ADC_CLIP		0x01ffe000
273aae9af60SChristian Lamparter #define		AR9170_PHY_SIGMA_DELTA_ADC_CLIP_S	13
274aae9af60SChristian Lamparter 
275aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RESTART			(AR9170_PHY_REG_BASE + 0x0170)
276aae9af60SChristian Lamparter #define		AR9170_PHY_RESTART_DIV_GC		0x001c0000
277aae9af60SChristian Lamparter #define		AR9170_PHY_RESTART_DIV_GC_S		18
278aae9af60SChristian Lamparter 
279aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RFBUS_REQ		(AR9170_PHY_REG_BASE + 0x017c)
280aae9af60SChristian Lamparter #define		AR9170_PHY_RFBUS_REQ_EN			0x00000001
281aae9af60SChristian Lamparter 
282aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING7			(AR9170_PHY_REG_BASE + 0x0180)
283aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING8			(AR9170_PHY_REG_BASE + 0x0184)
284aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING8_PILOT_MASK_2		0x000fffff
285aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING8_PILOT_MASK_2_S	0
286aae9af60SChristian Lamparter 
287aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BIN_MASK2_1		(AR9170_PHY_REG_BASE + 0x0188)
288aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BIN_MASK2_2		(AR9170_PHY_REG_BASE + 0x018c)
289aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BIN_MASK2_3		(AR9170_PHY_REG_BASE + 0x0190)
290aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BIN_MASK2_4		(AR9170_PHY_REG_BASE + 0x0194)
291aae9af60SChristian Lamparter #define		AR9170_PHY_BIN_MASK2_4_MASK_4		0x00003fff
292aae9af60SChristian Lamparter #define		AR9170_PHY_BIN_MASK2_4_MASK_4_S		0
293aae9af60SChristian Lamparter 
294aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING9			(AR9170_PHY_REG_BASE + 0x0198)
295aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING10			(AR9170_PHY_REG_BASE + 0x019c)
296aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING10_PILOT_MASK_2	0x000fffff
297aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING10_PILOT_MASK_2_S	0
298aae9af60SChristian Lamparter 
299aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TIMING11			(AR9170_PHY_REG_BASE + 0x01a0)
300aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING11_SPUR_DELTA_PHASE	0x000fffff
301aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING11_SPUR_DELTA_PHASE_S	0
302aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING11_SPUR_FREQ_SD	0x3ff00000
303aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING11_SPUR_FREQ_SD_S	20
304aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING11_USE_SPUR_IN_AGC	0x40000000
305aae9af60SChristian Lamparter #define		AR9170_PHY_TIMING11_USE_SPUR_IN_SELFCOR	0x80000000
306aae9af60SChristian Lamparter 
307aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RX_CHAINMASK		(AR9170_PHY_REG_BASE + 0x01a4)
308aae9af60SChristian Lamparter #define	AR9170_PHY_REG_NEW_ADC_DC_GAIN_CORR(_i)	(AR9170_PHY_REG_BASE + \
309aae9af60SChristian Lamparter 						 0x01b4 + ((_i) << 12))
310aae9af60SChristian Lamparter #define		AR9170_PHY_NEW_ADC_GAIN_CORR_ENABLE		0x40000000
311aae9af60SChristian Lamparter #define		AR9170_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE	0x80000000
312aae9af60SChristian Lamparter 
313aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MULTICHAIN_GAIN_CTL	(AR9170_PHY_REG_BASE + 0x01ac)
314aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_CTL_ALL		0x7f000000
315aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_CTL		0x01000000
316aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_CTL_S		24
317aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_ALT_LNACONF	0x06000000
318aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_ALT_LNACONF_S	25
319aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_MAIN_LNACONF	0x18000000
320aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_MAIN_LNACONF_S	27
321aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_ALT_GAINTB	0x20000000
322aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_ALT_GAINTB_S	29
323aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_MAIN_GAINTB	0x40000000
324aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_MAIN_GAINTB_S	30
325aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_LNA1		2
326aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_LNA2		1
327aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_LNA1_PLUS_LNA2	3
328aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_LNA1_MINUS_LNA2	0
329aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_GAINTB_0	0
330aae9af60SChristian Lamparter #define		AR9170_PHY_9285_ANT_DIV_GAINTB_1	1
331aae9af60SChristian Lamparter 
332aae9af60SChristian Lamparter #define	AR9170_PHY_REG_EXT_CCA0			(AR9170_PHY_REG_BASE + 0x01b8)
333aae9af60SChristian Lamparter #define		AR9170_PHY_REG_EXT_CCA0_THRESH62	0x000000ff
334aae9af60SChristian Lamparter #define		AR9170_PHY_REG_EXT_CCA0_THRESH62_S	0
335aae9af60SChristian Lamparter 
336aae9af60SChristian Lamparter #define	AR9170_PHY_REG_EXT_CCA			(AR9170_PHY_REG_BASE + 0x01bc)
337aae9af60SChristian Lamparter #define		AR9170_PHY_EXT_CCA_CYCPWR_THR1		0x0000fe00
338aae9af60SChristian Lamparter #define		AR9170_PHY_EXT_CCA_CYCPWR_THR1_S	9
339aae9af60SChristian Lamparter #define		AR9170_PHY_EXT_CCA_THRESH62		0x007f0000
340aae9af60SChristian Lamparter #define		AR9170_PHY_EXT_CCA_THRESH62_S		16
341*3f1240e4SChristian Lamparter #define		AR9170_PHY_EXT_CCA_MIN_PWR		0xff800000
342*3f1240e4SChristian Lamparter #define		AR9170_PHY_EXT_CCA_MIN_PWR_S		23
343aae9af60SChristian Lamparter 
344aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SFCORR_EXT		(AR9170_PHY_REG_BASE + 0x01c0)
345aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_EXT_M1_THRESH		0x0000007f
346aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_EXT_M1_THRESH_S	0
347aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_EXT_M2_THRESH		0x00003f80
348aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_EXT_M2_THRESH_S	7
349aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_EXT_M1_THRESH_LOW	0x001fc000
350aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_EXT_M1_THRESH_LOW_S	14
351aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_EXT_M2_THRESH_LOW	0x0fe00000
352aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_EXT_M2_THRESH_LOW_S	21
353aae9af60SChristian Lamparter #define		AR9170_PHY_SFCORR_SPUR_SUBCHNL_SD_S	28
354aae9af60SChristian Lamparter 
355aae9af60SChristian Lamparter #define	AR9170_PHY_REG_HALFGI			(AR9170_PHY_REG_BASE + 0x01d0)
356aae9af60SChristian Lamparter #define		AR9170_PHY_HALFGI_DSC_MAN		0x0007fff0
357aae9af60SChristian Lamparter #define		AR9170_PHY_HALFGI_DSC_MAN_S		4
358aae9af60SChristian Lamparter #define		AR9170_PHY_HALFGI_DSC_EXP		0x0000000f
359aae9af60SChristian Lamparter #define		AR9170_PHY_HALFGI_DSC_EXP_S		0
360aae9af60SChristian Lamparter 
361aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CHANNEL_MASK_01_30	(AR9170_PHY_REG_BASE + 0x01d4)
362aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CHANNEL_MASK_31_60	(AR9170_PHY_REG_BASE + 0x01d8)
363aae9af60SChristian Lamparter 
364aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CHAN_INFO_MEMORY		(AR9170_PHY_REG_BASE + 0x01dc)
365aae9af60SChristian Lamparter #define		AR9170_PHY_CHAN_INFO_MEMORY_CAPTURE_MASK	0x0001
366aae9af60SChristian Lamparter 
367aae9af60SChristian Lamparter #define	AR9170_PHY_REG_HEAVY_CLIP_ENABLE	(AR9170_PHY_REG_BASE + 0x01e0)
368aae9af60SChristian Lamparter #define	AR9170_PHY_REG_HEAVY_CLIP_FACTOR_RIFS	(AR9170_PHY_REG_BASE + 0x01ec)
369aae9af60SChristian Lamparter #define		AR9170_PHY_RIFS_INIT_DELAY		0x03ff0000
370aae9af60SChristian Lamparter 
371aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CALMODE			(AR9170_PHY_REG_BASE + 0x01f0)
372aae9af60SChristian Lamparter #define		AR9170_PHY_CALMODE_IQ			0x00000000
373aae9af60SChristian Lamparter #define		AR9170_PHY_CALMODE_ADC_GAIN		0x00000001
374aae9af60SChristian Lamparter #define		AR9170_PHY_CALMODE_ADC_DC_PER		0x00000002
375aae9af60SChristian Lamparter #define		AR9170_PHY_CALMODE_ADC_DC_INIT		0x00000003
376aae9af60SChristian Lamparter 
377aae9af60SChristian Lamparter #define	AR9170_PHY_REG_REFCLKDLY		(AR9170_PHY_REG_BASE + 0x01f4)
378aae9af60SChristian Lamparter #define	AR9170_PHY_REG_REFCLKPD			(AR9170_PHY_REG_BASE + 0x01f8)
379aae9af60SChristian Lamparter 
380aae9af60SChristian Lamparter 
381aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CAL_MEAS_0(_i)		(AR9170_PHY_REG_BASE + \
382aae9af60SChristian Lamparter 						 0x0410 + ((_i) << 12))
383aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CAL_MEAS_1(_i)		(AR9170_PHY_REG_BASE + \
384aae9af60SChristian Lamparter 						 0x0414 \ + ((_i) << 12))
385aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CAL_MEAS_2(_i)		(AR9170_PHY_REG_BASE + \
386aae9af60SChristian Lamparter 						 0x0418 + ((_i) << 12))
387aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CAL_MEAS_3(_i)		(AR9170_PHY_REG_BASE + \
388aae9af60SChristian Lamparter 						 0x041c + ((_i) << 12))
389aae9af60SChristian Lamparter 
390aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CURRENT_RSSI		(AR9170_PHY_REG_BASE + 0x041c)
391aae9af60SChristian Lamparter 
392aae9af60SChristian Lamparter #define	AR9170_PHY_REG_RFBUS_GRANT		(AR9170_PHY_REG_BASE + 0x0420)
393aae9af60SChristian Lamparter #define		AR9170_PHY_RFBUS_GRANT_EN		0x00000001
394aae9af60SChristian Lamparter 
395aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CHAN_INFO_GAIN_DIFF	(AR9170_PHY_REG_BASE + 0x04f4)
396aae9af60SChristian Lamparter #define		AR9170_PHY_CHAN_INFO_GAIN_DIFF_UPPER_LIMIT	320
397aae9af60SChristian Lamparter 
398aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CHAN_INFO_GAIN		(AR9170_PHY_REG_BASE + 0x04fc)
399aae9af60SChristian Lamparter 
400aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MODE			(AR9170_PHY_REG_BASE + 0x0a00)
401aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_ASYNCFIFO		0x80
402aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_AR2133			0x08
403aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_AR5111			0x00
404aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_AR5112			0x08
405aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_DYNAMIC			0x04
406aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_RF2GHZ			0x02
407aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_RF5GHZ			0x00
408aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_CCK			0x01
409aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_OFDM			0x00
410aae9af60SChristian Lamparter #define		AR9170_PHY_MODE_DYN_CCK_DISABLE		0x100
411aae9af60SChristian Lamparter 
412aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CCK_TX_CTRL		(AR9170_PHY_REG_BASE + 0x0a04)
413aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_TX_CTRL_JAPAN			0x00000010
414aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_TX_CTRL_TX_DAC_SCALE_CCK         0x0000000c
415aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_TX_CTRL_TX_DAC_SCALE_CCK_S       2
416aae9af60SChristian Lamparter 
417aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CCK_DETECT		(AR9170_PHY_REG_BASE + 0x0a08)
418aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_DETECT_WEAK_SIG_THR_CCK		0x0000003f
419aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_DETECT_WEAK_SIG_THR_CCK_S	0
420aae9af60SChristian Lamparter /* [12:6] settling time for antenna switch */
421aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_DETECT_ANT_SWITCH_TIME		0x00001fc0
422aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_DETECT_ANT_SWITCH_TIME_S		6
423aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV	0x2000
424aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV_S	13
425aae9af60SChristian Lamparter 
426aae9af60SChristian Lamparter #define	AR9170_PHY_REG_GAIN_2GHZ		(AR9170_PHY_REG_BASE + 0x0a0c)
4275c895691SChristian Lamparter #define	AR9170_PHY_REG_GAIN_2GHZ_CHAIN_2	(AR9170_PHY_REG_BASE + 0x2a0c)
428aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_RXTX_MARGIN	0x00fc0000
429aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_RXTX_MARGIN_S	18
430aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_BSW_MARGIN		0x00003c00
431aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_BSW_MARGIN_S	10
432aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_BSW_ATTEN		0x0000001f
433aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_BSW_ATTEN_S	0
434aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_XATTEN2_MARGIN	0x003e0000
435aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_XATTEN2_MARGIN_S	17
436aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_XATTEN1_MARGIN	0x0001f000
437aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_XATTEN1_MARGIN_S	12
438aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_XATTEN2_DB		0x00000fc0
439aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_XATTEN2_DB_S	6
440aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_XATTEN1_DB		0x0000003f
441aae9af60SChristian Lamparter #define		AR9170_PHY_GAIN_2GHZ_XATTEN1_DB_S	0
442aae9af60SChristian Lamparter 
443aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CCK_RXCTRL4		(AR9170_PHY_REG_BASE + 0x0a1c)
444aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_RXCTRL4_FREQ_EST_SHORT	0x01f80000
445aae9af60SChristian Lamparter #define		AR9170_PHY_CCK_RXCTRL4_FREQ_EST_SHORT_S	19
446aae9af60SChristian Lamparter 
447aae9af60SChristian Lamparter #define	AR9170_PHY_REG_DAG_CTRLCCK		(AR9170_PHY_REG_BASE + 0x0a28)
448aae9af60SChristian Lamparter #define		AR9170_REG_DAG_CTRLCCK_EN_RSSI_THR	0x00000200
449aae9af60SChristian Lamparter #define		AR9170_REG_DAG_CTRLCCK_RSSI_THR		0x0001fc00
450aae9af60SChristian Lamparter #define		AR9170_REG_DAG_CTRLCCK_RSSI_THR_S	10
451aae9af60SChristian Lamparter 
452aae9af60SChristian Lamparter #define	AR9170_PHY_REG_FORCE_CLKEN_CCK		(AR9170_PHY_REG_BASE + 0x0a2c)
453aae9af60SChristian Lamparter #define		AR9170_FORCE_CLKEN_CCK_MRC_MUX		0x00000040
454aae9af60SChristian Lamparter 
455aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE3		(AR9170_PHY_REG_BASE + 0x0a34)
456aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE4		(AR9170_PHY_REG_BASE + 0x0a38)
457aae9af60SChristian Lamparter 
458aae9af60SChristian Lamparter #define	AR9170_PHY_REG_SCRM_SEQ_XR		(AR9170_PHY_REG_BASE + 0x0a3c)
459aae9af60SChristian Lamparter #define	AR9170_PHY_REG_HEADER_DETECT_XR		(AR9170_PHY_REG_BASE + 0x0a40)
460aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CHIRP_DETECTED_XR	(AR9170_PHY_REG_BASE + 0x0a44)
461aae9af60SChristian Lamparter #define	AR9170_PHY_REG_BLUETOOTH		(AR9170_PHY_REG_BASE + 0x0a54)
462aae9af60SChristian Lamparter 
463aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TPCRG1			(AR9170_PHY_REG_BASE + 0x0a58)
464aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_NUM_PD_GAIN		0x0000c000
465aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_NUM_PD_GAIN_S		14
466aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_PD_GAIN_1		0x00030000
467aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_PD_GAIN_1_S		16
468aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_PD_GAIN_2		0x000c0000
469aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_PD_GAIN_2_S		18
470aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_PD_GAIN_3		0x00300000
471aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_PD_GAIN_3_S		20
472aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_PD_CAL_ENABLE		0x00400000
473aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG1_PD_CAL_ENABLE_S	22
474aae9af60SChristian Lamparter 
475aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TX_PWRCTRL4		(AR9170_PHY_REG_BASE + 0x0a64)
476aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL_PD_AVG_VALID	0x00000001
477aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL_PD_AVG_VALID_S	0
478aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL_PD_AVG_OUT	0x000001fe
479aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL_PD_AVG_OUT_S	1
480aae9af60SChristian Lamparter 
481aae9af60SChristian Lamparter #define	AR9170_PHY_REG_ANALOG_SWAP		(AR9170_PHY_REG_BASE + 0x0a68)
482aae9af60SChristian Lamparter #define		AR9170_PHY_ANALOG_SWAP_AB		0x0001
483aae9af60SChristian Lamparter #define		AR9170_PHY_ANALOG_SWAP_ALT_CHAIN	0x00000040
484aae9af60SChristian Lamparter 
485aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TPCRG5			(AR9170_PHY_REG_BASE + 0x0a6c)
486aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_OVERLAP	0x0000000f
487aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_OVERLAP_S	0
488aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_BOUNDARY_1	0x000003f0
489aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_BOUNDARY_1_S	4
490aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_BOUNDARY_2	0x0000fc00
491aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_BOUNDARY_2_S	10
492aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_BOUNDARY_3    0x003f0000
493aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_BOUNDARY_3_S  16
494aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_BOUNDARY_4    0x0fc00000
495aae9af60SChristian Lamparter #define		AR9170_PHY_TPCRG5_PD_GAIN_BOUNDARY_4_S  22
496aae9af60SChristian Lamparter 
497aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TX_PWRCTRL6_0		(AR9170_PHY_REG_BASE + 0x0a70)
498aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TX_PWRCTRL6_1		(AR9170_PHY_REG_BASE + 0x1a70)
499aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL_ERR_EST_MODE	0x03000000
500aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL_ERR_EST_MODE_S	24
501aae9af60SChristian Lamparter 
502aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TX_PWRCTRL7		(AR9170_PHY_REG_BASE + 0x0a74)
503aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL_INIT_TX_GAIN	0x01f80000
504aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL_INIT_TX_GAIN_S	19
505aae9af60SChristian Lamparter 
506aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TX_PWRCTRL9		(AR9170_PHY_REG_BASE + 0x0a7c)
507aae9af60SChristian Lamparter #define		AR9170_PHY_TX_DESIRED_SCALE_CCK		0x00007c00
508aae9af60SChristian Lamparter #define		AR9170_PHY_TX_DESIRED_SCALE_CCK_S	10
509aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL9_RES_DC_REMOVAL	0x80000000
510aae9af60SChristian Lamparter #define		AR9170_PHY_TX_PWRCTRL9_RES_DC_REMOVAL_S	31
511aae9af60SChristian Lamparter 
512aae9af60SChristian Lamparter #define	AR9170_PHY_REG_TX_GAIN_TBL1		(AR9170_PHY_REG_BASE + 0x0b00)
513aae9af60SChristian Lamparter #define		AR9170_PHY_TX_GAIN			0x0007f000
514aae9af60SChristian Lamparter #define		AR9170_PHY_TX_GAIN_S			12
515aae9af60SChristian Lamparter 
516aae9af60SChristian Lamparter /* Carrier leak calibration control, do it after AGC calibration */
517aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CL_CAL_CTL		(AR9170_PHY_REG_BASE + 0x0b58)
518aae9af60SChristian Lamparter #define		AR9170_PHY_CL_CAL_ENABLE		0x00000002
519aae9af60SChristian Lamparter #define		AR9170_PHY_CL_CAL_PARALLEL_CAL_ENABLE	0x00000001
520aae9af60SChristian Lamparter 
521aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE5		(AR9170_PHY_REG_BASE + 0x0b8c)
522aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE6		(AR9170_PHY_REG_BASE + 0x0b90)
523aae9af60SChristian Lamparter 
524aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CH0_TX_PWRCTRL11		(AR9170_PHY_REG_BASE + 0x0b98)
525aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CH1_TX_PWRCTRL11		(AR9170_PHY_REG_BASE + 0x1b98)
526aae9af60SChristian Lamparter #define		AR9170_PHY_TX_CHX_PWRCTRL_OLPC_TEMP_COMP	0x0000fc00
527aae9af60SChristian Lamparter #define		AR9170_PHY_TX_CHX_PWRCTRL_OLPC_TEMP_COMP_S	10
528aae9af60SChristian Lamparter 
529aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CAL_CHAINMASK		(AR9170_PHY_REG_BASE + 0x0b9c)
530aae9af60SChristian Lamparter #define	AR9170_PHY_REG_VIT_MASK2_M_46_61	(AR9170_PHY_REG_BASE + 0x0ba0)
531aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MASK2_M_31_45		(AR9170_PHY_REG_BASE + 0x0ba4)
532aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MASK2_M_16_30		(AR9170_PHY_REG_BASE + 0x0ba8)
533aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MASK2_M_00_15		(AR9170_PHY_REG_BASE + 0x0bac)
534aae9af60SChristian Lamparter #define	AR9170_PHY_REG_PILOT_MASK_01_30		(AR9170_PHY_REG_BASE + 0x0bb0)
535aae9af60SChristian Lamparter #define	AR9170_PHY_REG_PILOT_MASK_31_60		(AR9170_PHY_REG_BASE + 0x0bb4)
536aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MASK2_P_15_01		(AR9170_PHY_REG_BASE + 0x0bb8)
537aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MASK2_P_30_16		(AR9170_PHY_REG_BASE + 0x0bbc)
538aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MASK2_P_45_31		(AR9170_PHY_REG_BASE + 0x0bc0)
539aae9af60SChristian Lamparter #define	AR9170_PHY_REG_MASK2_P_61_45		(AR9170_PHY_REG_BASE + 0x0bc4)
540aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_SUB		(AR9170_PHY_REG_BASE + 0x0bc8)
541aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE7		(AR9170_PHY_REG_BASE + 0x0bcc)
542aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE8		(AR9170_PHY_REG_BASE + 0x0bd0)
543aae9af60SChristian Lamparter #define	AR9170_PHY_REG_POWER_TX_RATE9		(AR9170_PHY_REG_BASE + 0x0bd4)
544aae9af60SChristian Lamparter #define	AR9170_PHY_REG_XPA_CFG			(AR9170_PHY_REG_BASE + 0x0bd8)
545aae9af60SChristian Lamparter #define		AR9170_PHY_FORCE_XPA_CFG		0x000000001
546aae9af60SChristian Lamparter #define		AR9170_PHY_FORCE_XPA_CFG_S		0
547aae9af60SChristian Lamparter 
548aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CH1_CCA			(AR9170_PHY_REG_BASE + 0x1064)
549*3f1240e4SChristian Lamparter #define		AR9170_PHY_CH1_CCA_MIN_PWR		0x0ff80000
550*3f1240e4SChristian Lamparter #define		AR9170_PHY_CH1_CCA_MIN_PWR_S		19
551aae9af60SChristian Lamparter 
552aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CH2_CCA			(AR9170_PHY_REG_BASE + 0x2064)
553*3f1240e4SChristian Lamparter #define		AR9170_PHY_CH2_CCA_MIN_PWR		0x0ff80000
554*3f1240e4SChristian Lamparter #define		AR9170_PHY_CH2_CCA_MIN_PWR_S		19
555aae9af60SChristian Lamparter 
556aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CH1_EXT_CCA		(AR9170_PHY_REG_BASE + 0x11bc)
557*3f1240e4SChristian Lamparter #define		AR9170_PHY_CH1_EXT_CCA_MIN_PWR		0xff800000
558*3f1240e4SChristian Lamparter #define		AR9170_PHY_CH1_EXT_CCA_MIN_PWR_S	23
559aae9af60SChristian Lamparter 
560aae9af60SChristian Lamparter #define	AR9170_PHY_REG_CH2_EXT_CCA		(AR9170_PHY_REG_BASE + 0x21bc)
561*3f1240e4SChristian Lamparter #define		AR9170_PHY_CH2_EXT_CCA_MIN_PWR		0xff800000
562*3f1240e4SChristian Lamparter #define		AR9170_PHY_CH2_EXT_CCA_MIN_PWR_S	23
563aae9af60SChristian Lamparter 
564aae9af60SChristian Lamparter #endif	/* __CARL9170_SHARED_PHY_H */
565