1185377Ssam/*
2185377Ssam * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3185377Ssam * Copyright (c) 2002-2004 Atheros Communications, Inc.
4185377Ssam *
5185377Ssam * Permission to use, copy, modify, and/or distribute this software for any
6185377Ssam * purpose with or without fee is hereby granted, provided that the above
7185377Ssam * copyright notice and this permission notice appear in all copies.
8185377Ssam *
9185377Ssam * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10185377Ssam * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11185377Ssam * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12185377Ssam * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13185377Ssam * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14185377Ssam * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15185377Ssam * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16185377Ssam *
17204644Srpaulo * $FreeBSD$
18185377Ssam */
19185377Ssam#ifndef _DEV_ATH_AR5210PHY_H
20185377Ssam#define _DEV_ATH_AR5210PHY_H
21185377Ssam
22185377Ssam/*
23185377Ssam * Definitions for the PHY on the Atheros AR5210 parts.
24185377Ssam */
25185377Ssam
26185377Ssam/* PHY Registers */
27185377Ssam#define	AR_PHY_BASE		0x9800		/* PHY register base */
28185377Ssam#define	AR_PHY(_n)		(AR_PHY_BASE + ((_n)<<2))
29185377Ssam
30185377Ssam#define	AR_PHY_FRCTL		0x9804		/* PHY frame control */
31185377Ssam#define	AR_PHY_TURBO_MODE	0x00000001	/* PHY turbo mode */
32185377Ssam#define	AR_PHY_TURBO_SHORT	0x00000002	/* PHY turbo short symbol */
33185377Ssam#define	AR_PHY_TIMING_ERR	0x01000000	/* Detect PHY timing error */
34185377Ssam#define	AR_PHY_PARITY_ERR	0x02000000	/* Detect signal parity err */
35185377Ssam#define	AR_PHY_ILLRATE_ERR	0x04000000	/* Detect PHY illegal rate */
36185377Ssam#define	AR_PHY_ILLLEN_ERR	0x08000000	/* Detect PHY illegal length */
37185377Ssam#define	AR_PHY_SERVICE_ERR	0x20000000	/* Detect PHY nonzero service */
38185377Ssam#define	AR_PHY_TXURN_ERR	0x40000000	/* DetectPHY TX underrun */
39185377Ssam#define	AR_PHY_FRCTL_BITS \
40185377Ssam	"\20\1TURBO_MODE\2TURBO_SHORT\30TIMING_ERR\31PARITY_ERR\32ILLRATE_ERR"\
41185377Ssam	"\33ILLEN_ERR\35SERVICE_ERR\36TXURN_ERR"
42185377Ssam
43185377Ssam#define	AR_PHY_AGC		0x9808		/* PHY AGC command */
44185377Ssam#define	AR_PHY_AGC_DISABLE	0x08000000	/* Disable PHY AGC */
45185377Ssam#define	AR_PHY_AGC_BITS	"\20\33DISABLE"
46185377Ssam
47185377Ssam#define	AR_PHY_CHIPID		0x9818		/* PHY chip revision */
48185377Ssam
49185377Ssam#define	AR_PHY_ACTIVE		0x981c		/* PHY activation */
50185377Ssam#define	AR_PHY_ENABLE		0x00000001	/* activate PHY */
51185377Ssam#define	AR_PHY_DISABLE		0x00000002	/* deactivate PHY */
52185377Ssam#define	AR_PHY_ACTIVE_BITS	"\20\1ENABLE\2DISABLE"
53185377Ssam
54185377Ssam#define	AR_PHY_AGCCTL		0x9860		/* PHY calibration and noise floor */
55185377Ssam#define	AR_PHY_AGC_CAL		0x00000001	/* PHY internal calibration */
56185377Ssam#define	AR_PHY_AGC_NF		0x00000002	/* calc PHY noise-floor */
57185377Ssam#define	AR_PHY_AGCCTL_BITS	"\20\1CAL\2NF"
58185377Ssam
59185377Ssam#endif /* _DEV_ATH_AR5210PHY_H */
60