xref: /minix3/minix/drivers/net/fxp/mii.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /*
2*433d6423SLionel Sambuc ibm/mii.h
3*433d6423SLionel Sambuc 
4*433d6423SLionel Sambuc Created:	Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
5*433d6423SLionel Sambuc 
6*433d6423SLionel Sambuc Definitions for the Media Independent (Ethernet) Interface
7*433d6423SLionel Sambuc */
8*433d6423SLionel Sambuc 
9*433d6423SLionel Sambuc #ifndef _FXP_MII_H
10*433d6423SLionel Sambuc #define _FXP_MII_H
11*433d6423SLionel Sambuc 
12*433d6423SLionel Sambuc /* Registers in the Machine Independent Interface (MII) to the PHY.
13*433d6423SLionel Sambuc  * IEEE 802.3 (2000 Edition) Clause 22.
14*433d6423SLionel Sambuc  */
15*433d6423SLionel Sambuc #define MII_CTRL	0x0	/* Control Register (basic) */
16*433d6423SLionel Sambuc #define		MII_CTRL_RST	0x8000	/* Reset PHY */
17*433d6423SLionel Sambuc #define		MII_CTRL_LB	0x4000	/* Enable Loopback Mode */
18*433d6423SLionel Sambuc #define		MII_CTRL_SP_LSB	0x2000	/* Speed Selection (LSB) */
19*433d6423SLionel Sambuc #define		MII_CTRL_ANE	0x1000	/* Auto Negotiation Enable */
20*433d6423SLionel Sambuc #define		MII_CTRL_PD	0x0800	/* Power Down */
21*433d6423SLionel Sambuc #define		MII_CTRL_ISO	0x0400	/* Isolate */
22*433d6423SLionel Sambuc #define		MII_CTRL_RAN	0x0200	/* Restart Auto-Negotiation Process */
23*433d6423SLionel Sambuc #define		MII_CTRL_DM	0x0100	/* Full Duplex */
24*433d6423SLionel Sambuc #define		MII_CTRL_CT	0x0080	/* Enable COL Signal Test */
25*433d6423SLionel Sambuc #define		MII_CTRL_SP_MSB	0x0040	/* Speed Selection (MSB) */
26*433d6423SLionel Sambuc #define			MII_CTRL_SP_10		0x0000	/* 10 Mb/s */
27*433d6423SLionel Sambuc #define			MII_CTRL_SP_100		0x2000	/* 100 Mb/s */
28*433d6423SLionel Sambuc #define			MII_CTRL_SP_1000	0x0040	/* 1000 Mb/s */
29*433d6423SLionel Sambuc #define			MII_CTRL_SP_RES		0x2040	/* Reserved */
30*433d6423SLionel Sambuc #define		MII_CTRL_RES	0x003F	/* Reserved */
31*433d6423SLionel Sambuc #define MII_STATUS	0x1	/* Status Register (basic) */
32*433d6423SLionel Sambuc #define		MII_STATUS_100T4	0x8000	/* 100Base-T4 support */
33*433d6423SLionel Sambuc #define		MII_STATUS_100XFD	0x4000	/* 100Base-X FD support */
34*433d6423SLionel Sambuc #define		MII_STATUS_100XHD	0x2000	/* 100Base-X HD support */
35*433d6423SLionel Sambuc #define		MII_STATUS_10FD		0x1000	/* 10 Mb/s FD support */
36*433d6423SLionel Sambuc #define		MII_STATUS_10HD		0x0800	/* 10 Mb/s HD support */
37*433d6423SLionel Sambuc #define		MII_STATUS_100T2FD	0x0400	/* 100Base-T2 FD support */
38*433d6423SLionel Sambuc #define		MII_STATUS_100T2HD	0x0200	/* 100Base-T2 HD support */
39*433d6423SLionel Sambuc #define		MII_STATUS_EXT_STAT	0x0100	/* Supports MII_EXT_STATUS */
40*433d6423SLionel Sambuc #define		MII_STATUS_RES		0x0080	/* Reserved */
41*433d6423SLionel Sambuc #define		MII_STATUS_MFPS		0x0040	/* MF Preamble Suppression */
42*433d6423SLionel Sambuc #define		MII_STATUS_ANC		0x0020	/* Auto-Negotiation Completed */
43*433d6423SLionel Sambuc #define		MII_STATUS_RF		0x0010	/* Remote Fault Detected */
44*433d6423SLionel Sambuc #define		MII_STATUS_ANA		0x0008	/* Auto-Negotiation Ability */
45*433d6423SLionel Sambuc #define		MII_STATUS_LS		0x0004	/* Link Up */
46*433d6423SLionel Sambuc #define		MII_STATUS_JD		0x0002	/* Jabber Condition Detected */
47*433d6423SLionel Sambuc #define		MII_STATUS_EC		0x0001	/* Ext Register Capabilities */
48*433d6423SLionel Sambuc #define MII_PHYID_H	0x2	/* PHY ID (high) */
49*433d6423SLionel Sambuc #define		MII_PH_OUI_H_MASK	0xFFFF	/* High part of OUI */
50*433d6423SLionel Sambuc #define			MII_PH_OUI_H_C_SHIFT	6	/* Shift up in OUI */
51*433d6423SLionel Sambuc #define MII_PHYID_L	0x3	/* PHY ID (low) */
52*433d6423SLionel Sambuc #define		MII_PL_OUI_L_MASK	0xFC00	/* Low part of OUI */
53*433d6423SLionel Sambuc #define			MII_PL_OUI_L_SHIFT	10
54*433d6423SLionel Sambuc #define		MII_PL_MODEL_MASK	0x03F0	/* Model */
55*433d6423SLionel Sambuc #define			MII_PL_MODEL_SHIFT	4
56*433d6423SLionel Sambuc #define		MII_PL_REV_MASK		0x000F	/* Revision */
57*433d6423SLionel Sambuc #define MII_ANA		0x4	/* Auto-Negotiation Advertisement */
58*433d6423SLionel Sambuc #define		MII_ANA_NP	0x8000	/* Next PAge */
59*433d6423SLionel Sambuc #define		MII_ANA_RES	0x4000	/* Reserved */
60*433d6423SLionel Sambuc #define		MII_ANA_RF	0x2000	/* Remote Fault */
61*433d6423SLionel Sambuc #define		MII_ANA_TAF_M	0x1FE0	 /* Technology Ability Field */
62*433d6423SLionel Sambuc #define		MII_ANA_TAF_S	5	 /* Shift */
63*433d6423SLionel Sambuc #define			MII_ANA_TAF_RES		0x1000	/* Reserved */
64*433d6423SLionel Sambuc #define			MII_ANA_PAUSE_ASYM	0x0800	/* Asym. Pause */
65*433d6423SLionel Sambuc #define			MII_ANA_PAUSE_SYM	0x0400	/* Sym. Pause */
66*433d6423SLionel Sambuc #define			MII_ANA_100T4		0x0200	/* 100Base-T4 */
67*433d6423SLionel Sambuc #define			MII_ANA_100TXFD		0x0100	/* 100Base-TX FD */
68*433d6423SLionel Sambuc #define			MII_ANA_100TXHD		0x0080	/* 100Base-TX HD */
69*433d6423SLionel Sambuc #define			MII_ANA_10TFD		0x0040	/* 10Base-T FD */
70*433d6423SLionel Sambuc #define			MII_ANA_10THD		0x0020	/* 10Base-T HD */
71*433d6423SLionel Sambuc #define		MII_ANA_SEL_M	0x001F	 /* Selector Field */
72*433d6423SLionel Sambuc #define			MII_ANA_SEL_802_3 0x0001 /* 802.3 */
73*433d6423SLionel Sambuc #define MII_ANLPA	0x5	/* Auto-Neg Link Partner Ability Register */
74*433d6423SLionel Sambuc #define		MII_ANLPA_NP	0x8000	/* Next Page */
75*433d6423SLionel Sambuc #define		MII_ANLPA_ACK	0x4000	/* Acknowledge */
76*433d6423SLionel Sambuc #define		MII_ANLPA_RF	0x2000	/* Remote Fault */
77*433d6423SLionel Sambuc #define		MII_ANLPA_TAF_M	0x1FC0	 /* Technology Ability Field */
78*433d6423SLionel Sambuc #define		MII_ANLPA_SEL_M	0x001F	 /* Selector Field */
79*433d6423SLionel Sambuc #define MII_ANE		0x6	/* Auto-Negotiation Expansion */
80*433d6423SLionel Sambuc #define		MII_ANE_RES	0xFFE0	/* Reserved */
81*433d6423SLionel Sambuc #define		MII_ANE_PDF	0x0010	/* Parallel Detection Fault */
82*433d6423SLionel Sambuc #define		MII_ANE_LPNPA	0x0008	/* Link Partner is Next Page Able */
83*433d6423SLionel Sambuc #define		MII_ANE_NPA	0x0002	/* Local Device is Next Page Able */
84*433d6423SLionel Sambuc #define		MII_ANE_PR	0x0002	/* New Page has been received */
85*433d6423SLionel Sambuc #define		MII_ANE_LPANA	0x0001	/* Link Partner is Auto-Neg.able */
86*433d6423SLionel Sambuc #define MII_ANNPT	0x7	/* Auto-Negotiation Next Page Transmit */
87*433d6423SLionel Sambuc #define MII_ANLPRNP	0x8	/* Auto-Neg Link Partner Received Next Page */
88*433d6423SLionel Sambuc #define MII_MS_CTRL	0x9	/* MASTER-SLAVE Control Register */
89*433d6423SLionel Sambuc #define		MII_MSC_TEST_MODE	0xE000	/* Test mode */
90*433d6423SLionel Sambuc #define		MII_MSC_MS_MANUAL	0x1000	/* Master/slave manual config */
91*433d6423SLionel Sambuc #define		MII_MSC_MS_VAL		0x0800	/* Master/slave value */
92*433d6423SLionel Sambuc #define		MII_MSC_MULTIPORT	0x0400	/* Multi-port device */
93*433d6423SLionel Sambuc #define		MII_MSC_1000T_FD	0x0200	/* 1000Base-T Full Duplex */
94*433d6423SLionel Sambuc #define		MII_MSC_1000T_HD	0x0100	/* 1000Base-T Half Duplex */
95*433d6423SLionel Sambuc #define		MII_MSC_RES		0x00FF	/* Reserved */
96*433d6423SLionel Sambuc #define MII_MS_STATUS	0xA	/* MASTER-SLAVE Status Register */
97*433d6423SLionel Sambuc #define		MII_MSS_FAULT		0x8000	/* Master/slave config fault */
98*433d6423SLionel Sambuc #define		MII_MSS_MASTER		0x4000	/* Master */
99*433d6423SLionel Sambuc #define		MII_MSS_LOCREC		0x2000	/* Local Receiver OK */
100*433d6423SLionel Sambuc #define		MII_MSS_REMREC		0x1000	/* Remote Receiver OK */
101*433d6423SLionel Sambuc #define		MII_MSS_LP1000T_FD	0x0800	/* Link Partner 1000-T FD */
102*433d6423SLionel Sambuc #define		MII_MSS_LP1000T_HD	0x0400	/* Link Partner 1000-T HD */
103*433d6423SLionel Sambuc #define		MII_MSS_RES		0x0300	/* Reserved */
104*433d6423SLionel Sambuc #define		MII_MSS_IDLE_ERR	0x00FF	/* Idle Error Counter */
105*433d6423SLionel Sambuc /* 0xB ... 0xE */		/* Reserved */
106*433d6423SLionel Sambuc #define MII_EXT_STATUS	0xF	/* Extended Status */
107*433d6423SLionel Sambuc #define		MII_ESTAT_1000XFD	0x8000	/* 1000Base-X Full Duplex */
108*433d6423SLionel Sambuc #define		MII_ESTAT_1000XHD	0x4000	/* 1000Base-X Half Duplex */
109*433d6423SLionel Sambuc #define		MII_ESTAT_1000TFD	0x2000	/* 1000Base-T Full Duplex */
110*433d6423SLionel Sambuc #define		MII_ESTAT_1000THD	0x1000	/* 1000Base-T Half Duplex */
111*433d6423SLionel Sambuc #define		MII_ESTAT_RES		0x0FFF	/* Reserved */
112*433d6423SLionel Sambuc /* 0x10 ... 0x1F */		/* Vendor Specific */
113*433d6423SLionel Sambuc 
114*433d6423SLionel Sambuc void mii_print_stat_speed(u16_t stat, u16_t extstat);
115*433d6423SLionel Sambuc void mii_print_techab(u16_t techab);
116*433d6423SLionel Sambuc 
117*433d6423SLionel Sambuc #endif
118*433d6423SLionel Sambuc /*
119*433d6423SLionel Sambuc  * $PchId: mii.h,v 1.1 2004/12/27 13:33:30 philip Exp $
120*433d6423SLionel Sambuc  */
121