Home | History | Annotate | Line # | Download | only in ep93xx
      1  1.5  skrll /*	$NetBSD: epereg.h,v 1.5 2021/11/21 08:25:26 skrll Exp $ */
      2  1.1   joff 
      3  1.1   joff /*
      4  1.1   joff  * Copyright (c) 2004 Jesse Off
      5  1.1   joff  * All rights reserved.
      6  1.1   joff  *
      7  1.1   joff  * Redistribution and use in source and binary forms, with or without
      8  1.1   joff  * modification, are permitted provided that the following conditions
      9  1.1   joff  * are met:
     10  1.1   joff  * 1. Redistributions of source code must retain the above copyright
     11  1.1   joff  *    notice, this list of conditions and the following disclaimer.
     12  1.1   joff  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1   joff  *    notice, this list of conditions and the following disclaimer in the
     14  1.1   joff  *    documentation and/or other materials provided with the distribution.
     15  1.1   joff  *
     16  1.1   joff  * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA AND CONTRIBUTORS ``AS IS''
     17  1.1   joff  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     18  1.1   joff  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19  1.5  skrll  * ARE DISCLAIMED.  IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS
     20  1.1   joff  * HEAD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
     21  1.1   joff  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  1.1   joff  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23  1.1   joff  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24  1.1   joff  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  1.1   joff  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     26  1.1   joff  * THE POSSIBILITY OF SUCH DAMAGE.
     27  1.1   joff  */
     28  1.1   joff 
     29  1.1   joff #ifndef _EPEREG_H_
     30  1.1   joff #define _EPEREG_H_
     31  1.1   joff 
     32  1.2   joff #define EP93XX_AHB_EPE	0x00010000UL
     33  1.1   joff #define EPE_SIZE	0x000000f0UL
     34  1.1   joff #define EPE_RXCtl	0x00000000UL	/* Receiver Control */
     35  1.1   joff #define  RXCtl_IA0	0x00000001UL
     36  1.1   joff #define  RXCtl_IA1	0x00000002UL
     37  1.1   joff #define  RXCtl_IA2	0x00000004UL
     38  1.1   joff #define  RXCtl_IA3	0x00000008UL
     39  1.1   joff #define  RXCtl_IAHA	0x00000100UL
     40  1.1   joff #define  RXCtl_MA	0x00000200UL
     41  1.1   joff #define  RXCtl_BA	0x00000400UL
     42  1.1   joff #define  RXCtl_PA	0x00000800UL
     43  1.1   joff #define  RXCtl_RA	0x00001000UL
     44  1.1   joff #define  RXCtl_RCRCA	0x00002000UL
     45  1.1   joff #define  RXCtl_SRxON	0x00010000UL
     46  1.1   joff #define  RXCtl_BCRC	0x00020000UL
     47  1.1   joff #define  RXCtl_RxFCE0	0x00040000UL
     48  1.1   joff #define  RXCtl_RxFCE1	0x00080000UL
     49  1.1   joff #define  RXCtl_PauseA	0x00100000UL
     50  1.1   joff #define EPE_TXCtl	0x00000004UL	/* Transmitter Control */
     51  1.1   joff #define  TXCtl_STxON	0x00000001UL
     52  1.1   joff #define EPE_TestCtl	0x00000008UL	/* Test Control */
     53  1.1   joff #define  TestCtl_MFDX	0x00000040UL
     54  1.1   joff #define EPE_MIICmd	0x00000010UL	/* MII Command */
     55  1.1   joff #define  MIICmd_READ	0x00008000UL
     56  1.1   joff #define  MIICmd_WRITE	0x00004000UL
     57  1.1   joff #define EPE_MIIData	0x00000014UL	/* MII Data */
     58  1.1   joff #define EPE_MIISts	0x00000018UL	/* MII Status */
     59  1.1   joff #define MIISts_BUSY	0x00000001UL
     60  1.1   joff #define EPE_SelfCtl	0x00000020UL	/* Self Control */
     61  1.1   joff #define  SelfCtl_RESET	0x00000001UL
     62  1.1   joff #define  SelfCtl_PSPRS	0x00000100UL
     63  1.1   joff #define  SelfCtl_MDCDIV(x)	(((x) - 1) << 9)
     64  1.1   joff #define EPE_IntEn	0x00000024UL	/* Interrupt Enable */
     65  1.1   joff #define  IntEn_TSQIE	0x00000008UL
     66  1.1   joff #define  IntEn_REOFIE	0x00000004UL
     67  1.2   joff #define  IntEn_ECIE	0x02000000UL
     68  1.1   joff #define EPE_IntStsP	0x00000028UL	/* Interrupt Status Preserve */
     69  1.1   joff #define EPE_IntStsC	0x0000002cUL	/* Interrupt Status Clear */
     70  1.1   joff #define  IntSts_RxSQ	0x00000004UL
     71  1.1   joff #define  IntSts_TxSQ	0x00000008UL
     72  1.1   joff #define  IntSts_ECI	0x02000000UL
     73  1.1   joff #define  IntSts_MIII	0x00001000UL
     74  1.1   joff #define EPE_DiagAd	0x00000038UL	/* Diagnostic Address */
     75  1.1   joff #define EPE_DiagDa	0x0000003cUL	/* Diagnostic Data */
     76  1.1   joff #define EPE_GT		0x00000040UL	/* General Timer */
     77  1.1   joff #define EPE_FCT		0x00000044UL	/* Flow Control Timer */
     78  1.1   joff #define EPE_FCF		0x00000048UL	/* Flow Control Format */
     79  1.1   joff #define EPE_AFP		0x0000004cUL	/* Address Filter Pointer */
     80  1.1   joff #define EPE_IndAd	0x00000050UL	/* Individual Address */
     81  1.1   joff #define EPE_IndAd_SIZE	0x6
     82  1.1   joff #define EPE_HashTbl	0x00000050UL	/* Hash Table */
     83  1.1   joff #define EPE_HashTbl_SIZE	0x8
     84  1.1   joff #define EPE_GIIntSts	0x00000060UL	/* Global Interrupt Status */
     85  1.1   joff #define EPE_GIIntMsk	0x00000064UL	/* Global Interrupt Mask */
     86  1.1   joff #define  GIIntMsk_INT	0x00008000UL
     87  1.1   joff #define EPE_GIIntROSts	0x00000068UL	/* Global Interrupt Read-Only Status */
     88  1.1   joff #define EPE_GIIntFrc	0x0000006cUL	/* Global Interrupt Force */
     89  1.1   joff #define EPE_TXCollCnt	0x00000070UL	/* Transmit Collision Count */
     90  1.1   joff #define EPE_RXMissCnt	0x00000074UL	/* Receive Miss Count */
     91  1.1   joff #define EPE_RXRuntCnt	0x00000078UL	/* Receive Runt Count */
     92  1.1   joff #define EPE_BMCtl	0x00000080UL	/* Bus Master Control */
     93  1.1   joff #define  BMCtl_RxEn	0x00000001UL
     94  1.1   joff #define  BMCtl_TxEn	0x00000100UL
     95  1.1   joff #define EPE_BMSts	0x00000084UL	/* Bus Master Status */
     96  1.1   joff #define  BMSts_RxAct	0x00000080UL
     97  1.1   joff #define EPE_RXBCA	0x00000088UL	/* Receive Buffer Current Address */
     98  1.1   joff #define EPE_RXDQBAdd	0x00000090UL	/* Receive Descriptor Queue Base Addr */
     99  1.1   joff #define EPE_RXDQBLen	0x00000094UL	/* Receive Descriptor Queue Base Len */
    100  1.1   joff #define EPE_RXDQCurLen	0x00000096UL	/* Recv Descriptor Queue Current Len */
    101  1.1   joff #define EPE_RXDCurAdd	0x00000098UL	/* Recv Descriptor Current Address */
    102  1.1   joff #define EPE_RXDEnq	0x0000009cUL	/* Receive Descriptor Enqueue */
    103  1.1   joff #define EPE_RXStsQBAdd	0x000000a0UL	/* Receive Status Queue Base Address */
    104  1.1   joff #define EPE_RXStsQBLen	0x000000a4UL	/* Receive Status Queue Base Length */
    105  1.5  skrll #define EPE_RXStsQCurLen	0x000000a6UL	/* Recv Sts Q Current Length */
    106  1.1   joff #define EPE_RXStsQCurAdd	0x000000a8UL	/* Recv Sts Q Current Address */
    107  1.1   joff #define EPE_RXStsEnq	0x000000acUL	/* Receive Status Enqueue */
    108  1.1   joff #define EPE_TXDQBAdd	0x000000b0UL	/* Transmit Descriptor Q Base Addr */
    109  1.1   joff #define EPE_TXDQBLen	0x000000b4UL	/* Transmit Descriptor Q Base Length */
    110  1.1   joff #define EPE_TXDQCurLen	0x000000b6UL	/* Transmit Descriptor Q Current Len */
    111  1.1   joff #define EPE_TXDQCurAdd	0x000000b8UL	/* Transmit Descriptor Q Current Addr */
    112  1.1   joff #define EPE_TXDEnq	0x000000bcUL	/* Transmit Descriptor Enqueue */
    113  1.1   joff #define EPE_TXStsQBAdd	0x000000c0UL	/* Transmit Status Queue Base Address */
    114  1.1   joff #define EPE_TXStsQBLen	0x000000c4UL	/* Transmit Status Queue Base Length */
    115  1.1   joff #define EPE_TXStsQCurLen	0x000000c6UL	/* Transmit Sts Q Current Len */
    116  1.1   joff #define EPE_TXStsQCurAdd	0x000000c8UL	/* Transmit Sts Q Current Adr */
    117  1.1   joff #define EPE_RXBufThrshld	0x000000d0UL	/* Receive Buffer Threshold */
    118  1.1   joff #define EPE_TXBufThrshld	0x000000d4UL	/* Transmit Buffer Threshold */
    119  1.1   joff #define EPE_RXStsThrshld	0x000000d8UL	/* Receive Status Threshold */
    120  1.1   joff #define EPE_TXStsThrshld	0x000000dcUL	/* Transmit Status Threshold */
    121  1.1   joff #define EPE_RXDThrshld	0x000000e0UL	/* Receive Descriptor Threshold */
    122  1.1   joff #define EPE_TXDThrshld	0x000000e4UL	/* Transmit Descriptor Threshold */
    123  1.1   joff #define EPE_MaxFrmLen	0x000000e8UL	/* Maximum Frame Length */
    124  1.1   joff #define EPE_RXHdrLen	0x000000ecUL	/* Receive Header Length */
    125  1.1   joff #define EPE_MACFIFO	0x00004000UL	/* FIFO RAM */
    126  1.1   joff #define EPE_MACFIFO_SIZE	0xc000UL
    127  1.1   joff 
    128  1.1   joff /* Receive Status Queue, First Word */
    129  1.1   joff #define RXStsQ_RFP	0x80000000UL
    130  1.1   joff #define RXStsQ_RWE	0x40000000UL
    131  1.1   joff #define RXStsQ_EOF	0x20000000UL
    132  1.1   joff #define RXStsQ_EOB	0x10000000UL
    133  1.1   joff #define RXStsQ_RX_Err	0x00200000UL
    134  1.1   joff #define RXStsQ_OE	0x00100000UL
    135  1.1   joff #define RXStsQ_FE	0x00080000UL
    136  1.1   joff #define RXStsQ_Runt	0x00040000UL
    137  1.1   joff #define RXStsQ_EData	0x00020000UL
    138  1.1   joff #define RXStsQ_CRCE	0x00010000UL
    139  1.1   joff #define RXStsQ_CRCI	0x00008000UL
    140  1.1   joff 
    141  1.1   joff /* Transmit Status Queue */
    142  1.1   joff #define TXStsQ_TxFP	0x80000000UL
    143  1.1   joff #define TXStsQ_TxWE	0x40000000UL
    144  1.1   joff #define TXStsQ_FA	0x20000000UL
    145  1.1   joff #define TXStsQ_LCRS	0x10000000UL
    146  1.1   joff #define TXStsQ_OW	0x04000000UL
    147  1.1   joff #define TXStsQ_TxU	0x02000000UL
    148  1.1   joff #define TXStsQ_EColl	0x01000000UL
    149  1.1   joff 
    150  1.1   joff #endif /* _EPEREG_H_ */
    151