1*6e778a7eSPedro F. Giffuni /*- 2*6e778a7eSPedro F. Giffuni * SPDX-License-Identifier: ISC 3*6e778a7eSPedro F. Giffuni * 414779705SSam Leffler * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 514779705SSam Leffler * Copyright (c) 2002-2004 Atheros Communications, Inc. 614779705SSam Leffler * 714779705SSam Leffler * Permission to use, copy, modify, and/or distribute this software for any 814779705SSam Leffler * purpose with or without fee is hereby granted, provided that the above 914779705SSam Leffler * copyright notice and this permission notice appear in all copies. 1014779705SSam Leffler * 1114779705SSam Leffler * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 1214779705SSam Leffler * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1314779705SSam Leffler * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1414779705SSam Leffler * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1514779705SSam Leffler * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1614779705SSam Leffler * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1714779705SSam Leffler * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1814779705SSam Leffler */ 1914779705SSam Leffler #ifndef _DEV_ATH_AR5210PHY_H 2014779705SSam Leffler #define _DEV_ATH_AR5210PHY_H 2114779705SSam Leffler 2214779705SSam Leffler /* 2314779705SSam Leffler * Definitions for the PHY on the Atheros AR5210 parts. 2414779705SSam Leffler */ 2514779705SSam Leffler 2614779705SSam Leffler /* PHY Registers */ 2714779705SSam Leffler #define AR_PHY_BASE 0x9800 /* PHY register base */ 2814779705SSam Leffler #define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2)) 2914779705SSam Leffler 3014779705SSam Leffler #define AR_PHY_FRCTL 0x9804 /* PHY frame control */ 3114779705SSam Leffler #define AR_PHY_TURBO_MODE 0x00000001 /* PHY turbo mode */ 3214779705SSam Leffler #define AR_PHY_TURBO_SHORT 0x00000002 /* PHY turbo short symbol */ 3314779705SSam Leffler #define AR_PHY_TIMING_ERR 0x01000000 /* Detect PHY timing error */ 3414779705SSam Leffler #define AR_PHY_PARITY_ERR 0x02000000 /* Detect signal parity err */ 3514779705SSam Leffler #define AR_PHY_ILLRATE_ERR 0x04000000 /* Detect PHY illegal rate */ 3614779705SSam Leffler #define AR_PHY_ILLLEN_ERR 0x08000000 /* Detect PHY illegal length */ 3714779705SSam Leffler #define AR_PHY_SERVICE_ERR 0x20000000 /* Detect PHY nonzero service */ 3814779705SSam Leffler #define AR_PHY_TXURN_ERR 0x40000000 /* DetectPHY TX underrun */ 3914779705SSam Leffler #define AR_PHY_FRCTL_BITS \ 4014779705SSam Leffler "\20\1TURBO_MODE\2TURBO_SHORT\30TIMING_ERR\31PARITY_ERR\32ILLRATE_ERR"\ 4114779705SSam Leffler "\33ILLEN_ERR\35SERVICE_ERR\36TXURN_ERR" 4214779705SSam Leffler 4314779705SSam Leffler #define AR_PHY_AGC 0x9808 /* PHY AGC command */ 4414779705SSam Leffler #define AR_PHY_AGC_DISABLE 0x08000000 /* Disable PHY AGC */ 4514779705SSam Leffler #define AR_PHY_AGC_BITS "\20\33DISABLE" 4614779705SSam Leffler 4714779705SSam Leffler #define AR_PHY_CHIPID 0x9818 /* PHY chip revision */ 4814779705SSam Leffler 4914779705SSam Leffler #define AR_PHY_ACTIVE 0x981c /* PHY activation */ 5014779705SSam Leffler #define AR_PHY_ENABLE 0x00000001 /* activate PHY */ 5114779705SSam Leffler #define AR_PHY_DISABLE 0x00000002 /* deactivate PHY */ 5214779705SSam Leffler #define AR_PHY_ACTIVE_BITS "\20\1ENABLE\2DISABLE" 5314779705SSam Leffler 5414779705SSam Leffler #define AR_PHY_AGCCTL 0x9860 /* PHY calibration and noise floor */ 5514779705SSam Leffler #define AR_PHY_AGC_CAL 0x00000001 /* PHY internal calibration */ 5614779705SSam Leffler #define AR_PHY_AGC_NF 0x00000002 /* calc PHY noise-floor */ 5714779705SSam Leffler #define AR_PHY_AGCCTL_BITS "\20\1CAL\2NF" 5814779705SSam Leffler 5914779705SSam Leffler #endif /* _DEV_ATH_AR5210PHY_H */ 60