a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/*
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright (c) 2008-2011 Atheros Communications Inc.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Permission to use, copy, modify, and/or distribute this software for any
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * purpose with or without fee is hereby granted, provided that the above
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * copyright notice and this permission notice appear in all copies.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#ifndef PHY_H
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define PHY_H
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define CHANSEL_DIV 15
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define CHANSEL_2G(_freq) (((_freq) * 0x10000) / CHANSEL_DIV)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define CHANSEL_5G(_freq) (((_freq) * 0x8000) / CHANSEL_DIV)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_BASE 0x9800
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2))
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX 0x0007E000
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX_S 13
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_TX_GAIN_CLC 0x0000001E
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_TX_GAIN_CLC_S 1
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_TX_GAIN 0x0007F000
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_TX_GAIN_S 12
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_CLC_TBL1 0xa35c
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_CLC_I0 0x07ff0000
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_CLC_I0_S 16
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_CLC_Q0 0x0000ffd0
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_CLC_Q0_S 5
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define ANTSWAP_AB 0x0001
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define REDUCE_CHAIN_0 0x00000050
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define REDUCE_CHAIN_1 0x00000051
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_CHIP_ID 0x9818
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_TIMING11_SPUR_FREQ_SD 0x3FF00000
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_TIMING11_SPUR_FREQ_SD_S 20
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_PLL_CONTROL 0x16180
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define AR_PHY_PLL_MODE 0x16184
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#endif