Home | History | Annotate | Line # | Download | only in mii
makphyreg.h revision 1.1.70.1
      1  1.1.70.1       ad /*	$NetBSD: makphyreg.h,v 1.1.70.1 2007/01/12 00:57:40 ad Exp $	*/
      2       1.1  thorpej 
      3       1.1  thorpej /*-
      4       1.1  thorpej  * Copyright (c) 2001 The NetBSD Foundation, Inc.
      5       1.1  thorpej  * All rights reserved.
      6       1.1  thorpej  *
      7       1.1  thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8       1.1  thorpej  * by Jason R. Thorpe.
      9       1.1  thorpej  *
     10       1.1  thorpej  * Redistribution and use in source and binary forms, with or without
     11       1.1  thorpej  * modification, are permitted provided that the following conditions
     12       1.1  thorpej  * are met:
     13       1.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     14       1.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     15       1.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     17       1.1  thorpej  *    documentation and/or other materials provided with the distribution.
     18       1.1  thorpej  * 3. All advertising materials mentioning features or use of this software
     19       1.1  thorpej  *    must display the following acknowledgement:
     20       1.1  thorpej  *	This product includes software developed by the NetBSD
     21       1.1  thorpej  *	Foundation, Inc. and its contributors.
     22       1.1  thorpej  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23       1.1  thorpej  *    contributors may be used to endorse or promote products derived
     24       1.1  thorpej  *    from this software without specific prior written permission.
     25       1.1  thorpej  *
     26       1.1  thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27       1.1  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28       1.1  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29       1.1  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30       1.1  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31       1.1  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32       1.1  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33       1.1  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34       1.1  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35       1.1  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36       1.1  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     37       1.1  thorpej  */
     38       1.1  thorpej 
     39       1.1  thorpej #ifndef _DEV_MII_MAKPHYREG_H_
     40       1.1  thorpej #define	_DEV_MII_MAKPHYREG_H_
     41       1.1  thorpej 
     42       1.1  thorpej /*
     43       1.1  thorpej  * Marvell 88E1000 ``Alaska'' 10/100/1000 PHY registers.
     44       1.1  thorpej  */
     45       1.1  thorpej 
     46       1.1  thorpej #define	MII_MAKPHY_PSCR		0x10	/* PHY specific control register */
     47       1.1  thorpej #define	PSCR_DIS_JABBER		(1U << 0)   /* disable jabber */
     48       1.1  thorpej #define	PSCR_POL_REV		(1U << 1)   /* polarity reversal */
     49       1.1  thorpej #define	PSCR_SQE_TEST		(1U << 2)   /* SQE test */
     50       1.1  thorpej #define	PSCR_MBO		(1U << 3)   /* must be one */
     51       1.1  thorpej #define	PSCR_DIS_125CLK		(1U << 4)   /* 125CLK low */
     52       1.1  thorpej #define	PSCR_MDI_XOVER_MODE(x)	((x) << 5)  /* crossover mode */
     53  1.1.70.1       ad #define	PSCR_LOW_10T_THRESH	(1U << 7)   /* lower 10BASE-T Rx threshold */
     54       1.1  thorpej #define	PSCR_FORCE_LINK_GOOD	(1U << 10)  /* force link good */
     55       1.1  thorpej #define	PSCR_CRS_ON_TX		(1U << 11)  /* assert CRS on transmit */
     56       1.1  thorpej #define	PSCR_RX_FIFO(x)		((x) << 12) /* Rx FIFO depth */
     57       1.1  thorpej #define	PSCR_TX_FIFO(x)		((x) << 14) /* Tx FIFO depth */
     58       1.1  thorpej 
     59       1.1  thorpej #define	XOVER_MODE_MDI		0
     60       1.1  thorpej #define	XOVER_MODE_MDIX		1
     61       1.1  thorpej #define	XOVER_MODE_AUTO		2
     62       1.1  thorpej 
     63       1.1  thorpej #define	MII_MAKPHY_PSSR		0x11	/* PHY specific status register */
     64       1.1  thorpej #define	PSSR_JABBER		(1U << 0)   /* jabber indication */
     65       1.1  thorpej #define	PSSR_POLARITY		(1U << 1)   /* polarity indiciation */
     66       1.1  thorpej #define	PSSR_MDIX		(1U << 6)   /* 1 = MIDX, 0 = MDI */
     67       1.1  thorpej #define	PSSR_CABLE_LENGTH_get(x) (((x) >> 7) & 0x3)
     68       1.1  thorpej #define	PSSR_LINK		(1U << 10)  /* link indication */
     69       1.1  thorpej #define	PSSR_RESOLVED		(1U << 11)  /* speed and duplex resolved */
     70       1.1  thorpej #define	PSSR_PAGE_RECEIVED	(1U << 12)  /* page received */
     71       1.1  thorpej #define	PSSR_DUPLEX		(1U << 13)  /* 1 = FDX */
     72       1.1  thorpej #define	PSSR_SPEED_get(x)	(((x) >> 14) & 0x3)
     73       1.1  thorpej 
     74       1.1  thorpej #define	SPEED_10		0
     75       1.1  thorpej #define	SPEED_100		1
     76       1.1  thorpej #define	SPEED_1000		2
     77       1.1  thorpej #define	SPEED_reserved		3
     78       1.1  thorpej 
     79       1.1  thorpej #define	MII_MAKPHY_IE		0x12	/* Interrupt enable */
     80       1.1  thorpej #define	IE_JABBER		(1U << 0)   /* jabber indication */
     81       1.1  thorpej #define	IE_POL_CHANGED		(1U << 1)   /* polarity changed */
     82       1.1  thorpej #define	IE_MDI_XOVER_CHANGED	(1U << 6)   /* MDI/MDIX changed */
     83       1.1  thorpej #define	IE_FIFO_OVER_UNDER	(1U << 7)   /* FIFO over/underflow */
     84       1.1  thorpej #define	IE_FALSE_CARRIER	(1U << 8)   /* false carrier detected */
     85       1.1  thorpej #define	IE_SYMBOL_ERROR		(1U << 9)   /* symbol error occurred */
     86       1.1  thorpej #define	IE_LINK_CHANGED		(1U << 10)  /* link status changed */
     87       1.1  thorpej #define	IE_ANEG_COMPLETE	(1U << 11)  /* autonegotiation completed */
     88       1.1  thorpej #define	IE_PAGE_RECEIVED	(1U << 12)  /* page received */
     89       1.1  thorpej #define	IE_DUPLEX_CHANGED	(1U << 13)  /* duplex changed */
     90       1.1  thorpej #define	IE_SPEED_CHANGED	(1U << 14)  /* speed changed */
     91       1.1  thorpej #define	IE_ANEG_ERROR		(1U << 15)  /* autonegotiation error occurred */
     92       1.1  thorpej 
     93       1.1  thorpej #define	MII_MAKPHY_IS		0x13	/* Interrupt status */
     94       1.1  thorpej 	/* See Interrupt enable bits */
     95       1.1  thorpej 
     96       1.1  thorpej #define	MII_MAKPHY_EPSC		0x14	/* extended PHY specific control */
     97       1.1  thorpej #define	EPSC_TX_CLK(x)		((x) << 4)  /* transmit clock */
     98       1.1  thorpej #define	EPSC_TBI_RCLK_DIS	(1U << 12)  /* TBI RCLK disable */
     99       1.1  thorpej #define	EPSC_TBI_RX_CLK125_EN	(1U << 13)  /* TBI RX_CLK125 enable */
    100       1.1  thorpej #define	EPSC_LINK_DOWN_NO_IDLES	(1U << 15)  /* 1 = lost lock detect */
    101       1.1  thorpej 
    102       1.1  thorpej #define	MII_MAKPHY_REC		0x15	/* receive error counter */
    103       1.1  thorpej 
    104       1.1  thorpej #define	MII_MAKPHY_LEDCTRL	0x18	/* LED control */
    105       1.1  thorpej #define	LEDCTRL_LED_TX		(1U << 0)   /* 1 = activ/link, 0 = xmit */
    106       1.1  thorpej #define	LEDCTRL_LED_RX		(1U << 1)   /* 1 = activ/link, 1 = recv */
    107       1.1  thorpej #define	LEDCTRL_LED_DUPLEX	(1U << 2)   /* 1 = duplex, 0 = dup/coll */
    108       1.1  thorpej #define	LEDCTRL_LED_LINK	(1U << 3)   /* 1 = spd/link, 0 = link */
    109       1.1  thorpej #define	LEDCTRL_BLINK_RATE(x)	((x) << 8)
    110       1.1  thorpej #define	LEDCTRL_PULSE_STRCH(x)	((x) << 12)
    111       1.1  thorpej #define	LEDCTRL_DISABLE		(1U << 15)  /* disable LED */
    112       1.1  thorpej 
    113       1.1  thorpej #endif /* _DEV_MII_MAKPHYREG_H_ */
    114