Texas Instruments TMS320C645x DSP User manual

Type
User manual

This manual is also suitable for

TMS320C645x DSPEthernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO)
User's Guide
Literature Number: SPRU975B
August 2006
2 SPRU975B – August 2006Submit Documentation Feedback
Contents
Preface .............................................................................................................................. 101 Introduction .............................................................................................................. 111.1 Purpose of the Peripheral ..................................................................................... 111.2 Features ......................................................................................................... 111.3 Functional Block Diagram ..................................................................................... 121.4 Industry Standard(s) Compliance Statement ............................................................... 132 EMAC Functional Architecture .................................................................................... 142.1 Clock Control .................................................................................................... 142.2 Memory Map .................................................................................................... 152.3 System Level Connections .................................................................................... 162.4 Ethernet Protocol Overview ................................................................................... 242.5 Programming Interface ......................................................................................... 262.6 EMAC Control Module ......................................................................................... 372.7 Management Data Input/Output (MDIO) Module ........................................................... 382.8 EMAC Module ................................................................................................... 432.9 Media Independent Interfaces ................................................................................ 462.10 Packet Receive Operation ..................................................................................... 502.11 Packet Transmit Operation .................................................................................... 552.12 Receive and Transmit Latency ............................................................................... 552.13 Transfer Node Priority .......................................................................................... 562.14 Reset Considerations .......................................................................................... 562.15 Initialization ...................................................................................................... 572.16 Interrupt Support ................................................................................................ 602.17 Power Management ............................................................................................ 632.18 Emulation Considerations ..................................................................................... 633 EMAC Control Module Registers ................................................................................. 643.1 Introduction ...................................................................................................... 643.2 EMAC Control Module Interrupt Control Register (EWCTL) .............................................. 643.3 EMAC Control Module Interrupt Timer Count Register (EWINTTCNT) ................................. 654 MDIO Registers ......................................................................................................... 664.1 Introduction ...................................................................................................... 664.2 MDIO Version Register (VERSION) ......................................................................... 674.3 MDIO Control Register (CONTROL) ......................................................................... 684.4 PHY Acknowledge Status Register (ALIVE) ................................................................ 694.5 PHY Link Status Register (LINK) ............................................................................. 704.6 MDIO Link Status Change Interrupt (Unmasked) Register (LINKINTRAW) ............................ 714.7 MDIO Link Status Change Interrupt (Masked) Register (LINKINTMASKED) .......................... 724.8 MDIO User Command Complete Interrupt (Unmasked) Register (USERINTRAW) ................... 734.9 MDIO User Command Complete Interrupt (Masked) Register (USERINTMASKED) ................. 744.10 MDIO User Command Complete Interrupt Mask Set Register (USERINTMASKSET) ................ 754.11 MDIO User Command Complete Interrupt Mask Clear Register (USERINTMASKCLEAR) .......... 764.12 MDIO User Access Register 0 (USERACCESS0) ......................................................... 774.13 MDIO User PHY Select Register 0 (USERPHYSEL0) .................................................... 784.14 MDIO User Access Register 1 (USERACCESS1) ......................................................... 79
SPRU975B – August 2006 Table of Contents 3Submit Documentation Feedback
4.15 MDIO User PHY Select Register 1 (USERPHYSEL1) .................................................... 805 EMAC Port Registers ................................................................................................. 815.1 Introduction ...................................................................................................... 815.2 Transmit Identification and Version Register (TXIDVER) ................................................. 855.3 Transmit Control Register (TXCONTROL) .................................................................. 865.4 Transmit Teardown Register (TXTEARDOWN) ............................................................ 875.5 Receive Identification and Version Register (RXIDVER) .................................................. 885.6 Receive Control Register (RXCONTROL) .................................................................. 895.7 Receive Teardown Register (RXTEARDOWN) ............................................................. 905.8 Transmit Interrupt Status (Unmasked) Register (TXINTSTATRAW) .................................... 915.9 Transmit Interrupt Status (Masked) Register (TXINTSTATMASKED) ................................... 925.10 Transmit Interrupt Mask Set Register (TXINTMASKSET) ................................................ 935.11 Transmit Interrupt Mask Clear Register (TXINTMASKCLEAR) .......................................... 945.12 MAC Input Vector Register (MACINVECTOR) ............................................................. 955.13 Receive Interrupt Status (Unmasked) Register (RXINTSTATRAW) ..................................... 965.14 Receive Interrupt Status (Masked) Register (RXINTSTATMASKED) ................................... 975.15 Receive Interrupt Mask Set Register (RXINTMASKSET) ................................................. 985.16 Receive Interrupt Mask Clear Register (RXINTMASKCLEAR) ........................................... 995.17 MAC Interrupt Status (Unmasked) Register (MACINTSTATRAW) ..................................... 1005.18 MAC Interrupt Status (Masked) Register (MACINTSTATMASKED) ................................... 1015.19 MAC Interrupt Mask Set Register (MACINTMASKSET) ................................................. 1025.20 MAC Interrupt Mask Clear Register (MACINTMASKCLEAR) ........................................... 1035.21 Receive Multicast/Broadcast/Promiscuous Channel Enable Register (RXMBPENABLE) .......... 1045.22 Receive Unicast Enable Set Register (RXUNICASTSET) ............................................... 1065.23 Receive Unicast Clear Register (RXUNICASTCLEAR) .................................................. 1075.24 Receive Maximum Length Register (RXMAXLEN) ....................................................... 1085.25 Receive Buffer Offset Register (RXBUFFEROFFSET) .................................................. 1095.26 Receive Filter Low Priority Frame Threshold Register (RXFILTERLOWTHRESH) .................. 1105.27 Receive Channel 0-7 Flow Control Threshold Register (RX nFLOWTHRESH) ....................... 1115.28 Receive Channel 0-7 Free Buffer Count Register (RXnFREEBUFFER) .............................. 1125.29 MAC Control Register (MACCONTROL) .................................................................. 1135.30 MAC Status Register (MACSTATUS) ...................................................................... 1155.31 Emulation Control Register (EMCONTROL) .............................................................. 1175.32 FIFO Control Register (FIFOCONTROL) .................................................................. 1185.33 MAC Configuration Register (MACCONFIG) .............................................................. 1195.34 Soft Reset Register (SOFTRESET) ........................................................................ 1205.35 MAC Source Address Low Bytes Register (MACSRCADDRLO) ....................................... 1215.36 MAC Source Address High Bytes Register (MACSRCADDRHI) ....................................... 1225.37 MAC Hash Address Register 1 (MACHASH1) ............................................................ 1235.38 MAC Hash Address Register 2 (MACHASH2) ............................................................ 1245.39 Back Off Test Register (BOFFTEST) ....................................................................... 1255.40 Transmit Pacing Algorithm Test Register (TPACETEST) ............................................... 1265.41 Receive Pause Timer Register (RXPAUSE) .............................................................. 1275.42 Transmit Pause Timer Register (TXPAUSE) .............................................................. 1285.43 MAC Address Low Bytes Register (MACADDRLO) ...................................................... 1295.44 MAC Address High Bytes Register (MACADDRHI) ...................................................... 1305.45 MAC Index Register (MACINDEX) ......................................................................... 1315.46 Transmit Channel 0-7 DMA Head Descriptor Pointer Register (TXnHDP) ............................ 1325.47 Receive Channel 0-7 DMA Head Descriptor Pointer Register (RXnHDP) ............................ 133
4Contents SPRU975B – August 2006Submit Documentation Feedback
5.48 Transmit Channel 0-7 Completion Pointer Register (TX nCP) ........................................... 1345.49 Receive Channel 0-7 Completion Pointer Register (RX nCP) ........................................... 1355.50 Network Statistics Registers ................................................................................. 136Appendix A Glossary ...................................................................................................... 145Appendix B Revision History ............................................................................................ 147
SPRU975B – August 2006 Contents 5Submit Documentation Feedback
List of Figures
1 EMAC and MDIO Block Diagram ........................................................................................ 122 Ethernet Configuration with MII Interface ............................................................................... 163 Ethernet Configuration with RMII Interface ............................................................................. 184 Ethernet Configuration with GMII Interface ............................................................................. 205 Ethernet Configuration with RGMII Interface ........................................................................... 226 Ethernet Frame ............................................................................................................. 247 Basic Descriptor Format ................................................................................................... 268 Typical Descriptor Linked List ............................................................................................ 279 Transmit Descriptor Format ............................................................................................... 3010 Receive Descriptor Format ................................................................................................ 3311 EMAC Control Module Block Diagram .................................................................................. 3712 MDIO Module Block Diagram ............................................................................................. 3913 EMAC Module Block Diagram ............................................................................................ 4314 EMAC Control Module Interrupt Control Register (EWCTL) .......................................................... 6415 EMAC Control Module Interrupt Timer Count Register (EWINTTCNT) ............................................. 6516 MDIO Version Register (VERSION) ..................................................................................... 6717 MDIO Control Register (CONTROL) ..................................................................................... 6818 PHY Acknowledge Status Register (ALIVE) ............................................................................ 6919 PHY Link Status Register (LINK) ......................................................................................... 7020 MDIO Link Status Change Interrupt (Unmasked) Register (LINKINTRAW) ........................................ 7121 MDIO Link Status Change Interrupt (Masked) Register (LINKINTMASKED) ...................................... 7222 MDIO User Command Complete Interrupt (Unmasked) Register (USERINTRAW) ............................... 7323 MDIO User Command Complete Interrupt (Masked) Register (USERINTMASKED) ............................. 7424 MDIO User Command Complete Interrupt Mask Set Register (USERINTMASKSET) ........................... 7525 MDIO User Command Complete Interrupt Mask Clear Register (USERINTMASKCLEAR) ..................... 7626 MDIO User Access Register 0 (USERACCESS0) ..................................................................... 7727 MDIO User PHY Select Register 0 (USERPHYSEL0) ................................................................ 7828 MDIO User Access Register 1 (USERACCESS1) ..................................................................... 7929 MDIO User PHY Select Register 1 (USERPHYSEL1) ................................................................ 8030 Transmit Identification and Version Register (TXIDVER) ............................................................. 8531 Transmit Control Register (TXCONTROL) .............................................................................. 8632 Transmit Teardown Register (TXTEARDOWN) ........................................................................ 8733 Receive Identification and Version Register (RXIDVER) ............................................................. 8834 Receive Control Register (RXCONTROL) .............................................................................. 8935 Receive Teardown Register (RXTEARDOWN) ........................................................................ 9036 Transmit Interrupt Status (Unmasked) Register (TXINTSTATRAW) ................................................ 9137 Transmit Interrupt Status (Masked) Register (TXINTSTATMASKED) .............................................. 9238 Transmit Interrupt Mask Set Register (TXINTMASKSET) ............................................................ 9339 Transmit Interrupt Mask Clear Register (TXINTMASKCLEAR) ...................................................... 9440 MAC Input Vector Register (MACINVECTOR) ......................................................................... 9541 Receive Interrupt Status (Unmasked) Register (RXINTSTATRAW) ................................................ 9642 Receive Interrupt Status (Masked) Register (RXINTSTATMASKED) ............................................... 9743 Receive Interrupt Mask Set Register (RXINTMASKSET) ............................................................. 9844 Receive Interrupt Mask Clear Register (RXINTMASKCLEAR) ...................................................... 9945 MAC Interrupt Status (Unmasked) Register (MACINTSTATRAW) ................................................ 10046 MAC Interrupt Status (Masked) Register (MACINTSTATMASKED) ............................................... 10147 MAC Interrupt Mask Set Register (MACINTMASKSET) ............................................................. 10248 MAC Interrupt Mask Clear Register (MACINTMASKCLEAR) ...................................................... 10349 Receive Multicast/Broadcast/Promiscuous Channel Enable Register (RXMBPENABLE) ...................... 10450 Receive Unicast Enable Set Register (RXUNICASTSET) .......................................................... 10651 Receive Unicast Clear Register (RXUNICASTCLEAR) ............................................................. 10752 Receive Maximum Length Register (RXMAXLEN) ................................................................... 108
6List of Figures SPRU975B – August 2006Submit Documentation Feedback
53 Receive Buffer Offset Register (RXBUFFEROFFSET) .............................................................. 10954 Receive Filter Low Priority Frame Threshold Register (RXFILTERLOWTHRESH) .............................. 11055 Receive Channel nFlow Control Threshold Register (RX nFLOWTHRESH) ..................................... 11156 Receive Channel nFree Buffer Count Register (RX nFREEBUFFER) ............................................ 11257 MAC Control Register (MACCONTROL) .............................................................................. 11358 MAC Status Register (MACSTATUS) .................................................................................. 11559 Emulation Control Register (EMCONTROL) .......................................................................... 11760 FIFO Control Register (FIFOCONTROL) .............................................................................. 11861 MAC Configuration Register (MACCONFIG) ......................................................................... 11962 Soft Reset Register (SOFTRESET) .................................................................................... 12063 MAC Source Address Low Bytes Register (MACSRCADDRLO)................................................... 12164 MAC Source Address High Bytes Register (MACSRCADDRHI) ................................................... 12265 MAC Hash Address Register 1 (MACHASH1) ........................................................................ 12366 MAC Hash Address Register 2 (MACHASH2) ........................................................................ 12467 Back Off Random Number Generator Test Register (BOFFTEST) ................................................ 12568 Transmit Pacing Algorithm Test Register (TPACETEST) ........................................................... 12669 Receive Pause Timer Register (RXPAUSE) .......................................................................... 12770 Transmit Pause Timer Register (TXPAUSE) .......................................................................... 12871 MAC Address Low Bytes Register (MACADDRLO) .................................................................. 12972 MAC Address High Bytes Register (MACADDRHI) .................................................................. 13073 MAC Index Register (MACINDEX) ..................................................................................... 13174 Transmit Channel nDMA Head Descriptor Pointer Register (TX nHDP) .......................................... 13275 Receive Channel nDMA Head Descriptor Pointer Register (RX nHDP) .......................................... 13376 Transmit Channel nCompletion Pointer Register (TX nCP) ......................................................... 13477 Receive Channel nCompletion Pointer Register (RX nCP) ......................................................... 13578 Statistics Register ......................................................................................................... 136
SPRU975B – August 2006 List of Figures 7Submit Documentation Feedback
List of Tables
1 Interface Selection Pins ................................................................................................... 162 EMAC and MDIO Signals for MII Interface ............................................................................. 173 EMAC and MDIO Signals for RMII Interface ........................................................................... 194 EMAC and MDIO Signals for GMII Interface ........................................................................... 215 EMAC and MDIO Signals for RGMII Interface ......................................................................... 236 Ethernet Frame Description ............................................................................................... 247 Basic Descriptors ........................................................................................................... 268 Receive Frame Treatment Summary .................................................................................... 539 Middle of Frame Overrun Treatment .................................................................................... 5410 Emulation Control .......................................................................................................... 6311 EMAC Control Module Registers ......................................................................................... 6412 EMAC Control Module Interrupt Control Register (EWCTL) Field Descriptions ................................... 6413 EMAC Control Module Interrupt Timer Count Register (EWINTTCNT) Field Descriptions ....................... 6514 Management Data Input/Output (MDIO) Registers .................................................................... 6615 MDIO Version Register (VERSION) Field Descriptions ............................................................... 6716 MDIO Control Register (CONTROL) Field Descriptions .............................................................. 6817 PHY Acknowledge Status Register (ALIVE) Field Descriptions ..................................................... 6918 PHY Link Status Register (LINK) Field Descriptions .................................................................. 7019 MDIO Link Status Change Interrupt (Unmasked) Register (LINKINTRAW) Field Descriptions ................. 7120 MDIO Link Status Change Interrupt (Masked) Register (LINKINTMASKED) Field Descriptions ................ 7221 MDIO User Command Complete Interrupt (Unmasked) Register (USERINTRAW) Field Descriptions ........ 7322 MDIO User Command Complete Interrupt (Masked) Register (USERINTMASKED) Field Descriptions ....... 7423 MDIO User Command Complete Interrupt Mask Set Register (USERINTMASKSET) Field Descriptions ..... 7524 MDIO User Command Complete Interrupt Mask Clear Register (USERINTMASKCLEAR) FieldDescriptions ................................................................................................................. 7625 MDIO User Access Register 0 (USERACCESS0) Field Descriptions ............................................... 7726 MDIO User PHY Select Register 0 (USERPHYSEL0) Field Descriptions .......................................... 7827 MDIO User Access Register 1 (USERACCESS1) Field Descriptions ............................................... 7928 MDIO User PHY Select Register 1 (USERPHYSEL1) Field Descriptions .......................................... 8029 Ethernet Media Access Controller (EMAC) Registers ................................................................. 8130 Transmit Identification and Version Register (TXIDVER) Field Descriptions ....................................... 8531 Transmit Control Register (TXCONTROL) Field Descriptions ....................................................... 8632 Transmit Teardown Register (TXTEARDOWN) Field Descriptions.................................................. 8733 Receive Identification and Version Register (RXIDVER) Field Descriptions ....................................... 8834 Receive Control Register (RXCONTROL) Field Descriptions ........................................................ 8935 Receive Teardown Register (RXTEARDOWN) Field Descriptions .................................................. 9036 Transmit Interrupt Status (Unmasked) Register (TXINTSTATRAW) Field Descriptions .......................... 9137 Transmit Interrupt Status (Masked) Register (TXINTSTATMASKED) Field Descriptions ........................ 9238 Transmit Interrupt Mask Set Register (TXINTMASKSET) Field Descriptions ...................................... 9339 Transmit Interrupt Mask Clear Register (TXINTMASKCLEAR) Field Descriptions ................................ 9440 MAC Input Vector Register (MACINVECTOR) Field Descriptions ................................................... 9541 Receive Interrupt Status (Unmasked) Register (RXINTSTATRAW) Field Descriptions .......................... 9642 Receive Interrupt Status (Masked) Register (RXINTSTATMASKED) Field Descriptions......................... 9743 Receive Interrupt Mask Set Register (RXINTMASKSET) Field Descriptions ...................................... 9844 Receive Interrupt Mask Clear Register (RXINTMASKCLEAR) Field Descriptions ................................ 9945 MAC Interrupt Status (Unmasked) Register (MACINTSTATRAW) Field Descriptions .......................... 10046 MAC Interrupt Status (Masked) Register (MACINTSTATMASKED) Field Descriptions......................... 10147 MAC Interrupt Mask Set Register (MACINTMASKSET) Field Descriptions ...................................... 10248 MAC Interrupt Mask Clear Register (MACINTMASKCLEAR) Field Descriptions ................................ 10349 Receive Multicast/Broadcast/Promiscuous Channel Enable Register (RXMBPENABLE) Field Descriptions 104
8List of Tables SPRU975B – August 2006Submit Documentation Feedback
50 Receive Unicast Enable Set Register (RXUNICASTSET) Field Descriptions .................................... 10651 Receive Unicast Clear Register (RXUNICASTCLEAR) Field Descriptions ....................................... 10752 Receive Maximum Length Register (RXMAXLEN) Field Descriptions ............................................ 10853 Receive Buffer Offset Register (RXBUFFEROFFSET) Field Descriptions ........................................ 10954 Receive Filter Low Priority Frame Threshold Register (RXFILTERLOWTHRESH) Field Descriptions ....... 11055 Receive Channel nFlow Control Threshold Register (RX nFLOWTHRESH) Field Descriptions ............... 11156 Receive Channel nFree Buffer Count Register (RX nFREEBUFFER) Field Descriptions ...................... 11257 MAC Control Register (MACCONTROL) Field Descriptions ........................................................ 11358 MAC Status Register (MACSTATUS) Field Descriptions ........................................................... 11559 Emulation Control Register (EMCONTROL) Field Descriptions .................................................... 11760 FIFO Control Register (FIFOCONTROL) Field Descriptions........................................................ 11861 MAC Configuration Register (MACCONFIG) Field Descriptions ................................................... 11962 Soft Reset Register (SOFTRESET) Field Descriptions .............................................................. 12063 MAC Source Address Low Bytes Register (MACSRCADDRLO) Field Descriptions ............................ 12164 MAC Source Address High Bytes Register (MACSRCADDRHI) Field Descriptions............................. 12265 MAC Hash Address Register 1 (MACHASH1) Field Descriptions ................................................. 12366 MAC Hash Address Register 2 (MACHASH2) Field Descriptions ................................................. 12467 Back Off Test Register (BOFFTEST) Field Descriptions ............................................................ 12568 Transmit Pacing Algorithm Test Register (TPACETEST) Field Descriptions ..................................... 12669 Receive Pause Timer Register (RXPAUSE) Field Descriptions .................................................... 12770 Transmit Pause Timer Register (TXPAUSE) Field Descriptions ................................................... 12871 MAC Address Low Bytes Register (MACADDRLO) Field Descriptions ........................................... 12972 MAC Address High Bytes Register (MACADDRHI) Field Descriptions ............................................ 13073 MAC Index Register (MACINDEX) Field Descriptions ............................................................... 13174 Transmit Channel nDMA Head Descriptor Pointer Register (TX nHDP) Field Descriptions .................... 13275 Receive Channel nDMA Head Descriptor Pointer Register (RX nHDP) Field Descriptions .................... 13376 Transmit Channel nCompletion Pointer Register (TX nCP) Field Descriptions .................................. 13477 Receive Channel nCompletion Pointer Register (RX nCP) Field Descriptions ................................... 13578 Statistics Register Field Descriptions .................................................................................. 136A-1 Physical Layer Definitions ............................................................................................... 146B-1 Document Revision History .............................................................................................. 147
SPRU975B – August 2006 List of Tables 9Submit Documentation Feedback
PrefaceSPRU975B – August 2006
Read This First
About This Manual
This document provides a functional description of the Ethernet Media Access Controller (EMAC) andPhysical layer (PHY) device Management Data Input/Output (MDIO) module integrated withTMS320C645x devices.
Notational Conventions
This document uses the following conventions.Hexadecimal numbers are shown with the suffix h. For example, the following number is 40hexadecimal (decimal 64): 40h.Registers in this document are shown in figures and described in tables. Each register figure shows a rectangle divided into fields that represent the fields of the register.Each field is labeled with its bit name, its beginning and ending bit numbers above, and itsread/write properties below. A legend explains the notation used for the properties. Reserved bits in a register figure designate a bit that is used for future device expansion.
Related Documentation From Texas InstrumentsThe following documents describe the C6000™ devices and related support tools. Copies of thesedocuments are available on the Internet at www.ti.com. Tip: Enter the literature number in the search boxprovided at www.ti.com .
TMS320C6000 CPU and Instruction Set Reference Guide (literature number SPRU732B ) describes theCPU architecture, pipeline, instruction set, and interrupts of the C64x and C64x+ DSPs.
TMS320C6455 Technical Reference (literature number SPRU965 ) gives an introduction to theTMS320C6455™ DSP and discusses the application areas that are enhanced.
TMS320C6000 Programmer's Guide (literature number SPRU198 ) describes ways to optimize C andassembly code for the TMS320C6000™ DSPs and includes application program examples.
TMS320C6000 Code Composer Studio Tutorial (literature number SPRU301 ) introduces the CodeComposer Studio™ integrated development environment and software tools.
Code Composer Studio Application Programming Interface Reference Guide (literature numberSPRU321 ) describes the Code Composer Studio™ application programming interface (API), which allowsyou to program custom plug-ins for Code Composer.
TMS320C64x+ Megamodule Reference Guide (literature number SPRU871 ) describes theTMS320C64x+ digital signal processor (DSP) megamodule. Included is a discussion on the internal directmemory access (IDMA) controller, the interrupt controller, the power-down controller, memory protection,bandwidth management, and the memory and cache.
TMS320C645x DSP Peripherals Overview Reference Guide (literature number SPRUE52 ) provides abrief description of the peripherals available on the TMS320C645x digital signal processors (DSPs).
TMS320C6455 Chip Support Libraries (CSL) (literature number SPRC234 ) is a download with the latestchip support libraries.Trademarks
C6000, TMS320C6455, TMS320C6000, Code Composer Studio are trademarks of Texas Instruments.
10 Preface SPRU975B – August 2006Submit Documentation Feedback
1 Introduction
1.1 Purpose of the Peripheral
1.2 Features
User's GuideSPRU975B – August 2006
Ethernet Media Access Controller (EMAC)/Management
Data Input/Output (MDIO)
This document provides a functional description of the Ethernet Media Access Controller (EMAC) andPhysical layer (PHY) device Management Data Input/Output (MDIO) module integrated withTMS320C645x (C645x) devices. Included are the features of the EMAC and MDIO modules, a discussionof their architecture and operation, how these modules connect to the outside world, and the registersdescription for each module.
The EMAC controls the flow of packet data from the processor to the PHY. The MDIO module controlsPHY configuration and status monitoring.
Both the EMAC and the MDIO modules interface to the DSP through a custom interface that allowsefficient data transmission and reception. This custom interface is referred to as the EMAC controlmodule, and is considered integral to the EMAC/MDIO peripheral.
The EMAC module is used on TMS320C645x devices to move data between the device and another hostconnected to the same network, in compliance with the Ethernet protocol.
The basic feature set of the EMAC module integrated with C645x is:Synchronous 10/100/1000 Mbps operationFull duplex Gigabit operation (half duplex gigabit is not supported)Little endian and big endian supportSupports four types of interfaces to the physical layer device (PHY): standard media independentinterface (MII), reduced pin count media independent interface (RMII), standard gigabit mediaindependent interface (GMII) and reduced pin count gigabit media independent interface (RGMII)EMAC acts as DMA master to either internal or external device memory spaceEight receive channels with VLAN tag discrimination for receive quality of service (QOS) supportEight transmit channels with round–robin or fixed priority for transmit quality of service (QOS) supportEther-stats and 802.3-stats statistics gatheringTransmit CRC generation selectable on a per-channel basisBroadcast frames selection for reception on a single channelMulticast frames selection for reception on a single channelPromiscuous receive mode frames selection for reception on a single channel (all frames, all goodframes, short frames, error frames)Hardware flow control8K byte local EMAC descriptor memory that allows the peripheral to operate on descriptors withoutaffecting the CPU. The descriptor memory holds enough information to transfer up to 512 ethernetpackets without CPU intervention.Programmable interrupt logic permits the software driver to restrict the generation of back-to-backinterrupts, thus allowing more work to be performed in a single call to the interrupt service routine
SPRU975B – August 2006 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) 11Submit Documentation Feedback
www.ti.com
1.3 Functional Block Diagram
Configuration bus DMA memory
transfer controller
Peripheral bus
EMAC control module
EMAC module MDIO module
MII MDIO bus
EMAC/MDIO
interrupt
Interrupt
controller
RMII GMII RGMII
Introduction
Figure 1 shows the three main functional modules of the EMAC/MDIO peripheral:EMAC control moduleEMAC moduleMDIO module
The EMAC control module is the main interface between the device core processor and the EMACmodule and MDIO module. The EMAC control module contains the necessary components to allow theEMAC to make efficient use of device memory, plus it controls device interrupts. The EMAC controlmodule incorporates 8K byte internal RAM to hold EMAC buffer descriptors.
The management data input / output (MDIO) module implements the 802.3 serial management interface tointerrogate and control up to 32 ethernet PHY(s) connected to the device, using a shared two–wire bus.Application software uses the MDIO module to configure the auto-negotiation parameters of each PHYattached to the EMAC, retrieve the negotiation results, and configure required parameters in the EMACmodule for correct operation. The module is designed to allow almost transparent operation of the MDIOinterface, with very little maintenance from the core processor.
The ethernet media access controller (EMAC) module provides an efficient interface between the C645xcore processor and the networked community. The EMAC supports 10Base-T (10 Mbits / sec), and100BaseTX (100 Mbits / sec), in either half or full duplex mode, and 1000BaseT (1000 Mbits / sec) in fullduplex mode, with hardware flow control and quality-of-service (QOS) support.
Figure 1. EMAC and MDIO Block Diagram
Figure 1 also shows the main interface between the EMAC control module and the CPU.
The following connections are made to the device core:The peripheral bus connection from the EMAC control module allows the EMAC module to read andwrite both internal and external memory through the switch fabric interface.The EMAC control, EMAC, and MDIO modules all have control registers. These registers arememory-mapped into device memory space via the device configuration bus. The control module’sinternal RAM maps to this same range along with these registers.The EMAC and MDIO interrupts are combined into a single interrupt within the control module. Theinterrupt from the control module then goes to the device’s interrupt controller.
The EMAC and MDIO interrupts are combined within the control module, so only the control moduleinterrupt needs to be monitored by the application software or device driver. The interrupt is mapped to aspecific CPU interrupt via the enhanced interrupt selector within the C64x+ core. The combined EMAC /MDIO interrupt maps to the interrupt controller input as system event 17.
Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO)12 SPRU975B – August 2006Submit Documentation Feedback
www.ti.com
1.4 Industry Standard(s) Compliance Statement
Introduction
The EMAC peripheral conforms to the IEEE 802.3 standard, describing the “Carrier Sense Multiple Accesswith Collision Detection (CSMA/CD) Access Method and Physical Layer” specifications. ISO / IEC hasalso adopted the IEEE 802.3 standard and re-designated it as ISO/IEC 8802-3:2000(E).
In difference from this standard, the EMAC peripheral integrated with the C645x devices does not use thetransmit coding error signal MTXER. Instead of driving the error pin when an underflow condition occurson a transmitted frame, the EMAC intentionally generates an incorrect check sum by inverting the frameCRC so that the network will detect the transmitted frame as an error.
SPRU975B – August 2006 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) 13Submit Documentation Feedback
www.ti.com
2 EMAC Functional Architecture
2.1 Clock Control
2.1.1 MII Clocking
2.1.2 RMII Clocking
2.1.3 GMII Clocking
EMAC Functional Architecture
This chapter discusses the architecture and basic function of the EMAC peripheral.
The frequencies for the transmit and receive clocks are fixed by the IEEE 802.3 specification as shownbelow:
2.5 Mhz at 10 Mbps25 Mhz at 100 Mbps125 MHz at 1000 Mbps
The C645x device uses two PLL controllers to generate all of the clocks that the DSP needs. The primaryPLL controller generates a peripheral clock (SYSCLK2) that several peripherals use, including the EMAC.SYSCLK2 runs at a rate equal to 1/6th of the CPU clock frequency (CPUclk/6), and is not programmable.
The secondary PLL controller conveniently generates a reference clock (SYSCLK1). The EMAC uses theSYSCLK1 to generate the transmit and receive clocks for the GMII and RGMII interfaces. The frequencyof SYSCLK1 is equal to the secondary PLL controller’s input clock (25 MHz) multiplied by 10 and dividedby either 5 or 2. You must program SYSCLK1 to the correct frequency based on the interface that you areusing (as determined by the configuration pins MACSEL[1:0]). See Section 2.1.1 ,Section 2.1.3 , andSection 2.1.4 for the configuration of SYSCLK1 that is required on each interface.
Note: The RGMII interface does not require an interface clock. However, a reference clock thatis derived from SYSCLK1 is provided for your convenience. The reference clock is not afree running clock. The reference clock stops while the DSP is in reset; therefore, youmust be careful if you use this clock elsewhere in the system.
The MDIO clock is based on a divide-down of the peripheral clock (SYSCLK2) and is specified to run upto 2.5 MHz, although typical operation is 1.0 MHz. Since the peripheral clock frequency is variable, theapplication software or driver controls the divide-down amount.
When you select the MII clocking interface by setting MACSEL to the default value (00b), the transmit andreceive clock sources are provided from an external PHY via the MTCLK and MRCLK pins. These clocksare inputs to the EMAC module and operate at 2.5 MHz in 10 Mbps mode, and at 25 MHz in 100 MHzmode. The MII clocking interface is not used in 1000 Mbps mode. For timing purposes, data is transmittedand received with reference to MTCLK and MRCLK, respectively.
When you select the RMII interface by setting MACSEL to 01b, you must provide a 50MHz referenceclock through the MREFCLK pin. The EMAC clocks the transmit and receive operations from thereference clock. The MTCLK and MRCLK device pins are not used for this interface. The RMII protocolturns one data phase of an MII transfer into two data phases at double the clock frequency. This is thedriving factor for the 50 MHz reference clock. Data at the IO pins are running at 5 MHZ in 10 Mbps mode,and at 50 MHz in 100 Mbps mode.
When you set MACSEL to 02b to select GMII, the transmit and receive clock sources for 10/100 Mbpsmodes are provided from an external PHY via the MTCLK and MRCLK pins. For 1000 Mbps mode, thereceive clock is provided by an external PHY via the MRCLK pin. For transmit in 1000 Mbps mode, theclock is sourced synchronous with the data, and is provided by the EMAC to be output on the GMTCLKpin.
The SYSCLK1 of the secondary PLL controller sources the GMTCLK. The divider generating SYSCLK1needs to be programmed to /2 (the default value) for this interface to provide a 125 MHz clock to theEMAC.
14 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) SPRU975B – August 2006Submit Documentation Feedback
www.ti.com
2.1.4 RGMII Clocking
2.2 Memory Map
EMAC Functional Architecture
For timing purposes, data in 10/100 mode is transmitted and received with reference to MTCLK andMRCLK, respectively. For 1000 Mbps mode, receive timing is the same, but transmit is relative toGMTCLK.
When the RGMII interface is selected by setting MACSEL to 11b, you must configure the internal clock(SYSCLK1) to a 125 MHz frequency by setting the divider for the secondary PLL controller to /5. Thisprovides a reference clock that you can use to source the clock on the RGMII PHY as necessary.
Note: This reference clock is not a free running clock. An external device should only use thisclock if it does not expect a valid clock during device reset.
The EMAC drives the transmit clock, while an external PHY generates the receive clock. The referenceclock drives the device pin that gives the 125 MHz clock to the PHY; this enables the PHY to generate thereceive clock that is sent to EMAC.
The RGMII protocol takes a GMII data stream and turns it into an interface with half of the data bus widthand sends the same amount of data with a reduced pinout. The RGMII protocol also allows for dynamicswitching of the mode between 10/100/1000 Mbps modes. This negotiation data is embedded in theincoming data stream from the external PHY. For timing purposes, data is transmitted and received withrespect to MTCLK and MRCLK respectively.
The RGMII interface has separate I/O pins from the other EMAC pins because the interface voltage isdifferent from the other interfaces.
The EMAC includes an internal memory that holds information about the ethernet packets that arereceived or transmitted. This internal RAM is 2K x 32 bits in size. You can write data to and read datafrom the EMAC internal memory via either the EMAC or the CPU. It is used to store buffer descriptors thatare 4 words (16 bytes) deep. This 8K local memory can hold enough information to transfer up to 512ethernet packets without CPU intervention.
You can put the packet buffer descriptors in internal processor memory (L2) on the C645x devices. Thereare some trade-offs in terms of cache performance and throughput when you put descriptors in L2 versuswhen you put them in EMAC’s internal memory. Cache performance improves when you put the bufferdescriptors in internal memory. However, the EMAC throughput is better when you put the descriptors inthe local EMAC RAM.
SPRU975B – August 2006 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) 15Submit Documentation Feedback
www.ti.com
2.3 System Level Connections
2.3.1 Media Independent Interface (MII) Connections
MTCLK
MTXD[3−0]
MTXEN
MCOL
MCRS
MRCLK
MRXD[3−0]
MRXDV
MRXER
MDCLK
MDIO
Physical
layer
device
(PHY)
System
core Transformer
2.5 MHz
or
25 MHz
RJ−45
EMACMDIO
EMAC Functional Architecture
The C645x device supports four different interfaces to a physical layer device. You can only transfer dataon one interface at a given time. Each of these interfaces is selected in hardware via the configurationpins (MACSEL[1:0]).
Table 1 shows the possible settings for these configuration pins.
Table 1. Interface Selection Pins
MACSEL [1:0] Interface
00 MII01 RMII10 GMII11 RGMII
Figure 2 shows a device with integrated EMAC and MDIO interfaced via a MII connection. This interface isonly available in 10 Mbps and 100 Mbps modes.
Figure 2. Ethernet Configuration with MII Interface
16 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) SPRU975B – August 2006Submit Documentation Feedback
www.ti.com
EMAC Functional Architecture
Table 2 summarizes the individual EMAC and MDIO signals for the MII interface. For more information,refer to either the IEEE 802.3 standard or ISO/IEC 8802-3:2000(E).
The EMAC module does not include a transmit error (MTXER) pin. If a transmit error occurs, CRCinversion is used to negate the validity of the transmitted frame.
Table 2. EMAC and MDIO Signals for MII Interface
Signal Name I/O Description
MTCLK I Transmit clock (MTCLK). The transmit clock is a continuous clock that provides the timingreference for transmit operations. The MTXD and MTXEN signals are tied to this clock. Theclock is generated by the PHY and is 2.5 MHz at 10 Mbps operation and 25 MHz at 100Mbps operation.MTXD[3:0] O Transmit data (MTXD). The transmit data pins are a collection of 4 data signals comprising 4bits of data. MTDX0 is the least-significant bit (LSB). The signals are synchronized by MTCLKand valid only when MTXEN is asserted.MTXEN O Transmit enable (MTXEN). The transmit enable signal indicates that the MTXD pins aregenerating nibble data for use by the PHY. It is driven synchronously to MTCLK.MCOL I Collision detected (MCOL). The MCOL pin is asserted by the PHY when it detects a collisionon the network. It remains asserted while the collision condition persists. This signal is notnecessarily synchronous to MTCLK nor MRCLK. This pin is used in half-duplex operationonly.MCRS I Carrier sense (MCRS). The MCRS pin is asserted by the PHY when the network is not idle ineither transmit or receive. The pin is de-asserted when both transmit and receive are idle.This signal is not necessarily synchronous to MTCLK or MRCLK. This pin is used inhalf-duplex operation only.MRCLK I Receive clock (MRCLK). The receive clock is a continuous clock that provides the timingreference for receive operations. The MRXD, MRXDV, and MRXER signals are tied to thisclock. The clock is generated by the PHY and is 2.5 MHz at 10 Mbps operation and 25 MHzat 100 Mbps operation.MRXD[3:0] I Receive data (MRXD). The receive data pins are a collection of 4 data signals comprising 4bits of data. MRDX0 is the least-significant bit (LSB). The signals are synchronized byMRCLK and valid only when MRXDV is asserted.MRXDV I Receive data valid (MRXDV). The receive data valid signal indicates that the MRXD pins aregenerating nibble data for use by the EMAC. It is driven synchronously to MRCLK.MRXER I Receive error (MRXER). The receive error signal is asserted for one or more MRCLK periodsto indicate that an error was detected in the received frame. This is meaningful only duringdata reception when MRXDV is active.MDCLK O Management data clock (MDCLK). The MDIO data clock is sourced by the MDIO module onthe system. It is used to synchronize MDIO data access operations done on the MDIO pin.The frequency of this clock is controlled by the CLKDIV bits in the MDIO control register(CONTROL).MDIO I/O Management data input output (MDIO). The MDIO pin drives PHY management data into andout of the PHY by way of an access frame consisting of start of frame, read/write indication,PHY address, register address, and data bit cycles. The MDIO pin acts as an output foreverything except the data bit cycles, when the pin acts as an input for read operations.
SPRU975B – August 2006 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) 17Submit Documentation Feedback
www.ti.com
2.3.2 Reduced Media Independent Interface (RMII) Connections
MTXD[1−0]
MTXEN
MCRSDV
MREFCLK
MRXD[1−0]
MRXER
MDCLK
MDIO
Physical
layer
device
(PHY)
System
core
Transformer
RJ−45
EMACMDIO
EMAC Functional Architecture
Figure 3 shows a device with integrated EMAC and MDIO interfaced via a RMII connection. This interfaceis only available in 10 Mbps and 100 Mbps modes. The RMII interface is only supported in full-duplexmode for the C645x family of devices.
Figure 3. Ethernet Configuration with RMII Interface
18 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) SPRU975B – August 2006Submit Documentation Feedback
www.ti.com
EMAC Functional Architecture
The RMII interface has the same functionality as the MII, but it does so with a reduced number of pins,thus lowering the total cost for an application. In devices incorporating many PHY interfaces such asswitches, the number of pins can add significant cost as the port counts increase. Table 3 summarizes theindividual EMAC and MDIO signals for the RMII interface.
The RMII interface does not include an MCOL signal. A collision is detected from the receive and transmitdata delimiters. The data signals are 2 bits wide, and a single reference clock must be provided to theMAC, operating at 50MHz to sustain the same data rate as MII.
Table 3. EMAC and MDIO Signals for RMII Interface
Signal Name I/O Description
MTXD[1-0] O Transmit data (MTXD). The transmit data pins are a collection of 2 data signals comprising 2bits of data. MTDX0 is the least-significant bit (LSB). The signals are synchronized to theRMII reference clock and valid only when MTXEN is asserted.MTXEN O Transmit enable (MTXEN). The transmit enable signal indicates that the MTXD pins aregenerating nibble data for use by the PHY. It is driven synchronously to the RMII referenceclock.MCRSDV I Carrier sense/receive data valid (MCRSDV). The MCRSDV pin is asserted by the PHY whenthe network is not idle in either transmit or receive. The data on MRXD is considered validonce the MCRSDV signal is asserted. The pin is de-asserted when both transmit and receiveare idle. The assertion of this signal is asynchronous to the RMII reference clock. This pin isused in half-duplex operation only.MREFCLK I Reference clock (MREFCLK). A 50MHz clock must be provided through this pin for RMIIoperation.MRXD[1-0] I Receive data (MRXD). The receive data pins are a collection of 2 data signals comprising 2bits of data. MRDX0 is the least-significant bit (LSB). The signals are synchronized to theRMII reference clock and valid only when MCRSDV is asserted. In 10 Mbps operation, MRXDis sampled every 10th cycle of the RMII reference clock.MRXER I Receive error (MRXER). The receive error signal is asserted for one or more reference clockperiods to indicate that an error was detected in the received frame. This is meaningful onlyduring data reception when MCRSDV is active. It is driven synchronously to the RMIIreference clock.MDCLK O Management data clock (MDCLK). The MDIO data clock is sourced by the MDIO module onthe system. It is used to synchronize MDIO data access operations done on the MDIO pin.The frequency of this clock is controlled by the CLKDIV bits in the MDIO control register(CONTROL).MDIO I/O Management data input output (MDIO). The MDIO pin drives PHY management data into andout of the PHY by way of an access frame consisting of start of frame, read/write indication,PHY address, register address, and data bit cycles. The MDIO pin acts as an output foreverything except the data bit cycles, when the pin acts as an input for read operations.
SPRU975B – August 2006 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) 19Submit Documentation Feedback
www.ti.com
2.3.3 Gigabit Media Independent Interface (GMII) Connections
MTCLK
MTXD[7−0]
MTXEN
MCOL
MCRS
MRCLK
MRXD[7−0]
MRXDV
MRXER
MDCLK
MDIO
Physical
layer
device
(PHY)
System
core Transformer
2.5 MHz,
25 MHz,
RJ−45
EMACMDIO
GMTCLK
or 125 MHz
EMAC Functional Architecture
Figure 4 shows a device with integrated EMAC and MDIO interfaced via a GMII connection. This interfaceis available in 10 Mbps, 100 Mbps, and 1000 Mbps modes.
Figure 4. Ethernet Configuration with GMII Interface
The GMII interface supports 10/100/1000 Mbps modes. Only full-duplex mode is available in 1000 Mbpsmode. In 10/100 Mbps modes, the GMII interface acts like an MII interface, and only the lower 4 bits ofdata are transferred for each of the data buses.
20 Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO) SPRU975B – August 2006Submit Documentation Feedback
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148

Texas Instruments TMS320C645x DSP User manual

Type
User manual
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI