|
| 1 | +.. _util_mii_to_rmii: |
| 2 | + |
| 3 | +Util MII to RMII |
| 4 | +=============================================================================== |
| 5 | + |
| 6 | +.. hdl-component-diagram:: |
| 7 | + |
| 8 | +The :git-hdl:`Util MII to RMII <library/util_mii_to_rmii>` core |
| 9 | +is designed to interface the Zynq-7000/Zynq UltraScale+ MPSoC - PS |
| 10 | +Gigabit Ethernet MAC and Reduced Media Independent Interface (RMII) |
| 11 | +:adi:`ADIN1300` PHY from the :adi:`CN0506` Dual PHY Ethernet evaluation board. |
| 12 | + |
| 13 | +Features |
| 14 | +-------------------------------------------------------------------------------- |
| 15 | + |
| 16 | +* Configurable interface for the MAC block (Media Independent Interface - MII |
| 17 | + or Gigabit Media Independent Interface - GMII). |
| 18 | +* Configurable data rate for the MAC block and PHY chip. |
| 19 | + |
| 20 | +Files |
| 21 | +-------------------------------------------------------------------------------- |
| 22 | + |
| 23 | +.. list-table:: |
| 24 | + :header-rows: 1 |
| 25 | + |
| 26 | + * - Name |
| 27 | + - Description |
| 28 | + * - :git-hdl:`library/util_mii_to_rmii/util_mii_to_rmii.v` |
| 29 | + - Verilog source for the main module made of the MII and RMII interfaces. |
| 30 | + * - :git-hdl:`library/util_mii_to_rmii/mac_phy_link.v` |
| 31 | + - Verilog source for the conversion between RMII PHY chip interface and |
| 32 | + MII MAC block interface. |
| 33 | + * - :git-hdl:`library/util_mii_to_rmii/phy_mac_link.v` |
| 34 | + - Verilog source for the conversion between MII MAC block interface and |
| 35 | + RMII PHY chip interface. |
| 36 | + |
| 37 | +Block Diagram |
| 38 | +-------------------------------------------------------------------------------- |
| 39 | + |
| 40 | +.. image:: block_diagram.svg |
| 41 | + :alt: Util MII to RMII block diagram |
| 42 | + |
| 43 | + |
| 44 | +Configuration Parameters |
| 45 | +-------------------------------------------------------------------------------- |
| 46 | + |
| 47 | +.. hdl-parameters:: |
| 48 | + |
| 49 | + * - INTF_CFG |
| 50 | + - MAC Block Interface Selection |
| 51 | + * - RATE_10_100 |
| 52 | + - Data Rate Selection |
| 53 | + |
| 54 | +Interface |
| 55 | +-------------------------------------------------------------------------------- |
| 56 | + |
| 57 | +.. hdl-interfaces:: |
| 58 | + |
| 59 | + * - MII |
| 60 | + - MAC-PHY Link (MII MAC Block to RMII PHY) |
| 61 | + * - GMII |
| 62 | + - MAC-PHY Link (GMII MAC Block to RMII PHY) |
| 63 | + * - RMII |
| 64 | + - PHY-MAC Link (RMII PHY to MII MAC Block) |
| 65 | + * - ref_clk |
| 66 | + - Reference Clock for MII to RMII IP core |
| 67 | + * - reset_n |
| 68 | + - Active-Low reset for MII to RMII IP core |
| 69 | + |
| 70 | + |
| 71 | +Theory of Operation |
| 72 | +-------------------------------------------------------------------------------- |
| 73 | + |
| 74 | +The following timing diagrams illustrate different signal protocols for MII and |
| 75 | +RMII interfaces at data rates of 100 and 10 Mbps. |
| 76 | + |
| 77 | +Receive Transactions |
| 78 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 79 | + |
| 80 | +- RMII (PHY) receive transaction at 100 Mbps with no errors and phy_crs_dv |
| 81 | + asserted until the final packet dibit. According to the RMII Specification |
| 82 | + Rev. 1.2, after the assertion of phy_crs_dv, several 00's dibits can precede |
| 83 | + the preamble 01's dibits. The preamble is composed of 28 "01" dibits and the |
| 84 | + start of frame delimiter of 3 "01" dibits and one "11" dibit followed by the |
| 85 | + frame containing 64-1522 bytes: |
| 86 | + |
| 87 | + |
| 88 | +.. image:: phy_rec_simple.svg |
| 89 | + :alt: PHY Receive Simple |
| 90 | + |
| 91 | +- RMII (PHY) receive transaction at 100 Mbps with no errors and phy_crs_dv |
| 92 | + toggling at 25 MHz starting on a nibble boundary and indicates the PHY has |
| 93 | + lost the carrier but has accumulated nibbles to transfer: |
| 94 | + |
| 95 | +.. image:: d2_phy_rec_tog.svg |
| 96 | + :alt: PHY Receive Toggle |
| 97 | + |
| 98 | +- At a data rate of 10 Mbps (ref_clk frequency divided by 10), mii_rxd will be |
| 99 | + sampled every :math:`10^{th}` cycle. |
| 100 | +- MII receive transaction converted from RMII (PHY) receive transaction at 100 |
| 101 | + Mbps. In the MII mode mii_rx_dv and mii_rxd will be sampled on the falling |
| 102 | + edge of the 25 MHz mii_rx_clk and when mii_rx_dv is de-asserted, mii_rxd will |
| 103 | + present 0b0000 to the Ethernet MAC: |
| 104 | + |
| 105 | +.. image:: mii_recv.svg |
| 106 | + :alt: ETH MAC Receive |
| 107 | + |
| 108 | +Transmit Transactions |
| 109 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 110 | + |
| 111 | +- MII transmit transaction at 100 Mbps. In the MII mode mii_tx_en and mii_txd |
| 112 | + will be sampled on the rising edge of the 25 MHz mii_tx_clk: |
| 113 | + |
| 114 | +.. image:: mii_transm.svg |
| 115 | + :alt: ETH MAC Transmit |
| 116 | + |
| 117 | +- In case of errors detection, mii_tx_er will be asserted and mii_txd dibits |
| 118 | + will be "01" for the rest of transmission to RMII interface. |
| 119 | +- At a data rate of 10 Mbps (ref_clk frequency divided by 10), mii_txd will be |
| 120 | + sampled every :math:`10^{th}` cycle. |
| 121 | +- RMII transmit transaction converted from MII transmit transaction at 100 |
| 122 | + Mbps. In the RMII mode rmii_tx_en and rmii_txd will be sampled on the rising |
| 123 | + edge of the 50 MHz ref_clk: |
| 124 | + |
| 125 | +.. image:: rmii_transm.svg |
| 126 | + :alt: PHY Transmit |
| 127 | + |
| 128 | +Software Support |
| 129 | +-------------------------------------------------------------------------------- |
| 130 | + |
| 131 | +Analog Devices recommends to use the provided software drivers. |
| 132 | + |
| 133 | +- :dokuwiki:`Analog Devices ADIN1300/ADIN1200 PHY Linux Driver <resources/tools-software/linux-drivers/net-phy/adin>` |
| 134 | + |
| 135 | +References |
| 136 | +-------------------------------------------------------------------------------- |
| 137 | + |
| 138 | +- :git-hdl:`library/util_mii_to_rmii` |
| 139 | +- :adi:`ADIN1300 PHY Information <adin1300>` |
| 140 | +- :adi:`ADIN1300 PHY Documentation <media/en/technical-documentation/data-sheets/ADIN1300.pdf>` |
| 141 | +- :dokuwiki:`ADIN1300 PHY Linux Driver <resources/tools-software/linux-drivers/net-phy/adin>` |
| 142 | +- :adi:`CN0506 Information <en/design-center/reference-designs/circuits-from-the-lab/cn0506.html>` |
| 143 | +- :adi:`CN0506 Reference Note <media/en/reference-design-documentation/reference-designs/cn0506.pdf>` |
| 144 | +- :dokuwiki:`CN0506 HDL Reference Design <resources/eval/user-guides/circuits-from-the-lab/cn0506/hdl>` |
| 145 | +- :dokuwiki:`CN0506 User Guide <resources/eval/user-guides/circuits-from-the-lab/cn0506>` |
| 146 | + |
| 147 | + |
0 commit comments