Home | History | Annotate | Line # | Download | only in mii
      1  1.1  gdamore /*	$NetBSD: mvphyreg.h,v 1.1 2006/07/21 23:55:27 gdamore Exp $	*/
      2  1.1  gdamore 
      3  1.1  gdamore /*-
      4  1.1  gdamore  * Copyright (c) 2006 Sam Leffler, Errno Consulting
      5  1.1  gdamore  * All rights reserved.
      6  1.1  gdamore  *
      7  1.1  gdamore  * Redistribution and use in source and binary forms, with or without
      8  1.1  gdamore  * modification, are permitted provided that the following conditions
      9  1.1  gdamore  * are met:
     10  1.1  gdamore  * 1. Redistributions of source code must retain the above copyright
     11  1.1  gdamore  *    notice, this list of conditions and the following disclaimer.
     12  1.1  gdamore  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  gdamore  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  gdamore  *    documentation and/or other materials provided with the distribution.
     15  1.1  gdamore  *
     16  1.1  gdamore  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     17  1.1  gdamore  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     18  1.1  gdamore  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19  1.1  gdamore  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     20  1.1  gdamore  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     21  1.1  gdamore  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     22  1.1  gdamore  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23  1.1  gdamore  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     24  1.1  gdamore  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25  1.1  gdamore  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26  1.1  gdamore  * SUCH DAMAGE.
     27  1.1  gdamore  */
     28  1.1  gdamore 
     29  1.1  gdamore /*
     30  1.1  gdamore  * Definitions for the Marvell 88E6060 Ethernet PHY.
     31  1.1  gdamore  */
     32  1.1  gdamore #ifndef _DEV_MII_MVPHYREG_H_
     33  1.1  gdamore #define	_DEV_MII_MVPHYREG_H_
     34  1.1  gdamore 
     35  1.1  gdamore /*
     36  1.1  gdamore  * PHY Registers
     37  1.1  gdamore  */
     38  1.1  gdamore #define MII_MV_PHY_SPECIFIC_STATUS	17
     39  1.1  gdamore #define MII_MV_SWITCH_GLOBAL_ADDR	31	/* switch itself */
     40  1.1  gdamore 
     41  1.1  gdamore /* MV_PHY_SPECIFIC_STATUS fields */
     42  1.1  gdamore #define MV_STATUS_RESOLVED_SPEED_100	0x4000
     43  1.1  gdamore #define MV_STATUS_RESOLVED_DUPLEX_FULL	0x2000
     44  1.1  gdamore #define MV_STATUS_RESOLVED		0x0800
     45  1.1  gdamore #define MV_STATUS_REAL_TIME_LINK_UP	0x0400
     46  1.1  gdamore 
     47  1.1  gdamore /*
     48  1.1  gdamore  * Per-Port Switch Registers
     49  1.1  gdamore  */
     50  1.1  gdamore #define MV_PORT_STATUS			0
     51  1.1  gdamore #define MV_SWITCH_ID			3
     52  1.1  gdamore #define MV_PORT_CONTROL			4
     53  1.1  gdamore #define MV_PORT_BASED_VLAN_MAP		6
     54  1.1  gdamore #define MV_PORT_ASSOCIATION_VECTOR	11
     55  1.1  gdamore #define MV_RX_COUNTER			16
     56  1.1  gdamore #define MV_TX_COUNTER			17
     57  1.1  gdamore 
     58  1.1  gdamore /* MV_SWITCH_ID fields */
     59  1.1  gdamore #define MV_SWITCH_ID_DEV		0xfff0
     60  1.1  gdamore #define MV_SWITCH_ID_DEV_S		4
     61  1.1  gdamore #define MV_SWITCH_ID_REV		0x000f
     62  1.1  gdamore #define MV_SWITCH_ID_REV_S		0
     63  1.1  gdamore 
     64  1.1  gdamore /* MV_PORT_CONTROL fields */
     65  1.1  gdamore #define MV_PORT_CONTROL_PORT_STATE	0x0003
     66  1.1  gdamore #define MV_PORT_CONTROL_PORT_STATE_DISABLED	0x0000
     67  1.1  gdamore #define MV_PORT_CONTROL_PORT_STATE_FORWARDING	0x0003
     68  1.1  gdamore 
     69  1.1  gdamore #define MV_PORT_CONTROL_EGRESS_MODE	0x0100	/* enable on rx */
     70  1.1  gdamore #define MV_PORT_CONTROL_INGRESS_TRAILER	0x4000	/* enable on tx */
     71  1.1  gdamore 
     72  1.1  gdamore #define MV_EGRESS_TRAILER_VALID		0x80
     73  1.1  gdamore #define MV_INGRESS_TRAILER_OVERRIDE	0x80
     74  1.1  gdamore 
     75  1.1  gdamore #define MV_PHY_TRAILER_SIZE		4
     76  1.1  gdamore 
     77  1.1  gdamore /*
     78  1.1  gdamore  * Switch Global Registers accessed via MII_MV_SWITCH_GLOBAL_ADDR.
     79  1.1  gdamore  */
     80  1.1  gdamore #define MV_SWITCH_GLOBAL_STATUS		0
     81  1.1  gdamore #define MV_SWITCH_MAC_ADDR0		1
     82  1.1  gdamore #define MV_SWITCH_MAC_ADDR2		2
     83  1.1  gdamore #define MV_SWITCH_MAC_ADDR4		3
     84  1.1  gdamore #define MV_SWITCH_GLOBAL_CONTROL	4
     85  1.1  gdamore #define MV_ATU_CONTROL			10
     86  1.1  gdamore #define MV_ATU_OPERATION		11
     87  1.1  gdamore #define MV_ATU_DATA			12
     88  1.1  gdamore #define MV_ATU_MAC_ADDR0		13
     89  1.1  gdamore #define MV_ATU_MAC_ADDR2		14
     90  1.1  gdamore #define MV_ATU_MAC_ADDR4		15
     91  1.1  gdamore 
     92  1.1  gdamore /* MV_SWITCH_GLOBAL_STATUS fields */
     93  1.1  gdamore #define MV_SWITCH_STATUS_READY	0x0800
     94  1.1  gdamore 
     95  1.1  gdamore /* MV_SWITCH_GLOBAL_CONTROL fields */
     96  1.1  gdamore #define MV_CTRMODE		0x0100
     97  1.1  gdamore #define MV_CTRMODE_GOODFRAMES	0x0000
     98  1.1  gdamore #define MV_CTRMODE_BADFRAMES	0x0100
     99  1.1  gdamore 
    100  1.1  gdamore /* MV_ATU_CONTROL fields */
    101  1.1  gdamore #define MV_ATUCTRL_ATU_SIZE	0x3000
    102  1.1  gdamore #define MV_ATUCTRL_ATU_SIZE_S	12
    103  1.1  gdamore #define MV_ATUCTRL_AGE_TIME	0x0ff0
    104  1.1  gdamore #define MV_ATUCTRL_AGE_TIME_S	4
    105  1.1  gdamore 
    106  1.1  gdamore /* MV_ATU_OPERATION fields */
    107  1.1  gdamore #define MV_ATU_BUSY		0x8000
    108  1.1  gdamore #define MV_ATU_OP		0x7000
    109  1.1  gdamore #define MV_ATU_OP_FLUSH_ALL	0x1000
    110  1.1  gdamore #define MV_ATU_OP_GET_NEXT	0x4000
    111  1.1  gdamore 
    112  1.1  gdamore #define	MV_ATU_IS_BUSY(v)	(((v) & MV_ATU_BUSY) != 0)
    113  1.1  gdamore 
    114  1.1  gdamore /* MV_ATU_DATA fields */
    115  1.1  gdamore #define MV_ENTRYPRI		0xc000
    116  1.1  gdamore #define MV_ENTRYPRI_S		14
    117  1.1  gdamore #define MV_PORTVEC		0x03f0
    118  1.1  gdamore #define MV_PORTVEC_S		4
    119  1.1  gdamore #define MV_ENTRYSTATE		0x000f
    120  1.1  gdamore #define MV_ENTRYSTATE_S		0
    121  1.1  gdamore 
    122  1.1  gdamore #endif /* _DEV_MII_MVPHYREG_H_ */
    123