1// Copyright 2018 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#pragma once
6
7#define MII_BMCR        0x00    /* Basic mode control register */
8#define MII_BMSR        0x01    /* Basic mode status register  */
9#define MII_PHYSID1     0x02    /* PHYS ID 1               */
10#define MII_PHYSID2     0x03    /* PHYS ID 2               */
11#define MII_ADVERTISE   0x04    /* Advertisement control reg   */
12#define MII_LPA         0x05    /* Link partner ability reg    */
13#define MII_EXPANSION   0x06    /* Expansion register           */
14#define MII_GBCR        0x09    /* 1000BASE-T control           */
15#define MII_GBSR        0x0a    /* 1000BASE-T status           */
16#define MII_ESTATUS     0x0f    /* Extended Status */
17#define MII_DCOUNTER    0x12    /* Disconnect counter           */
18#define MII_FCSCOUNTER  0x13    /* False carrier counter       */
19#define MII_NWAYTEST    0x14    /* N-way auto-neg test reg     */
20#define MII_RERRCOUNTER 0x15    /* Receive error counter       */
21#define MII_SREVISION   0x16    /* Silicon revision           */
22#define MII_RESV1       0x17    /* Reserved...               */
23#define MII_LBRERROR    0x18    /* Lpback, rx, bypass error    */
24#define MII_PHYADDR     0x19    /* PHY address               */
25#define MII_RESV2       0x1a    /* Reserved...               */
26#define MII_TPISTATUS   0x1b    /* TPI status for 10mbps       */
27#define MII_NCONFIG     0x1c    /* Network interface config    */
28#define MII_EPAGSR      0x1f    /* Page Select register */
29
30/* Basic mode control register. */
31#define BMCR_RESV           0x003f  /* Unused...                   */
32#define BMCR_SPEED1000      0x0040  /* MSB of Speed (1000)         */
33#define BMCR_CTST           0x0080  /* Collision test              */
34#define BMCR_FULLDPLX       0x0100  /* Full duplex                 */
35#define BMCR_ANRESTART      0x0200  /* Auto negotiation restart    */
36#define BMCR_ISOLATE        0x0400  /* Isolate data paths from MII */
37#define BMCR_PDOWN          0x0800  /* Enable low power state      */
38#define BMCR_ANENABLE       0x1000  /* Enable auto negotiation     */
39#define BMCR_SPEED100       0x2000  /* Select 100Mbps              */
40#define BMCR_LOOPBACK       0x4000  /* TXD loopback bits           */
41#define BMCR_RESET          0x8000  /* Reset to default state      */
42#define BMCR_SPEED10        0x0000  /* Select 10Mbps               */
43
44/* Basic mode status register. */
45#define BMSR_ERCAP          0x0001  /* Ext-reg capability          */
46#define BMSR_JCD            0x0002  /* Jabber detected             */
47#define BMSR_LSTATUS        0x0004  /* Link status                 */
48#define BMSR_ANEGCAPABLE    0x0008  /* Able to do auto-negotiation */
49#define BMSR_RFAULT         0x0010  /* Remote fault detected       */
50#define BMSR_ANEGCOMPLETE   0x0020  /* Auto-negotiation complete   */
51#define BMSR_RESV           0x00c0  /* Unused...                   */
52#define BMSR_ESTATEN        0x0100  /* Extended Status in R15      */
53#define BMSR_100HALF2       0x0200  /* Can do 100BASE-T2 HDX       */
54#define BMSR_100FULL2       0x0400  /* Can do 100BASE-T2 FDX       */
55#define BMSR_10HALF         0x0800  /* Can do 10mbps, half-duplex  */
56#define BMSR_10FULL         0x1000  /* Can do 10mbps, full-duplex  */
57#define BMSR_100HALF        0x2000  /* Can do 100mbps, half-duplex */
58#define BMSR_100FULL        0x4000  /* Can do 100mbps, full-duplex */
59#define BMSR_100BASE4       0x8000  /* Can do 100mbps, 4k packets  */
60