- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

# mii.h

    00001 /* Generic MII registers. */
    00002
    00003 #define MII_BMCR            0x00        /* Basic mode control register */
    00004 #define MII_BMSR            0x01        /* Basic mode status register  */
    00005 #define MII_PHYSID1         0x02        /* PHYS ID 1                   */
    00006 #define MII_PHYSID2         0x03        /* PHYS ID 2                   */
    00007 #define MII_ADVERTISE       0x04        /* Advertisement control reg   */
    00008 #define MII_LPA             0x05        /* Link partner ability reg    */
    00009 #define MII_EXPANSION       0x06        /* Expansion register          */
    00010 #define MII_DCOUNTER        0x12        /* Disconnect counter          */
    00011 #define MII_FCSCOUNTER      0x13        /* False carrier counter       */
    00012 #define MII_NWAYTEST        0x14        /* N-way auto-neg test reg     */
    00013 #define MII_RERRCOUNTER     0x15        /* Receive error counter       */
    00014 #define MII_SREVISION       0x16        /* Silicon revision            */
    00015 #define MII_RESV1           0x17        /* Reserved...                 */
    00016 #define MII_LBRERROR        0x18        /* Lpback, rx, bypass error    */
    00017 #define MII_PHYADDR         0x19        /* PHY address                 */
    00018 #define MII_RESV2           0x1a        /* Reserved...                 */
    00019 #define MII_TPISTATUS       0x1b        /* TPI status for 10mbps       */
    00020 #define MII_NCONFIG         0x1c        /* Network interface config    */
    00021
    00022 /* Basic mode control register. */
    00023 #define BMCR_RESV               0x007f  /* Unused...                   */
    00024 #define BMCR_CTST               0x0080  /* Collision test              */
    00025 #define BMCR_FULLDPLX           0x0100  /* Full duplex                 */
    00026 #define BMCR_ANRESTART          0x0200  /* Auto negotiation restart    */
    00027 #define BMCR_ISOLATE            0x0400  /* Disconnect DP83840 from MII */
    00028 #define BMCR_PDOWN              0x0800  /* Powerdown the DP83840       */
    00029 #define BMCR_ANENABLE           0x1000  /* Enable auto negotiation     */
    00030 #define BMCR_SPEED100           0x2000  /* Select 100Mbps              */
    00031 #define BMCR_LOOPBACK           0x4000  /* TXD loopback bits           */
    00032 #define BMCR_RESET              0x8000  /* Reset the DP83840           */
    00033
    00034 /* Basic mode status register. */
    00035 #define BMSR_ERCAP              0x0001  /* Ext-reg capability          */
    00036 #define BMSR_JCD                0x0002  /* Jabber detected             */
    00037 #define BMSR_LSTATUS            0x0004  /* Link status                 */
    00038 #define BMSR_ANEGCAPABLE        0x0008  /* Able to do auto-negotiation */
    00039 #define BMSR_RFAULT             0x0010  /* Remote fault detected       */
    00040 #define BMSR_ANEGCOMPLETE       0x0020  /* Auto-negotiation complete   */
    00041 #define BMSR_RESV               0x07c0  /* Unused...                   */
    00042 #define BMSR_10HALF             0x0800  /* Can do 10mbps, half-duplex  */
    00043 #define BMSR_10FULL             0x1000  /* Can do 10mbps, full-duplex  */
    00044 #define BMSR_100HALF            0x2000  /* Can do 100mbps, half-duplex */
    00045 #define BMSR_100FULL            0x4000  /* Can do 100mbps, full-duplex */
    00046 #define BMSR_100BASE4           0x8000  /* Can do 100mbps, 4k packets  */
    00047
    00048 /* Advertisement control register. */
    00049 #define ADVERTISE_SLCT          0x001f  /* Selector bits               */
    00050 #define ADVERTISE_CSMA          0x0001  /* Only selector supported     */
    00051 #define ADVERTISE_10HALF        0x0020  /* Try for 10mbps half-duplex  */
    00052 #define ADVERTISE_10FULL        0x0040  /* Try for 10mbps full-duplex  */
    00053 #define ADVERTISE_100HALF       0x0080  /* Try for 100mbps half-duplex */
    00054 #define ADVERTISE_100FULL       0x0100  /* Try for 100mbps full-duplex */
    00055 #define ADVERTISE_100BASE4      0x0200  /* Try for 100mbps 4k packets  */
    00056 #define ADVERTISE_RESV          0x1c00  /* Unused...                   */
    00057 #define ADVERTISE_RFAULT        0x2000  /* Say we can detect faults    */
    00058 #define ADVERTISE_LPACK         0x4000  /* Ack link partners response  */
    00059 #define ADVERTISE_NPAGE         0x8000  /* Next page bit               */
    00060
    00061 #define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
    00062       ADVERTISE_CSMA)
    00063 #define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
    00064                        ADVERTISE_100HALF | ADVERTISE_100FULL)
    00065
    00066 /* Link partner ability register. */
    00067 #define LPA_SLCT                0x001f  /* Same as advertise selector  */
    00068 #define LPA_10HALF              0x0020  /* Can do 10mbps half-duplex   */
    00069 #define LPA_10FULL              0x0040  /* Can do 10mbps full-duplex   */
    00070 #define LPA_100HALF             0x0080  /* Can do 100mbps half-duplex  */
    00071 #define LPA_100FULL             0x0100  /* Can do 100mbps full-duplex  */
    00072 #define LPA_100BASE4            0x0200  /* Can do 100mbps 4k packets   */
    00073 #define LPA_RESV                0x1c00  /* Unused...                   */
    00074 #define LPA_RFAULT              0x2000  /* Link partner faulted        */
    00075 #define LPA_LPACK               0x4000  /* Link partner acked us       */
    00076 #define LPA_NPAGE               0x8000  /* Next page bit               */
    00077
    00078 #define LPA_DUPLEX    (LPA_10FULL | LPA_100FULL)
    00079 #define LPA_100     (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
    00080
    00081 /* Expansion register for auto-negotiation. */
    00082 #define EXPANSION_NWAY          0x0001  /* Can do N-way auto-nego      */
    00083 #define EXPANSION_LCWP          0x0002  /* Got new RX page code word   */
    00084 #define EXPANSION_ENABLENPAGE   0x0004  /* This enables npage words    */
    00085 #define EXPANSION_NPCAPABLE     0x0008  /* Link partner supports npage */
    00086 #define EXPANSION_MFAULTS       0x0010  /* Multiple faults detected    */
    00087 #define EXPANSION_RESV          0xffe0  /* Unused...                   */
    00088
    00089 /* N-way test register. */
    00090 #define NWAYTEST_RESV1          0x00ff  /* Unused...                   */
    00091 #define NWAYTEST_LOOPBACK       0x0100  /* Enable loopback for N-way   */
    00092 #define NWAYTEST_RESV2          0xfe00  /* Unused...                   */
    00093
    00094 #define SPEED_10        10
    00095 #define SPEED_100       100
    00096
    00097 /* Duplex, half or full. */
    00098 #define DUPLEX_HALF       0x00
    00099 #define DUPLEX_FULL       0x01
    00100
    00101 /* PHY ID */
    00102 #define MII_DM9161_ID     0x0181b8a0
    00103 #define MII_AM79C875_ID   0x00225540  /* 0x00225541 */
    00104
    00105 #define AT91C_PHY_ADDR  31

The Make Controller Kit is an open source project maintained by MakingThings.
MakingThings code is released under the Apache 2.0 license.
Bug tracker, development wiki and status can be found at http://dev.makingthings.com.
This document was last updated on 18 May 2009.