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 PHY_H 1862306a36Sopenharmony_ci#define PHY_H 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#define CHANSEL_DIV 15 2162306a36Sopenharmony_ci#define CHANSEL_2G(_freq) (((_freq) * 0x10000) / CHANSEL_DIV) 2262306a36Sopenharmony_ci#define CHANSEL_5G(_freq) (((_freq) * 0x8000) / CHANSEL_DIV) 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci#define AR_PHY_BASE 0x9800 2562306a36Sopenharmony_ci#define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2)) 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX 0x0007E000 2862306a36Sopenharmony_ci#define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX_S 13 2962306a36Sopenharmony_ci#define AR_PHY_TX_GAIN_CLC 0x0000001E 3062306a36Sopenharmony_ci#define AR_PHY_TX_GAIN_CLC_S 1 3162306a36Sopenharmony_ci#define AR_PHY_TX_GAIN 0x0007F000 3262306a36Sopenharmony_ci#define AR_PHY_TX_GAIN_S 12 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#define AR_PHY_CLC_TBL1 0xa35c 3562306a36Sopenharmony_ci#define AR_PHY_CLC_I0 0x07ff0000 3662306a36Sopenharmony_ci#define AR_PHY_CLC_I0_S 16 3762306a36Sopenharmony_ci#define AR_PHY_CLC_Q0 0x0000ffd0 3862306a36Sopenharmony_ci#define AR_PHY_CLC_Q0_S 5 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci#define ANTSWAP_AB 0x0001 4162306a36Sopenharmony_ci#define REDUCE_CHAIN_0 0x00000050 4262306a36Sopenharmony_ci#define REDUCE_CHAIN_1 0x00000051 4362306a36Sopenharmony_ci#define AR_PHY_CHIP_ID 0x9818 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci#define AR_PHY_TIMING11_SPUR_FREQ_SD 0x3FF00000 4662306a36Sopenharmony_ci#define AR_PHY_TIMING11_SPUR_FREQ_SD_S 20 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci#define AR_PHY_PLL_CONTROL 0x16180 4962306a36Sopenharmony_ci#define AR_PHY_PLL_MODE 0x16184 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_cienum ath9k_ant_div_comb_lna_conf { 5262306a36Sopenharmony_ci ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2, 5362306a36Sopenharmony_ci ATH_ANT_DIV_COMB_LNA2, 5462306a36Sopenharmony_ci ATH_ANT_DIV_COMB_LNA1, 5562306a36Sopenharmony_ci ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2, 5662306a36Sopenharmony_ci}; 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci#endif 59