Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / dev / network / common / mif / mii-h.fth
CommitLineData
920dae64
AT
1\ ========== Copyright Header Begin ==========================================
2\
3\ Hypervisor Software File: mii-h.fth
4\
5\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
6\
7\ - Do no alter or remove copyright notices
8\
9\ - Redistribution and use of this software in source and binary forms, with
10\ or without modification, are permitted provided that the following
11\ conditions are met:
12\
13\ - Redistribution of source code must retain the above copyright notice,
14\ this list of conditions and the following disclaimer.
15\
16\ - Redistribution in binary form must reproduce the above copyright notice,
17\ this list of conditions and the following disclaimer in the
18\ documentation and/or other materials provided with the distribution.
19\
20\ Neither the name of Sun Microsystems, Inc. or the names of contributors
21\ may be used to endorse or promote products derived from this software
22\ without specific prior written permission.
23\
24\ This software is provided "AS IS," without a warranty of any kind.
25\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
26\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
27\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
28\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
29\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
30\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
31\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
32\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
33\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
34\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
35\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
36\
37\ You acknowledge that this software is not designed, licensed or
38\ intended for use in the design, construction, operation or maintenance of
39\ any nuclear facility.
40\
41\ ========== Copyright Header End ============================================
42id: @(#) mii-h.fth 1.2 03/08/23
43purpose: Ethernet PHY MII register access routines and bit-fields.
44copyright: Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved.
45copyright: Use is subject to license terms.
46
47headers
48
49\ PHY Control register
50: phy-cr@ ( -- data ) 0 phy@ ;
51: phy-cr! ( data -- ) 0 phy! ;
52
53\ PHY Status register
54: phy-sr@ ( -- data ) 1 phy@ drop 1 phy@ ;
55
56\ PHY Identifier registers
57: phy-id1@ ( -- data ) 2 phy@ ;
58: phy-id2@ ( -- data ) 3 phy@ ;
59
60: phy-id@ ( -- phy-id ) phy-id1@ d# 16 lshift phy-id2@ or ;
61
62\ Auto-negotiation Advertisement register
63: phy-anar@ ( -- data ) 4 phy@ ;
64: phy-anar! ( data -- ) 4 phy! ;
65
66\ Auto-Negotiation Link Partner Ability Register
67: phy-anlpar@ ( -- data ) 5 phy@ ;
68
69\ Auto-Negotiation Expansion Register
70: phy-aner@ ( -- data ) h# 6 phy@ ;
71
72headerless
73
74\ Basic Control register definitions
75h# 8000 constant phycr.reset
76h# 4000 constant phycr.loopback
77h# 2040 constant phycr.speed-mask
78h# 1000 constant phycr.an-enable
79h# 200 constant phycr.an-restart
80h# 100 constant phycr.duplex
81
82h# 0 constant phycr.speed-10
83h# 2000 constant phycr.speed-100
84h# 40 constant phycr.speed-1000
85
86\ Basic Status register definitions
87h# 20 constant physr.an-complete
88h# 4 constant physr.link-up
89h# 100 constant physr.ext-status
90
91\ PHY Identifier values
92h# 206050 constant broadcom-605x
93h# 1410c52 constant marvell-88e1000
94h# 437411 constant lucent-3X31T
95
96\ Autonegotiation Advertisement Register definitions
97h# 1 constant anar.selector-field \ IEEE 802.3 protocol selector field.
98
99\ Autonegotiation Link Partner Ability register definitions
100h# 20 constant anlpar.10hdx
101h# 40 constant anlpar.10fdx
102h# 80 constant anlpar.100hdx
103h# 100 constant anlpar.100fdx
104
105\ Autonegotiation Expansion register definitions
106h# 1 constant aner.lp-an-able
107h# 10 constant aner.mlf \ Multiple link fault
108
109headers