cosmetics
[tomato.git] / release / src / include / bcmenetphy.h
blob6fbe9d08555a9505cdf963d1ce1d912f624b0a56
1 /*
2 * Misc Broadcom BCM47XX MDC/MDIO enet phy definitions.
4 * Copyright 2004, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
8 * the contents of this file may not be disclosed to third parties, copied
9 * or duplicated in any form, in whole or in part, without the prior
10 * written permission of Broadcom Corporation.
11 * $Id$
14 #ifndef _bcmenetphy_h_
15 #define _bcmenetphy_h_
17 /* phy address */
18 #define MAXEPHY 32 /* mdio phy addresses are 5bit quantities */
19 #define EPHY_MASK 0x1f /* phy mask */
20 #define EPHY_NONE 31 /* nvram: no phy present at all */
21 #define EPHY_NOREG 30 /* nvram: no local phy regs */
23 /* just a few phy registers */
24 #define CTL_RESET (1 << 15) /* reset */
25 #define CTL_LOOP (1 << 14) /* loopback */
26 #define CTL_SPEED (1 << 13) /* speed selection 0=10, 1=100 */
27 #define CTL_ANENAB (1 << 12) /* autonegotiation enable */
28 #define CTL_RESTART (1 << 9) /* restart autonegotiation */
29 #define CTL_DUPLEX (1 << 8) /* duplex mode 0=half, 1=full */
31 #define ADV_10FULL (1 << 6) /* autonegotiate advertise 10full */
32 #define ADV_10HALF (1 << 5) /* autonegotiate advertise 10half */
33 #define ADV_100FULL (1 << 8) /* autonegotiate advertise 100full */
34 #define ADV_100HALF (1 << 7) /* autonegotiate advertise 100half */
36 /* link partner ability register */
37 #define LPA_SLCT 0x001f /* same as advertise selector */
38 #define LPA_10HALF 0x0020 /* can do 10mbps half-duplex */
39 #define LPA_10FULL 0x0040 /* can do 10mbps full-duplex */
40 #define LPA_100HALF 0x0080 /* can do 100mbps half-duplex */
41 #define LPA_100FULL 0x0100 /* can do 100mbps full-duplex */
42 #define LPA_100BASE4 0x0200 /* can do 100mbps 4k packets */
43 #define LPA_RESV 0x1c00 /* unused */
44 #define LPA_RFAULT 0x2000 /* link partner faulted */
45 #define LPA_LPACK 0x4000 /* link partner acked us */
46 #define LPA_NPAGE 0x8000 /* next page bit */
48 #define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
49 #define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
51 #define STAT_REMFAULT (1 << 4) /* remote fault */
52 #define STAT_LINK (1 << 2) /* link status */
53 #define STAT_JAB (1 << 1) /* jabber detected */
54 #define AUX_FORCED (1 << 2) /* forced 10/100 */
55 #define AUX_SPEED (1 << 1) /* speed 0=10mbps 1=100mbps */
56 #define AUX_DUPLEX (1 << 0) /* duplex 0=half 1=full */
58 #endif /* _bcmenetphy_h_ */