/** * \file * * \brief API driver for KSZ8051RNL PHY based on driver for DM9161A PHY PHY. * Adapted from the mii.h file provided as part of LWIP under the license below: * Only designed to work with the KSZ8051RNL PHY, not yet fully tested. * * Copyright (c) 2012 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * \asf_license_stop * */ #ifndef RMII_H_INCLUDED #define RMII_H_INCLUDED /** \addtogroup eth_phy_rmii @{*/ /** \addtogroup rmii_registers PHY registers Addresses @{*/ #define MII_BMCR 0x0 /**< Basic Mode Control Register */ #define MII_BMSR 0x1 /**< Basic Mode Status Register */ #define MII_PHYID1 0x2 /**< PHY Identifier Register 1 */ #define MII_PHYID2 0x3 /**< PHY Identifier Register 2 */ #define MII_ANAR 0x4 /**< Auto_negotiation Advertisement Register */ #define MII_ANLPAR 0x5 /**< Auto_negotiation Link Partner Ability Register */ #define MII_ANER 0x6 /**< Auto-negotiation Expansion Register */ #define MII_ANNP 0x7 /**< Auto-Negotiation Next Page */ #define MII_LPNP 0x8 /**< Link Partner Next Page Ability */ #define MII_AFE 0x11 /**< AFE Control 1*/ #define MII_RXER 0x15 /**< RXER Counter*/ #define MII_OMSO 0x16 /**< Operation Mode Strap Override */ #define MII_OMSS 0x17 /**< Operation Mode Strap Status */ #define MII_EXPC 0x18 /**< Expanded Control */ #define MII_INTCS 0x1B /**< Interrupt Control/Status */ #define MII_LMDCS 0x1D /**< LinkMD Control/Status */ #define MII_PC1 0x1E /**< PHY Control 1*/ #define MII_PC2 0x1F /**< PHY Control 2*/ /** @}*/ /** \addtogroup phy_bmcr Basic Mode Control Register (BMCR, 0) List Bit definitions: \ref MII_BMCR @{*/ #define MII_RESET (1u << 15) /**< 1= Software Reset; 0=Normal Operation */ #define MII_LOOPBACK (1u << 14) /**< 1=loopback Enabled; 0=Normal Operation */ #define MII_SPEED_SELECT (1u << 13) /**< 1=100Mbps; 0=10Mbps */ #define MII_AUTONEG (1u << 12) /**< Auto-negotiation Enable */ #define MII_POWER_DOWN (1u << 11) /**< 1=Power down 0=Normal operation */ #define MII_ISOLATE (1u << 10) /**< 1 = Isolate 0 = Normal operation */ #define MII_RESTART_AUTONEG (1u << 9) /**< 1 = Restart auto-negotiation 0 = Normal operation */ #define MII_DUPLEX_MODE (1u << 8) /**< 1 = Full duplex operation 0 = Normal operation */ #define MII_COLLISION_TEST (1u << 7) /**< 1 = Collision test enabled 0 = Normal operation */ /** Reserved bits: 6 to 0, Read as 0, ignore on write */ /** @}*/ /** \addtogroup phy_bmsr Basic Mode Status Register (BMSR, 1) List Bit definitions: \ref MII_BMSR @{*/ #define MII_100BASE_T4 (1u << 15) /**< 100BASE-T4 Capable */ #define MII_100BASE_TX_FD (1u << 14) /**< 100BASE-TX Full Duplex Capable */ #define MII_100BASE_TX_HD (1u << 13) /**< 100BASE-TX Half Duplex Capable */ #define MII_10BASE_T_FD (1u << 12) /**< 10BASE-T Full Duplex Capable */ #define MII_10BASE_T_HD (1u << 11) /**< 10BASE-T Half Duplex Capable */ /** Reserved bits: 10 to 7, Read as 0, ignore on write */ #define MII_MF_PREAMB_SUPPR (1u << 6) /**< MII Frame Preamble Suppression */ #define MII_AUTONEG_COMP (1u << 5) /**< Auto-negotiation is completed */ #define MII_REMOTE_FAULT (1u << 4) /**< Remote Fault */ #define MII_AUTONEG_ABILITY (1u << 3) /**< Auto Configuration Ability */ #define MII_LINK_STATUS (1u << 2) /**< Link Status */ #define MII_JABBER_DETECT (1u << 1) /**< Jabber Detect */ #define MII_EXTEND_CAPAB (1u << 0) /**< Extended Capability */ /** @}*/ /** \addtogroup phy_id PHY ID Identifier Register (PHYID, 2,3) List definitions: \ref MII_PHYID1, \ref MII_PHYID2 @{*/ /**