Home | History | Annotate | Line # | Download | only in mii
inbmphyreg.h revision 1.2.2.2
      1  1.2.2.2  yamt /*	$NetBSD: inbmphyreg.h,v 1.2.2.2 2010/03/11 15:03:41 yamt Exp $	*/
      2  1.2.2.2  yamt /*******************************************************************************
      3  1.2.2.2  yamt Copyright (c) 2001-2005, Intel Corporation
      4  1.2.2.2  yamt All rights reserved.
      5  1.2.2.2  yamt 
      6  1.2.2.2  yamt Redistribution and use in source and binary forms, with or without
      7  1.2.2.2  yamt modification, are permitted provided that the following conditions are met:
      8  1.2.2.2  yamt 
      9  1.2.2.2  yamt  1. Redistributions of source code must retain the above copyright notice,
     10  1.2.2.2  yamt     this list of conditions and the following disclaimer.
     11  1.2.2.2  yamt 
     12  1.2.2.2  yamt  2. Redistributions in binary form must reproduce the above copyright
     13  1.2.2.2  yamt     notice, this list of conditions and the following disclaimer in the
     14  1.2.2.2  yamt     documentation and/or other materials provided with the distribution.
     15  1.2.2.2  yamt 
     16  1.2.2.2  yamt  3. Neither the name of the Intel Corporation nor the names of its
     17  1.2.2.2  yamt     contributors may be used to endorse or promote products derived from
     18  1.2.2.2  yamt     this software without specific prior written permission.
     19  1.2.2.2  yamt 
     20  1.2.2.2  yamt THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     21  1.2.2.2  yamt AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22  1.2.2.2  yamt IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23  1.2.2.2  yamt ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     24  1.2.2.2  yamt LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     25  1.2.2.2  yamt CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     26  1.2.2.2  yamt SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     27  1.2.2.2  yamt INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     28  1.2.2.2  yamt CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     29  1.2.2.2  yamt ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     30  1.2.2.2  yamt POSSIBILITY OF SUCH DAMAGE.
     31  1.2.2.2  yamt *******************************************************************************/
     32  1.2.2.2  yamt 
     33  1.2.2.2  yamt /*
     34  1.2.2.2  yamt  * Copied from the Intel code, and then modified to match NetBSD
     35  1.2.2.2  yamt  * style for MII registers more.
     36  1.2.2.2  yamt  */
     37  1.2.2.2  yamt 
     38  1.2.2.2  yamt #ifndef _DEV_MII_INBMPHYREG_H_
     39  1.2.2.2  yamt #define	_DEV_MII_INBMPHYREG_H_
     40  1.2.2.2  yamt 
     41  1.2.2.2  yamt /* Bits...
     42  1.2.2.2  yamt  * 15-5: page
     43  1.2.2.2  yamt  * 4-0: register offset
     44  1.2.2.2  yamt  */
     45  1.2.2.2  yamt #define BME1000_PAGE_SHIFT        5
     46  1.2.2.2  yamt #define BME1000_REG(page, reg)    \
     47  1.2.2.2  yamt         (((page) << BME1000_PAGE_SHIFT) | ((reg) & BME1000_MAX_REG_ADDRESS))
     48  1.2.2.2  yamt 
     49  1.2.2.2  yamt #define BME1000_MAX_REG_ADDRESS        0x1f  /* 5 bit address bus (0-0x1f) */
     50  1.2.2.2  yamt #define BME1000_MAX_MULTI_PAGE_REG     0xf   /* Registers equal on all pages */
     51  1.2.2.2  yamt 
     52  1.2.2.2  yamt #define	BM_PHY_REG_PAGE(offset)			\
     53  1.2.2.2  yamt 	((uint16_t)(((offset) >> BME1000_PAGE_SHIFT) & 0xffff))
     54  1.2.2.2  yamt #define	BM_PHY_REG_NUM(offset)			\
     55  1.2.2.2  yamt 	((uint16_t)((offset) & BME1000_MAX_REG_ADDRESS)		\
     56  1.2.2.2  yamt 	| (((offset) >> (21 - BME1000_PAGE_SHIFT)) & ~BME1000_MAX_REG_ADDRESS))
     57  1.2.2.2  yamt 
     58  1.2.2.2  yamt /* BME1000 Specific Registers */
     59  1.2.2.2  yamt #define BME1000_PHY_SPEC_CTRL	BME1000_REG(0, 16) /* PHY Specific Control */
     60  1.2.2.2  yamt #define BME1000_PSCR_DISABLE_JABBER             0x0001 /* 1=Disable Jabber */
     61  1.2.2.2  yamt #define BME1000_PSCR_POLARITY_REVERSAL_DISABLE  0x0002 /* 1=Polarity Reversal Disabled */
     62  1.2.2.2  yamt #define BME1000_PSCR_POWER_DOWN                 0x0004 /* 1=Power Down */
     63  1.2.2.2  yamt #define BME1000_PSCR_COPPER_TRANSMITER_DISABLE  0x0008 /* 1=Transmitter Disabled */
     64  1.2.2.2  yamt #define BME1000_PSCR_CROSSOVER_MODE_MASK        0x0060
     65  1.2.2.2  yamt #define BME1000_PSCR_CROSSOVER_MODE_MDI         0x0000 /* 00=Manual MDI configuration */
     66  1.2.2.2  yamt #define BME1000_PSCR_CROSSOVER_MODE_MDIX        0x0020 /* 01=Manual MDIX configuration */
     67  1.2.2.2  yamt #define BME1000_PSCR_CROSSOVER_MODE_AUTO        0x0060 /* 11=Automatic crossover */
     68  1.2.2.2  yamt #define BME1000_PSCR_ENALBE_EXTENDED_DISTANCE   0x0080 /* 1=Enable Extended Distance */
     69  1.2.2.2  yamt #define BME1000_PSCR_ENERGY_DETECT_MASK         0x0300
     70  1.2.2.2  yamt #define BME1000_PSCR_ENERGY_DETECT_OFF          0x0000 /* 00,01=Off */
     71  1.2.2.2  yamt #define BME1000_PSCR_ENERGY_DETECT_RX           0x0200 /* 10=Sense on Rx only (Energy Detect) */
     72  1.2.2.2  yamt #define BME1000_PSCR_ENERGY_DETECT_RX_TM        0x0300 /* 11=Sense and Tx NLP */
     73  1.2.2.2  yamt #define BME1000_PSCR_FORCE_LINK_GOOD            0x0400 /* 1=Force Link Good */
     74  1.2.2.2  yamt #define BME1000_PSCR_DOWNSHIFT_ENABLE           0x0800 /* 1=Enable Downshift */
     75  1.2.2.2  yamt #define BME1000_PSCR_DOWNSHIFT_COUNTER_MASK     0x7000
     76  1.2.2.2  yamt #define BME1000_PSCR_DOWNSHIFT_COUNTER_SHIFT    12
     77  1.2.2.2  yamt 
     78  1.2.2.2  yamt #define BME1000_PHY_PAGE_SELECT	BME1000_REG(0, 22) /* Page Select */
     79  1.2.2.2  yamt 
     80  1.2.2.2  yamt #define BME1000_BIAS_SETTING	29
     81  1.2.2.2  yamt #define BME1000_BIAS_SETTING2	30
     82  1.2.2.2  yamt 
     83  1.2.2.2  yamt #define	I82578_ADDR_REG		29
     84  1.2.2.2  yamt #define	I82577_ADDR_REG		16
     85  1.2.2.2  yamt #define	I82577_CFG_REG		22
     86  1.2.2.2  yamt 
     87  1.2.2.2  yamt #define HV_OEM_BITS		BME1000_REG(0, 25)
     88  1.2.2.2  yamt #define HV_OEM_BITS_LPLU	(1 << 2)
     89  1.2.2.2  yamt #define HV_OEM_BITS_A1KDIS	(1 << 6)
     90  1.2.2.2  yamt #define HV_OEM_BITS_ANEGNOW	(1 << 10)
     91  1.2.2.2  yamt 
     92  1.2.2.2  yamt #define HV_INTC_FC_PAGE_START	768
     93  1.2.2.2  yamt #define	BM_PORT_CTRL_PAGE	769
     94  1.2.2.2  yamt 
     95  1.2.2.2  yamt #define	IGP3_KMRN_DIAG		BME1000_REG(770, 19)
     96  1.2.2.2  yamt #define	IGP3_KMRN_DIAG_PCS_LOCK_LOSS	(1 << 1)
     97  1.2.2.2  yamt 
     98  1.2.2.2  yamt #define HV_MUX_DATA_CTRL	BME1000_REG(776, 16)
     99  1.2.2.2  yamt #define HV_MUX_DATA_CTRL_FORCE_SPEED	(1 << 2)
    100  1.2.2.2  yamt #define HV_MUX_DATA_CTRL_GEN_TO_MAC	(1 << 10)
    101  1.2.2.2  yamt 
    102  1.2.2.2  yamt #define	BM_WUC_PAGE		800
    103  1.2.2.2  yamt #define	BM_WUC			BME1000_REG(BM_WUC_PAGE, 1)
    104  1.2.2.2  yamt #define	BM_WUC_ADDRESS_OPCODE	0x11
    105  1.2.2.2  yamt #define	BM_WUC_DATA_OPCODE	0x12
    106  1.2.2.2  yamt #define	BM_WUC_ENABLE_PAGE	BM_PORT_CTRL_PAGE
    107  1.2.2.2  yamt #define	BM_WUC_ENABLE_REG	17
    108  1.2.2.2  yamt #define	BM_WUC_ENABLE_BIT	(1 << 2)
    109  1.2.2.2  yamt #define	BM_WUC_HOST_WU_BIT	(1 << 4)
    110  1.2.2.2  yamt 
    111  1.2.2.2  yamt #endif /* _DEV_MII_INBMPHYREG_H_ */
    112