xref: /dflybsd-src/sys/dev/netif/ath/ath_hal/ar9002/ar9285phy.h (revision 572ff6f6e8b95055988f178b6ba12ce77bb5b3c2)
1*572ff6f6SMatthew Dillon /*
2*572ff6f6SMatthew Dillon  * Copyright (c) 2008-2010 Atheros Communications Inc.
3*572ff6f6SMatthew Dillon  * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd.
4*572ff6f6SMatthew Dillon  *
5*572ff6f6SMatthew Dillon  * Redistribution and use in source and binary forms, with or without
6*572ff6f6SMatthew Dillon  * modification, are permitted provided that the following conditions
7*572ff6f6SMatthew Dillon  * are met:
8*572ff6f6SMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
9*572ff6f6SMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
10*572ff6f6SMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
11*572ff6f6SMatthew Dillon  *    notice, this list of conditions and the following disclaimer in the
12*572ff6f6SMatthew Dillon  *    documentation and/or other materials provided with the distribution.
13*572ff6f6SMatthew Dillon  *
14*572ff6f6SMatthew Dillon  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*572ff6f6SMatthew Dillon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*572ff6f6SMatthew Dillon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*572ff6f6SMatthew Dillon  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*572ff6f6SMatthew Dillon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*572ff6f6SMatthew Dillon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*572ff6f6SMatthew Dillon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*572ff6f6SMatthew Dillon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*572ff6f6SMatthew Dillon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*572ff6f6SMatthew Dillon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*572ff6f6SMatthew Dillon  * SUCH DAMAGE.
25*572ff6f6SMatthew Dillon  *
26*572ff6f6SMatthew Dillon  * $FreeBSD$
27*572ff6f6SMatthew Dillon  */
28*572ff6f6SMatthew Dillon #ifndef	__ATH_AR9285PHY_H__
29*572ff6f6SMatthew Dillon #define	__ATH_AR9285PHY_H__
30*572ff6f6SMatthew Dillon 
31*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1              0x7820
32*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1_ENPACAL      0x00000800
33*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1_ENPACAL_S    11
34*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1_PDPADRV1     0x02000000
35*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1_PDPADRV1_S   25
36*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1_PDPADRV2     0x01000000
37*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1_PDPADRV2_S   24
38*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1_PDPAOUT      0x00800000
39*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G1_PDPAOUT_S    23
40*572ff6f6SMatthew Dillon 
41*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G2              0x7824
42*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G2_OFFCAL       0x00001000
43*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G2_OFFCAL_S     12
44*572ff6f6SMatthew Dillon 
45*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3             0x7828
46*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_PDVCCOMP    0x02000000
47*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_PDVCCOMP_S  25
48*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_0    0x00E00000
49*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_0_S    21
50*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_1    0x001C0000
51*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_1_S    18
52*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_2    0x00038000
53*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_2_S    15
54*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_3    0x00007000
55*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_3_S    12
56*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_4    0x00000E00
57*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_OB_4_S    9
58*572ff6f6SMatthew Dillon 
59*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_DB1_0    0x000001C0
60*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_DB1_0_S    6
61*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_DB1_1    0x00000038
62*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_DB1_1_S    3
63*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_DB1_2    0x00000007
64*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G3_DB1_2_S    0
65*572ff6f6SMatthew Dillon 
66*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4         0x782C
67*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB1_3    0xE0000000
68*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB1_3_S    29
69*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB1_4    0x1C000000
70*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB1_4_S    26
71*572ff6f6SMatthew Dillon 
72*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_0    0x03800000
73*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_0_S    23
74*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_1    0x00700000
75*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_1_S    20
76*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_2    0x000E0000
77*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_2_S    17
78*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_3    0x0001C000
79*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_3_S    14
80*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_4    0x00003800
81*572ff6f6SMatthew Dillon #define AR9285_AN_RF2G4_DB2_4_S    11
82*572ff6f6SMatthew Dillon 
83*572ff6f6SMatthew Dillon #define AR9285_RF2G5                    0x7830
84*572ff6f6SMatthew Dillon #define AR9285_RF2G5_IC50TX             0xfffff8ff
85*572ff6f6SMatthew Dillon #define AR9285_RF2G5_IC50TX_SET         0x00000400
86*572ff6f6SMatthew Dillon #define AR9285_RF2G5_IC50TX_XE_SET      0x00000500
87*572ff6f6SMatthew Dillon #define AR9285_RF2G5_IC50TX_CLEAR       0x00000700
88*572ff6f6SMatthew Dillon #define AR9285_RF2G5_IC50TX_CLEAR_S     8
89*572ff6f6SMatthew Dillon 
90*572ff6f6SMatthew Dillon #define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX   0x0007E000
91*572ff6f6SMatthew Dillon #define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX_S 13
92*572ff6f6SMatthew Dillon #define AR_PHY_TX_GAIN_CLC       0x0000001E
93*572ff6f6SMatthew Dillon #define AR_PHY_TX_GAIN_CLC_S     1
94*572ff6f6SMatthew Dillon #define AR_PHY_TX_GAIN           0x0007F000
95*572ff6f6SMatthew Dillon #define AR_PHY_TX_GAIN_S         12
96*572ff6f6SMatthew Dillon 
97*572ff6f6SMatthew Dillon #define AR_PHY_CLC_TBL1      0xa35c
98*572ff6f6SMatthew Dillon #define AR_PHY_CLC_I0        0x07ff0000
99*572ff6f6SMatthew Dillon #define AR_PHY_CLC_I0_S      16
100*572ff6f6SMatthew Dillon #define AR_PHY_CLC_Q0        0x0000ffd0
101*572ff6f6SMatthew Dillon #define AR_PHY_CLC_Q0_S      5
102*572ff6f6SMatthew Dillon 
103*572ff6f6SMatthew Dillon #define AR_PHY_MULTICHAIN_GAIN_CTL          0x99ac
104*572ff6f6SMatthew Dillon #define AR_PHY_9285_FAST_DIV_BIAS           0x00007E00
105*572ff6f6SMatthew Dillon #define AR_PHY_9285_FAST_DIV_BIAS_S         9
106*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_CTL_ALL         0x7f000000
107*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_CTL             0x01000000
108*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_CTL_S           24
109*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_ALT_LNACONF     0x06000000
110*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_ALT_LNACONF_S   25
111*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_MAIN_LNACONF    0x18000000
112*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S  27
113*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_ALT_GAINTB      0x20000000
114*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_ALT_GAINTB_S    29
115*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_MAIN_GAINTB     0x40000000
116*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_MAIN_GAINTB_S   30
117*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_LNA1            2
118*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_LNA2            1
119*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_LNA1_PLUS_LNA2  3
120*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_LNA1_MINUS_LNA2 0
121*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_GAINTB_0        0
122*572ff6f6SMatthew Dillon #define AR_PHY_9285_ANT_DIV_GAINTB_1        1
123*572ff6f6SMatthew Dillon 
124*572ff6f6SMatthew Dillon /* for AR_PHY_CCK_DETECT */
125*572ff6f6SMatthew Dillon #define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME           0x00001FC0
126*572ff6f6SMatthew Dillon #define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME_S         6
127*572ff6f6SMatthew Dillon #define AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV    0x2000
128*572ff6f6SMatthew Dillon #define AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV_S  13
129*572ff6f6SMatthew Dillon 
130*572ff6f6SMatthew Dillon #endif
131