Luis R. Rodriguez | f078f20 | 2008-08-04 00:16:41 -0700 | [diff] [blame] | 1 | /* |
Sujith Manoharan | 5b68138 | 2011-05-17 13:36:18 +0530 | [diff] [blame] | 2 | * Copyright (c) 2008-2011 Atheros Communications Inc. |
Luis R. Rodriguez | f078f20 | 2008-08-04 00:16:41 -0700 | [diff] [blame] | 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for any |
| 5 | * purpose with or without fee is hereby granted, provided that the above |
| 6 | * copyright notice and this permission notice appear in all copies. |
| 7 | * |
| 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 15 | */ |
| 16 | |
| 17 | #ifndef PHY_H |
| 18 | #define PHY_H |
| 19 | |
Luis R. Rodriguez | 7152451 | 2010-04-15 17:38:32 -0400 | [diff] [blame] | 20 | #define CHANSEL_DIV 15 |
| 21 | #define CHANSEL_2G(_freq) (((_freq) * 0x10000) / CHANSEL_DIV) |
| 22 | #define CHANSEL_5G(_freq) (((_freq) * 0x8000) / CHANSEL_DIV) |
| 23 | |
Luis R. Rodriguez | f078f20 | 2008-08-04 00:16:41 -0700 | [diff] [blame] | 24 | #define AR_PHY_BASE 0x9800 |
| 25 | #define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2)) |
| 26 | |
Vivek Natarajan | 53bc7aa | 2010-04-05 14:48:04 +0530 | [diff] [blame] | 27 | #define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX 0x0007E000 |
| 28 | #define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX_S 13 |
Vivek Natarajan | 53bc7aa | 2010-04-05 14:48:04 +0530 | [diff] [blame] | 29 | #define AR_PHY_TX_GAIN_CLC 0x0000001E |
| 30 | #define AR_PHY_TX_GAIN_CLC_S 1 |
| 31 | #define AR_PHY_TX_GAIN 0x0007F000 |
| 32 | #define AR_PHY_TX_GAIN_S 12 |
| 33 | |
| 34 | #define AR_PHY_CLC_TBL1 0xa35c |
| 35 | #define AR_PHY_CLC_I0 0x07ff0000 |
| 36 | #define AR_PHY_CLC_I0_S 16 |
| 37 | #define AR_PHY_CLC_Q0 0x0000ffd0 |
| 38 | #define AR_PHY_CLC_Q0_S 5 |
Senthil Balasubramanian | 8bd1d07 | 2009-02-12 13:57:03 +0530 | [diff] [blame] | 39 | |
Luis R. Rodriguez | f078f20 | 2008-08-04 00:16:41 -0700 | [diff] [blame] | 40 | #define ANTSWAP_AB 0x0001 |
| 41 | #define REDUCE_CHAIN_0 0x00000050 |
| 42 | #define REDUCE_CHAIN_1 0x00000051 |
Luis R. Rodriguez | 8fe6536 | 2010-04-15 17:38:14 -0400 | [diff] [blame] | 43 | #define AR_PHY_CHIP_ID 0x9818 |
Luis R. Rodriguez | f078f20 | 2008-08-04 00:16:41 -0700 | [diff] [blame] | 44 | |
Luis R. Rodriguez | 1547da3 | 2010-04-15 17:39:15 -0400 | [diff] [blame] | 45 | #define AR_PHY_TIMING11_SPUR_FREQ_SD 0x3FF00000 |
| 46 | #define AR_PHY_TIMING11_SPUR_FREQ_SD_S 20 |
| 47 | |
Vasanthakumar Thiagarajan | 0b488ac | 2011-04-20 10:26:15 +0530 | [diff] [blame] | 48 | #define AR_PHY_PLL_CONTROL 0x16180 |
| 49 | #define AR_PHY_PLL_MODE 0x16184 |
| 50 | |
Luis R. Rodriguez | f078f20 | 2008-08-04 00:16:41 -0700 | [diff] [blame] | 51 | #endif |