Media Independent Interface
The Media Independent Interface (MII) was originally defined as a standard interface used to connect a Fast Ethernet (i.e., 100 Mbit/s) MAC-block to a PHY chip.
The MII design has been extended to support reduced signals and increased speeds. Current variants are Reduced Media Independent Interface, Gigabit Media Independent Interface, Reduced Gigabit Media Independent Interface, Serial Gigabit Media Independent Interface, 10 Gigabit Media Independent Interface, XAUI, GBIC, SFP, SFF, XFP, and XFI.
The equivalent of MII for 10 megabit Ethernet is the Attachment Unit Interface.
Media Independent Interface
Being media independent means that different types of PHY devices for connecting to different media (i.e. Twisted pair copper, fiber optic, etc.) can be used without redesigning or replacing the MAC hardware. The MII bus (standardized by IEEE 802.3u) connects different types of PHYs (Physical Transceivers) to Media Access Controllers (MAC). Thus any MAC may be used with any PHY, independent of the network signal transmission media. The MII bus transfers data using 4-bit words (nibble) in each direction (4 transmit data bits, 4 receive data bits). The data is clocked at 25 MHz to achieve 100 Mbit/s speed.
The MII can be used to connect a MAC to an external PHY using a pluggable connector (shown in the figure (extreme right)), or direct to a PHY chip which is on the same PCB. On a PC the CNR connector Type B carries MII bus interface signals.
The MDIO Serial Management Interface (SMI) is used to transfer management information between MAC and PHY.
The standard MII features a small set of registers:[1]
- Basic Mode Configuration (#0)
- Status Word (#1)
- PHY Identification (#2, #3)
- Ability Advertisement (#4)
- Link Partner Ability (#5)
- Auto Negotiation Expansion (#6)
The MII Status Word is the most useful datum, since it may be used to detect whether an Ethernet NIC is connected to a network. It contains a bitmask with the following meaning:
0x8000 Capable of 100baseT4 0x7800 Capable of 10/100 HD/FD (most common) 0x0040 Preamble suppression permitted 0x0020 Autonegotiation complete 0x0010 Remote fault 0x0008 Capable of Autonegotiation 0x0004 Link established 0x0002 Jabber detected 0x0001 Extended MII register exist.
A more detailed reference on registers exported by MII-compatible PHY's can be found looking at the Linux MII interface definition include/linux/mii.h
Transmitter signals
- TXD0 Transmit data bit 0 (MAC to PHY) (transmitted first)
- TXD1 Transmit data bit 1 (MAC to PHY)
- TXD2 Transmit data bit 2 (MAC to PHY)
- TXD3 Transmit data bit 3 (MAC to PHY)
- TXEN When high, clock data on TXD0 - TXD3 to the transmitter (MAC to PHY)
- TXER Transmit Error (optional, rarely used) (MAC to PHY)
- TXCLK Transmit clock, 25 MHz for 100Mbit/s, 2.5 MHz for 10Mbit/s. All Tx signals are referenced to this clock (PHY to MAC)
Receiver signals
- RXD0 Receive data bit 0 (PHY to MAC) (received first)
- RXD1 Receive data bit 1 (PHY to MAC)
- RXD2 Receive data bit 2 (PHY to MAC)
- RXD3 Receive data bit 3 (PHY to MAC)
- RXDV RX_Data Valid (PHY to MAC)
- COL Collision Detect (PHY to MAC)
- CRS Carrier Sense (PHY to MAC)
- RXER Receive Error (PHY to MAC)
- RXCLK Receive clock, 25 MHz for 100Mbit/s, 2.5 MHz for 10Mbit/s (PHY to MAC)
Management signals
- MDIO Management data I/O line (bidirectional, push-pull)
- MDC Management data clock line (unidirectional: MAC to PHY). MDC and MDIO can be shared among multiple PHYs.
In operation of data transmission, the transmit enable signal (TXEN) is asserted Active to indicate the start of an Ethernet frame, and is held active until the frame's transmission is completed. Simultaneously, the transmit clock signal (TXCLK) is set to Active for every new group of data bits (TXD0-TXD3). At 2.5 MHz for 10 Mbit/s mode and 25 MHz for 100 Mbit/s mode.
During reception the receive data valid signal (RXDV) goes active when the frame starts, and is held active throughout the frame duration. The clock signal (RXCLK) goes active for every new group of receive data bits (RXD0-RXD3). For the shortest possible frame size of 64 bytes, this means ~130 clocks. Any frame transferred begins with sync bits before the data payload. At powerup the PHY usually adapts to whatever it's connected to (Auto-negotiation) unless you alter settings via the MDIO interface.
Limitations
There is no physical signal which defines whether the interface is in full or half duplex mode, but both the MAC and the PHY need to agree. This must instead be communicated over the serial MDIO/MDC interface, but the standard does not specify a standard MDIO register bit for the duplex mode. This means that custom software is required for every PHY.
The interface requires 16 signals, out of which only two can be shared among multiple PHYs. This presents a problem especially for multi-port devices. A 8-port switch using MII would for example need 8*14+2=114 signals. For this reason, the Reduced Media Independent Interface was developed.
Reduced Media Independent Interface
Reduced Media Independent Interface (RMII) is a standard which was developed to reduce the number of signals required to connect a PHY to a MAC. Four things were changed compared to the MII standard to achieve this:
- The two clocks TXCLK and RXCLK are replaced by a single clock. This clock is an input to the PHY rather than an output, which allows the clock signal to be shared among all PHYs in a multiport device, such as a switch.
- The clock frequency is doubled from 25 MHz to 50 MHz, while the data paths are narrowed to 2 bits rather than 4 bits.
- RXDV and CRS signals are multiplexed to one signal.
- The COL signal is removed.
These changes means that RMII uses about half the number of signals compared to MII. The high pin count of MII is more of a burden on microcontrollers with built-in MAC, FPGA's, multiport switches or repeaters, and PC motherboard chipsets than it is for a separate single port Ethernet MAC which partially explains why the older MII standard was more wasteful of pins.
Transmitter signals
- TXD0 Transmit data bit 0 (MAC to PHY) (transmitted first)
- TXD1 Transmit data bit 1 (MAC to PHY)
- TX_EN When high, clock data on TXD0 and TXD1 to the transmitter (MAC to PHY)
- REF_CLK Continuous 50 MHz Reference Clock (may be shared among interfaces). Reference clock may be an input on both devices or may be driven from MAC to PHY.
Receiver signals
- RXD0 Receive data bit 0 (PHY to MAC) (received first)
- RXD1 Receive data bit 1 (PHY to MAC)
- CRS_DV, Carrier Sense (CRS)/RX_Data Valid(RX_DV) multiplexed on alternate clock cycles. In 10 Mbit/s mode, it alternates every 10 clock cycles. (PHY to MAC)
- RX_ER Receive Error (optional on switches) (PHY to MAC)
The receiver signals are referenced to the REF_CLK, same as the transmitter signals.
Management signals
- MDIO Management data I/O line (bidirectional, push-pull)
- MDC Management data clock line (unidirectional: MAC to PHY). MDC and MDIO can be shared among multiple PHYs.
On multiport devices, MDIO, MDC, and REF_CLK may be shared leaving 6 or 7 pins per port.
RMII requires a 50 MHz clock where MII requires a 25 MHz clock and data is clocked out two bits at a time vs 4 bits at a time for MII or 1 bit at a time for SNI (10 Mbit/s only). Data is sampled on the rising edge only (i.e. it is not double pumped).
The REF_CLK operates at 50 MHz in both 100 Mbit/s mode and 10 Mbit/s mode. Instead, the transmitting side (PHY or MAC) must keep all signals valid for 10 clock cycles in 10 Mbit/s mode. The receiver (PHY or MAC) samples the input signals only every tenth cycle in 10 Mbit/s mode.
Limitations
There is no signal which defines whether the interface is in full or half duplex mode, but both the MAC and the PHY need to agree. This must instead be communicated over the serial MDIO/MDC interface, but the standard does not specify a standard MDIO register bit for the duplex mode. This means that custom software is required for every PHY. There is also no signal which defines whether the interface is in 10 or 100 Mbit/s mode, so this must also be handled using the MDIO/MDC interface, just like the duplex setting. Future versions of the RMII standard might specify a way to transmit data over TXD0/TXD1/RXD0/RXD1 pins while TX_EN and CRS_DV are de-asserted.
The lack of the RX_ER signal which is not connected on some MACs (such as multiport switches) is dealt with by data replacement on some PHYs to invalidate the CRC. The missing COL signal is derived from AND-ing together the TX_EN and the decoded CRS signal from the CRS_DV line in half duplex mode. This means a slight modification of the definition of CRS: On MII, CRS is asserted for both Rx and Tx frames; on RMII only for Rx frames. This has the consequence that on RMII the two error conditions "no carrier" and "lost carrier" cannot be detected, and it is difficult or impossible to support shared media such as 10BASE2 or 10BASE5.
Signal levels
TTL signal levels are used for 5 V or 3.3 V logic. Input high threshold is 2.0 V and low is 0.8 V. The specification states that inputs should be 5 V tolerant, however, some popular chips with RMII interfaces are not 5 V tolerant. Given trends in the semiconductor industry and the fact that both ICs are usually on the same board, lack of 5 V tolerance is probably very common, and chips that actually drive 5 V are probably even rarer. 5 V tolerance is probably found primarily on older MII only devices. On the other hand, newer devices may support 2.5 V and 1.8 V logic. National.com doesn't make 5 V tolerant RMII PHYs. National DP83848: no 5 V. SMSC LAN8187: 1.8 V to 3.3 V, not 5 V tolerant. Intel LXT9781/LXT9761 8/6 port PHY: 5 V tolerant. Atmel AT91SAM7XC256 microcontroller: 5 V tolerant, AMD 79C875 4 port PHY: 5 V tolerant, FPGAs sufficient to implement MAC are usually not 5 V tolerant.
The RMII signals are treated as lumped signals rather than transmission lines; no termination or controlled impedance is necessary; output drive (and thus slew rates) need to be as slow as possible (rise times from 1- to 5 ns) in order to permit this. Drivers should be able to drive 25 pF of capacitance which allows for PCB traces up to 0.30 meters. At least the standard says the signals need not be treated as transmission lines. However, at 1 ns edge rates a trace longer than about 2.7 cm (1ns/(5.9ns/m)*(3.7 m/0.0254 m)*(1/6)), transmission line effects could be a significant problem; at 5 ns, traces can be 5 times longer. The IEEE version of the related MII standard specifies 68 Ω trace impedance.[2] National recommends running 50 Ω traces with 33 Ω (adds to driver output impedance) series termination resistors for either MII or RMII mode to reduce reflections.[citation needed] National also suggests that traces be kept under 0.15 meters long and matched within 0.05 meters on length to minimize skew.[3]
Since the RMII standard neglected to stipulate that TX_EN should only be sampled on alternate clock cycles, it is not symmetric with CRS_DV and two RMII PHY devices cannot be connected back to back to form a repeater; this is possible, however, with the National DP83848 which supplies the decoded RX_DV as a supplemental signal in RMII mode [4]
Gigabit Media Independent Interface
Gigabit Media Independent Interface (GMII) is an interface between the Media Access Control (MAC) device and the physical layer (PHY). The interface defines speeds up to 1000 Mbit/s, implemented using an eight-bit data interface clocked at 125 MHz, and is backwards compatible with the Media Independent Interface (MII) specification. It can also operate on fall-back speeds of 10 or 100 Mbit/s as per the MII specification.
Data on the interface is framed using the IEEE Ethernet standard. As such it consists of a preamble, start frame delimiter, Ethernet headers, protocol specific data and a cyclic redundancy check (CRC).
The GMII interface is defined in IEEE Standard 802.3, 2000 Edition.[5]
Transmitter signals
- GTXCLK - clock signal for gigabit TX.. signals (125 MHz)
- TXCLK - clock signal for 10/100 Mbit signals
- TXD[7..0] - data to be transmitted
- TXEN - transmitter enable
- TXER - transmitter error (used to corrupt a packet)
There are two clocks, depending on whether the PHY is operating at gigabit or 10/100 Mb speeds. For gigabit speeds, the GTXCLK is supplied to the PHY and the TXD, TXEN, TXER signals are synchronized to this. Otherwise for 10 or 100 Mbit/s the TXCLK (supplied by PHY) is used for synchronizing those signals. This operates at either 25 MHz for 100 Mbit/s or 2.5 MHz for 10 Mbit/s connections. The receiver clock is much simpler, with only one clock, which is recovered from the incoming data. Hence the GTXCLK and RXCLK are not coherent.
Receiver signals
- RXCLK - received clock signal (recovered from incoming received data)
- RXD[7..0] - received data
- RXDV - signifies data received is valid
- RXER - signifies data received has errors
- COL - Collision Detect (half-duplex connections only)
- CS - Carrier Sense (half-duplex connections only)
Management signals
- MDC - Management interface clock
- MDIO - Management interface I/O bidirectional pin.
The management interface controls the behaviour of the PHY. There are 32 addresses, each containing 16 bits. The first 16 addresses have a defined usage,[6] while the others are device specific. These registers can be used to configure the device (say "only gigabit, full duplex", or "only full duplex") or can be used to determine the current operating mode.
Reduced Gigabit Media Independent Interface
Reduced Gigabit Media Independent Interface (RGMII) specifies a particular interface between an Ethernet MAC and PHY.
RGMII uses half the number of data pins as used in the GMII interface. This reduction is achieved by clocking data on both the rising and falling edges of the clock in 1000 Mbit/s operation, and by eliminating non-essential signals (carrier-sense and collision-indication). Thus RGMII consists only of: RX_CTL, RXC, RXD[3:0], TX_CTL, TXC, TXD[3:0] (12 pins, as opposed to GMII's 24).
Unlike GMII, the transmit clock signal is always provided by the MAC on the TXC line, rather than being provided by the PHY for 10/100 Mbit/s operation and by the MAC at 1000 Mbit/s.
RGMII supports Ethernet speeds of:
[Mbit/s] | [MHz] | Bits/Clockcycle |
---|---|---|
10 | 2.5 | 4 |
100 | 25 | 4 |
1000 | 125 | 8 |
Serial Gigabit Media Independent Interface
The Serial Gigabit Media Independent Interface (SGMII) is a variant of MII, a standard interface used to connect an Ethernet MAC-block to a PHY. It is used for Gigabit Ethernet but can also carry 10/100 MBit Ethernet.
It uses differential pairs at 625 MHz clock frequency DDR for TX and RX data and TX and RX clocks. It differs from GMII by its low-power and low pin count serial 8B/10B coded interface (commonly referred to as a SerDes). Transmit and receive path each use one differential pair for data and another differential pair for clock. The TX/RX clocks must be generated on device output but are optional on device input (Clock recovery may be used alternatively). 10/100 MBit Ethernet is carried by duplicating data words 100/10 times each, so the clock is always at 625 MHz.
Quad Serial Gigabit Media Independent Interface
The Quad Serial Gigabit Media Independent Interface (QSGMII) is a method of combining four SGMII lines into a 5Gbit/s interface. QSGMII, like SGMII, uses LVDS signalling for the TX and RX data and a single LVDS clock signal.
QSGMII uses significantly fewer signal lines than four SGMII busses.
10 Gigabit Media Independent Interface
10 Gigabit Media Independent Interface (XGMII) is a standard defined in IEEE 802.3 for connecting full duplex 10 Gigabit Ethernet (10GbE) ports to each other and to other electronic devices on a printed circuit board. It is composed from two 32-bits datapaths (Rx & Tx) and two 4-bits control flows (Rxc & Txc), operating at 156.25 MHz DDR (312.5 MT/s).
Typically used for on-chip connections; in chip-to-chip usage mostly replaced by XAUI.
See also
- Communications and Networking Riser (CNR)
- G.hn, an ITU-T recommendation that uses the term MII to refer to the interface between the Data Link Layer and the Physical Layer.
- List of device bandwidths
References
- ↑ IEEE Standard 802.3: CSMA/CD Access Method and Physical Layer Specifications, Section Two, Chapter 22.2.4 (retrieved on 15-10-2010)
- ↑ AN-1469 datasheet
- ↑ AN-1469 datasheet p. 5
- ↑ AN-1405 schematic.
- ↑ http://ieeexplore.ieee.org/servlet/opac?punumber=7057
- ↑ IEEE 802.3,2000-22.2.4 Management Functions
External links
- national.com - RMII specification
- national.com - AN-1405 DP83848 RMII
- national.com - DP83848C PHY Data Sheet
- hp.com - RGMIIv2_0_final_hp.pdf RGMII 2002-04-01 Version 2.0
- Serial-GMII Specification Revision 1.8 (ENG-46158)
- Serial-GMII Specification Revision 1.7 (ENG-46158)
- CEVA implementation documentation
- Altera 10Gb Ethernet IP with XGMII and XAUI interfaces
- Cisco Serial-MII Specification Revision 2.1
- GMII Timing and Electrical Specification
|