0% found this document useful (0 votes)
18 views5 pages

Ethernet 802.3 MDC/MDIO Design Guide

The document outlines the design and coding exercise for the Ethernet 802.3 Management Interface (MDC/MDIO), detailing the Master and Slave Block functionalities for managing PHY devices. It specifies the transaction processes, including host transactions, register access, and error handling, along with the timing and signal requirements as per the Ethernet specification. Additionally, it includes a comprehensive appendix on the management interface specifications, including signal timing and frame structure.

Uploaded by

Adithya Kanna
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views5 pages

Ethernet 802.3 MDC/MDIO Design Guide

The document outlines the design and coding exercise for the Ethernet 802.3 Management Interface (MDC/MDIO), detailing the Master and Slave Block functionalities for managing PHY devices. It specifies the transaction processes, including host transactions, register access, and error handling, along with the timing and signal requirements as per the Ethernet specification. Additionally, it includes a comprehensive appendix on the management interface specifications, including signal timing and frame structure.

Uploaded by

Adithya Kanna
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Design/Coding Exercise: Ethernet 802.

3 Management Interface (MDC/MDIO) Design

Design/Coding Exercise: Ethernet Management Interface


(MDC/MDIO) Design
Reference: Ethernet 802.3-2000 Specification Clause 22.2. Relevant portion of the spec is reproduced
at the end of this document.

MDC/MDIO is a 2-wire interface used by Ethernet Station Management Entity to configure as well as
read status from various PHY devices connected to it. There can be a maximum of 31 PHY devices
sharing the bidirectional MDIO serial line.

MDIO Master Block: Design a Master Block which translates host access transactions to MDC/MDIO
transaction. This Master Block generally sits in the MAC Device Controller Chip.

mdio_out
reset_n
mdio_oe mdio
clk
mdio_in
cfg_mdc_pwidth[3:0]
cfg_no_preamble
Mgmt Interface
Master Block mdc
(mmb_core)
[in MAC Device]
host_mmb_req
host_mmb_rw_n

host_mmb_phy_addr[4:0]
host_mmb_reg_addr[4:0]
host_mmb_wr_data[15:0]

mmb_host_ack
mmb_host_rd_data[15:0]
mmb_host_rd_err

MDC/MDIO transaction specification is given in the Appendix of this document. mdc clock is generated
by dividing “clk” by 2*Cfg_mdc_pwidth. Cfg_mdc_pwidth determines the high/low pulse width of MDC in
units of “clk” cycle. Value of 0 for cfg_mdc_pwidth is not valid. When under reset, MDC is not generated
and is ‘0’. Cfg_mdc_pwidth can be configured with a value between 3 and 15. If cfg_no_preamble is
high, the preamble should be suppressed. If cfg_no_preamble is low, master should send the preamble.

Host Transaction: Host initiates a MDIO transaction by asserting host_mmb_req along with the
corresponding access type (read or write). Read access is indicated by host_mmb_rw_n being ‘1’
and write access is by host_mmb_rw_n being ‘0’. PHY to which the access is slated is provided by
host_mmb_phy_addr and within the chosen PHY, one of the 32 registers is chosen by
host_mmb_reg_addr. Once MMB completes the requested transaction, it asserts mmb_host_ack for
one clock cycle, based on which the host would deassert host_mmb_req. In case of write transaction,
MMB writes into PHY device’s chosen register with host_mmb_wr_data. In case of read transaction,
MMB sends the read data from PHY through mmb_host_rd_data along with mmb_host_ack.
Mmb_host_rd_err is generated by MMB if the PHY is not responding to the requested read access (TA
not driven with ‘0’ for the second bit).

Wipro Confidential Page 1 of 5


Design/Coding Exercise: Ethernet 802.3 Management Interface (MDC/MDIO) Design

MDIO Slave Block: Also Design a Slave Block which translates MDC/MDIO transactions to access
registers in the PHY device. As many as 32 registers can be accessed. The Slave Block sits in the PHY
device. Each PHY device responds to MDC/MDIO transactions only if the PHY address of the
transaction matches with that of its own device address (cfg_phy_addr). It can be assumed that ratio of
MDC period to “clk” period is greater than or equal to 4. The clk in master and slave could be different
and may not have any timing relationship with each other. msb_reg_* and reg_msb_* signals are
generated synchronously with slave’s “clk” signal. For a read transaction, if register block does not
respond with msb_reg_ack in time, the slave block should not respond to the transaction (by not
driving second bit of TA as zero). This will result in rd_err at Master. Slave block should be capable of
understanding MDC/MDIO transaction with or without preamble from Master.

mdio_out
reset_n
mdio_oe mdio
clk
mdio_in
cfg_phy_addr[4:0]

Mgmt Interface
Slave Block mdc
(msb_core)
[in PHY Device]
msb_reg_req
msb_reg_rw_n

msb_reg_reg_addr[4:0]
msb_reg_wr_data[15:0]

reg_msb_ack
reg_msb_rd_data[15:0]

Host Register Block:


The Register block houses 32 registers. Each register is of 16-bit wide and can be read/write by the
MDIO slave block.
Once msb_reg_req is asserted in a clock cycle (say cycle no 1), host register block acknowledges and
completes the accesses by asserting reg_msb_ack for one clock cycle in cycle no N (where N is the
cycle time of the read/write transactions) and returns read data along with ack for read access and
writes write data into the corresponding register for write access. Once MSB samples reg_msb_ack as
asserted high, it deasserts msb_reg_req. Cycle time for accesses to the host register can be taken as
2 which implies that reg_msb_ack is asserted in the next cycle following msb_reg_req assertion.

Host Register Block is provided as a verification model.

reset_n
clk msb_reg_req
msb_reg_rw_n

Host Register msb_reg_reg_addr[4:0]


Block
(msb_reg_blk) msb_reg_wr_data[15:0]
[in PHY Device] reg_msb_ack
reg_msb_rd_data[15:0]

Wipro Confidential Page 2 of 5


Design/Coding Exercise: Ethernet 802.3 Management Interface (MDC/MDIO) Design

Appendix: Management Interface Specification

[Link] MDC (management data clock)


MDC is sourced by the Station Management entity to the PHY as the timing reference for transfer of
information on the MDIO signal. MDC is an aperiodic signal that has no maximum high or low times. The
minimum high and low times for MDC shall be 160 ns each, and the minimum period for MDC shall be
400 ns, regardless of the nominal period of TX_CLK and RX_CLK.

[Link] MDIO (management data input/output)


MDIO is a bidirectional signal between the PHY and the STA. It is used to transfer control information and status
between the PHY and the STA. Control information is driven by the STA synchronously with respect to MDC and
is sampled synchronously by the PHY. Status information is driven by the PHY synchronously with respect to
MDC and is sampled synchronously by the STA.

MDIO shall be driven through three-state circuits that enable either the STA or the PHY to drive the signal.

A PHY that is attached to the MII via the mechanical interface specified in 22.6 shall provide a resistive pullup to
maintain the signal in a high state. The STA shall incorporate a resistive pull-down on the MDIO signal and thus
may use the quiescent state of MDIO to determine if a PHY is connected to the MII via the mechanical interface
defined in 22.6. The limits on the values of these pull-ups and pull-downs are defined in [Link].

[Link] Management frame structure


Frames transmitted on the MII Management Interface shall have the frame structure shown in Table 22–10.

The order of bit transmission shall be from left to right.

[Link].1 IDLE (IDLE condition)


The IDLE condition on MDIO is a high-impedance state. All three state drivers shall be disabled and the
PHY’s pull-up resistor will pull the MDIO line to a logic one.

[Link].2 PRE (preamble)


At the beginning of each transaction, the station management entity shall send a sequence of 32 contiguous logic
one bits on MDIO with 32 corresponding cycles on MDC to provide the PHY with a pattern that it can use to
establish synchronization. A PHY shall observe a sequence of 32 contiguous one bits on MDIO with 32
corresponding cycles on MDC before it responds to any transaction.

If the STA determines that every PHY that is connected to the MDIO signal is able to accept management frames
that are not preceded by the preamble pattern, then the STA may suppress the generation of the preamble pattern,
and may initiate management frames with the ST (Start of Frame) pattern.

[Link].3 ST (start of frame)


The start of frame is indicated by a <01> pattern. This pattern assures transitions from the default logic one line
state to zero and back to one.

[Link].4 OP (operation code)


The operation code for a read transaction is <10>, while the operation code for a write transaction is <01>.

[Link].5 PHYAD (PHY Address)


The PHY Address is five bits, allowing 32 unique PHY addresses. The first PHY address bit transmitted and
received is the MSB of the address. A PHY that is connected to the station management entity via the mechanical
interface defined in 22.6 shall always respond to transactions addressed to PHY Address zero <00000>. A station

Wipro Confidential Page 3 of 5


Design/Coding Exercise: Ethernet 802.3 Management Interface (MDC/MDIO) Design

management entity that is attached to multiple PHYs must have a priori knowledge of the appropriate PHY
Address for each PHY.

[Link].6 REGAD (Register Address)


The Register Address is five bits, allowing 32 individual registers to be addressed within each PHY. The first
Register Address bit transmitted and received is the MSB of the address. The register accessed at Register Address
zero <00000> shall be the control register defined in [Link], and the register accessed at Register Address one
<00001> shall be the status register defined in [Link].

[Link].7 TA (turnaround)
The turnaround time is a 2 bit time spacing between the Register Address field and the Data field of a management
frame to avoid contention during a read transaction. For a read transaction, both the STA and the PHY shall remain
in a high-impedance state for the first bit time of the turnaround. The PHY shall drive a zero bit during the second
bit time of the turnaround of a read transaction. During a write transaction, the STA shall drive a one bit for the
first bit time of the turnaround and a zero bit for the second bit time of the turnaround. Figure 22–13 shows the
behavior of the MDIO signal during the turnaround field of a read transaction.

In case of a MDIO Read transaction, Slave block will request the data from the Register block. If the Register
block did not give acknowledgement (ack), then this is an error condition. This error condition need to be notified
to Master. This error is indicated to Master, by Slave not driving the MDIO line “0” during second cycle of TA.
The master block will check for the second cycle of TA being non-zero and then report “Read Error” to the
host.

[Link].8 DATA (data)


The data field is 16 bits. The first data bit transmitted and received shall be bit 15 of the register being
addressed.

22.3.4 MDIO timing relationship to MDC


MDIO (Management Data Input/Output) is a bidirectional signal that can be sourced by the Station Management
Entity (STA) or the PHY. When the STA sources the MDIO signal, the STA shall provide a minimum of 10 ns of
setup time and a minimum of 10 ns of hold time referenced to the rising edge of MDC, as shown in Figure 22–16,
measured at the MII connector.

Signal Min Setup Min Hold


MDIO 10 ns 10 ns

Wipro Confidential Page 4 of 5


Design/Coding Exercise: Ethernet 802.3 Management Interface (MDC/MDIO) Design

When the MDIO signal is sourced by the PHY, it is sampled by the STA synchronously with respect to the rising
edge of MDC. The clock to output delay from the PHY, as measured at the MII connector, shall be a minimum of
0 ns, and a maximum of 300 ns, as shown in Figure 22–17.

Wipro Confidential Page 5 of 5

Common questions

Powered by AI

A mismatch in clock timing between the master and slave devices in the MDC/MDIO interface can lead to data integrity issues due to misaligned data sampling. Such discrepancies can cause violations of setup and hold time requirements, resulting in incorrect data capture. To mitigate these issues, careful design of clock domains, synchronization mechanisms such as FIFOs, or phase-locked loops (PLLs) can ensure proper alignment and timing adjustments. Additionally, adhering to the minimum MDC period specifications independent of other clock signals can help maintain reliable operations across varying device frequencies .

The 'mmb_host_rd_err' signal plays a crucial role in identifying and reporting transaction errors during MDIO read operations. Specifically, if the PHY does not respond with the correct timing during the turnaround time (does not drive a zero in the second bit), the master detects this fault and asserts the 'mmb_host_rd_err' signal. This alerts the host to a read error, enhancing the robustness of the transaction process by allowing timely detection and handling of communication issues, ensuring system reliability and facilitating troubleshooting .

The host incorporates a resistive pull-down on the MDIO line to determine if a PHY is connected to the MII mechanical interface. This setup ensures that in the absence of a PHY, the MDIO line remains in a logic one state due to the pull-up provided by the PHY. During system initialization, this mechanism allows the station management entity to detect the presence or absence of connected PHYs and configure them appropriately. This detection is essential for proper initialization and system integrity .

The MDIO signal in the MDC/MDIO protocol is bidirectional, facilitating control information and status communication between the STA and PHY. The use of three-state logic allows both the STA and the PHY to drive the signal while preventing contention on the line. When not actively driven, the signal defaults to a logic high due to the PHY's pull-up resistor, ensuring a clear quiescent state. This design is essential for enabling multiple devices on the same line to communicate without interference, maintaining signal integrity and allowing efficient data exchange .

The 'turnaround' in the MDC/MDIO protocol involves a 2-bit time spacing to prevent signal contention during read transactions. During this period, both the STA and the PHY initially maintain a high-impedance state. The PHY then drives a zero bit in the second bit time. If the PHY fails to drive this zero, indicating that the register block did not acknowledge the request, a read error is detected. This error condition is crucial for the master block to determine if the PHY failed to respond correctly, thus indicating a potential communication or hardware failure .

The configuration of 'cfg_no_preamble' directly affects whether the preamble is transmitted in MDC/MDIO interface transactions. If 'cfg_no_preamble' is high, the preamble is suppressed; if it is low, the station management entity sends a preamble, which consists of 32 logic one bits on MDIO with 32 cycles on MDC to establish synchronization. This is crucial for PHYs that require a preamble for synchronization but can be omitted if PHYs are known to accept frames without it .

The minimal setup and hold time requirements for the MDIO signal (10 ns each with respect to the rising edge of MDC) are critical for ensuring proper synchronization and data integrity during transmissions. These constraints ensure that data on MDIO is stable and valid when sampled, preventing timing violations that could lead to incorrect data being latched by the receiver. Such meticulous timing specifications are necessary for reliable communication, especially as the system operates at higher speeds and across potentially varying electrical conditions .

The 'Cfg_mdc_pwidth' setting determines the pulse width of the MDC signal in terms of the host clock cycles. Specifically, the MDC clock is generated by dividing the 'clk' by 2 times the 'Cfg_mdc_pwidth'. A valid 'Cfg_mdc_pwidth' ranges from 3 to 15, altering the high/low durations of the MDC signal. This control over the MDC period is essential for ensuring compatibility with the protocol's requirements for minimum high and low times and aligning the MDC with the host and slave clocks, which may have different timing relationships .

The PHY Address (PHYAD) and Register Address (REGAD) within the MDIO frame structure are critical for precise specification and selection in transactions. PHYAD, a 5-bit field, allows the identification of up to 32 distinct PHY devices, ensuring that only the target device responds to a given communication. REGAD, also a 5-bit field, identifies one of the 32 registers within the chosen PHY for the operation. Together, these address fields enable accurate targeting and access control of specific registers within designated devices, facilitating efficient and error-free communication in complex networks with multiple devices .

The slave block in a PHY device handles both read and write operations through MDC/MDIO transactions by interpreting signals from the master. For writes, it receives data and writes it to the specified register upon acknowledging a 'write' type operation. For reads, it requests the requisite data from its register block and must acknowledge in time; failure to do so results in an error signaled back to the master. Timing signals and operational commands must be strictly adhered to, ensuring the slave's responses are correctly synchronized with the master, thereby facilitating precise read/write operations .

You might also like