Ethernet PHY Configuration Using MDIO for Industrial Applications (Rev. A)
Total Page:16
File Type:pdf, Size:1020Kb
www.ti.com Table of Contents Application Report Ethernet PHY Configuration Using MDIO for Industrial Applications Garrett Ding, Pratheesh Gangadhar TK, David Zaucha ABSTRACT As a bridge of the link layer device medium access controller (MAC) and physical medium such as copper cable, the Ethernet physical layer device (PHY) integrates all the physical-layer functions needed to transmit and receive data on standard twisted-pair cables. Proper PHY configuration using management data input/output (MDIO) is fundamental during the prototype stage, and also crucial to meeting the requirements of lowest deterministic latency and fastest link detection in industrial Ethernet applications such as EtherCAT®. This application report provides guidance on the Ethernet PHY configuration using the MDIO module within the Programmable-Realtime Unit Industrial Communications Sub-System (PRU-ICSS) in the Sitara™ device from TI, for industrial applications, by dissecting the PHY DP83822 configuration in EtherCAT on the AMIC110 Industrial Communications Engine (ICE). The goal of this application report is to expedite the development of industrial Ethernet applications on custom boards with migration and troubleshooting guides for the PHYs [1] [2] [3]. Table of Contents 1 PHY Selection and Connection............................................................................................................................................. 2 2 PHY Reset and Address.........................................................................................................................................................4 3 PHY Speed, Duplex, and More...............................................................................................................................................6 4 Enhanced Link Detection.....................................................................................................................................................10 5 Add PHYs in Processor SDK............................................................................................................................................... 14 6 Conclusion............................................................................................................................................................................ 16 7 References............................................................................................................................................................................ 16 8 Revision History................................................................................................................................................................... 17 List of Figures Figure 1-1. Ethernet PHY Connection With MAC and Physical Medium.....................................................................................2 Figure 1-2. DP83822 Functional Block Diagram......................................................................................................................... 3 Figure 2-1. PHY Reset Signal......................................................................................................................................................4 Figure 3-1. MDIO Registers in Code Composer Studio...............................................................................................................9 Figure 5-1. Board Library in PDK...............................................................................................................................................14 Figure 5-2. AMIC110 ICE Board Library.................................................................................................................................... 15 Figure 5-3. Adding New Board and PHY................................................................................................................................... 16 List of Tables Table 2-1. PHY Reset Control Register (PHYRCR).....................................................................................................................5 Table 3-1. MDIOUSERACCESS0 Register Field Descriptions....................................................................................................8 Table 4-1. LEDs Configuration Register 1 (LEDCFG1)..............................................................................................................11 Table 4-2. PHY Registers in EtherCAT...................................................................................................................................... 13 Table 4-3. Data Link Status Register in EtherCAT.....................................................................................................................13 Trademarks Sitara™ and Code Composer Studio™ are trademarks of Texas Instruments. Cortex™ is a trademark of ARM Limited. EtherCAT® is a registered trademark of Beckhoff Automation GmbH. ARM® is a registered trademark of ARM Limited. All trademarks are the property of their respective owners. SPRACC8A – DECEMBER 2017 – REVISED MAY 2021 Ethernet PHY Configuration Using MDIO for Industrial Applications 1 Submit Document Feedback Copyright © 2021 Texas Instruments Incorporated PHY Selection and Connection www.ti.com 1 PHY Selection and Connection Many industrial Ethernet applications require PHY to comply with IEEE 802.3 100BaseTX or 100BaseFX, support 100-Mbps full-duplex links, use auto-negotiation, and support MDI/MDI-X auto-crossover in 100BaseTX mode. Moreover, link loss reaction time is also a key benchmark to ensure that link sensitivity is faster than 15 µs for redundancy operation. Although most PHYs support several media-independent interfaces with different pin counts and data rates to communicate with the MAC, the MII is recommended, because it reduces the additional forwarding delay caused by the TX FIFO in RMII. Figure 1-1 shows a typical Ethernet PHY connection with MAC and physical medium. MII DP83822 MAC 10/100 Mbps Magnetics RJ-45 pr1_mii0_rxlink Ethernet PHY 25 MHz/50 MHz Status LEDs Clock Source Copyright © 2017, Texas Instruments Incorporated Figure 1-1. Ethernet PHY Connection With MAC and Physical Medium The AMIC110 Industrial Communications Engine (ICE) is a development platform targeted for industrial communications and industrial Ethernet in particular. The AMIC110 ICE is the Sitara AMIC110 System-on-Chip (SoC) that features the ARM® Cortex™-A8 processor, with the PRU-ICSS, which enables the integration of real-time industrial protocols, without needing ASIC or FPGA. The power-saving DP83822 device (see Figure 1-2) was selected in the AMIC110 ICE. The DP83822 not only meets the requirements of IEEE 802.3u, but also maintains high margins in terms of cross-talk and alien noise. The DP83822 device is a fully featured, single-port Physical Layer transceiver for 10BASE-Te, 100BASE-TX, and 100BASE-FX signaling, and its signals fall into the following categories: • MAC interface • Serial management interface • Clock interface • GPIO and LED interface • Media-dependent interface • Power and ground pins • Other pins 2 Ethernet PHY Configuration Using MDIO for Industrial Applications SPRACC8A – DECEMBER 2017 – REVISED MAY 2021 Submit Document Feedback Copyright © 2021 Texas Instruments Incorporated www.ti.com PHY Selection and Connection MII / RGMII Option RMII Option Serial Serial Management Management TX_CLK TX_EN / TX_CTRL TX_D[3:0] MDIO MDC COL CRS / CRS_DV RX_ER RX_DVRX_CTRL / RX_D[3:0] RX_CLK TX_EN TX_D[3:0] CRS / RX_DV RX_ER RX_DV (optional) RX_D[3:0] MDIO MDC MII / RGMII / RMII Interface TX RX TX_CLK RX_CLK Data Data MII 10BASE-Te Registers 10BASE-Te and and 100BASE-TX/FX 100BASE-TX/FX Auto-Negotiation Wake-on-LAN Energy Efficient Ethernet Transmit Block Clock Receive Block Generation DAC ADC BIST LED Cable Diagnostics Auto-MDIX Driver Reference TD± RD± LEDs Clock Figure 1-2. DP83822 Functional Block Diagram Beckhoff provides a comprehensive PHY selection guide to assist in PHY selection and configuration[1]. This document lists a variety of PHYs from TI, such as the DP836x, DP838x, TLK10x, and TLK11x. SPRACC8A – DECEMBER 2017 – REVISED MAY 2021 Ethernet PHY Configuration Using MDIO for Industrial Applications 3 Submit Document Feedback Copyright © 2021 Texas Instruments Incorporated PHY Reset and Address www.ti.com 2 PHY Reset and Address PHY bootstrap configurations, which place the device into the desired operation mode, are performed at power up or hardware reset. A hardware reset is accomplished by applying a low pulse, with a duration of at least 10 µs (T1), to the RESET pin in the DP83822 PHY. This pulse resets the device so that all registers are reinitialized to default values, and the hardware configuration values are relatched into the device (see Figure 2-1). T1 Hardware RESET_N Figure 2-1. PHY Reset Signal Because the bootstrap pins have alternative functions after the reset is deasserted, to minimize interference during bootstrap pin signal sampling the PRU-ICSS MII multiplexing should not occur until after the PHY RESET is released on the AMIC110 ICE. If these bootstrap pins are not configured, they will be GPIO and High-Z as soon as the reset is released. The hardware reset sequence implementation in the TI EtherCAT looks as follows: Board_init(BOARD_INIT_MODULE_CLOCK); Board_phyReset(2); /* mux PRU MII after PHY reset in case PRU drives signals * on the pins and interfere with the PHY bootstrap configurations */ #ifdef ENABLE_UART_PRINT Board_init(BOARD_INIT_UART_STDIO|BOARD_INIT_ICSS_PINMUX); #else Board_init(BOARD_INIT_ICSS_PINMUX);