58. Ethernet (ETH): media access control (MAC) with DMA controller

58.1 Ethernet introduction

Portions Copyright (c) Synopsys, Inc. All rights reserved. Used with permission.

The Ethernet peripheral enables to transmit and receive data over Ethernet in compliance with the IEEE 802.3-2008 standard.

The peripheral is configurable to meet the needs of a large variety of consumer and industrial applications.

58.2 Ethernet main features

The Ethernet peripheral embeds a dedicated DMA for direct memory interface, a media access controller (MAC) and a PHY interface block supporting several formats.

58.2.1 Standard compliance

The Ethernet peripheral is compliant with the following standards:

58.2.2 MAC features

MAC Tx and Rx common features

MAC Tx features

MAC Rx features

58.2.3 Transaction layer (MTL) features

MTL Tx and Rx Common Features

MTL Tx features

MTL Rx features

58.2.4 DMA block features

The DMA block exchanges data between the peripheral and the system memory. DMA transfers are driven by software descriptors structure. The application can use a set of registers (see Section 58.11.2: Ethernet DMA registers ) to control the DMA operations. The DMA block supports the following features:

58.2.5 Bus interface features

AHB master interface

The AHB master interface features are the following:

The AHB master interface does not generate the following:

AHB slave interface

The AHB slave interface supports the following features:

The AHB slave interface does not generate the following responses:

58.3 Ethernet pins and internal signals

Table 522 lists the Ethernet inputs and output signals connected to package pins or balls. Active pins depend on the PHY type selected (MII or RMII) and on the device configuration.

Table 523 shows the internal Ethernet signals.

Table 522. Ethernet peripheral pins

Port nameDigital port typeDescription
ETH_COLInputCollision detection signal, MII only.
ETH_CRSinputCarrier sense signal, MII only
ETH_REF_CLKInputRMII reference clock
ETH_RX_CLKInputMII timing reference for Rx data transfers
ETH_RXD[3:0]InputReceive data.
4 pins for MII, 2 for RMII.
ETH_RX_DVInputReceive data valid
ETH_CRS_DVInputRMII: Carrier Sense (CRS) and RX_Data Valid (RX_DV) multiplexed on alternate clock cycles. In 10 Mbit/s mode, it alternates every 10 clock cycles.
ETH_RX_ERInputReceive error
ETH_TX_CLKInputMII timing reference for Tx data transfers
ETH_TXD[3:0]OutputTransmit data.
4 pins for MII, 2 for RMII.
ETH_TX_ENOutputTransmit data enable
ETH_TX_EROutputTransmit error
ETH_MDCOutputManagement data clock
ETH_MDIOInput/outputManagement data

Table 522. Ethernet peripheral pins (continued)

Port nameDigital port typeDescription
ETH_PHY_INTNInputPHY interrupt
ETH_PPS_OUTOutputPTP pulse-per-second output

Table 523. Ethernet internal input/output signals

Signal nameSignal typeDescription
eth_hclkDigital inputAHB clock
eth_sbd_intr_itDigital outputMain Ethernet interrupt
lpi_intr_oDigital outputSideband signal generated when the transmitter or receiver enters or exits the LPI state.
pmt_intr_oDigital outputSideband signal generated when a valid remote wake-up packet is received
eth_mii_tx_clkDigital inputMII Tx kernel clock
eth_mii_rx_clkDigital inputMII Rx kernel clock
eth_rmii_ref_clkDigital inputRMII reference kernel clock
eth_ptp_pps_outDigital outputPTP pulse-per-second signal
mac_speed_o[1:0]Digital outputMAC speed information used by the RCC
clk_ptp_ref_iDigital inputPTP reference clock input. This input is connected to eth_hclk clock.
eth_ptp_trig[4:1]Digital inputTrigger input for auxiliary snapshots of the PTP system time

58.4 Ethernet architecture

The Ethernet peripheral is composed of 4 main functional modules:

A protocol adaption module is added to support the RMII PHY Media Independent Interfaces.

Figure 781. Ethernet high-level block diagram

Figure 781. Ethernet high-level block diagram. The diagram shows the internal architecture of the Ethernet MAC. On the left, a 32-bit AHB Master and Slave interface are connected to a DMA Arbiter and a CSR (Control and Status Register). The DMA Arbiter connects to DMA Tx0 and DMA Rx0 blocks. DMA Tx0 connects to a 2KB Tx FIFO Control block, which in turn connects to a MAC Tx block. DMA Rx0 connects to a 2KB Rx FIFO Control block, which connects to a MAC Rx block. The MAC Tx and MAC Rx blocks are connected to an MII (Media Independent Interface) block, which is connected to a PHY I/F block. The MAC Tx and MAC Rx blocks are also connected to a Select block, which is connected to an RMII block. The RMII block is connected to the PHY I/F block. The CSR block is connected to the DMA Arbiter, DMA Tx0, DMA Rx0, 2KB Tx FIFO Control, 2KB Rx FIFO Control, MAC Tx, MAC Rx, and the Select block. The CSR block also receives several interrupt signals: eth_sbd_intr_it, lpi_intr_o, pmt_intr_o, clk_ptp_ref_i, eth_ptp_trig[4:1], and mac_speed_o[1:0]. The CSR block also outputs several signals: eth_hclk, eth_tx_clk, eth_ref_clk, eth_rx_clk, ETH_PPS_OUT, and eth_ptp_pps_out. The diagram is labeled 'ETHERNET MAC' and 'MSV40388V8'.
Figure 781. Ethernet high-level block diagram. The diagram shows the internal architecture of the Ethernet MAC. On the left, a 32-bit AHB Master and Slave interface are connected to a DMA Arbiter and a CSR (Control and Status Register). The DMA Arbiter connects to DMA Tx0 and DMA Rx0 blocks. DMA Tx0 connects to a 2KB Tx FIFO Control block, which in turn connects to a MAC Tx block. DMA Rx0 connects to a 2KB Rx FIFO Control block, which connects to a MAC Rx block. The MAC Tx and MAC Rx blocks are connected to an MII (Media Independent Interface) block, which is connected to a PHY I/F block. The MAC Tx and MAC Rx blocks are also connected to a Select block, which is connected to an RMII block. The RMII block is connected to the PHY I/F block. The CSR block is connected to the DMA Arbiter, DMA Tx0, DMA Rx0, 2KB Tx FIFO Control, 2KB Rx FIFO Control, MAC Tx, MAC Rx, and the Select block. The CSR block also receives several interrupt signals: eth_sbd_intr_it, lpi_intr_o, pmt_intr_o, clk_ptp_ref_i, eth_ptp_trig[4:1], and mac_speed_o[1:0]. The CSR block also outputs several signals: eth_hclk, eth_tx_clk, eth_ref_clk, eth_rx_clk, ETH_PPS_OUT, and eth_ptp_pps_out. The diagram is labeled 'ETHERNET MAC' and 'MSV40388V8'.
  1. 1. For a definition of the internal signals, refer to Table 523 .
  2. 2. Refer to RCC chapter "Clock distribution for Ethernet" for a detailed description of the Ethernet clock architecture.

58.4.1 DMA controller

The DMA has independent Transmit (Tx) and Receive (Rx) engines. The Tx engine transfers data from the system memory to the MAC Transaction Layer (MTL), whereas the Rx engine transfers data from the device port (PHY) to the system memory.

The controller uses descriptors to efficiently move data from source to destination with minimal application CPU intervention. The DMA is designed for packet-oriented data transfers such as packets in Ethernet. The controller can be programmed to interrupt the application CPU for situations such as Packet Transmit and Receive Transfer completion, and other normal or error conditions.

DMA data structures

The DMA and the application communicate through the following two data structures:

The DMA transfers the data packets received by the MAC to the Rx buffer in system memory and Tx data packets from the Tx buffer in the system memory. The descriptors that reside in the system memory contain the pointers to these buffers.

The base address of each list is written to the respective Tx and Rx registers: Channel Tx descriptor list address register (ETH_DMAC TXDLAR) and Channel Rx descriptor list address register (ETH_DMAC RXDLAR) .

The descriptor list is forward linked and the next descriptor is always considered at a fixed offset to the current one. The number of descriptors in the list is programmed in the respective Tx/Rx, Channel Tx descriptor ring length register (ETH_DMAC TXRLR) and Channel Rx descriptor ring length register (ETH_DMAC RXRLR) .

Once the DMA processes the last descriptor in the list, it automatically jumps back to the descriptor in the List address register to create a descriptor ring. The descriptor lists reside in the physical memory address space of the application. Each descriptor can point to a maximum of two buffers. This enables two buffers to be used and physically addressed, rather than contiguous buffers in memory.

A data buffer resides in the application physical memory space and consists of an entire packet or part of a packet, but cannot exceed a single packet. Buffers contain only data. The buffer status is saved in the descriptor. Data chaining refers to packets that span multiple data buffers. However, a single descriptor cannot span multiple packets. The DMA skips to the data buffer of next packet when EOP is detected.

Descriptors are specified in Section 58.10: Descriptors .

DMA arbitration

The DMA module incorporates an arbiter that performs the arbitration between the Tx and Rx channels accesses from the AHB master interface. The following two types of arbitrations are supported and can be selected through DMA mode register (ETH_DMAMR) :

DMA transmission in default mode

The Tx DMA engine in default mode proceeds as follows:

  1. 1. The application sets up the Transmit descriptor (TDES0–TDES3) and sets the Own bit (TDES0[31]) after setting up the corresponding data buffer(s) with Ethernet Packet data.
  2. 2. The application shifts the Descriptor tail pointer offset value of the Transmit channel.
  3. 3. The DMA fetches the descriptor from the application memory.
  4. 4. If the DMA detects one of the following conditions, the transmission from that channel is suspended, bit 2 and 16 of the corresponding DMA channel Status register are set, and the Tx engine proceeds to step 11:
    • – The descriptor is flagged as owned by the application (TDES3 [31] = 0).
    • – The descriptor tail pointer is equal to the current descriptor pointer in Ring Descriptor list mode.
    • – An error condition occurs.
  5. 5. If the acquired descriptor is flagged as owned by the DMA (TDES3[31] = 1), the DMA decodes the Transmit Data Buffer address from the acquired descriptor.
  6. 6. The DMA fetches the Transmit data from the system memory and transfers the data to the MTL for transmission.
  7. 7. If an Ethernet packet is stored over data buffers in multiple descriptors, the DMA closes the intermediate descriptor and fetches the next descriptor. Steps 3 through 7 are repeated until the end-of-Ethernet-packet data is transferred to the MTL.
  8. 8. When packet transmission is complete, if IEEE 1588 timestamp feature was enabled for the packet (as indicated in the Tx status), the timestamp value obtained from MTL is written to the Tx descriptor (TDES0 and TDES1) that contains the EOP buffer. The status information is written to this Tx descriptor (TDES3). The application now owns this descriptor because the Own bit is cleared during this step. If the timestamp feature is disabled for this packet, the DMA does not alter TDES0 and TDES1 contents.
  9. 9. Bit 0 of Channel status register (ETH_DMACSR) is set after completing transmission of a packet that has Interrupt on Completion (TDES2[31]) set in its Last Descriptor. The DMA engine returns to step 3.
  10. 10. In the Suspend state, the DMA tries to acquire the descriptor again (and thereby return to step 3). A poll demand command is triggered by writing any value to the Channel Tx descriptor tail pointer register (ETH_DMACTXDTPR) when it receives a Transmit Poll demand and the Underflow Interrupt Status bit is cleared. If the application stopped the DMA by clearing Bit 0 of Transmit control register of corresponding DMA channel, the DMA enters the Stop state.

Figure 782. DMA transmission flow (standard mode)

Flowchart of DMA transmission flow in standard mode. The process starts with 'Start Tx DMA', followed by '(Re-)fetch next descriptor from Tx Queue'. It then checks 'Own bit set?'. If 'Yes', it proceeds to 'Transfer data from Buffer(s)'. If 'No', it goes to 'Close intermediate descriptor'. From 'Transfer data from Buffer(s)', it checks 'Packet read completely?'. If 'Yes', it proceeds to 'Transmit packet'. If 'No', it goes to 'Close intermediate descriptor'. From 'Transmit packet', it checks 'Start required?'. If 'Yes', it proceeds to 'Wait for Tx status'. If 'No', it goes to 'Close TDES3 of last descriptor'. From 'Wait for Tx status', it checks 'Timestamp present?'. If 'Yes', it proceeds to 'Write timestamp to TDES0 and TDES1'. If 'No', it goes to 'Wait status word to TDES3'. From 'Write timestamp to TDES0 and TDES1', it proceeds to 'Wait status word to TDES3'. From 'Wait status word to TDES3', it checks 'DMA Tx stopped?'. If 'Yes', it loops back to 'Start Tx DMA'. If 'No', it proceeds to 'Transmit Poll demand'. From 'Transmit Poll demand', it loops back to '(Re-)fetch next descriptor from Tx Queue'. From 'Close intermediate descriptor', it proceeds to 'End of descriptor ring?'. If 'Yes', it proceeds to 'Suspend Tx DMA queue'. If 'No', it loops back to '(Re-)fetch next descriptor from Tx Queue'. From 'Close TDES3 of last descriptor', it proceeds to 'End of descriptor ring?'. If 'Yes', it proceeds to 'Suspend Tx DMA queue'. If 'No', it loops back to '(Re-)fetch next descriptor from Tx Queue'. From 'Suspend Tx DMA queue', it proceeds to 'Transmit Poll demand'.
graph TD; Start1[Start Tx DMA] -- Start --> Start2[Start Tx DMA]; Start2 --> Fetch[(Re-)fetch next descriptor from Tx Queue]; Fetch --> OwnBit{Own bit set?}; OwnBit -- No --> CloseInt[Close intermediate descriptor]; OwnBit -- Yes --> Transfer[Transfer data from Buffer(s)]; Transfer --> ReadComplete{Packet read completely?}; ReadComplete -- No --> CloseInt; ReadComplete -- Yes --> Transmit[Transmit packet]; Transmit --> StartReq{Start required?}; StartReq -- No --> CloseLast[Close TDES3 of last descriptor]; StartReq -- Yes --> WaitTx[Wait for Tx status]; WaitTx --> Timestamp{Timestamp present?}; Timestamp -- No --> WaitStatus[Wait status word to TDES3]; Timestamp -- Yes --> WriteTs[Write timestamp to TDES0 and TDES1]; WriteTs --> WaitStatus; WaitStatus --> TxStopped{DMA Tx stopped?}; TxStopped -- Yes --> Start2; TxStopped -- No --> PollDemand[Transmit Poll demand]; PollDemand --> Fetch; CloseInt --> EndRing{End of descriptor ring?}; EndRing -- No --> Fetch; EndRing -- Yes --> Suspend[Suspend Tx DMA queue]; Suspend --> PollDemand; CloseLast --> EndRing; EndRing -- No --> Fetch; EndRing -- Yes --> Suspend;

MS40862V1

Flowchart of DMA transmission flow in standard mode. The process starts with 'Start Tx DMA', followed by '(Re-)fetch next descriptor from Tx Queue'. It then checks 'Own bit set?'. If 'Yes', it proceeds to 'Transfer data from Buffer(s)'. If 'No', it goes to 'Close intermediate descriptor'. From 'Transfer data from Buffer(s)', it checks 'Packet read completely?'. If 'Yes', it proceeds to 'Transmit packet'. If 'No', it goes to 'Close intermediate descriptor'. From 'Transmit packet', it checks 'Start required?'. If 'Yes', it proceeds to 'Wait for Tx status'. If 'No', it goes to 'Close TDES3 of last descriptor'. From 'Wait for Tx status', it checks 'Timestamp present?'. If 'Yes', it proceeds to 'Write timestamp to TDES0 and TDES1'. If 'No', it goes to 'Wait status word to TDES3'. From 'Write timestamp to TDES0 and TDES1', it proceeds to 'Wait status word to TDES3'. From 'Wait status word to TDES3', it checks 'DMA Tx stopped?'. If 'Yes', it loops back to 'Start Tx DMA'. If 'No', it proceeds to 'Transmit Poll demand'. From 'Transmit Poll demand', it loops back to '(Re-)fetch next descriptor from Tx Queue'. From 'Close intermediate descriptor', it proceeds to 'End of descriptor ring?'. If 'Yes', it proceeds to 'Suspend Tx DMA queue'. If 'No', it loops back to '(Re-)fetch next descriptor from Tx Queue'. From 'Close TDES3 of last descriptor', it proceeds to 'End of descriptor ring?'. If 'Yes', it proceeds to 'Suspend Tx DMA queue'. If 'No', it loops back to '(Re-)fetch next descriptor from Tx Queue'. From 'Suspend Tx DMA queue', it proceeds to 'Transmit Poll demand'.

DMA transmission in OSP (Operate on Second Packet) mode

In Run state, if bit 4 is set in the Channel transmit control register (ETH_DMACCTXCR) , the Transmit process can simultaneously acquire two packets without closing the Status descriptor of the first packet. While the Transmit process completes the first packet transfer, it immediately polls the Transmit descriptor list for the second packet. If the second packet is valid, the Transmit process transfers this packet before writing the status information of the first packet.

In OSP mode, DMA transmission in the Run state operates as described in the following sequence:

  1. 1. The DMA executes steps 1 to 7 of the DMA transmission sequence in default mode (see Section : DMA transmission in default mode ).
  2. 2. The DMA fetches the next descriptor without closing previous packet last descriptor.
  3. 3. If the DMA owns the acquired descriptor, the DMA decodes the transmit buffer address in this descriptor. If the DMA does not own the descriptor, the DMA goes into Suspend mode and jumps to step 7.
  4. 4. The DMA fetches the Transmit packet from the system memory and transfers the packet to the MTL until the EOP data is transferred, closing the intermediate descriptors if this packet is split across multiple descriptors.
  5. 5. The DMA waits for the packet transmission status and timestamp of previous packet. When the status is available, the DMA writes the timestamp to TDES0 and TDES1 if such timestamp was captured (as indicated by a status bit). The DMA writes the status, with a cleared Own bit, to the corresponding TDES3, thus closing the descriptor. If Timestamp feature is not enabled for the previous packet, the DMA does not alter the contents of TDES2 and TDES3.
  6. 6. The Transmit interrupt is set (if enabled). The DMA fetches the next descriptor and proceeds to step 3 (when Status is normal). If the previous transmission status shows an underflow error, the DMA goes into Suspend mode (step 7).
  7. 7. In Suspend mode, if a pending status and timestamp are received from the MTL, the DMA performs the following operations:
    1. a) The DMA writes the timestamp (if enabled for the current packet) to TDES2 and TDES3.
    2. a) The DMA writes the status to the corresponding TDES3.
    3. a) The DMA sets the relevant interrupts and returns to Suspend mode.
    If no status is pending and the application stopped the DMA by clearing bit 0 of Transmit Control Register of corresponding DMA channel, the DMA enters the Stop state.
  8. 8. The DMA can exit Suspend mode and enter the Run state (it goes either to step 1 or to step 2 depending on pending status) only after receiving a Transmit Poll demand in Transmit Descriptor Tail Pointer register of corresponding channel.

A description of the basic DMA transmission flow in OSP mode is given in Figure 784: Receive DMA flow .

Figure 783. DMA transmission flow (OSP mode)

Flowchart of DMA transmission flow (OSP mode)
graph TD; StartTxDMA[Start Tx DMA] --> FetchNext[(Re-)fetch next descriptor from Tx Queue]; FetchNext --> OwnBitSet{Own bit set?}; OwnBitSet -- No --> EndRing{End of descriptor ring?}; OwnBitSet -- Yes --> TransferData[Transfer data from Buffer(s)]; TransferData --> PacketReadComplete{Packet read completely?}; PacketReadComplete -- No --> CloseDesc[Close intermediate descriptor]; PacketReadComplete -- Yes --> SecondPacket{Second packet?}; SecondPacket -- No --> EndRing; SecondPacket -- Yes --> WaitStatus[Wait for previous packet status]; WaitStatus --> TimestampPresent{Timestamp present?}; TimestampPresent -- No --> EndRing; TimestampPresent -- Yes --> WriteTimestamp[Write timestamp to TDES0 and TDES1]; WriteTimestamp --> WaitStatusWord[Wait status word to TDES3]; WaitStatusWord --> EndRing; EndRing -- No --> FetchNext; EndRing -- Yes --> TxDMAQueueSuspended[Tx DMA queue suspended]; TxDMAQueueSuspended --> PrevPacketStatus{Prev. packet status available?}; TxDMAQueueSuspended --> TxDemand{Tx Poll demand?}; PrevPacketStatus -- No --> DMAStopped{DMA Tx stopped?}; PrevPacketStatus -- Yes --> DMAStopped; TxDemand -- No --> DMAStopped; TxDemand -- Yes --> DMAStopped; DMAStopped -- No --> FetchNext; DMAStopped -- Yes --> StopDMA[Stop DMA]; CloseDesc --> FetchNext;

The flowchart illustrates the DMA transmission process in OSP mode. It begins with 'Start Tx DMA', followed by '(Re-)fetch next descriptor from Tx Queue'. A decision 'Own bit set?' follows; if 'No', it proceeds to 'End of descriptor ring?'; if 'Yes', it goes to 'Transfer data from Buffer(s)'. From 'Transfer data from Buffer(s)', a decision 'Packet read completely?' is made; if 'No', it goes to 'Close intermediate descriptor' and loops back to '(Re-)fetch next descriptor from Tx Queue'; if 'Yes', it asks 'Second packet?'. If 'No', it goes to 'End of descriptor ring?'; if 'Yes', it goes to 'Wait for previous packet status'. From 'Wait for previous packet status', it asks 'Timestamp present?'; if 'No', it goes to 'End of descriptor ring?'; if 'Yes', it goes to 'Write timestamp to TDES0 and TDES1', then 'Wait status word to TDES3', and finally 'End of descriptor ring?'. If 'End of descriptor ring?' is 'No', it loops back to '(Re-)fetch next descriptor from Tx Queue'; if 'Yes', it goes to 'Tx DMA queue suspended'. From 'Tx DMA queue suspended', it checks 'Prev. packet status available?' and 'Tx Poll demand?'. If both are 'No', it checks 'DMA Tx stopped?'; if 'Yes', it goes to 'Stop DMA'; if 'No', it loops back to '(Re-)fetch next descriptor from Tx Queue'. If either 'Prev. packet status available?' or 'Tx Poll demand?' is 'Yes', it goes directly to 'DMA Tx stopped?'.

Flowchart of DMA transmission flow (OSP mode)

MS40863V1

DMA reception

In the Receive path, the DMA reads a packet from the MTL receive queue and writes it to the packet data buffers of the corresponding DMA channel.

The reception sequence for Rx DMA engine is as follows (see also Figure 784: Receive DMA flow ):

  1. 1. The application sets up the Rx descriptors (RDES0-RDES3) and the Own bit (RDES3[31]). The application must set the correct value in the Receive descriptor tail pointer register of corresponding DMA channel.
  2. 2. When bit 0 of Channel receive control register (ETH_DMACRXCR) is set, the DMA enters the Run state. The DMA looks for free descriptors based on the Rx Current Descriptor and Descriptor tail pointer register values. If there are no free descriptors, the DMA channel enters the Suspend state and goes to step 11.
  3. 3. The DMA fetches the next available descriptor in the ring and decodes the receive data buffer address from acquired descriptors.
  4. 4. If IEEE 1588 timestamping is enabled and the timestamp is available for the previous packet, the DMA writes the timestamp (if available) to the RDES0 and RDES1 of current descriptor and sets the CTXT field (RDES3[30]).
  5. 5. The DMA processes the incoming packets and stores them in the data buffers of acquired descriptor.
  6. 6. If the current packet transfer is not complete, the DMA closes the current descriptor as intermediate and goes to step 10.
  7. 7. The DMA retrieves the status of the Receive frame from the MTL and writes the status word to current descriptor with the Own bit cleared and the Last descriptor bit set.
  8. 8. The DMA writes the Frame Length to RDES3 and the VLAN tag to RDES0. The DMA also writes the MAC control frame opcode, OAM control frame code, and extended status information (if available) to RDES1 of the last descriptor.
  9. 9. The DMA stores the timestamp (if available). The DMA writes the context descriptor after the last descriptor for the current packet (in the next available descriptor).
  10. 10. If more descriptors are available in the Rx DMA descriptor ring, go to step 3, otherwise go to the Suspend state (step 11).
  11. 11. The Receive DMA exits the Suspend state when a Receive Poll demand is given and the application increments the channel Receive tail pointer register. The engine proceeds to step 2 and fetches again the next descriptor.

Figure 784. Receive DMA flow

Flowchart of Receive DMA flow for Ethernet MAC with DMA controller.
graph TD; Start([Start]) --> Stop[Stop Rx DMA]; Stop --> StartRx[Start Rx DMA]; StartRx --> Fetch[(Re)Fetch next descriptor]; Fetch --> Poll{Receive Poll demand}; Poll --> Stopped{Rx DMA stopped?}; Stopped -- Yes --> Stop; Stopped -- No --> Own{Own bit set?}; Own -- No --> Suspend[Suspend Rx DMA]; Suspend --> Fetch; Own -- Yes --> Pending{Timestamp pending?}; Pending -- Yes --> WriteTS[Write timestamp to RDES0 and RDES1]; WriteTS --> Clear[Clear pending timestamp]; Pending -- No --> Data{Packet data available?}; Data -- No --> Wait[Wait for packet data]; Wait --> Write[Write data to buffer]; Data -- Yes --> Write; Write --> Complete{Packet transfer complete?}; Complete -- No --> CloseInt[Close RDES3 as intermediate descriptor]; CloseInt --> Fetch; Complete -- Yes --> TS{Timestamp present?}; TS -- Yes --> Set[Set pending timestamp]; TS -- No --> CloseLast[Close RDES3 as last descriptor]; Set --> CloseLast; CloseLast --> Stopped2{Rx DMA stopped?}; Stopped2 -- Yes --> Stop; Stopped2 -- No --> End{End of descriptor ring?}; End -- Yes --> CloseLast; End -- No --> Fetch;

The flowchart illustrates the Receive DMA process. It begins with 'Start Rx DMA', which leads to '(Re)Fetch next descriptor'. A 'Receive Poll demand' leads to a decision 'Rx DMA stopped?'. If 'Yes', it goes to 'Stop Rx DMA', which then leads to 'Start Rx DMA'. If 'No', it goes to 'Own bit set?'. If 'No', it goes to 'Suspend Rx DMA', which then loops back to '(Re)Fetch next descriptor'. If 'Yes', it goes to 'Timestamp pending?'. If 'Yes', it goes to 'Write timestamp to RDES0 and RDES1', then 'Clear pending timestamp', then 'Close RDES3 as last descriptor'. If 'No', it goes to 'Packet data available?'. If 'No', it goes to 'Wait for packet data', then 'Write data to buffer'. If 'Yes', it goes directly to 'Write data to buffer'. From 'Write data to buffer', it goes to 'Packet transfer complete?'. If 'No', it goes to 'Close RDES3 as intermediate descriptor', which then loops back to '(Re)Fetch next descriptor'. If 'Yes', it goes to 'Timestamp present?'. If 'Yes', it goes to 'Set pending timestamp', then 'Close RDES3 as last descriptor'. If 'No', it goes directly to 'Close RDES3 as last descriptor'. From 'Close RDES3 as last descriptor', it goes to 'Rx DMA stopped?'. If 'Yes', it goes to 'Stop Rx DMA', which then leads to 'Start Rx DMA'. If 'No', it goes to 'End of descriptor ring?'. If 'Yes', it loops back to 'Close RDES3 as last descriptor'. If 'No', it loops back to '(Re)Fetch next descriptor'.

Flowchart of Receive DMA flow for Ethernet MAC with DMA controller.

MS40864V1

Priority scheme for Tx DMA and Rx DMA

The DMA arbiter performs the arbitration between the Tx and Rx paths of DMA channel 0 to access descriptors and data buffers. The DMA arbiter supports two types of arbitration: fixed priority and weighted round-robin. The DA bit of the DMA mode register (ETH_DMAMR) specifies the arbitration scheme (fixed or weighted round-robin) between the Tx and Rx DMA of a given channel.

If the Tx DMA and Rx DMA of a given channel are enabled, the DMA which gets the bus when the channel gets control of the bus must be specified. The priority between the corresponding Tx DMA and Rx DMA can be configured through the TXPR field of the DMA mode register (ETH_DMAMR) . For round-robin arbitration, the weighted priority between the Tx DMA and Rx DMA is configured through the PR field of the DMA mode register (ETH_DMAMR) . Table 524 provides information about the priority scheme between Tx DMA and Rx DMA.

Table 524. Priority scheme for Tx DMA and Rx DMA

DMA mode register
(ETH_DMAMR)
Priority scheme
PR[2:0]TXPRDA
xxx01Rx always has priority over Tx
00000Tx and Rx have equal priority. Rx gets the access first on simultaneous requests.
00100Rx has priority over Tx in ratio 2:1.
01000Rx has priority over Tx in ratio 3:1.
01100Rx has priority over Tx in ratio 4:1.
10000Rx has priority over Tx in ratio 5:1.
10100Rx has priority over Tx in ratio 6:1.
11000Rx has priority over Tx in ratio 7:1.
11100Rx has priority over Tx in ratio 8:1.
xxx11Tx always has priority over Rx.
00010Tx and Rx have equal priority. Tx gets the access first on simultaneous requests.
00110Tx has priority over Rx in ratio 2:1.
01010Tx has priority over Rx in ratio 3:1.
01110Tx has priority over Rx in ratio 4:1.
10010Tx has priority over Rx in ratio 5:1.
10110Tx has priority over Rx in ratio 6:1.
11010Tx has priority over Rx in ratio 7:1.
11110Tx has priority over Rx in ratio 8:1.

58.4.2 MTL

The MAC Transaction Layer (MTL) provides the FIFO memory interface to buffer and regulate the packets between the application system memory and the MAC. It also enables the data to be transferred between the application clock and MAC clock domains. The MTL layer features two 32-bit wide data paths: the Transmit path and the Receive Path.

The application or internal DMA pushes the Ethernet packets read from the application or system memory into the Tx FIFO. The packet is then popped out and transferred to the MAC when the queue threshold is reached (threshold mode) or complete packet is in the queue (store-and-forward mode). When EOP is transferred, the status of the transmission is taken from the MAC and transferred back to the application or internal DMA. The Tx queue size is 2048 bytes.

The MTL Rx module receives the packets from the MAC and pushes them into the Rx queue. The status (fill level) of the queue is indicated to the application or to DMA when it crosses the configured Receive threshold (RTC bits[1:0] defined in Rx queue operating mode register (ETH_MTLRXQOMR) ), or when the complete packet was received. The MTL also indicates the queue fill level so that the DMA can initiate preconfigured burst transfers towards the master interface. The Rx queue size is 2048 bytes.

58.4.3 MAC

The MAC is responsible of the Ethernet protocol processing. In Transmission mode, it receives data from MTL before transferring it to the PHY interface. In Reception mode, the MAC receives data from the PHY interface before transferring them to the Rx FIFO of the MTL module.

This section briefly describes transmission and reception sequences.

MAC transmission

The transmission sequence is as follows:

  1. 1. Transmission is initiated when the MTL application pushes in data with the SOP (Start of packet) signal asserted.
  2. 2. When the SOP signal is detected, the MAC accepts the data and begins the transmission to the MII.
  3. 3. When the EOP (End of packet) is transferred to the MAC, the MAC does one of the following:
    • – The MAC completes the normal transmission and provides the transmission status to the MTL.
    • – If a normal collision (in Half-duplex mode) occurs during transmission, the MAC provides the Transmit status to the MTL, with the Retry bit set. The MAC provides the Retry request till one of the following is true:
      • the packet was successfully transmitted;
      • the maximum number of Retry requests expires. In this case, the MAC aborts the packet transmission with Excessive Collision Transmit status. The MAC accepts and drops all further data until the next SOP is received. The MTL block should retransmit the same packet from SOP when a Retry request (in the Status) is observed from the MAC.

Figure 785: Overview of MAC transmission flow illustrates the MAC transmission process flow.

Figure 785. Overview of MAC transmission flow

Flowchart of MAC transmission flow
graph TD; Start([Start]) --> WaitData[Wait for data & SOP From MTL]; WaitData --> SOPAsserted{SOP asserted by MTL?}; SOPAsserted -- YES --> WaitIPG[Wait for IPG/any back-off delay hal-duplex]; SOPAsserted -- NO --> WaitData; WaitIPG --> Transmit[Transmit preamble+SFD+Data received from the MTL to the PHY]; Transmit --> NoCarrier{No carrier/Carrier loss/Excessive defer/Late collisions/Jabber?}; NoCarrier -- YES --> DropData1[Drop all the data received from MTL and abort transmission]; NoCarrier -- NO --> Collision{Collision}; Collision -- YES --> SendStatus[Send status to MTL with Retry bit set]; SendStatus --> ConditionD{Condition D: Retry_count ≤ retry_limit}; ConditionD -- YES --> WaitData; ConditionD -- NO --> DropData2[Drop all the data received from MTL and abort transmission]; Collision -- NO --> A_EOP{A. EOP asserted by MTL? B. Underflow asserted by MAC?}; A_EOP -- Condition A --> NormalTrans[Normal transmission completed and Transmission status conveyed to MTL]; A_EOP -- Condition B --> DropData2; NormalTrans --> WaitData; DropData1 --> WaitData; DropData2 --> WaitData;

The flowchart illustrates the MAC transmission process. It begins with 'Start', leading to 'Wait for data & SOP From MTL'. A decision 'SOP asserted by MTL?' follows; if 'YES', it proceeds to 'Wait for IPG/any back-off delay (hal-duplex)', then 'Transmit preamble+SFD+Data received from the MTL to the PHY'. If 'NO', it loops back to 'Wait for data & SOP From MTL'. After transmission, a decision 'No carrier/Carrier loss/Excessive defer/Late collisions/Jabber?' is made; if 'YES', data is dropped and transmission aborted, looping back to 'Wait for data & SOP From MTL'. If 'NO', a 'Collision' decision is made. If 'YES', status is sent to MTL with Retry bit set, then 'Condition D: Retry_count ≤ retry_limit' is checked; if 'YES', it loops back to 'Wait for data & SOP From MTL', otherwise data is dropped. If 'NO', a decision 'A. EOP asserted by MTL? B. Underflow asserted by MAC?' is made; if 'Condition A' is met, transmission is normal and status is conveyed to MTL, then loops back to 'Wait for data & SOP From MTL'; if 'Condition B' is met, data is dropped.

Flowchart of MAC transmission flow

MSv40390V1

MAC reception

A receive operation is initiated when the MAC detects an SFD on MII. The MAC strips the preamble and SFD before proceeding to process the packet. The header fields are checked for filtering and the FCS field used to verify the CRC for the packet. The received packet is stored in a shallow buffer until the address filtering is performed. The packet is dropped in the MAC if it fails the address filter.

The reception sequence is as follows:

  1. 1. When the receive data valid signal (RxDV) of MII becomes active, the Receive State Machine (RSM) starts looking for the SFD field (0xD nibble).

The state machine drops received packets until it detects SFD.

  1. 2. When SFD is detected, the state machine starts sending the data of Ethernet packet to the RPC module, beginning with the first byte following the SFD (destination address).
  2. 3. If IEEE 1588 timestamp feature is enabled, the MAC takes a snapshot of the system time at which SFD of any packet is detected on MII. If this packet is not dropped during MAC filtering, the timestamp is passed to the application. The MAC converts the received nibble data into bytes and forwards the valid packet data to the RFC module.
  3. 4. The Receive State Machine decodes the Length/Type field of the Ethernet packet being received.

If the Length/Type field is less than 1,536 and if the MAC is programmed for the Auto CRC/Pad Stripping (bit 20 of the Operating mode configuration register (ETH_MACCR) ), the state machine sends the packet data up to the count specified in the Length/Type field and starts dropping bytes (including the FCS field). The state machine decodes the Length/Type field and checks for the Length interpretation.

  1. 5. If the Length/Type field is greater than or equal to 1,536, the RPE module sends all received Ethernet packet data to the RFC module if you have not enabled the CRC stripping for Type packet in Bit 21 of the Operating mode configuration register (ETH_MACCR) . However, if the CRC stripping has been enabled for Type packets and not enabled the Receive Checksum Offload Engine, the MAC strips and drops the last 4 bytes of all packets of ether type before forwarding the packets to the application.
  2. 6. By default, the MAC is programmed for watchdog timer to be enabled, that is, packets above 2,048 (10,240 if Jumbo Packet is enabled) bytes (DA + SA + LT + DATA + PAD + FCS) are cut off at the RPE module. In addition, you can use a programmable watchdog timer (bit 16 of Watchdog timeout register (ETH_MACWTR) ) to override the fixed timeout of 2,048 or 10,240 bytes. You can disable the watchdog timer by programming bit 19 of Operating mode configuration register (ETH_MACCR) . However, even if the watchdog timer is disabled, a packet greater than 32 Kbytes is cut off and a watchdog timeout status is given.

Figure 786. MAC reception flow

Flowchart of MAC reception flow
graph TD; Start([Start]) --> WaitPhy[Wait for phy_rxdv_i from GMII/MII]; WaitPhy --> WaitSFD[Wait until SFD is detected]; WaitSFD --> StartSend[Start sending the received Ethernet packet to the application layer, starting from DA field]; StartSend --> IEEE1588{IEEE 1588 timestamp feature enabled?}; IEEE1588 -- YES --> StoreTime[Store the snapshot of the system time when SFD detected]; IEEE1588 -- NO --> LengthType{Length/Type field <1536 & Auto CRC/Pad stripping enabled?}; StoreTime --> LengthType; LengthType -- NO --> LengthTypeGE1536[Length/Type field ≥1536]; LengthType -- NO --> SendOnly[Send only the number of bytes (specified in the Length field) of the received Ethernet packet to RFC. Drop extra padding and FCS field]; LengthTypeGE1536 --> CRCStripping{CRC stripping for Type packets enabled?}; CRCStripping -- YES --> ChecksumOffload{Receive checksum Offload engine enabled?}; CRCStripping -- NO --> SendAll[Send all received Ethernet packet data to RFC]; ChecksumOffload -- YES --> DropLast4[Drop the last 4 bytes of all Ether type packets and send the remaining bytes to RFC]; ChecksumOffload -- NO --> DropLast4; SendOnly --> CRCError{CRC error? OR Packet to be filtered?}; SendAll --> CRCError; DropLast4 --> CRCError; CRCError -- NO --> SendPacket[Send the packet, timestamp and Status to the Application layer]; CRCError -- YES --> DropPacket[Drop the packet and send the Status to the Application layer]; DropPacket --> Start;

The flowchart illustrates the MAC reception process. It begins with 'Start', followed by waiting for the physical receive data valid signal (phy_rxdv_i) from the GMII/MII interface. Once detected, it waits for the Start Frame Delimiter (SFD). The process then starts sending the received Ethernet packet to the application layer, beginning from the Destination Address (DA) field. A decision is made regarding the IEEE 1588 timestamp feature. If enabled, a snapshot of the system time is stored when the SFD is detected. Next, a decision is made regarding the Length/Type field and Auto CRC/Pad stripping. If the Length/Type field is less than 1536 and Auto CRC/Pad stripping is enabled, only the specified number of bytes are sent to the RFC, with extra padding and the FCS field dropped. If the Length/Type field is greater than or equal to 1536, a decision is made regarding CRC stripping for Type packets. If CRC stripping is enabled, another decision is made regarding the Receive checksum Offload engine. If the offload engine is enabled, the last 4 bytes of all Ether type packets are dropped, and the remaining bytes are sent to the RFC. If the offload engine is not enabled, all received Ethernet packet data is sent to the RFC. Finally, a decision is made regarding CRC errors or packets to be filtered. If there is a CRC error or the packet is to be filtered, the packet is dropped, and the Status is sent to the Application layer. Otherwise, the packet, timestamp, and Status are sent to the Application layer, and the process loops back to the initial waiting state.

Flowchart of MAC reception flow

MSV40391V1

58.5 )Ethernet functional description: MAC

58.5.1 Double VLAN processing

The Ethernet peripheral supports the double VLAN (Virtual LAN) tagging feature in which the MAC can process up to two VLAN tags (inner and outer).

The MAC supports the following:

Transmit path

Table 525: Double VLAN processing features in Tx path describes the features supported by the MAC on the Transmit side.

Table 525. Double VLAN processing features in Tx path

FeatureDescription
Support for C-VLAN and S-VLAN Tag types

The inner or outer VLAN tag can be of C-VLAN and S-VLAN type. The VLAN type is specified through the CSVL bit of VLAN inclusion register (ETH_MACVIR) and Inner VLAN inclusion register (ETH_MACIVIR) , respectively.

The Ethernet peripheral supports processing of any sequence of outer and inner VLAN tags. However, it does not support the C-VLAN S-VLAN sequence.

The MAC does not check whether the packet provided by the application has a valid sequence of the VLAN Tag types or the insertion or replacement operation results in invalid sequence of VLAN Tag type. Therefore, the application must provide correct sequence of VLAN Tag types and program the MAC in such a way that it results in correct sequence of VLAN Tag types in the transmitted packet. The application must ensure the following:

  • – The inner tag should not be S-VLAN when outer C-VLAN Tag insertion is enabled.
  • – The outer tag should not be C-VLAN when inner S-VLAN Tag insertion is enabled.
  • – The inner tag should not be S-VLAN when outer tag should be replaced with C-VLAN.
  • – The outer tag should not be C-VLAN when inner tag should be replaced with S-VLAN.
VLAN Tag deletion

VLAN tag deletion can be enabled for outer or inner tag through VLC field in the VLAN inclusion register (ETH_MACVIR) or Inner VLAN inclusion register (ETH_MACIVIR) , respectively. When VLAN deletion is enabled, the MAC deletes the tag present at the corresponding position. When a packet has only one tag, it is considered as the outer tag. If inner tag deletion is enabled and the packet has only one tag, the MAC does not delete the tag.

VLAN Tag Insertion or Replacement

VLAN tag insertion or replacement can be enabled for outer or inner tag through VLC field in the VLAN inclusion register (ETH_MACVIR) or Inner VLAN inclusion register (ETH_MACIVIR) , respectively. When VLAN tag insertion or replacement is enabled, the VLTI bit in the previous register is used to determine whether the VLAN tag should be taken from the register or the control word.

Receive path

Table 526: Double VLAN processing in Rx path describes the features supported by the MAC on the Receive side and the corresponding bits in the VLAN tag register (ETH_MACVTR) .

Table 526. Double VLAN processing in Rx path

FeatureDescription
Outer or inner VLAN tag-based filteringThe MAC can filter packets based on the outer or inner VLAN tag through the ERIVLT bit.
C-VLAN or S-VLAN tag-based filteringThe MAC can filter packets based on the C-VLAN or S-VLAN type based on the ERSVLM bit.
Outer and Inner VLAN Tag strippingThe MAC can strip the outer and inner VLAN Tags from received frame based on the EVLS and EIVLS bits.
16-bit outer and inner VLAN Tag and Type in Rx statusThe MAC can provide the 16-bit outer and inner VLAN Tag and Type in the Rx status based on the EVLRXS and EIVLRXS bits, respectively.
Disabling or skipping checking of outer VLAN Tag typeThe MAC can disable or skip checking of outer VLAN Tag type to match C-VLAN or S-VLAN based on the DOVLTC bit.

58.5.2 Source address and VLAN insertion, replacement, or deletion

Source address insertion or replacement

The software can use the SA (source address) insertion or replacement feature to instruct the MAC to do the following for Tx packets:

When SA insertion is enabled, the application must ensure that the packets sent to the MAC do not have the SA field. The MAC does not check whether the SA field is present in the Transmit packet and it inserts the content of MAC Address Registers in the SA field. Similarly, when SA replacement is enabled, the application must ensure that the SA field is present in the packets sent to the MAC. The MAC replaces the six bytes following the Destination Address field in the Transmit packet with the content of the MAC Address Registers.

SA insertion or replacement feature can be enabled for all Transmit packets or selective packets:

replacement by MAC Address1 registers. When bit 25 of TDES3 is reset, it indicates insertion or replacement by MAC Address 0 registers.

If MAC Address1 registers are not enabled, the MAC Address0 registers are used for insertion or replacement whatever of the value of the most-significant bit of the SA Insertion Control field.

VLAN insertion, replacement, or deletion

The software can use the VLAN insertion, replacement, or deletion feature to instruct the MAC to do the following for Tx packets:

Insertion or replacement is performed based on the setting of VLTi bit in the VLAN inclusion register (ETH_MACVIR) as described in Table 527: VLAN insertion or replacement based on VLTi bit .

Table 527. VLAN insertion or replacement based on VLTi bit

ConditionDescription
VLTi bit is setThe MAC inserts or replaces the following:
VLAN Type field (C-VLAN or S-VLAN as indicated by the CSVL bit of VLAN inclusion register (ETH_MACVIR) )
VLAN Tag field with VT field of Transmit context descriptor of the packet
VLTi bit is resetThe MAC inserts or replaces the following:
VLAN Type field (C-VLAN or S-VLAN as indicated by the CSVL bit of VLAN inclusion register (ETH_MACVIR) )
VLAN Tag field with the VLT field of VLAN inclusion register (ETH_MACVIR)

When VLAN replacement or deletion is enabled, the MAC checks if the VLAN Type field (0x8100 or 0x88A8) is present after the DA and SA fields in the Transmit packet. The replace or delete operation does not occur if the VLAN Type field is not detected in two bytes following the DA and SA fields. However, when VLAN insertion is enabled, the MAC does not check the presence of VLAN Type field in the Transmit packet and just inserts the VLAN Type and VLAN Tag fields.

You can enable the VLAN insertion, replacement, or deletion feature for all Tx packets or selective packets:

In addition, the VLP (VLAN Priority control) bit must be reset in VLAN inclusion register (ETH_MACVIR) (for outer VLAN) and Inner VLAN inclusion register (ETH_MACVIR) (in inner VLAN) for the MAC to take the control inputs from the host, depending on the configuration.

58.5.3 Packet filtering

The MAC supports the following types of filtering for Rx packets:

The three filter types can be cascaded. Figure 787 shows the filtering sequence for Rx packets.

Figure 787. Packet filtering sequence

Flowchart of packet filtering sequence showing four stages: Ethernet DA or SA Filter (Layer 2), VLAN Filter (Layer 2), IP SA or DA Filter (Layer 3), and TCP or UDP SP or DP Filter (Layer 4). Each stage has 'Fail' and 'Pass' paths. 'Fail' paths lead to 'Discard Packet' or 'Deliver to the Host'. 'Pass' paths lead to the next filter or 'Deliver to the Host'.
graph TD; A[Receive Packet] --> B[Ethernet DA or SA Filter]; B -- Fail --> D[Discard Packet]; B -- Pass --> C[VLAN Filter]; C -- Fail --> D; C -- Pass --> E[IP SA or DA Filter]; E -- Fail --> D; E -- Pass --> F[TCP or UDP SP or DP Filter]; F -- Fail --> D; F -- Pass --> G[Deliver to the Host];

The diagram illustrates the packet filtering sequence for Rx packets. It starts with 'Receive Packet' at the top. The first filter is 'Ethernet DA or SA Filter' (Layer 2). If it fails, the packet is discarded. If it passes, it goes to the 'VLAN Filter' (Layer 2). If the VLAN filter fails, the packet is discarded. If it passes, it goes to the 'IP SA or DA Filter' (Layer 3). If the IP filter fails, the packet is discarded. If it passes, it goes to the 'TCP or UDP SP or DP Filter' (Layer 4). If the TCP/UDP filter fails, the packet is discarded. If it passes, the packet is delivered to the host. A vertical line on the left side of the filters indicates that any 'Fail' path leads to 'Discard Packet'. A vertical line on the right side indicates that any 'Pass' path leads to the next filter or 'Deliver to the Host'.

Flowchart of packet filtering sequence showing four stages: Ethernet DA or SA Filter (Layer 2), VLAN Filter (Layer 2), IP SA or DA Filter (Layer 3), and TCP or UDP SP or DP Filter (Layer 4). Each stage has 'Fail' and 'Pass' paths. 'Fail' paths lead to 'Discard Packet' or 'Deliver to the Host'. 'Pass' paths lead to the next filter or 'Deliver to the Host'.

MSv40800V1

The sequence shown in Figure 787 is valid when all the filters (L2, VLAN, L3, L4) are active. If any of the Layer filters are not enabled, that filter is bypassed and the subsequent filter is applied. A packet that fails any of the filters is discarded. However, the discarded packet can be forwarded to the host based on the register control.

For example, when RA bit of Packet filtering control register (ETH_MACPFR) is set to 1, all the discarded packets are forwarded to the host but with their packet status indicating the

specific filter failure. If RA bit is cleared to 0, VTFE and IPFE bits of Packet filtering control register (ETH_MACPFR) control if the packets that fail the VLAN filter and Layer 3-4 filter should be discarded or forwarded to the host.

MAC source or destination address filtering

The MAC address filtering module checks the source address (SA) and destination address (DA) fields of each incoming packet.

Unicast destination address filtering

The MAC supports 4 MAC addresses for unicast perfect filtering. If perfect filtering is selected (HUC bit of Packet filtering control register (ETH_MACPFR) is reset), the MAC compares all 48 bits of received unicast address with the programmed MAC address for any match. The default MacAddr0 is always enabled.

The MacAddr1 to MacAddr3 addresses are selected with an individual enable bit. You can mask each byte during comparison with corresponding received DA byte by setting the corresponding Mask Byte Control bit in MAC Address x high register (ETH_MACAxHR) . This enables group address filtering for the DA.

In Hash filtering mode (when HUC bit is set), the MAC performs imperfect filtering for unicast addresses using a 64-bit Hash table. For Hash filtering, the MAC uses the upper 6 bits CRC of the received destination address to index the content of the Hash table. A value of 00000 selects bit 0 of selected register, and a value of 11111 selects bit 63 of Hash Table register. If the corresponding bit (indicated by the 6-bit CRC) is set to 1, the unicast packet is considered to have passed the Hash filter; otherwise, the packet is considered to have failed the Hash filter.

Multicast destination address filtering

To program the MAC to pass all multicast packets, set the PM bit in Packet filtering control register (ETH_MACPFR) . If the PM bit is reset, the MAC performs the filtering for multicast addresses based on the HMC bit of the Packet filtering control register (ETH_MACPFR) .

In Perfect filtering mode, the multicast address is compared with the programmed MAC destination address registers. Group address filtering is also supported.

In Hash filtering mode, the MAC performs imperfect filtering using a 64-bit Hash table. The MAC uses the upper 6-bits CRC of received multicast address to index the content of the Hash table. A value of 000000 selects bit 0 of selected register and a value of 111111 selects bit 63 of the Hash Table register. If the corresponding bit is set to 1, the multicast packet is considered to have passed the Hash filter. Otherwise, the packet is considered to have failed the Hash filter.

Hash or Perfect address filtering

To configure the DA filter to pass a packet when its DA matches either the Hash filter or the Perfect filter, set the HPF bit and the corresponding HUC or HMC bits in Packet filtering control register (ETH_MACPFR) . This is applicable to both unicast and multicast packets. If the HPF bit is reset, only one of the filters (Hash or Perfect) is applied to receive packet.

Broadcast address filtering

The MAC does not filter any broadcast packets by default. To program the MAC to reject all broadcast packets, set the DBF bit in Packet filtering control register (ETH_MACPFR) .

Unicast source address filtering

The MAC can perform perfect filtering based on the source address field of received packets. By default, the MAC compares the SA field with the values programmed in the SA registers. You can configure the MAC Address registers to use SA instead of DA for comparison by setting bit 30 of MAC Address x high register (ETH_MACAxHR) .

The MAC also supports group filtering with SA. You can filter a group of addresses by masking one or more bytes of the address. The MAC drops the packets that fail the SA filter if the SAF bit is set in Packet filtering control register (ETH_MACPFR) . Otherwise, the result of the SA filter is given as a status bit in the Receive Status word (see Table 529 ). When the SAF bit is set, the SA filter and DA filter result is ANDed to decide whether the packet needs to be forwarded. This means that the packet is dropped if either filter fails. The packet is forwarded to the application only if the packet passes both filters in-order.

Inverse filtering

For DA and SA filtering, you can invert the filter-match result at the final output by setting the DAIF and SAIF bits of Packet filtering control register (ETH_MACPFR) . The DAIF bit is applicable for both Unicast and Multicast DA packets. The result of the unicast or multicast destination address filter is inverted in this mode. Similarly, when the SAIF bit is set, the result of unicast SA filter is reversed.

Table 528 and Table 529 summarize the DA and SA filtering based on the type of packets received.

Note: When the RA bit of Packet filtering control register (ETH_MACPFR) is set, all packets are forwarded to the system along with the correct result of the address filtering in the Rx status.

Table 528. Destination address filtering

Packet typePRHPFHUCDAIFHMCPMDBFDA filter operation
Broadcast1XXXXXXPass
0XXXXX0Pass
0XXXXX1Fail
Unicast1XXXXXXPass all packets
0X00XXXPass on Perfect/Group filter match
0X01XXXFail on Perfect/Group filter match
0010XXXPass on Hash filter match
0011XXXFail on Hash filter match
0110XXXPass on Hash or Perfect/Group filter match
0111XXXFail on Hash or Perfect/Group filter match
Multicast1XXXXXXPass all packets
XXXXX1XPass all packets
0XX000XPass on Perfect/Group filter match and drop Pause packets if PCF = 0x
00X010XPass on Hash filter match and drop Pause packets if PCF = 0x
01X010XPass on Hash or Perfect/Group filter match and drop Pause packets if PCF = 0x

Table 528. Destination address filtering (continued)

Packet typePRHPFHUCDAIFHMCPMDBFDA filter operation
Multicast0XX100XFail on Perfect/Group filter match and drop Pause packets if PCF = 0x
00X110XFail on Hash filter match and drop Pause packets if PCF = 0x
01X110XFail on Hash or Perfect/Group filter match and drop Pause packets if PCF = 0x

Table 529. Source address filtering

Packet typePRSAIFSAFSA filter operation
Unicast1XXPass all packets.
000Pass status on Perfect or Group filter match but do not drop packets that fail
010Fail status on Perfect or Group filter match but do not drop packet
001Pass on Perfect or Group filter match and drop packets that fail
011Fail on Perfect or Group filter match and drop packets that fail

VLAN filtering

The MAC supports Perfect and Hash VLAN filtering. Refer to Section 58.9.14: Programming guidelines to perform VLAN filtering on the receive for detailed programming steps.

VLAN tag Perfect filtering

In VLAN tag Perfect filtering, the MAC compares the VLAN tag of received packet and provides the VLAN packet status to the application. Based on the programmed mode, the MAC compares the lower 12 bits or all 16 bits of received VLAN tag to determine the perfect match.

If VLAN tag Perfect filtering is enabled, the MAC forwards the VLAN-tagged packets along with VLAN tag match status and drops the VLAN packets that do not match. You can also enable the inverse matching for VLAN packets by setting the VTIM bit of VLAN tag register (ETH_MACVTR) . In addition, you can enable matching of S-VLAN tagged packets along with the default C-VLAN tagged packets by setting the ESVL bit of VLAN tag register (ETH_MACVTR) . The VLAN packet status bit(bit 10 of RDES0) indicates the VLAN tag match status for the matched packets.

Note: The source or destination address (if enabled) has precedence over the VLAN tag filters. This means that a packet that fails the source or destination address filter is dropped irrespective of the VLAN tag filter results.

VLAN tag Hash filtering

The 16-bit VLAN Hash Table is used for group address filtering based on the VLAN tag. The VLAN tag Hash filtering feature can be enabled using the VTHM (VLAN tag Hash Table match enable) bit of the VLAN tag register (ETH_MACVTR) . If the VTHM bit is set, the most significant four bits of CRC-32 of VLAN tag are used to index the content of the VLAN Hash Table register. A value of 1 in the VLAN Hash Table register, corresponding to the index, indicates that the VLAN tag of the packet matched and the packet should be forwarded. A value of 0 indicates that VLAN-tagged packet should be dropped.

Note: The 16 or 12 bits of VLAN Tag are considered for CRC-32 computation based on ETV bit in ETH_MACVTR register.

When ETV bit is reset, most significant four bits of CRC-32 of VLAN Tag are inverted and used to index the content of VLAN Hash table register (ETH_MACVHTR) .

When ETV bit is set, most significant four bits of CRC-32 of VLAN Tag are directly used to index the content of VLAN tag register (ETH_MACVTR) .

The MAC also supports the inverse matching for VLAN packets. In the inverse matching mode, when the VLAN tag of a packet matches the Perfect or Hash filter, the packet should be dropped. If the VLAN perfect and VLAN Hash match are enabled, a packet is considered as matched if either the VLAN Hash or the VLAN perfect filter matches. When inverse match is set, a packet is forwarded only when both perfect and Hash filters indicate mismatch.

Table 530 shows the different possibilities for VLAN matching and the final VLAN match status. When the RA bit of Packet filtering control register (ETH_MACPFR) is set, all packets are received and the VLAN match status is indicated in the VF bit of RDES2 normal descriptor (write-back format) . When the RA bit is not set and the VTTFE bit is set in Packet filtering control register (ETH_MACPFR) , the packet is dropped if the final VLAN match status is Fail. In Table 530 , value X means that this column can have any value.

When VLAN VID is programmed to 0 in the VL field of VLAN tag register (ETH_MACVTR) , all VLAN-tagged packets are considered as perfect matched but the status of the VLAN Hash match depends on the VTHM and VTIM bits in VLAN tag register (ETH_MACVTR) .

Table 530. VLAN match status (1)

VIDVLAN perfect filter match resultVTHM BitVLAN Hash filter match resultVTIM bitFinal VLAN match status
VID = 0Pass0XXPass
Pass1X0Pass
Pass1Fail1Pass
Pass1Pass1Fail
VID != 0PassXX0Pass
Fail0X0Fail
Fail1Fail0Fail
Fail1Pass0Pass
Fail0X1Pass
PassXX1Fail
Fail1Pass1Fail
Fail1Fail1Pass

1. In this table, 'X' represents any value.

Layer 3 and Layer 4 filtering

The MAC supports Layer 3 and Layer 4 based packet filtering. The Layer 3 filtering refers to the IP Source or Destination Address filtering in the IPv4 or IPv6 packets whereas Layer 4 filtering refers to the Source or Destination Port number filtering in TCP or UDP.

The Layer 3 and Layer 4 packet filtering feature automatically enables the IPC Full Checksum Offload Engine on the Receive side. For Layer 3 or Layer 4 filtering operation, you must set the IPC bit of the Operating mode configuration register (ETH_MACCR) to enable the Rx Checksum Offload engine.

When Layer 3 and Layer 4 filtering is enabled, the packets are filtered in the following way:

The MAC forwards the packets that match all enabled fields to the application along with the status. The MAC gives the matched field status only if the IPC bit of Operating mode configuration register (ETH_MACCR) is set and one of the following conditions is true:

When multiple Layer 3 and Layer 4 filters are enabled, any filter match is considered as a match. If more than one filter matches, the MAC provides the status of the lowest filter where Filter 0 is the lowest filter and Filter 3 is the highest filter. For example, if Filter 0 and Filter 1 match, the MAC gives the status corresponding to filter 0.

Note: The source or destination address and VLAN tag filters (if enabled) have precedence over Layer 3 and Layer 4 filter. This means that a packet which fails the source or destination address or VLAN tag filter is dropped irrespective of the Layer 3 and Layer 4 filter results.

The MAC drops the packets that do not match any of the enabled fields. You can use the inverse match feature to block or drop a packet with specific TCP or UDP over IP fields and forward all other packets. The aborted or partial packets are dropped in the MTL Rx FIFO. If the Rx FIFO operates in the Threshold (cut-through) mode and the threshold is programmed to a small value. Such packet transfer to the application starts before the failed Layer 3 and Layer 4 filter results are available, the application may receive a partial packet with appropriate abort status.

By default, all non-TCP or UDP IP packets are bypassed from the Layer 3 and Layer 4 filters. You can optionally program the MAC to drop all non-TCP or UDP over IP packets.

Layer 3 filtering

The MAC supports perfect matching or inverse matching for IP Source Address and Destination Address. In addition, you can match the complete IP address or mask the lower bits matching, that is, compare all bits of the address except the specified lower mask bits.

For IPv6 packets filtering, you can enable the last four data registers of a register set to contain the 128-bit IP Source Address or IP Destination Address. The IP Source Address or Destination Address should be programmed in the order defined in the IPv6 specification, that is, the first byte of the IP Source Address or Destination Address in the received packet is in the higher byte of the register and the subsequent registers follow the same order.

For IPv4 packet filtering, you can enable the second and third data registers of a register set to contain the 32-bit IP Source Address and IP Destination Address. The remaining two data registers are reserved. The IP Source Address or Destination Address should be programmed in the order defined in the IPv4 specification, that is, the first byte of IP Source Address and Destination Address in the received packet in the higher byte of the respective register.

Layer 4 filtering

The MAC supports perfect matching or inverse matching for TCP or UDP Source and Destination Port numbers. However, you can program only one type (TCP or UDP) at a time. The first data register contains the 16-bit Source and Destination Port numbers of TCP or UDP, that is, the lower 16 bits for Source Port number and higher 16 bits for Destination Port number.

The TCP or UDP Source and Destination Port numbers should be programmed in the order defined in the TCP or UDP specification, that is, the first byte of TCP or UDP Source and Destination Port number in the received packet is in the higher byte of the register.

Layer 3 and Layer 4 filters register set

The MAC implements two sets of registers for Layer 3 and Layer 4 based packet filtering. In a register set, there is a control register, such as L3 and L4 control 0 register (ETH_MACL3L4C0R) , to control the packet filtering. In addition, there are five address registers to program the Layer 3 and Layer 4 fields to be matched, such as:

The second, and independent set of registers are: L3 and L4 control 1 register (ETH_MACL3L4C1R) , Layer 4 address filter 1 register (ETH_MACL4A1R) , Layer3 address 0 filter 1 Register (ETH_MACL3A01R) , Layer3 address 1 filter 1 register (ETH_MACL3A11R) , Layer3 address 2 filter 1 Register (ETH_MACL3A21R) and Layer3 address 3 filter 1 register (ETH_MACL3A31R) .

58.5.4 IEEE 1588 timestamp support

The IEEE 1588 standard defines a precision time protocol (PTP) which allows precise synchronization of clocks in measurement and control systems implemented with technologies such as network communication, local computing, and distributed objects. The PTP applies to systems communicating by local area networks supporting multicast messaging, including (but not limited to) Ethernet. This protocol enables heterogeneous systems that include clocks of varying inherent precision, resolution, and stability to synchronize. The protocol supports system-wide synchronization accuracy in the submicrosecond range with minimal network and local clock computing resources.

This chapter contains the following sections:

IEEE 1588 timestamp support

The Ethernet peripheral supports the IEEE 1588-2002 (version 1) and IEEE 1588-2008 (version 2). The IEEE 1588-2002 supports PTP transported over UDP/IP. The IEEE 1588 2008 supports PTP transported over Ethernet. The peripheral provides programmable support for both standards. It supports the following features:

Clock types

The MAC supports the following clock types defined in the IEEE 1588-2008 specifications:

The ordinary clock of a domain supports a single copy of the protocol. It has a single PTP state and a single physical port. In typical industrial automation applications, an ordinary clock is associated with an application device such as a sensor or an actuator. In telecom applications, the ordinary clock can be associated with a timing demarcation device.

The ordinary clock can be a grandmaster or a slave clock. It supports the following features:

The table below shows the messages for which you can take the timestamp snapshot on the receive side for master and slave nodes.

Table 531. Ordinary clock: PTP messages for snapshot

MasterSlave
Delay_ReqSYNC

For an ordinary clock, you can take the snapshot of either of the following PTP message types: version 1 or version 2. You cannot take the snapshots for both PTP message types. You can take the snapshot by setting the TSVER2ENA bit and selecting the snapshot mode in Timestamp control Register (ETH_MACTSCR) .

The boundary clock typically has several physical ports which communicate with the network. The messages related to synchronization, master-slave hierarchy, and

signaling end in the protocol engine of the boundary clock. Such messages are not forwarded. The PTP message type status given by the MAC helps to identify the type of message and take appropriate action.

The boundary clock is similar to the ordinary clock except for the following features:

The end-to-end transparent clock supports the end-to-end delay measurement mechanism between the slave clocks and the master clock. The end-to-end transparent clock forwards all messages like normal bridge, router, or repeater. The residence time of a PTP packet is the time taken by the PTP packet from the Ingress port to the Egress port.

The residence time of a SYNC packet inside the end-to-end transparent clock is updated in the correction field of the associated Follow_Up PTP packet before it is transmitted. Similarly, the residence time of a Delay_Req packet, inside the end-to-end transparent clock, is updated in the correction field of the associated Delay_Resp PTP packet before it is transmitted. Therefore, the snapshot needs to be taken at both Ingress and Egress ports only for the messages mentioned in Table 532 . You can take the snapshot by setting the SNAPTYPESEL bits to 10 in the Timestamp control Register (ETH_MACTSCR) .

Table 532. End-to-end transparent clock: PTP messages for snapshot

PTP messages
SYNC
Delay_Req

In the peer-to-peer transparent clock, the computation of the link delay is based on an exchange of Pdelay_Req, Pdelay_Resp, and Pdelay_Resp_Follow_Up messages with the link peer.

The peer-to-peer transparent clock differs from the end-to-end transparent clock in the way it corrects and handles the PTP timing messages. In all other aspects, it is identical to the end-to-end transparent clock.

The residence time of the Pdelay_Req and the associated Pdelay_Resp packets is added and inserted into the correction field of the associated Pdelay_Resp_Followup packet. Therefore, support for taking snapshot for the event messages related to Pdelay is added as shown in Table 540 .

Table 533. Peer-to-peer transparent clock: PTP messages for snapshot
PTP messages
SYNC
Pdelay_Req
Pdelay_Resp

You can take the snapshot by setting the SNAPTYPESEL bit to 11 in Timestamp control Register (ETH_MACTSCR) .

Delay request-response mechanism

The system or network is classified into the master and slave nodes for distributing the timing and clock information. Figure 788 shows the process that PTP uses for synchronizing a slave node with a master node by exchanging PTP messages.

Figure 788. Networked time synchronization Figure 788: Networked time synchronization diagram showing the exchange of PTP messages between a Master and a Slave to synchronize their clocks. The diagram plots time on the vertical axis for both Master and Slave. 1. At time t1, the Master sends a 'Sync message' to the Slave. 2. The Slave receives it at time t2 and captures this time. 3. The Master then sends a 'Follow_up message containing value of t1' to the Slave. 4. The Slave receives this at time t3 and now knows t1 and t2. 5. The Slave sends a 'Delay_Req message' to the Master at time t3. 6. The Master receives it at time t4 and captures this time. 7. The Master sends a 'Delay_Resp message containing value of t4' back to the Slave. 8. The Slave receives it and now has t1, t2, t3, and t4. A dashed box on the Slave's side labeled 'Data at slave clock' shows the accumulation of these timestamps over time. Vertical arrows at the bottom indicate the passage of time for both Master and Slave.
Figure 788: Networked time synchronization diagram showing the exchange of PTP messages between a Master and a Slave to synchronize their clocks. The diagram plots time on the vertical axis for both Master and Slave. 1. At time t1, the Master sends a 'Sync message' to the Slave. 2. The Slave receives it at time t2 and captures this time. 3. The Master then sends a 'Follow_up message containing value of t1' to the Slave. 4. The Slave receives this at time t3 and now knows t1 and t2. 5. The Slave sends a 'Delay_Req message' to the Master at time t3. 6. The Master receives it at time t4 and captures this time. 7. The Master sends a 'Delay_Resp message containing value of t4' back to the Slave. 8. The Slave receives it and now has t1, t2, t3, and t4. A dashed box on the Slave's side labeled 'Data at slave clock' shows the accumulation of these timestamps over time. Vertical arrows at the bottom indicate the passage of time for both Master and Slave.

As shown in Figure 788 , the PTP uses the following process:

  1. 1. The master broadcasts the PTP Sync messages to all its nodes. The Sync message contains the reference time information of the master. This message leaves the system of the master at \( t_1 \) . This time must be captured for Ethernet ports at MII.
  2. 2. The slave receives the SYNC message and also captures the exact time, \( t_2 \) , using its timing reference.
  3. 3. The master sends a Follow_up message to the slave, which contains \( t_1 \) information for later use.
  4. 4. The slave sends a Delay_Req message to the master and notes the exact time, \( t_3 \) , at which this packet leaves the MII interface.
  1. 5. The master receives the message, capturing the exact time \( t_4 \) , at which the message enters its system.
  2. 6. The master sends the \( t_4 \) information to the slave in the Delay_Resp message.
  3. 7. The slave uses the four values of \( t_1 \) , \( t_2 \) , \( t_3 \) , and \( t_4 \) to synchronize its local timing reference with the timing reference of the master.

Most of the PTP implementation is done in the software above the UDP layer. However, the hardware support is required to capture the exact time when specific PTP packets enter or leave the Ethernet port at the MII interface. This timing information must be captured and returned to the software for proper implementation of PTP with high accuracy.

Peer-to-peer PTP transparent clock (P2P TC) message support

The IEEE 1588-2008 standard supports peer-to-peer PTP (Pdelay) message in addition to the Sync, Delay Request, Follow-up, and Delay Response messages. Figure 789 shows the method to calculate the propagation delay in clocks supporting peer-to-peer path correction.

Figure 789. Propagation delay calculation in clocks supporting peer-to-peer path correction

Timing diagram for PTP peer-to-peer path correction showing the exchange of Pdelay_Req, Pdelay_Resp, and Pdelay_Resp_Follow_Up messages between Port1 and Port2.

The diagram illustrates the timing sequence for peer-to-peer path correction between two PTP ports: Port1 (requester) and Port2 (responder). Time increases downwards.

MSv40801V3

Timing diagram for PTP peer-to-peer path correction showing the exchange of Pdelay_Req, Pdelay_Resp, and Pdelay_Resp_Follow_Up messages between Port1 and Port2.

As shown in Figure 789 , the propagation delay is calculated as follows:

  1. 1. Port 1 issues a Pdelay_Req message and generates a timestamp ( \( t_1 \) ) for the Pdelay_Req message.
  2. 2. Port 2 receives the Pdelay_Req message and generates a timestamp ( \( t_2 \) ) for this message.
  1. 3. Port 2 returns a Pdelay_Resp message and generates a timestamp ( \( t_3 \) ) for this message.

To minimize errors caused by frequency offset between the two ports, Port 2 returns the Pdelay_Resp message as quickly as possible after the receipt of the Pdelay_Req message. Port 2 returns any one of the following:

    • – Difference between the timestamps \( t_2 \) and \( t_3 \) in the Pdelay_Resp message
    • – Difference between the timestamps \( t_2 \) and \( t_3 \) in the Pdelay_Resp_Follow_Up message
    • – Timestamps \( t_2 \) and \( t_3 \) in the Pdelay_Resp and Pdelay_Resp_Follow_Up messages, respectively
    1. 4. Port 1 generates a timestamp ( \( t_4 \) ) on receiving the Pdelay_Resp message.
    2. 5. Port 1 uses all four timestamps to compute the mean link delay.

Timestamp correction

According to the IEEE 1588 specifications, a timestamp must be captured when the message timestamp point (leading edge of the first bit of the octet immediately following the Start Frame Delimiter octet) crosses the boundary between the node and the network.

As the MAC takes the timestamp at an internal point far from the actual boundary of the node and network, this captured timestamp is corrected/updated for the ingress/egress path latency (including the delay in the PHY layers). Further correction is done for the inaccuracies/errors introduced due to the clock (MII Tx, Rx clock) being different at the capture point as compared to the PTP clock ( \( clk\_ptp\_ref\_i \) ) that is used to generate the time. The resultant CDC (clock domain crossing) circuits add an error that depends on the clock period of the MII and PTP clocks.

Ingress correction

In the Receive side, the timestamp captured at the internal snapshot point is delayed (later in time) as compared to the time at which that packet SFD bit is received at the port boundary. Therefore, the captured timestamp must be reduced by the ingress latency and the errors in CDC sampling. This correction value must be determined/calculated by the software and written into the Timestamp Ingress correction nanosecond register (ETH_MACTSICNR) .

The correction value consists of the following three components:

  1. 1. External latency in the PHY layer between boundary point and the input of the core
    If the PHY is compliant with the IEEE 802.3 Clause 45 MMD registers, it has registers indicating the maximum and minimum ingress latency. The software can read these registers and determine the average ingress latency in the PHY. Alternatively (if the PHY does not support these registers), the ingress latency must be determined from the PHY datasheet or timing characteristics.
  2. 2. Internal latency from the input of the core to the internal capture point
    The latency differs based on the active PHY interface (such as MII or RMII) and the operating speed, as shown in Table 534 .
  3. 3. CDC synchronization
    The CDC synchronization error is almost equal to twice the clock-period of the PTP clock ( \( clk\_ptp\_ref\_i \) ).

The values determined from these three components should be added by the software and must be written into the TSIC field of the Timestamp Ingress correction nanosecond register (ETH_MACTSICNR) .

Note: The value written to the register must be negative (two's complement), because it has to be subtracted from the captured timestamp. The MAC receiver adds the value in this register to the captured timestamp and then gives the resultant value as the timestamp of the received packet.

When TSCTRLSSR bit in Timestamp control Register (ETH_MACTSCR) is set, the nanoseconds field of the captured timestamp is in decimal format with a granularity of 1 ns. So bit 31 of TSIC must be set to 1 (for negative value) and bits 30 to 0 must be programmed with " \( 10^9 - \text{total ingress\_correction\_value[nanosecond part]} \) " represented in binary. For example, if the required correction value is \( -5 \) ns, then the value is 0xBB9A C9FB.

When TSCTRLSSR bit in Timestamp control Register (ETH_MACTSCR) is reset, the nanoseconds field of the captured timestamp is in binary format with a granularity of \( \sim 0.466 \) ns. Therefore, bits[30:0] must be written with " \( 2^{31} - \text{total ingress\_correction\_value} \) " represented in binary with bit[31] = 1.

Egress correction

In the Transmit side, the timestamp captured at the internal snapshot point is earlier (advanced in time) as compared to the time at which that packet SFD bit is output at the port boundary. Therefore, the captured timestamp must be compensated by the egress latency and the errors in CDC sampling. This correction value must be determined/calculated by the software and written into the Timestamp Egress correction nanosecond register (ETH_MACTSECNR) .

The correction value consists of the following three components:

  1. 1. External latency in the PHY layer between the output of the core and the boundary of the port and the network

If the PHY is compliant with the IEEE 802.3 Clause 45 MMD registers, it has registers indicating the maximum and minimum egress latency. The software can read these registers and determine the average egress latency in the PHY. Alternatively (if the PHY does not support these registers), the egress latency must be determined from the PHY datasheet or timing characteristics.

  1. 2. Internal latency from the internal capture point and the output of the core

The latency differs based on the active PHY interface (RMII, MII, etc.) and the operating speed as shown in Table 534 .

  1. 3. CDC synchronization error

The timestamp correction because of synchronization is compensated by adding

\[ \text{EGRESS\_SYNC\_CORR} = (1 \times \text{PTP\_CLK\_PER} + 4 \times \text{TX\_CLK\_PER}) \]

Table 534 lists the Egress and Ingress latency values for various PHY interfaces:

Table 534. Egress and ingress latency for PHY interfaces

PHY interfaceEgress latencyIngress latency
RGMII1 Gbps1212
RGMII100 Mbps4040
RGMII10 Mbps400400
Table 534. Egress and ingress latency for PHY interfaces (continued)
PHY interfaceEgress latencyIngress latency
RMII100 Mbps40120
RMII10 Mbps400800

Frequency range of reference timing clock

The timestamp information are transferred across asynchronous clock domains, from the MAC clock domain to the application clock domain. Therefore, a minimum delay is required between two consecutive timestamp captures. This delay is four clock cycles of MII and three clock cycles of PTP clocks. If the delay between two timestamp captures is less than this delay, the MAC does not take a timestamp snapshot for the second packet.

The PTP clock frequency limitations are the following:

The maximum PTP clock frequency is limited by the maximum resolution of the reference time (10 ns at 100 MHz). In addition, the resolution or granularity of the reference time source determines the accuracy of the synchronization. Therefore, a higher PTP clock frequency gives better system performance.

The minimum PTP clock frequency depends on the time required between two consecutive SFD bytes and the time taken for synchronizing the time with the MII clock domain. This relationship is given by the following equation:

\[ 3 * \text{PTP clock period} + 4 * \text{MII clock period} \leq \text{Minimum gap between two SFDs} \]

The MII clock frequency is fixed by IEEE specifications. Therefore, the minimum PTP clock frequency required for proper operation depends on the operating mode and operating speed of the MAC as shown in Table 535 .

Table 535. Minimum PTP clock frequency example
ModeMinimum gap between two SFDsMinimum PTP frequency with internal timestamp
10 Mbps Full-duplex168 MII clocks
(128 clocks for a 64-byte packet + 24 clocks of min IFG + 16 clocks of preamble)
5 MHz
10 Mbps Half-duplex48 MII clocks
(8 clocks for a JAM pattern sent just after SFD because of collision + 24 IFG + 16 preamble)
5 MHz
100 Mbps full duplex168 MII clocks
(128 clocks for a 64-byte packet + 24 clocks of min IFG + 16 clocks of preamble)
5 MHz
100 Mbps Half-duplex48 MII clocks
(8 clocks for a JAM pattern sent just after SFD because of collision + 24 IFG + 16 preamble)
5 MHz

PTP processing and control

Table 536 shows the common message header for the PTP messages. This format is taken from the IEEE 1588-2008 specifications.

Table 536. Message format defined in IEEE 1588-2008

BitsOctetOffset
76543210
transportSpecificmessageType10
ReservedversionPTP11
messageLength22
domainNumber14
Reserved15
flagField26
correctionField88
Reserved416
sourcePortIdentity1020
sequenceId230
controlField (1)132
logMessageInterval133

1. The controlField is used in version 1. In version 2, the messageType field is used for detecting different message types.

Some fields of the Ethernet payload can be used to detect the PTP packet type and control the snapshot to be taken. These fields are different for the following PTP packets:

PTP packets over IPv4

Table 537 provides information about the fields that are matched to control the snapshot for the PTP packets sent over UDP over IPv4 for IEEE 1588 version 1 and 2. The octet positions for the tagged packets are offset by 4. This is based on the IEEE 1588-2008, Annex D and the message format defined in Table 536 .

Table 537. Message format defined in IEEE 1588-2008

Matched fieldOctet positionMatched valueDescription
MAC packet type12, 130x0800IPv4 datagram
IP version and header length140x45IP version is IPv4
Layer 4 protocol230x11UDP

Table 537. Message format defined in IEEE 1588-2008 (continued)

Matched fieldOctet positionMatched valueDescription
IP multicast address (IEEE 1588 version 1)30, 31, 32, 330xE0, 0x00, 0x01, 0x81
(or 0x82 or 0x83 or 0x84)
Multicast IPv4 addresses allowed:
224.0.1.129
224.0.1.130
224.0.1.131
224.0.1.132
IP multicast address (IEEE 1588 version 2)30, 31, 32, 330xE0, 0x00, 0x01, 0x81 (Hex)
0xE0, 0x00, 0x00, 0x6B (Hex)
PTP Primary multicast address:
224.0.1.129
PTP Pdelay multicast address:
224.0.0.107
UDP destination port36, 370x013F, 0x01400x013F: PTP event messages (1)
0x0140: PTP general messages
PTP control field (IEEE 1588 version 1)740x00, 0x01, 0x02, 0x03, 0x040x00: SYNC
0x01: Delay_Req
0x02: Follow_Up
0x03: Delay_Resp
0x04: Management
PTP message type field (IEEE 1588 version 2)42 (nibble)0x0, 0x1, 0x2, 0x3, 0x8, 0x9,
0xB, 0xC, 0xD
0x0: SYNC
0x1: Delay_Req
0x2: Pdelay_Req
0x3: Pdelay_Resp
0x8: Follow_Up
0x9: Delay_Resp
0xA: Pdelay_Resp_Follow_Up
0xB: Announce
0xC: Signaling
0xD: Management
PTP version43 (nibble)0x1 or 0x20x1: Supports PTP version 1
0x2: Supports PTP version 2

1. PTP event messages are SYNC, Delay_Req (IEEE 1588 version 1 and 2) or Pdelay_Req, Pdelay_Resp (IEEE 1588 version 2 only)

PTP frames over IPv6

Table 538 provides information about the fields that are matched to control the snapshots for the PTP packets sent over UDP over IPv6 for IEEE 1588 version 1 and 2. The octet positions for the tagged packets are offset by 4. This is based on the IEEE 1588-2008, Annex D and the message format defined in Table 536 .

Table 538. IPv6-UDP PTP packet fields required for control and status

Matched fieldOctet positionMatched valueDescription
MAC packet type12, 130x86DDIP datagram
IP version14 (bits [7:4])0x6IP version is IPv6
Layer 4 protocol20 (1)0x11UDP

Table 538. IPv6-UDP PTP packet fields required for control and status (continued)

Matched fieldOctet positionMatched valueDescription
PTP multicast address38 – 53FF0x:0:0:0:0:0:181 (Hex)
FF02:0:0:0:0:0:6B (Hex)
PTP primary multicast address:
FF0x:0:0:0:0:0:0:181 (Hex)
PTP Pdelay multicast address:
FF02:0:0:0:0:0:0:6B (Hex)
UDP destination port56, 57a0x013F, 0x1400x013F: PTP event message
0x0140: PTP general messages
PTP control field (IEEE 1588 version 1)94a0x00, 0x01, 0x02, 0x03, or 0x040x00: SYNC
0x01: Delay_Req
0x02: Follow_Up
0x03: Delay_Resp
0x04: Management (version1)
PTP message type field (IEEE 1588 version 2)62a (nibble)0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xB, 0xC, or 0xD0x0: SYNC
0x1: Delay_Req
0x2: Pdelay_Req
0x3: Pdelay_Resp
0x8: Follow_Up
0x9: Delay_Resp
0xA: Pdelay_Resp_Follow_Up
0xB: Announce
0xC: Signaling
0xD: Management
PTP Version63 (nibble)0x1 or 0x20x1: Supports PTP version 1
0x2: Supports PTP version 2

1. The Extension header is not defined for PTP packets.

PTP packets over Ethernet

Table 539 provides information about the fields that are matched to control the snapshots for the PTP packets sent over Ethernet for IEEE 1588 version 1 and 2. The octet positions for the tagged packets are offset by 4. This is based on the IEEE 1588-2008, Annex D and the message format.

Table 539. Ethernet PTP packet fields required for control and status

Matched fieldOctet positionMatched valueDescription
MAC destination multicast address (1)0–501-1B-19-00-00-00
01-80-C2-00-00-0E
All PTP messages can use any of the following multicast addresses (2) :
01-1B-19-00-00-00
01-80-C2-00-00-0E (3)
MAC packet type12, 130x88F7PTP Ethernet packet

Table 539. Ethernet PTP packet fields required for control and status (continued)

Matched fieldOctet positionMatched valueDescription
PTP control field
(IEEE 1588 version 1)
460x00, 0x01, 0x02, 0x03, or 0x040x00: SYNC
0x01: Delay_Req
0x02: Follow_Up
0x03: Delay_Resp
0x04: Management
PTP message type field
(IEEE 1588 version 2)
14 (nibble)0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xB, 0xC, or 0xD0x0: SYNC
0x1: Delay_Req
0x2: Pdelay_Req
0x3: Pdelay_Resp
0x8: Follow_Up
0x9: Delay_Resp
0xA: Pdelay_Resp_Follow_Up
0xB: Announce
0xC: Signaling
0xD: Management
PTP version15 (nibble)0x1 or 0x20x1: Supports PTP version 1
0x2: Supports PTP version 2
  1. 1. The unicast address match of destination addresses (DA), programmed in MAC address 0 to 31, is used if the TSENMACADDR bit of Timestamp control Register (ETH_MACTSCR) is set.
  2. 2. IEEE 1588-2008, Annex F
  3. 3. The MAC does not consider the PTP version 1 messages with Peer delay multicast address (01-80-C2-00-00-0E) as valid PTP messages.

Transmit path functions

The MAC captures a timestamp when the start packet delimiter (SFD) of a packet is sent on the MII interface. The packets, for which a timestamp has to be captured, can be controlled on per-packet basis. Each Transmit packet can be marked to indicate whether a timestamp should be captured for it.

The MAC does not process the transmitted packets to identify the PTP packets. The packets for which a timestamp has to be captured must be specified. The packets can be defined by using the control bits in the Transmit Descriptor (see Section 58.10.3: Transmit descriptor ). The MAC returns the timestamp to the software inside the corresponding Transmit descriptor, thus automatically connecting the timestamp to the specific PTP packet.

The 64-bit timestamp information is written to the TDES0 and TDES1 fields. The TDES0 field holds the 32 least significant bits of the timestamp.

Receive path functions

The MAC can be programmed to capture the timestamp of all packets received on the MII interface or to process packets to identify the valid PTP messages. The snapshot of the time to be sent to the application can be controlled by using the following options of the Timestamp control Register (ETH_MACTSCR) :

Note: The peripheral also supports the PTP messages over VLAN packets.

Table 540 indicates the PTP messages for which a snapshot is taken depending on the SNAPTYPSEL field in Timestamp control Register (ETH_MACTSCR) .

Table 540. Timestamp snapshot dependency on ETH_MACTSCR bits

SNAPTYPSELTSMSTRENATSEVNTENAPTP messages
00X0SYNC, Follow_Up, Delay_Req, Delay_Resp
0001SYNC
0011Delay_Req
01X0SYNC, Follow_Up, Delay_Req, Delay_Resp, Pdelay_Req, Pdelay_Resp, Pdelay_Resp_Follow_Up
0101SYNC, Pdelay_Req, Pdelay_Resp
0111Delay_Req, Pdelay_Req, Pdelay_Resp
10XXSYNC, Delay_Req
11XXPdelay_Req, Pdelay_Resp

The DMA returns the timestamp to the software application inside the corresponding Receive descriptor. The extended status, containing the timestamp message status and the IPC status, is written in the RDES1 normal descriptor and the snapshot of the timestamp is written in RDES0 and RDES1 fields of the context descriptor. The RDES0 field holds the 32 least significant bits of the timestamp.

Programming guidelines for IEEE 1588 timestamping (system time correction)

See Section : System time correction in Section 58.9.9: Programming guidelines for IEEE 1588 timestamping on page 2883 .

IEEE 1588 system time source

To get a snapshot of the time, the MAC requires a reference time in 64-bit format as defined in the IEEE 1588-2002 (80-bit format as defined in the IEEE 1588-2008).

Description of IEEE 1588 system time source

The peripheral uses the reference clock input and uses it to internally generate the Reference time (also called the system time) and capture timestamps.

The timestamp has the following fields:

The seconds field is the integer portion of the timestamp in units of seconds. It is 48-bit wide. For example, 2.0000000001 seconds are represented as seconds Field = 0x0000 0000 0002.

The nanoseconds field is the fractional portion of the timestamp in units of nanoseconds. For example, 2.0000000001 seconds are represented as nanoSeconds = 0x0000 0001 .

The nanoseconds field supports the following two modes:

These modes can be set through TSCTRLSSR bit in Timestamp control Register (ETH_MACTSCR) .

System time register module

The 64-bit PTP time is updated using the PTP input reference clock, clk_ptp_ref_i . This PTP time is used as a source to take snapshots (timestamps) of the Ethernet frames being transmitted or received at the MII.

The system time counter can be initialized or corrected using either the coarse or the fine correction method.

In the coarse correction method, the initial value or the offset value is written to the timestamp update register. For initialization, the system time counter is programmed with the value in the timestamp update registers, whereas for system time correction the offset value (timestamp update register) is added to or subtracted from the system time.

In the fine correction method, the slave clock (reference clock) frequency drift with respect to the master clock (as defined in IEEE 1588-2002 specifications) is corrected over a period of time, unlike in the coarse correction method where it is corrected in a single clock cycle. The longer correction time helps maintain linear time and does not introduce drastic changes (or a large jitter) in the reference time between PTP Sync message intervals. In this method, an accumulator sums up the contents of the Addend register as shown in Figure 790 . The arithmetic carry that the accumulator generates is used as a pulse to increment the system time counter. The accumulator and the addend are 32-bit registers. The accumulator acts as a high-precision frequency multiplier or divider.

This system time update algorithm is shown in Figure 790 .

Figure 790. System time update using fine correction method

Block diagram of system time update using fine correction method. The diagram shows a hierarchy of registers and adders. At the top, an 'Addend register' is updated via 'Addend update'. Its output goes to an adder (+). The second input to this adder is the output of an 'Accumulator register'. The output of the adder goes to the 'Accumulator register'. Below the accumulator register, an 'Increment Subsecond register' input goes to another adder (+). The second input to this adder is the output of a 'Constant value' block. The output of this adder goes to the 'Subsecond register'. Below the subsecond register, an 'Increment Second register' input goes to a third adder (+). The second input to this adder is the output of the 'Subsecond register'. The output of this adder goes to the 'Second register'. The output of the 'Second register' is the final system time output. A label 'ai15670' is in the bottom right corner of the diagram.
Block diagram of system time update using fine correction method. The diagram shows a hierarchy of registers and adders. At the top, an 'Addend register' is updated via 'Addend update'. Its output goes to an adder (+). The second input to this adder is the output of an 'Accumulator register'. The output of the adder goes to the 'Accumulator register'. Below the accumulator register, an 'Increment Subsecond register' input goes to another adder (+). The second input to this adder is the output of a 'Constant value' block. The output of this adder goes to the 'Subsecond register'. Below the subsecond register, an 'Increment Second register' input goes to a third adder (+). The second input to this adder is the output of the 'Subsecond register'. The output of this adder goes to the 'Second register'. The output of the 'Second register' is the final system time output. A label 'ai15670' is in the bottom right corner of the diagram.

The system time update logic requires a 50 MHz clock frequency to achieve 20 ns accuracy. The frequency division is the ratio of the reference clock frequency to the required clock frequency. For example, if the reference clock ( clk_ptp_ref_i ) is 66 MHz, this ratio is calculated as \( 66 \text{ MHz} / 50 \text{ MHz} = 1.32 \) . Therefore, the default addend value to be set in the register is \( 2^{32} / 1.32 \) , 0xC1F07C1F.

If the reference clock drifts lower, for example, to 65 MHz, the ratio is \( 65 / 50 \) , that is 1.3 and the value to set in the addend register is \( 2^{32} / 1.30 \) , or 0xC4EC 4EC4.

If the clock drifts higher, for example to 67 MHz, the addend register must be set to 0xBF0B 7672. When there is not clock drift, the default addend value of 0xC1F0 7C1F ( \( 2^{32} / 1.32 \) ) must be programmed.

In Figure 790, the constant value used to accumulate the subsecond register is decimal 43, which achieves a system time accuracy of 20 ns (in other words, it is incremented in 20 ns steps).

The software must calculate the drift in frequency based on the SYNC messages and accordingly update the Addend register.

Initially, the slave clock is set with FreqCompensationValue0 in the Addend register. This value is as follows:

\[ \text{FreqCompensationValue}_0 = 2^{32} / \text{FreqDivisionRatio} \]

If MasterToSlaveDelay is initially assumed to be the same for consecutive Sync messages, the algorithm given in this section must be applied. After a few Sync cycles, frequency lock occurs. The slave clock can then determine a precise MasterToSlaveDelay value and re-synchronize with the master using the new value.

The algorithm is as follows:

  1. 1. At time MasterSyncTime n the master sends the slave clock a SYNC message. The slave receives this message when its local clock is SlaveClockTime n and computes MasterClockTime n as follows:

\[ \text{MasterClockTime}_n = \text{MasterSyncTime}_n + \text{MasterToSlaveDelay}_n \]

  1. 2. The master clock counts for current Sync cycle, MasterClockCount n is

\[ \text{MasterClockCount}_n = \text{MasterClockTime}_n - \text{MasterClockTime}_{n-1} \]

(assuming that MasterToSlaveDelay is the same for Sync cycles n and n – 1)

  1. 3. The slave clock count for current Sync cycle, SlaveClockCount n is

\[ \text{SlaveClockCount}_n = \text{SlaveClockTime}_n - \text{SlaveClockTime}_{n-1} \]

  1. 4. The difference between master and slave clock counts for current Sync cycle, ClockDiffCount n is

\[ \text{ClockDiffCount}_n = \text{MasterClockTime}_n - \text{SlaveClockTime}_n \]

  1. 5. The frequency-scaling factor for slave clock, FreqScaleFactor n is

\[ \text{FreqScaleFactor}_n = (\text{MasterClockCount}_n + \text{ClockDiffCount}_n) / \text{SlaveClockCount}_n \]

  1. 6. The frequency compensation value for Addend register, FreqCompensationValue n is

\[ \text{FreqCompensationValue}_n = \text{FreqScaleFactor}_n \times \text{FreqCompensationValue}_{n-1} \]

In theory, this algorithm achieves the lock in one Sync cycle. However, it may take several cycles, because of changing network propagation delays and operating conditions. This algorithm is self-correcting. If the slave clock is initially set to an incorrect value by the master, the algorithm corrects it at the cost of additional Sync cycles.

Refer to Section 58.9.9: Programming guidelines for IEEE 1588 timestamping for detailed programming steps.

IEEE 1588 auxiliary snapshots

The auxiliary snapshot feature enables to store a snapshot of the system time based on an external event. The event is considered to be the rising edge of the eth_ptp_trgx (where x = 1 to 4) sideband signal.

Up to four auxiliary snapshot inputs can be configured and up to four snapshots can be stored. A FIFO is accessible through registers: Auxiliary timestamp seconds register (ETH_MACATSSR) and Auxiliary timestamp nanoseconds register (ETH_MACATSNR) .

The snapshots taken for any input are stored in a common FIFO; only 64 bits are kept. The application can read the Timestamp status register (ETH_MACTSSR) to know the timestamp of which input is available for reading at the top of this FIFO.

When a snapshot is stored, the MAC indicates this to the application with an interrupt. The value of the snapshot is read through a FIFO register access. If the FIFO becomes full and an external trigger to take the snapshot is asserted, a snapshot trigger-missed status (ATSSTM) is set in the Timestamp status register (ETH_MACTSSR) . This indicates that the latest auxiliary snapshot of the timestamp is not stored in the FIFO. The latest snapshot is not written to the FIFO when it is full.

When an application reads the 64-bit timestamp from the FIFO, the space becomes available to store the next snapshot. You can clear a FIFO by setting the ATSFC bit in Auxiliary control register (ETH_MACACR) . When multiple snapshots are present in the FIFO, the count is indicated in bits[27:25] of Timestamp status register (ETH_MACTSSR) .

Flexible pulse-per-second output

The MAC supports either a fixed pulse-per-second output mode (also called fixed mode) or a flexible pulse-per-second output mode for the ETH_PPS_OUT and eth_ptp_pps_out outputs:

In this mode, only the frequency of the PPS output can be changed by setting the PPSCTRL0 field in the PPS control register (ETH_MACPPSCR) .

In this mode, the software has the flexibility to program the start or stop time, width, and interval of the pulse generated on the eth_ptp_pps_out output:

The start and stop times are programmed through PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) .

The PPS width and interval are programmed in terms of granularity of system time (number of the units of subsecond increment value) through PPS width register (ETH_MACPPSWR) and PPS interval register (ETH_MACPPSIR) , respectively.

Note: By default, the peripheral is in Fixed mode and indicates one second interval. When Fixed mode is selected by clearing PPSEN0 to 0 in the PPS control register (ETH_MACPPSCR) :

Description of flexible pulse-per-second (PPS) output

The peripheral supports the following features with the flexible PPS outputs:

Note: The PTP reference clock mentioned in the following sections is the clock at which the system time is updated. When the TSCFUPDT bit of Timestamp control Register (ETH_MACSCR) is set to 0, this clock is similar to the clk_ptp_ref_i clock. In Fine correction mode, this is the clock tick at which the system time is updated (using Subsecond increment register (ETH_MACSSIR) (as shown in Figure 790).

Refer to Section 58.9.12: Programming guidelines for flexible pulse-per-second (PPS) output for further details on how configuring flexible pulse output.

PPS start and stop times

The initial start time can be programmed in the Target Time registers.

If required, the start or stop time can be programmed again. However, this can be done only after the earlier programmed value is synchronized with the PTP clock domain. Bit 31 of PPS target time nanoseconds register (ETH_MACPPSTTNR) indicates that the synchronization is complete. This enables to program the start or stop time in advance even before the earlier stop or start time has elapsed.

To ensure proper PPS signal output, it is recommended to program advanced system time for the start or stop time. If the application programs a start or stop time that has already elapsed, the MAC sets an error status bit indicating the programming error. If enabled, the MAC also sets the Target Time Reached interrupt event. The application can cancel the start or stop request only if the corresponding start or stop time has not elapsed. If the time has elapsed, the cancel command has no effect.

PPS width and interval

The PPS width and interval are programmed in terms of granularity of system time, that is, number of the units of subsecond increment value. For example, to obtain a PPS pulse width of 40 ns and an interval of 100 ns with a PTP reference clock of 50 MHz, program the width and interval to values 2 and 5, respectively. Smaller granularity can be achieved by using a faster PTP reference clock.

Before giving the command to trigger a pulse or pulse train on the PPS output, program or update the interval and width of the PPS signal output.

PTP timestamp offload function

This feature enables the automatic generation of specific PTP packets to be performed, when the MAC operates as a specific node in the PTP network.

These packets can be generated periodically or triggered by the host software. In other modes, this feature can parse the incoming PTP packets on the receiver, and automatically generate and respond to the required PTP packets. It helps to offload certain PTP node functions with better accuracy and lower response latency.

The PTP offload feature is selected through PTP Offload control register (ETH_MACPOCR) . 80-bit PTP node identity is configured through the following three registers: PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP Source port identity 2 register (ETH_MACSPI2R) .

Description of PTP offload function

Depending on the programmed mode, the MAC generates PTP Ethernet messages periodically or from the application, or based on reception of a particular PTP message. Table 541 indicates the PTP message generation criteria.

Table 541. PTP message generation criteria

ProgrammingModeCriteria for generation of PTP messagesPTP message type generated
SNAPTYPSELTSMSTRENATSEVNTENA
0001Ordinary or Boundary SlaveSYNC message receptionDelay_Req
0011Ordinary or Boundary MasterPeriodic or on trigger from applicationSYNC
Delay_Req message receptionDelay_Resp
0101Transparent SlavePeriodic or on trigger from applicationPdelay_Req
Pdelay_Req message receptionPdelay_Resp
SYNC message receptionDelay_Req

Table 541. PTP message generation criteria (continued)

ProgrammingModeCriteria for generation of PTP messagesPTP message type generated
SNAPTYPSELTSMSTRENATSEVNTENA
0111Transparent MasterPeriodic or on trigger from applicationPdelay_Req
Pdelay_Req message receptionPdelay_Resp
Periodic or on trigger from applicationSYNC
Delay_Req message receptionDelay_Resp
11XXPeer-to-Peer TransparentPeriodic or on trigger from applicationPdelay_Req
Pdelay_Req message receptionPdelay_Resp
All other programming combinations are invalid for PTP Offload feature.

Note: Clocks supporting peer delay mechanism must not generate delay request/delay response messages, according to IEEE 1588-2008 specifications. However, the peripheral controller supports this for flexibility, with a programmable control bit (DRRDIS) in the PTP Offload control register (ETH_MACPOCR) .

The DRRDIS bit can be used to control the response generation for delay request/delay response message. For example, in transparent slave mode, delay request is generated in response to received SYNC only when the bit is reset.

When the MAC is set as an Ordinary or Boundary Slave clock in the PTP network, it can respond to the reception of SYNC messages with an automatic generation and transmission of the corresponding Delay_Req message. Similarly, various other modes of operation are explained in Table 541 .

The MAC supports the multicast communication model for the generation of SYNC and Pdelay_Req PTP messages. For instance, the Destination Address field of the generated PTP over Ethernet packet is the defined special multicast addresses (0x011B 1900 0000 for all except peer delay mechanism messages and 0x0180 C200 000E for peer delay mechanism messages).

When the MAC responds to received SYNC, Delay_Req and Pdelay_Req PTP messages with special multicast destination address, it also uses the corresponding special multicast address in the DA field of the automatically generated Delay_Req, Delay_Resp, and Pdelay_Resp PTP messages, respectively.

When the MAC responds to received SYNC, Delay_Req and Pdelay_Req PTP messages with unicast destination address, it takes the SA field of the received packets and makes

them as the DA field of the automatically generated Delay_Req, Delay_Resp, and Pdelay_Resp PTP messages, respectively.

At the same time, all the received PTP messages are forwarded to the application along with Rx status, indicating whether the response was generated by the MAC, if it satisfies the packet filtering logic of the MAC receiver

When the MAC automatically generates a PdelayReq or responds with a Delay_Req, the egress timestamp of these two PTP messages are provided in the Tx TS status (Tx Timestamp Status register and interrupt generated).

In addition to messageType and versionPTP fields match for basic PTP over Ethernet message detection, the following additional fields are matched to qualify the received PTP message type:

  1. 1. The domainNumber field is checked for a match against the value programmed in the CSR.
  2. 2. The twoStepFlag in flagField field is checked for one-step indication (0b0).
  3. 3. The transportSpecific field is checked for Default PTP over Ethernet (0b0000) or 802.1AS mode (0b1111) when enabled.

PTP packet generation

This section explains the format and content of the automatically generated PTP packets by the MAC when this mode is enabled. It provides the template of the common PTP message header, as well as the detailed description of the fields of the specific PTP packets generated.

Table 542. Common PTP message header fields

BitsOctetsOffset
76543210
transportSpecificmessageType10
ReservedversionPTP11
messageLength22
domainNumber14
Reserved15
flagField26
correctionField88
Reserved416
sourcePortIdentity1020
sequenceId230
sequenceId230
controlField132
logMessageInterval133

PTP message header fields

The following encoded values are used for PTP message types:

The following transport protocol encoding is used:

It is always set to 2 because PTP version 2 is supported.

This field contains the value from the PTP Offload control register (ETH_MACPOCR) .

The following values are used:

For more information, see Table 543 .

This field takes the value programmed in the PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP Source port identity 2 register (ETH_MACSPI2R) .

Pdelay_Resp and Delay_Resp use the same sequenceId field from received Pdelay_Req and Delay_Req PTP messages. For SYNC/Delay_Req, Pdelay_Req, a separate sequenceId counter is maintained. These sequenceId counters get incremented by 1 every time the corresponding message is generated and transmitted.

The following encoded values are used for controlField:

This field contains logSyncInterval from the corresponding MAC_Log_Message_Interval register.

This field contains the sum of DRSYNCR and logSyncInterval value taken from the Log message interval register (ETH_MACLMIR) for a multicast PTP message and 0111 1111 for unicast PTP message.

where \( \text{logSyncInterval} = \log_2(\text{Mean Value of Interval in seconds}) \)

The MAC supports values of –15 to 15 for logSyncInterval fields, which translates to a range from 32.768 micro second ( \( 2^{-15} \) ) to 215 second. For a given value of log sync interval (N), the time interval between two SYNC packets is given by the following:

For example:

Note: The MAC uses the PTP system time to generate the intervals for periodic packet transmission. For negative values of log message interval programmed, the generated period may deviate from the value given by the equation \( 2^{(30+N)} \) , because of the non-binary nature of the nanoseconds field of the system time.

PTP message-specific fields

The message-specific fields are the following:

There is no suffix supported, so this field contains the length of the PTP message that includes 34-byte PTP common header and the body specific to the message type.

For SYNC and Delay_Req packets, this field contains 44, whereas for Delay_Resp, Pdelay_Req and Pdelay_Resp, it contains 54.

This field is the captured egress timestamp for SYNC, Delay_Req, and Pdelay_Req PTP messages.

For Delay_Resp PTP message, this is the ingress timestamp of the corresponding received Delay_Req PTP message.

For Delay_Resp and Pdelay_Resp PTP messages, this is the sourcePortIdentity field taken from the corresponding received Delay_Req and Pdelay_Req PTP messages.

For the Pdelay_Resp PTP message, this field is set to 0.

One-step timestamp

The MAC supports the one-step timestamp feature that enables to identify the offset in the packet and inserts the timestamp received from the application at that offset.

MAC Transmit PTP mode for one-step timestamp

Depending upon the type of message and its mode, the MAC updates the following fields of Transmit PTP packets:

Table 543 shows how the PTP mode is selected based on the settings of SNAPTYPSEL, TSMSTRENA, and TSEVNTENA bits of the Timestamp control Register (ETH_MACTSCR) and the fields that are updated for the incoming PTP packets based on the message type in that mode, during the one-step timestamping operation.

Table 543. MAC Transmit PTP mode and one-step timestamping operation

ProgrammingModePer packet control (1)Messages processed on transmission
SNAPTYP SELTSMSTR ENATSEVNT ENATTSE (2)OSTC (3)TTS (4)
XXXN/A1XXTimestamp is captured and returned to application
XXXN/AX0XOST operation is not performed (PTP packet is not modified)
00X0End-to-end transparent01Ingress TSSync (correction field for residence time and Ingress asymmetric correction)
Delay_Req (correction field for residence time and Egress asymmetric correction)
0001Ordinary or Boundary Slave11XDelay_Req (originTimestamp field)
Delay_Req (correction field for Egress asymmetric correction)
0011Ordinary or Boundary Master01XSync (originTimestamp field)
Sync (correction field for subnanosecond correction)
01X0End-to-end Transparent with support for peer delay mechanism01Ingress TSSync (correction field for residence time and Ingress asymmetric correction)
Ingress TSPdelay_Req (correction field for residence time and Egress asymmetric correction)
Ingress TSPdelay_Resp (correction field for residence time and Ingress asymmetric correction)

Table 543. MAC Transmit PTP mode and one-step timestamping operation (continued)

ProgrammingModePer packet control (1)Messages processed on transmission
SNAPTYP SELTSMSTR ENATSEVNT ENATTSE (2)OSTC (3)TTS (4)
0101Ordinary or Boundary Slave with support for peer delay mechanism or Peer-to-peer transparent01Ingress TSSync (correction field for residence time and Ingress asymmetric correction)
(applicable only for Peer to Peer transparent clock operation)
11XDelay_Req (originTimestamp field)
Delay_Req (correction field for Egress asymmetric correction)
11XPdelay_Req (originTimestamp field)
Pdelay_Req (correction field for Egress asymmetric correction)
01Ingress TS for Pdelay_ReqPdelay_Resp (correction field for turnaround time and Ingress asymmetric correction)
0111Ordinary or Boundary Master with support for peer delay mechanism01XSync (originTimestamp field)
Sync (correction field for subnanosecond correction)
11XPdelay_Req (originTimestamp field)
Pdelay_Req (correction field for Egress asymmetric correction)
01Ingress TS for Pdelay_ReqPdelay_Resp (correction field for turnaround time and Ingress asymmetric correction)
10XXEnd-to-end transparent01Ingress TSSync (correction field for residence time and Ingress asymmetric correction)
Ingress TSDelay_Req (correction field for residence time and Egress asymmetric correction)

Table 543. MAC Transmit PTP mode and one-step timestamping operation (continued)

ProgrammingModePer packet control (1)Messages processed on transmission
SNAPTYP SELTSMSTR ENATSEVNT ENATTSE (2)OSTC (3)TTS (4)
11XXPeer-to-peer transparent01Ingress TSSync (correction field for residence time and Ingress asymmetric correction)
11XPdelay_Req (originTimestamp field)
Pdelay_Req (correction field for Egress asymmetric correction)
01Ingress TS for Pdelay_ReqPdelay_Resp (correction field for turnaround time and Ingress asymmetric correction)
  1. 1. The per-packet control values provided here are the recommended settings used by devices in typical PTP operation and for the programmed mode.
  2. 2. TTSE represents TTSE bit of TDES2 transmit normal descriptor. The TTSE function is independent from the OST function and the programmed operation mode for OST. The MAC captures and returns the timestamp when the TTSE bit is set.
  3. 3. OSTC represents OSTC bit of TDES3 transmit context descriptor
  4. 4. TTS represents the timestamp value provided in the TTSH, TTSL fields of TDES0 and TDES1 transmit normal descriptor (write-back format).

Note: Residence time/ turnaround time is calculated as the difference between the captured timestamp (egress timestamp) and the ingress timestamp. Clocks supporting peer delay mechanism do not use delay request or response, but it is included in OST for flexibility.

Enabling one-step timestamp

The one-step timestamp feature can be enabled for a given packet by setting bit 20 (OSTC) in TDES3 context descriptor. To update the correction field in certain PTP packets, the ingress timestamp must be given in the TSSL and TSSH fields.

The one-step timestamp feature is supported only for the PTP over Ethernet packets. It is not supported for PTP over IPv4/IPv6 packets.

58.5.5 Checksum offload engine

Communication protocols such as TCP and UDP implement checksum fields, which help determine the integrity of data transmitted over a network. The most widespread use of Ethernet is to encapsulate TCP and UDP over IP datagrams. The MAC has a Checksum Offload Engine (COE) to support checksum calculation and insertion in the Transmit path, as well as error detection in the Receive path.

Transmit checksum offload engine

In the transmit path, the MAC calculates the checksum and inserts it in the Tx packet. This feature helps reducing the load on the software and can improve the overall system throughput.

The COE module supports two types of checksum calculation and insertion. The checksum engine can be controlled for each packet by setting the CIC bits (TDES3 bits[17:16]).

Note: The checksum for TCP, UDP, or ICMP is calculated over a complete packet, and then inserted into its corresponding header field. Because of this requirement, the Tx FIFO automatically operates in the Store-and-forward mode even if the MAC is configured in Threshold (cut-through) mode.

Make sure that the Tx FIFO is deep enough to store a complete packet before that packet is transferred to the MAC transmitter, the reason being that when space is not available to accept the programmed burst length of data, then the MTL Tx FIFO starts reading to avoid deadlock. In such a case, the COE fails as the start of the packet header is read out before the payload checksum can be calculated and inserted. Therefore, the checksum insertion must be enabled only in the packets that are less than the number of bytes, given by the following equation:

\[ \text{Packet size} < \text{TxQSize} - (\text{PBL} + 7) \times 4 \]

where

TxQSize corresponds to the TQS bitfield of Tx queue operating mode Register (ETH_MTLTXQOMR)

PBL corresponds to the TxPBL bitfield of Channel transmit control register (ETH_DMACTXCR)

Refer to IETF specifications RFC 791, RFC 793, RFC 768, RFC 792, RFC 2460, and RFC 4443 for IPv4, TCP, UDP, ICMP, IPv6, and ICMPv6 packet header specifications, respectively.

IP header checksum engine

In IPv4 datagrams, the integrity of the header fields is indicated by the 16-bit Header Checksum field (the eleventh and twelfth bytes of the IPv4 datagram). The COE detects an IPv4 datagram when the Type field of Ethernet packet has the value 0x0800 and the Version field of IP datagram has the value 0x4. The checksum field of the input packet is ignored during calculation and replaced with the calculated value.

Note: IPv6 headers do not have a checksum field. Therefore, the COE does not modify the IPv6 header fields.

The result of this IP header checksum calculation is indicated by the IP Header Error status bit in the Transmit status (bit 0 in Table 565: TDES3 normal descriptor (write-back format) ).

This status bit is set whenever the values of the Ethernet Type field and the Version field of IP header are not consistent, or when the Ethernet packet does not have enough data, as

indicated by the IP header Length field. In other words, this bit is set when an IP header error is asserted under the following circumstances:

TCP/UDP/ICMP checksum engine

The TCP/UDP/ICMP Checksum Engine processes the IPv4 or IPv6 header (including extension headers) and determines whether the encapsulated payload is TCP, UDP, or ICMP. The checksum is calculated for the TCP, UDP, or ICMP payload and inserted into its corresponding field in the header. The Tx COE can work in the following two modes:

Note: For ICMP-over-IPv4 packets, the Checksum field in the ICMP packet must always be 0x0000 in both modes, because pseudo-headers are not defined for such packets. If it does not equal 0x0000, an incorrect checksum may be inserted into the packet.

The result of this operation is indicated by the Payload Checksum Error status bit in the Transmit Status vector (bit 12 in Table 565: TDES3 normal descriptor (write-back format) ). This engine sets the Payload Checksum Error status bit when it detects that the packet has been forwarded to the MAC Transmitter engine in the store-and-forward mode without the end of packet (EOP) being written to the FIFO, or when the packet ends before the number of bytes indicated by the Payload Length field in the IP Header is received. When the packet is longer than the indicated payload length, the COE ignores them as stuff bytes, and no error is reported. When this engine detects the first type of error, it does not modify the TCP, UDP, or ICMP header. For the second error type, it still inserts the calculated checksum into the corresponding header field.

Table 544 describes the functions supported by Transmit Checksum Offload engine based on the packet type. When the MAC does not insert the checksum, it is indicated as “No” in the table.

Note: Do not enable checksum insertion for IPv4 or IPv6 packets that are greater than the frame size constraint specified in Section : Transmit checksum offload engine because it might result in incorrect checksum insertion or unexpected behavior.

Table 544. Transmit checksum offload engine functions for different packet types
Packet typeHardware IP header checksum insertionHardware TCP/UDP checksum insertion
Non-IPv4 or IPv6 packetNoNo
IPv4 packet is greater than 1,522 bytes (2,000 bytes when IEEE 802.3ad support for 2K packets is enabled in the MAC) but less than or equal to the frame size constraint specified in Section : Transmit checksum offload engine .YesYes
IPv6 packet is greater than 1,522 bytes (2,000 bytes when IEEE 802.3ad support for 2K packets is enabled in MAC) but less than or equal to the frame size constraint specified in Section : Transmit checksum offload engine .Not applicableYes
IPv4 with TCP, UDP, or ICMPYesYes
IPv4 packet has IP options (IP header is longer than 20 bytes)YesYes
Packet is an IPv4 fragmentYesNo
IPv6 packet with the following next header fields in main or extension headers:
  • – Hop-by-hop options (in IPv6 main header)
  • – Hop-by-hop options (in IPv6 extension header)
  • – Destinations options
  • – Routing (with segment left 0)
  • – Routing (with segment left > 0)
  • – TCP, UDP, or ICMP
  • – Authentication
  • – Any other next header field in main or extension headers
  • – Not applicable
  • – Not applicable
  • – Not applicable
  • – Not applicable
  • – Not applicable
  • – Not applicable
  • – Not applicable
  • – Not applicable
  • – Yes
  • – No
  • – Yes
  • – No
  • – No
  • – Yes
  • – No
  • – No
IPv4 packet has TCP header with Options fieldsYesYes
IPv4 Tunnels:
  • – IPv4 packet in an IPv4 tunnel
  • – IPv6 packet in an IPv4 tunnel
  • – Yes (IPv4 tunnel header)
  • – Yes (IPv4 tunnel header)
  • – No
  • – No
IPv6 Tunnels:
  • – IPv4 packet in an IPv6 tunnel
  • – IPv6 packet in an IPv6 tunnel
  • – Not applicable
  • – Not applicable
  • – No
  • – No
IPv4 packet has 802.3ac tag (with C-VLAN tag or S-VLAN Tag when enabled).YesYes
IPv6 packet has 802.3ac tag (with C-VLAN tag or S-VLAN Tag when enabled).Not applicableYes
IPv4 frames with security features (such as encapsulated security payload)YesNo
IPv6 frames with security features (such as encapsulated security payload)Not applicableNo

Receive checksum offload engine

The Receive Checksum Offload engine is used to detect errors in IP packets by calculating the header checksum and further matching it with the received header checksum. This engine also identifies a TCP, UDP, or ICMP payload in received IP packets and calculates the checksum of such payloads appropriately.

The Receive Checksum Offload Engine (Rx COE) can be enabled by setting the IPC bit of Operating mode configuration register (ETH_MACCR) . When this bit is set, both IPv4 and IPv6 packet in the received Ethernet packets are detected and processed for data integrity. The MAC receiver identifies IPv4 or IPv6 packets by checking for value 0x0800 or 0x86DD, respectively, in the Type field of the received Ethernet packet. This identification is applicable to single VLAN-tagged packets. It is also applicable to double VLAN-tagged packets when the EDVLP bit of the VLAN tag register (ETH_MACVTR) is set.

The Rx COE calculates the IPv4 header checksums and checks that they match the received IPv4 header checksums. The result of this operation (pass or fail) is given to the RFC module for insertion into the receive status word. The IP Header Error bit is set for any mismatch between the indicated payload type (Ethernet Type field) and the IP header version, or when the received packet does not have enough bytes, as indicated by the Length field of the IPv4 header (or when fewer than 20 bytes are available in an IPv4 or IPv6 header).

Packets with TCP/IP errors (header or payload) are dropped in MTL when DIS_TCP_EF bit of the Rx queue operating mode register (ETH_MTLRXQOMR) is reset and FEP bit is set.

This engine also identifies a TCP, UDP, or ICMP payload in the received IP datagrams (IPv4 or IPv6) and calculates the checksum of such payloads properly, as defined in the TCP, UDP, or ICMP specifications. This engine includes the TCP, UDP, or ICMPv6 pseudo-header bytes for checksum calculation and checks whether the received checksum field matches the calculated value. The result of this operation is given as a Payload Checksum Error bit in the receive status word. This status bit is also set if the length of the TCP, UDP, or ICMP payload does not match the expected payload length given in the IP header.

Table 545: Receive checksum offload engine functions for different packet types describes the functions supported by the Rx COE based on the packet type. When the payload of an IP packet is not processed (indicated as "No" in the table), the information (whether the checksum engine is bypassed or not) is given in the receive status.

Note: The MAC does not append any payload checksum bytes to the received Ethernet packets.

Table 545. Receive checksum offload engine functions for different packet types

Packet typeHardware IP header checksum checkingHardware TCP/UDP/ICMP checksum checking
Non-IPv4 or IPv6NoNo
IPv4 packet is greater than 1,522 bytes (2,000 bytes when IEEE 802.3ad support for 2K packets is enabled in the MAC)YesYes
IPv6 packet is greater than 1,522 bytes (2,000 bytes when IEEE 802.3ad Support for 2K packets is enabled in the MAC)Not applicableYes
IPv4 with TCP, UDP, or ICMPYesYes
IPv4 header's protocol field contains a protocol other than TCP, UDP, or ICMPYesNo
IPv4 packet has IP options (IP header is longer than 20 bytes)YesYes
Packet is an IPv4 fragmentYesNo
IPv6 packet with the following next header fields in main or extension headers:
– Hop-by-hop options (in IPv6 main header)
– Hop-by-hop options (in IPv6 extension header)
– Destinations options
– Routing (with segment left 0)
– Routing (with segment left > 0)
– TCP, UDP, or ICMP
– Any other next header field in main or extension headers
– Not applicable
– Not applicable
– Not applicable
– Not applicable
– Not applicable
– Not applicable
– Not applicable
– Not applicable
– Yes
– No
– Yes
– Yes
– No
– Yes
– No
IPv4 packet has TCP header with Options fieldsYesYes
IPv4 Tunnels:
– IPv4 packet in an IPv4 tunnel
– IPv6 packet in an IPv4 tunnel
– Yes (IPv4 tunnel header)
– Yes (IPv4 tunnel header)
– No
– No
IPv6 Tunnels:
– IPv4 packet in an IPv6 tunnel
– IPv6 packet in an IPv6 tunnel
– Not applicable
– Not applicable
– No
– No
IPv4 packet has 802.3ac tag (with C-VLAN Tag or S-VLAN Tag when enabled).YesYes
IPv6 packet has 802.3ac tag (with C-VLAN Tag or S-VLAN Tag when enabled).Not applicableYes
IPv4 frames with security features (such as encapsulated security payload)YesNo
IPv6 frames with security features (such as encapsulated security payload)Not applicableNo

58.5.6 TCP segmentation offload

The MAC supports the TCP segmentation offload (TSO) feature in which the DMA splits a large TCP packet into multiple small packets and passes these packets to the MTL as shown in Figure 791 .

This feature is enabled by programming the TSE bit of corresponding ETH_DMACCR register (see Channel transmit control register (ETH_DMACCTXCR) ). It is only supported when the MAC operates in Full-duplex mode.

For detailed programming steps, refer to Section 58.9.13: Programming guidelines for TSO .

Figure 791. TCP segmentation offload overview

Diagram illustrating the TCP segmentation offload (TSO) process. A TCP packet is input to a TSD engine. The TSD engine outputs segments (Seg N, ..., Seg 2, Seg 1) to an MTL Tx queue #. The TSD engine also outputs a DMA Tx Channel # to the DMA Tx Channel # block.
graph LR; TCP[TCP packet] --> TSD[TSD engine]; TSD --> Segments["Seg N | ... | Seg 2 | Seg 1"]; Segments --> MTL["MTL Tx queue #"]; TSD --> DMA["DMA Tx Channel #"];

The diagram shows the flow of data during TCP segmentation offload. A single 'TCP packet' enters a 'TSD engine'. The engine processes it into multiple segments, labeled 'Seg N', '...', 'Seg 2', and 'Seg 1'. These segments are then passed to an 'MTL Tx queue #'. Additionally, the 'TSD engine' sends a signal to a 'DMA Tx Channel #' block.

MSv40802V1

Diagram illustrating the TCP segmentation offload (TSO) process. A TCP packet is input to a TSD engine. The TSD engine outputs segments (Seg N, ..., Seg 2, Seg 1) to an MTL Tx queue #. The TSD engine also outputs a DMA Tx Channel # to the DMA Tx Channel # block.
DMA operation with TSO feature

Figure 792 shows the TSO flow.

Figure 792. TCP segmentation offload flow Flowchart of TCP segmentation offload (TSO) flow
graph TD; A([Receive TSO packet]) --> B[Read header]; B --> C[Update header fields (if required)]; C --> D[Forward the header to the MTL]; D --> E{Header complete?}; E -- No --> B; E -- Yes --> F[Read payload]; F --> G[Forward the payload to the MTL]; G --> H{Payload length = MSS?}; H -- No --> F; H -- Yes --> I[Segmentation Complete]; I --> J{Payload remaining?}; J -- Yes --> B; J -- No --> K([Read the next packet])

The flowchart illustrates the TCP segmentation offload (TSO) process. It begins with 'Receive TSO packet', followed by 'Read header', 'Update header fields (if required)', and 'Forward the header to the MTL'. A decision 'Header complete?' follows; if 'No', it loops back to 'Read header'; if 'Yes', it proceeds to 'Read payload', 'Forward the payload to the MTL', and 'Payload length = MSS?'. If 'No', it loops back to 'Read payload'; if 'Yes', it proceeds to 'Segmentation Complete' and 'Payload remaining?'. If 'Yes', it loops back to 'Read header'; if 'No', it proceeds to 'Read the next packet'.

Flowchart of TCP segmentation offload (TSO) flow

For the TSO feature, the Tx DMA operation is as follows:

  1. 1. The application sets up the Transmit descriptor (TDES0-TDES3) and sets the Own bit (TDES3[31]) after setting up the corresponding data buffer(s) with Ethernet packet data.
  2. 2. The application increases the offset value of the Descriptor tail pointer of the DMA Tx channel.
  3. 3. While in the Run state, the DMA fetches the next available descriptor and performs one of the following actions:
    • – If the descriptor is a context descriptor and the context is not between the first and last descriptors of a packet, the DMA stores the context values.
    • – If the descriptor is a context descriptor and the context is between the first and last descriptors of a packet, the DMA closes the context descriptor indicating a Context Descriptor Error (TDES3[23]) and fetches the next descriptor.
    • – If the descriptor is a normal descriptor, the DMA checks the TSE bit. If the TSE bit is not set, the DMA continues with the default mode of operation or OSF operation (if enabled).
    1. 4. The DMA calculates the number of segments from the TCP payload length (TDES3[17:0]) and the MSS value.
    2. 5. The DMA goes through channel arbitration to fetch the data buffers. The DMA fetches the header and payload separately.
    3. 6. For the first segment, the DMA fetches the header from the system memory and stores it in the TSO memory (if present and when the length of header is not greater than the TSO memory size). If the current segmented packet is not the first segment, it fetches again the header buffer in system memory, as done for the first segment. In such cases, the DMA does not close the first descriptor containing the header buffer until the header for last segment is fetched.
    4. 7. The required fields in the header bytes are modified/updated as per the segmentation requirements and written into the corresponding MTL Tx queue.
    5. 8. The DMA then takes the payload buffer pointer, fetches the MSS number of payload bytes from the system memory, and directly pushes it into the MTL Tx queue. If the buffer(s) in the descriptor do(es) not have enough data for the MSS payload (except for the last segment), the DMA closes this descriptor.
    6. 9. The DMA jumps to Step 3 and repeats the process until the last segment is written into the Tx queue.
    7. 10. The DMA closes the last descriptor and the first descriptor (containing the header buffer when it is not stored in TSO memory), and then moves on to the next packet transfer.

The DMA repeats all these steps if more descriptors are available. When no more descriptor are available, the DMA enters the suspend state.

Note: The TSO engine determines whether to perform TSO or USO operation based on the THL field (TCP Header Length) in TDES3 of first Normal Tx descriptor for the packet. The value of 2 indicates USO and any value greater than or equal to 5 indicates TSO.

TCP/IP header fields

While segmenting a TCP packet, the DMA automatically updates the TCP/IP header fields. Table 546 describes how the TCP and IP headers are updated.

Table 546. TSO: TCP and IP header fields

Packet sequenceTCP headerIP header
First packet
  1. 1. The sequence number is not updated. The value provided in the header is used.
  2. 2. If set, the FIN and PSH flags are cleared.
  3. 3. The TCP checksum is calculated again.
IPv4 Header
  • – Total Length = MSS + TCP Header Length + IP Header Length
  • – Identification field is not modified. It is sent as per the header provided by the software.
  • – IPv4 Header Checksum is recalculated.
IPv6 Header
  • – Payload Length = MSS + TCP Header Length + IP Extension Header Length
Subsequent packets
  1. 1. The sequence number is updated. The MSS value is added to the sequence number value of previous segment.
  2. 2. If set, the FIN and PSH flags are cleared.
  3. 3. The TCP checksum is calculated again.
IPv4 Header
  • – Total Length = MSS + TCP Header Length + IP Header Length
  • – Identification field = Previous Identification Field + 1
  • – IPv4 Header Checksum is recalculated
IPv6 Header
  • – Payload Length = MSS + TCP Header Length + IP Extension Header Length
Last packet
  1. 1. The sequence number is updated. The MSS value is added to the sequence number value of previous segment.
  2. 2. If FIN and PSH flags were set in original header, these flags are set.
  3. 3. The TCP checksum is calculated again.
IPv4 Header
  • – Total Length = Remaining Payload + TCP Header Length + IP Header Length
  • – Identification Field = Previous Identification Field + 1
  • – IPv4 header Checksum is recalculated
IPv6 Header
  • – Payload Length = Remaining Payload Length + TCP Header Length + IP Extension Header Length

Header and payload fields of segmented packets

After segmentation, the split packets use the same header as the parent TCP packet for header fields other than the ones described in Table 546: TSO: TCP and IP header fields . Figure 793: Header and payload fields of segmented packets shows how same header is used for the header fields of segmented packets.

The application must create the header in Buffer 1 of the first descriptor of the packet to be segmented and provide the header length in TDES2 of the first descriptor (FD = 1). When the FD bit is set, the DMA reads the header from the header buffer to which the TDES0 is pointing. Buffer 2 of the first descriptor can be used for payload and TDES0 and TDES1 of subsequent descriptors. For subsequent descriptors (FD = 0), the address to which the TDES0 and TDES1 are pointing is treated as payload buffer address of the same packet.

Figure 793. Header and payload fields of segmented packets

Diagram illustrating the header and payload fields of segmented packets. At the top, a 'Header (H)' and 'TCP payload (P)' are shown. Below this, a 'Single header in Tx buffer' (H) and 'Segmented payload in Tx buffer' (P1, P2, ..., P/V) are shown. Arrows indicate the flow of data from the top level to the segmented level, and then to the final segmented packets (H, P1), (H, P2), (H, ...), (H, P/V).

The diagram illustrates the process of packet segmentation. At the top, a 'Header (H)' and 'TCP payload (P)' are shown. Below this, a 'Single header in Tx buffer' (H) and 'Segmented payload in Tx buffer' (P1, P2, ..., P/V) are shown. Arrows indicate the flow of data from the top level to the segmented level, and then to the final segmented packets (H, P1), (H, P2), (H, ...), (H, P/V). The diagram is labeled MSv40803V1.

Diagram illustrating the header and payload fields of segmented packets. At the top, a 'Header (H)' and 'TCP payload (P)' are shown. Below this, a 'Single header in Tx buffer' (H) and 'Segmented payload in Tx buffer' (P1, P2, ..., P/V) are shown. Arrows indicate the flow of data from the top level to the segmented level, and then to the final segmented packets (H, P1), (H, P2), (H, ...), (H, P/V).

Context descriptor sequence

The context descriptor can provide the maximum segment size (MSS) value for segmentation. The application must provide the context descriptor before the normal descriptor to be used for the corresponding TCP packet. If the application needs to provide a new MSS, it must create the context descriptor in the descriptor list before the first normal descriptor of the packet to be segmented with the new MSS value. The MSS value in the context descriptor is valid only if the TCMSSV bit of TDES3 in context descriptor is set and the OSTC bit is reset (refer to Section 58.10.3: Transmit descriptor ).

When the application provides a context descriptor with a valid MSS value, the DMA internally stores the MSS value and uses this value for all subsequent packets for which the TSO is enabled through the TSE bit of TDES3 normal descriptor.

If the application places a context descriptor in the middle of a packet (between the first and last descriptors of a packet), the DMA does the following:

  1. 1. The DMA ignores the context and closes the descriptor.
  2. 2. The DMA indicates the error in descriptor status.
  3. 3. The DMA generates an interrupt if the CDEE bit is set in the Interrupt enable register corresponding to a DMA channel (see Channel interrupt enable register (ETH_DMAIER) ).

The application can read the interrupt status through CDE bit of Status register corresponding to a DMA channel (see Channel status register (ETH_DMACSR) ).

Building the Descriptor and the packet for the TSO feature

To enable segmentation for a packet, the application must set the TSE bit of TDES3 of first normal descriptor (see Section 58.10.3: Transmit descriptor ). If the TSE bit is set in TDES3 for a non TCP/IP packet, the DMA behavior is unpredictable.

The application must program the length of the TCP packet payload in TDES3[17:0] and the TCP header in TDES3[22:19]. The maximum length of TCP packet payload that can be segmented is 256 Kbytes.

The header of the packet including Ethernet header, L3 header and L4 header should be provided in Buffer1 of the first normal descriptor of the TSO packet. Only buffer 1 of the first normal descriptor of a packet enabled for TSO is taken as the buffer containing the header.

The TCP payload can begin from buffer 2 of the first normal descriptor and continue to buffer 1 and buffer 2 of second normal descriptor and subsequent descriptors.

The TCP payload may span across multiple buffers and multiple descriptors. The size of buffers containing the TCP payload should add up to be equal to the TCP payload length provided in TDES3[17:0] of the first normal descriptor.

The MAC always calculates and appends CRC and inserts Padding (if required) for all packets segmented by the DMA. If the TSE bit of TDES3 is enabled, the CRC PAD Control (CPC) field of TDES3 is reserved. To determine the size of a TCP packet after segmentation, the DMA uses the Maximum Segment Size (MSS) provided by the application through context descriptor. The DMA segments only those packets which have payload size greater than MSS. The application must provide the MSS by either programming the MSS value in ETH_DMAACR (see Channel control register (ETH_DMAACR) ) or by providing a context descriptor. The DMA uses the last programmed value of MSS or the last MSS value provided through context (whichever is provided later).

The header length plus the MSS size (which is equal to the size of each TCP segment) should not exceed 16383 bytes otherwise the MAC transmitter truncates the packet after 16383 bytes causing a CRC error.

The header length plus MSS size plus programmed PBL value in ETH_DMACTXCR register (see Channel transmit control register (ETH_DMACTXCR) ) should be lesser than the Tx queue size programmed in TQS field of ETH_MTLTXQOMR register (see Tx queue operating mode Register (ETH_MTLTXQOMR) ). A MSS plus header equal to half the programmed Tx queue size is recommended.

The DMA also supports segmentation of VLAN-tagged TCP/IP frames. If the TCP packet has a VLAN tag, then the same tag is used for all the segments irrespective of the VLAN tag type provided (C-VLAN or S-VLAN). The VLAN tag insert/replace control bits are used for all segments.

If the Double VLAN feature is selected, then the DMA passes both tags for all segments irrespective of the VLAN tag types provided (C-VLAN or S-VLAN). The VLAN tag Insert/Replace control bits for both tags is applicable to all segments. If the Double VLAN feature is not selected, then the application must not set the TSE bit in TDES3 for a TCP/IP packet with two tags. The DMA behavior in this scenario is unpredictable.

If the TSE bit is set in TDES3 for the packet and TCP header length provided is less than 5 (meaning this is an invalid TCP header because it is less than 20 bytes), the DMA does not perform segmentation, instead it transmits the entire packet as a single packet. In this scenario, the CRC pad control bits are forced by DMA to 00 (MAC does CRC and padding) and checksum insertion control bits are forced to 11 (hardware does the checksum calculation for both header and payload).

58.5.7 IPv4 ARP offload

The MAC supports the Address Recognition Protocol (ARP) Offload for IPv4 packets. This feature allows to process the IPv4 ARP request packet in the receive path and to generate the corresponding ARP response packet in the transmit path.

The MAC generates the ARP reply packets for appropriate ARP request packets. ARP packets for IPv4 are L2 layer packets with Length/Type of 0x0806.

The ARP offloading sequence is as follows:

  1. 1. The MAC receiver gets an ARP request if the request Target Protocol Address matches the IPv4 address programmed in the MAC L3 register.
  2. 2. The MAC generates an ARP reply packet.
  3. 3. The MAC copies the Sender Hardware Address field in the ARP request to the following fields:
    • – DA field of the Ethernet packet header
    • – Target Hardware Address field of the ARP reply packet
  4. 4. The MAC copies the Sender Protocol Address field in the ARP request to the Target Protocol Address field in the ARP reply packet.
  5. 5. The MAC places its MAC address in the following fields:
    • – SA field of the Ethernet packet header
    • – Sender Hardware Address field of the ARP reply packet
  6. 6. The MAC copies the Target Protocol Address field in the ARP request to the Sender Protocol Address field in the ARP reply packet.
  7. 7. The MAC sets the opcode field in ARP reply packet to 2 indicating ARP reply.
  8. 8. The MAC recalculates the CRC and performs padding for the generated ARP reply packet.
  9. 9. The MAC transmitter sends the ARP reply

The MAC processes only one ARP request at a time. It does not store the fields of multiple ARP requests. If the MAC receives an ARP request when it is already processing an earlier ARP request, the MAC does not generate the ARP reply for new ARP request. The MAC forwards the new ARP request packet to the application with ARP Reply Not Generated status bit set (bit 34). However, in power-down mode, if the MAC receives an ARP request when it is already processing an earlier ARP request, the MAC drops the new ARP request. If the Disable CRC check (DCRCC) bit of the Extended operating mode configuration register (ETH_MACECR) is set, then the MAC does not check for valid CRC of a ARP

request packet. It can generate an ARP response packet if the other conditions are valid. The ARP request packet must always have a valid CRC.

Note: When the received ARP request is less than the 64-byte packet length, the MAC does not send an ARP response. It is treated as a normal packet and forwarded to the application based on the MAC filter settings.

58.5.8 Loopback

The MAC supports loopback of transmitted packets to its receiver.

Guidelines for using Loopback mode

Below some guidelines for using the Loopback mode:

The Transmit and Receive clocks can have an asynchronous timing relationship. Therefore, an asynchronous FIFO is used to make the loopback path of the transmitted data to the Receive path. The FIFO is free-running to write on the write clock (eth_mii_tx_clk) and read on every read clock (eth_mii_rx_clk). At the start of each packet read from the FIFO, the write and read pointers are reinitialized to have an offset of four (in 10/100 Mbps mode). This avoids overflow or underflow during a packet transfer, and ensures that the overflow or underflow occurs only during the IPG period between the packets. The FIFO depth of five or nine is sufficient to prevent data corruption for packet sizes up to 9,022 bytes with a difference of 200 ppm between MII Transmit and Receive clock frequencies.

Therefore, bigger packets should not be looped back because they may get corrupted in this loopback FIFO.

At the end of every received packet, the Receive Protocol Engine module generates received packet status and sends it to the Receive Packet Controller module. The control, missed packet, and filter fail status are added to the Receive status in the Receive Packet Controller module. The MAC does not process ARP or PMT packets that are looped back.

Enabling Loopback mode

To enable this feature, program the LM bit of the Operating mode configuration register (ETH_MACCR) . Loopback can be enabled for all PHY interfaces. The data is always looped back through internal asynchronous FIFO on to the internal Receive MII interface, irrespective of which PHY interface is selected.

The loopback data is also passed through the corresponding transmit PHY interface block, onto the Ethernet line.

Note: During loopback, the data/packet is reflected on mii_txd signal. Preemption is not supported in Loopback mode.

58.5.9 Flow control

The transmit flow control involves transmitting Pause packets in Full-duplex mode and backpressure in Half-duplex mode to control the flow of packets from the remote end. This section describes the flow control for transmit and receive paths.

Flow control in Full-duplex mode

In Full-duplex mode, the MAC uses IEEE 802.3x Pause packets for flow control. Table 547 describes the fields of a Pause packet.

Table 547. Pause packet fields

FieldDescription
DAContains the special multicast address
SAContains the MAC address 0
TypeContains 8808
MAC Control opcodeContains 0001 for IEEE 802.3x Pause Control packets
PTContains Pause time specified in the PT field of the Tx Queue flow control register (ETH_MACQTXFCR)

When the FCB bit is set, the MAC generates and transmits a single Pause packet. If the FCB bit is set again after the Pause packet transmission is complete, the MAC sends another Pause packet irrespective of whether the pause time is complete or not. To extend the pause or terminate the pause prior to the time specified in the previously-transmitted Pause packet, the application should program the Pause Time register with appropriate value and then again set the FCB bit.

Flow control in Half-duplex mode

In Half-duplex mode, the MAC uses the deferral mechanism for the flow control (backpressure). When the application requests to stop receiving packets, the MAC sends a JAM pattern of 32 bytes when it senses a packet reception, provided the transmit flow control is enabled. This results in a collision and the remote station backs off. If the application requests a packet to be transmitted, it is scheduled and transmitted even when the backpressure is activated. If the backpressure is kept activated for a long time (and more than 16 consecutive collision events occur), the remote stations abort the transmission because of excessive collisions.

Table 548 describes the flow control in the Tx path based on the setting of the following bits:

Flow control is similar for all queues.

Table 548. Tx MAC flow control

TFEDMDescription
0XThe MAC transmitter does not perform the flow control or backpressure operation.
10The MAC transmitter performs backpressure when Bit 0 of Tx Queue flow control register (ETH_MACQTXFCR) is set.
11The MAC transmitter sends the Pause packet when Bit 0 of Tx Queue flow control register (ETH_MACQTXFCR) is set.

Transmit flow control

The transmit flow control is enabled when TFE bit is set in Tx Queue flow control register (ETH_MACQTXFCR) .

Flow control trigger

The application can request the MAC to send a Pause packet or initiate back-pressure by setting the FCB bit in the corresponding Tx Queue flow control register (ETH_MACQTXFCR) .

Receive flow control

In the Receive path, the flow control is functional only in Full-duplex mode. If any Pause packet is received in Half-duplex mode, the packet is considered as a normal control packet.

Description of receive flow control

Table 549 describes the flow control in the Rx path based on the setting of the following bits:

Table 549. Rx MAC flow control

RFEDMDescription
0xThe MAC receiver does not detect the received Pause packets.
10The MAC receiver does not detect the received Pause packets but recognizes such packets as Control packets.
11The MAC receiver detects or processes the Pause packets and responds to such packets by stopping the MAC transmitter.

The following sequence describes the Rx flow control:

  1. 1. The MAC checks the destination address (DA) of the received Pause packet for either of the following:
    • – Multicast destination address: the DA matches the unique multicast address specified for the control packet (0x0180 C200 0001).
    • – Unicast destination address: the DA matches the content of the MAC Address 0 registers ( MAC Address 0 high register (ETH_MACA0HR) and MAC Address x

low register (ETH_MACAxLR) ) and the UP bit of Rx flow control register (ETH_MACRXFCR) is set.

If the UP bit is set, the MAC processes Pause packets with unicast destination address in addition to the unique multicast address.

  1. 2. The MAC decodes the following fields of the received packet:
    • – Type field: this field is checked for 0x8808.
    • – Opcode field: this field is checked for 0x0001 (Pause packet).
    • – Pause time: the Pause time (for Pause packet) is captured to determine the time for which the transmitter needs to be blocked.
  2. 3. If the byte count of the status indicates 64 bytes and there is no CRC error, the MAC transmitter pauses the transmission of any data packet for the duration of the decoded Pause Time value multiplied by the slot time (64 byte times).

If subsequent Pause packets are received before the earlier Pause Time expires, the MAC updates the Pause Timer with new value.

Enabling receive flow control

Set the RFE bit in the Rx flow control register (ETH_MACRXFCR) to enable the Pause flow control.

58.5.10 MAC management counters

The peripheral supports storing the statistics about the received and transmitted packets in registers that are accessible through the application.

The counters in the MAC management counters (MMC) module can be viewed as an extension of the register address space of the CSR module. The MMC module maintains a set of registers for gathering statistics on the received and transmitted packets. The register set includes a control register for controlling the behavior of the registers, two 32-bit registers containing interrupts generated (receive and transmit), and two 32-bit registers containing masks for the Interrupt register (receive and transmit). These registers are accessible from the Application through the AHB slave interface in the same way the CSR registers are accessed. The organization of these registers is shown in Section 58.11.4: Ethernet MAC and MMC registers .

The MMC counters are free running. There is no separate enable for the counters to start. A particular MMC counter starts counting when corresponding packet is received or transmitted.

The Receive MMC counters are updated for packets that are passed by the Address Filter (AFM) block. The statistics of packets dropped by the AFM module, are not updated unless they are runt packets of less than 6 bytes (DA bytes are not received fully). To get statistics of all packets, set bit 0 in the Packet filtering control register (ETH_MACPFR) . The MMC module gathers statistics on encapsulated IPv4, IPv6, TCP, UDP, or ICMP payloads in received Ethernet packets.

In addition to control registers, two sets of registers are implemented:

Definitions

The following terminology is used in MMC register descriptions:

Table 550. Size of the maximum receive packet

JES2KPGPSLCEEDVLPUntagged frame maximum size in bytesSingle VLAN frame maximum size in bytesDouble VLAN Frame maximum size in bytes
1XX1901890229026
01XX200020002000
0011GPSLGPSL+4GPSL+8
0001151815221526
1XX0901890229022
0010GPSLGPSL+4GPSL+4
0000151815221522

58.5.11 Interrupts generated by the MAC

Interrupts can be generated from the MAC as a result of various events. These interrupt events are combined with the events in the DMA on the eth_sbd_intr_it signal. The MAC interrupts are of level type, that is, the interrupt remains asserted (high) until it is cleared by the application or software.

The Interrupt status register (ETH_MACISR) describes the events that can cause an interrupt from the MAC. The MAC interrupts are enabled by default. Each event can be prevented from asserting the interrupt on the eth_sbd_intr_it signals by setting the corresponding mask bits in the Interrupt enable register (ETH_MACIER) .

The interrupt register bits only indicate the block from which the event is reported. You must read the corresponding status registers and other registers to clear the interrupt.

58.5.12 MAC and MMC register descriptions

Refer to Section 58.11.4: Ethernet MAC and MMC registers .

58.6 Ethernet functional description: PHY interfaces

The Ethernet peripheral support several PHY interfaces. The root interface is the MII one. All other interfaces are derived from it as shown in Figure 794 .

Figure 794. Supported PHY interfaces

Figure 794: Supported PHY interfaces block diagram. A dashed box labeled 'MAC' contains 'MAC Tx' and 'MAC Rx' blocks. Arrows from these blocks point to an 'RMII' block and a 'Select' block. The 'RMII' block is connected to the 'Select' block. The 'Select' block has an output labeled 'PHY I/F'. A line labeled 'MII' connects the 'MAC' box to the 'Select' block. The diagram is labeled MSv40804V2.
Figure 794: Supported PHY interfaces block diagram. A dashed box labeled 'MAC' contains 'MAC Tx' and 'MAC Rx' blocks. Arrows from these blocks point to an 'RMII' block and a 'Select' block. The 'RMII' block is connected to the 'Select' block. The 'Select' block has an output labeled 'PHY I/F'. A line labeled 'MII' connects the 'MAC' box to the 'Select' block. The diagram is labeled MSv40804V2.

This section describes the SMA module used for PHY control and different PHY interfaces. It contains the following sections:

58.6.1 Station management agent (SMA)

The application can access the PHY registers through the station management agent (SMA) module. The SMA includes a two-wire station management interface (MIM).

The SMA module supports accessing up to 32 PHYs. The application can address one of the 32 registers from any 32 PHYs. Only one register in one PHY can be addressed at a time. The application sends the control data to the PHY and receives status information from the PHY through the SMA module, as shown in Figure 795 .

Figure 795. SMA Interface block

Figure 795: SMA Interface block diagram. A block labeled 'STM32' is connected to a vertical block labeled '802.3 MAC'. From the '802.3 MAC' block, two lines labeled 'MDC' and 'MDIO' point to a block labeled 'External PHY'. The diagram is labeled ai15621c.
Figure 795: SMA Interface block diagram. A block labeled 'STM32' is connected to a vertical block labeled '802.3 MAC'. From the '802.3 MAC' block, two lines labeled 'MDC' and 'MDIO' point to a block labeled 'External PHY'. The diagram is labeled ai15621c.

SMA functional overview

The MAC initiates the management write or read operation with respect to the MDC clock. The MDC clock is derived from the CSR clock (eth_hclk). The maximum operating frequency of the ETH_MDC pin is 2.5 MHz, as specified in IEEE 802.3 specifications. However, a different divider can be selected if the system supports higher clock frequencies. The division factor depends on the clock range setting through CR[3:0] in the MDIO address register (ETH_MACMDIOAR) register. The MDC clock is selected as follows:

Table 551. MDC clock selection

Selectioneth_hclkMDC clock
000060–100 MHzCSR clock/42
0001100–150 MHzCSR clock/62
001020–35 MHzCSR clock/16
001135–60 MHzCSR clock/26
0100150–250 MHzCSR clock/102
0101250–300 MHzCSR clock/124
0110, 0111Reserved-

The data exchange between the MAC and the PHY is performed through a three-state buffer and brought out as ETH_MDIO line connected to the PHY.

Figure 796 shows the structure of a Clause 45 MDIO packet, while Table 552 provides a detailed description of the packet fields.

Figure 796. MDIO packet structure (Clause 45)

IDLEPREAMBLESTARTOPCODEPHY ADDRDEV TYPETAADDR/
DATA

Table 552. MDIO Clause 45 frame structure

FieldDescription
IDLEThe ETH_MDIO line is three-state; there is no clock on ETH_MDC.
PREAMBLE32 continuous bits of value 1
STARTStart of packet is 0b00
OPCODE
  • – 0b00: Address
  • – 0b01: Write
  • – 0b10: Read+ Address
  • – 0b11: Read
PHY ADDR5-bit address select for one of 32 PHYs
DEV TYPE5-bit device type
TATurnaround
  • – 0bZ0: Read and post-read increment address
  • – 0b10: Write and address MDIO accesses where Z is the tri-state level
DATA16-bit value: for an address cycle (OPCODE = 0b00), this frame contains the address of the register to be accessed on the next cycle. For the data cycle of a write frame, this field contains the data to be written to the register. For read or post-read increment address frames, this field contains the contents of the register read from the PHY.
  • – In address and data write cycles, the peripheral drives the ETH_MDIO line during the transfer of these 16 bits.
  • – In read and post-read increment address cycles, the PHY drives the ETH_MDIO line during the transfer of these 16 bits.

The frame structure for Clause 22 frames is also supported. The C45E bit in MDIO address register (ETH_MACMDIOAR) can be programmed to enable Clause 22 or Clause 45 mode of operation. Figure 797 shows the structure of a Clause 22 MDIO packet, while Table 553 provides a detailed description of the packet fields.

Figure 797. MDIO packet structure (Clause 22)

IDLEPREAMBLESTARTOPCODEPHY ADDRREG ADDRTADATA
MSv40806V1
Table 553. MDIO Clause 22 frame structure
FieldDescription
IDLEThe ETH_MDIO line is three-state; there is no clock on ETH_MDC.
PREAMBLE32 continuous bits of value 1
STARTStart of packet is 0b01
OPCODE0b10 for Read and 0b01 for Write
PHY ADDR5-bit address select for one of 32 PHYs
REG ADDRRegister address in the selected PHY
TATurnaround
– 0bZ0: Read and post-read increment address
– 0b10: Write and address MDIO accesses where Z is the tri-state level
DATAAny 16-bit value. In a Write operation, the MAC drives ETH_MDIO. In a Read operation, the PHY drives it.

In addition to normal read and write operations, the SMA also supports post-read increment address while operating in Clause 45 mode.

MII management write operations

After the station management agent receives the PHY address and the write data from the MAC CSR module, the SMA starts a write operation to the PHY registers.

Figure 798 illustrates the flow for a write operation from the SMA module to the PHY registers.

Figure 798. SMA write operation flow

Flowchart of SMA write operation flow
graph TD
    A[Set MAC MDIO address
register
bits[3:2] to 0b10 and bit 0] --> B[MAC CSR transfers
PHY address and write data
(MAC MDIO data register)] B --> C[SMA module starts write
operation on GMII
management interface] C --> D[Write data packet
transmitted on MDIO] D --> E[MAC drives MDIO for duration
of packet] E --> F[Write operation complete] F --> G[CSR resets busy bit] C --> H[Busy bit set high] H --> I[CSR ignores write operations
performed to MAC MDIO
address or MAC MDIO data
registers when Busy bit high] I --> G C -.- J[Management packet format used as
specified in GMII specifications (as
per IEEE 802.3-2002, Section
22.2.4.5)]

The flowchart illustrates the SMA write operation flow. It begins with setting the MAC MDIO address register bits[3:2] to 0b10 and bit 0. The MAC CSR then transfers the PHY address and write data from the MAC MDIO data register. The SMA module starts the write operation on the GMII management interface. This action triggers two parallel paths: 1) the busy bit is set high, and the CSR ignores subsequent write operations to the MAC MDIO address or data registers while the busy bit is high; 2) the write data packet is transmitted on the MDIO line, and the MAC drives the MDIO line for the duration of the packet until the write operation is complete. Both paths converge when the CSR resets the busy bit. A note specifies that the management packet format follows IEEE 802.3-2002, Section 22.2.4.5.

Flowchart of SMA write operation flow

When bits[3:2] are set to 01 and bit 0 to 1 in the MDIO address register (ETH_MACMDIOAR) , the MAC CSR module transfers the PHY address, the register address in PHY, and the write data ( MDIO data register (ETH_MACMDIODR) ) to the SMA to initiate a Write operation into the PHY registers. At this point, the SMA module starts a Write operation on the MII management Interface using the management packet format specified in the MII specifications (as per IEEE 802.3-2002 specifications, Section 22.2.4.5 ).

When the SMA module starts a Write operation, the write data packet is transmitted on the MDIO line. The MAC drives the MDIO line for complete duration of the packet. The Busy bit is set high until the write operation is complete. The CSR ignores the Write operations performed to the MDIO address register (ETH_MACMDIOAR) or the MDIO data register

( ETH_MACMDIODR ) during this period (the Busy bit is high). When the Write operation is complete, the SMA module indicates this to the CSR, and the CSR resets the Busy bit. The packet format for the Write operation is as follows:

Figure 799. Write data packet

IDLEPREAMBLESTARTOPCODEPHY ADDRREG ADDRTADATAIDLE
Z1111..110101AAAAARRRRR10DDD...DDDZ

MSv40807V1

MII management read operation

When bits[3:2] are set to 11 and bit 0 to 1 in the MDIO address register (ETH_MACMDIOAR) , the MAC CSR module transfers the PHY address and the register address in PHY to the SMA to initiate a Read operation in the PHY registers. At this point, the SMA module starts a Read operation on the MII management interface using the management packet format specified in the MII specifications (as per IEEE 802.3-2002 specifications, Section 22.2.4.5 ).

When the SMA module starts a Read operation on the MDIO, the CSR ignores the Write operations to the MDIO address register (ETH_MACMDIOAR) or MDIO data register (ETH_MACMDIODR) register during this period (the Busy bit is high) and the transaction is completed without any error on the MCI interface. When the Read operation is complete, the SMA indicates this to the CSR. The CSR resets the Busy bit and updates the MDIO data register (ETH_MACMDIODR) with the data read from the PHY. The MAC drives the MDIO line for the complete duration of the frame except during the Data fields when the PHY is driving the MDIO line. For more information about the communication from the application to the PHYs, see the Reconciliation Sublayer and Media Independent Interface Specifications sections of the IEEE 802.3z, 1000BASE Ethernet.

The packet format for the Read operation is as follows:

Figure 800. Read data packet

IDLEPREAMBLESTARTOPCODEPHY ADDRREG ADDRTADATAIDLE
Z1111..110110AAAAARRRRRZ0DDD...DDDZ

MSv40808V1

Preamble suppression

The IEEE standard specifies 32-bit preamble (all-ones) for the MDIO frames. The peripheral provides controls to support preamble suppression. It transmits MDIO frames with only 1 preamble bit. The preamble suppression can be enabled by setting the PSE bit in MDIO address register (ETH_MACMDIOAR) .

Trailing clocks and back-to-back transactions

The peripheral drives the ETH_MDC clock for the duration of the MDIO frame. There is no clock driven during the idle period. The trailing clock feature can be used if the PHY needs the ETH_MDC clock to be active for some cycles after the MDIO frame. The NTC[2:0] bitfield in MDIO address register (ETH_MACMDIOAR) allows the programming of trailing clocks from 0 to 7.

The peripheral supports back-to-back transactions which allow starting the next MDIO frame even before the trailing clocks are complete for previous MDIO frame. This feature can be enabled by setting BTB bit in MDIO address register (ETH_MACMDIOAR) when the trailing clock feature is also enabled. When back-to-back transactions are enabled, the GMII busy bit (GB) is cleared immediately after MDIO frame completion. This allows the software to issue the next command, which is executed by the peripheral while trailing clocks are still on for the previous MDIO frame. When (GB) transactions are not enabled, the GMII busy bit is cleared after the trailing clocks are complete for the MDIO frame.

Interrupt for MDIO transaction completion

The peripheral can generate an interrupt on completion of MDIO read or write transactions. Therefore, the application need not poll the GMII busy bit of the MDIO address register (ETH_MACMDIOAR) to know the completion of MDIO commands.

58.6.2 Media independent interface (MII)

The media-independent interface (MII) defines the interconnection between the MAC sublayer and the PHY for data transfer at 10 Mbit/s and 100 Mbit/s.

MII signals are given in Figure 801: Media independent interface (MII) signals .

Figure 801. Media independent interface (MII) signals

Diagram of the Media Independent Interface (MII) signals between an STM32 MCU and an External PHY. The diagram shows the 802.3 MAC sublayer within the STM32 MCU connected to an External PHY. The signals are: TX_CLK (clock from PHY to MAC), TXD[3:0] (data from MAC to PHY), TX_EN (enable from MAC to PHY), TX_ER (optional error from MAC to PHY), RX_CLK (clock from PHY to MAC), RXD[3:0] (data from PHY to MAC), RX_DV (data valid from PHY to MAC), RX_ER (error from PHY to MAC), CRS (carrier sense from PHY to MAC), and COL (collision from PHY to MAC).

The diagram illustrates the connection between an STM32 MCU and an External PHY via the Media Independent Interface (MII). The STM32 MCU contains an 802.3 MAC sublayer. The signals are as follows:

MSv40809V2

Diagram of the Media Independent Interface (MII) signals between an STM32 MCU and an External PHY. The diagram shows the 802.3 MAC sublayer within the STM32 MCU connected to an External PHY. The signals are: TX_CLK (clock from PHY to MAC), TXD[3:0] (data from MAC to PHY), TX_EN (enable from MAC to PHY), TX_ER (optional error from MAC to PHY), RX_CLK (clock from PHY to MAC), RXD[3:0] (data from PHY to MAC), RX_DV (data valid from PHY to MAC), RX_ER (error from PHY to MAC), CRS (carrier sense from PHY to MAC), and COL (collision from PHY to MAC).

the most significant bit. While RX_EN is deasserted and RX_ER is asserted, a specific RXD[3:0] value is used to transfer specific information from the PHY.

This signal indicates that the PHY is presenting recovered and decoded nibbles on the MII for reception. It must be asserted synchronously (RX_CLK) with the first recovered nibble of the frame and must remain asserted through the final recovered nibble. It must be deasserted prior to the first clock cycle that follows the final nibble. In order to receive the frame correctly, the RX_DV signal must encompass the frame, starting no later than the SFD field.

This signal must be asserted for one or more clock periods (RX_CLK) to indicate to the MAC sublayer that an error was detected somewhere in the frame. This error condition must be qualified by RX_DV assertion.

This signal is asserted by the PHY when either the transmit or receive medium is non idle. It is deasserted by the PHY when both transmit and receive media are idle. The PHY must ensure that the CS signal remains asserted throughout the duration of a collision condition. This signal is not required to transition synchronously with respect to the Tx and Rx clocks. In Full-duplex mode the state of this signal is don't care for the MAC sublayer.

This signal must be asserted by the PHY upon detection of a collision on the medium and must remain asserted while the collision condition persists. This signal is not required to transition synchronously with respect to the Tx and Rx clocks. In Full-duplex mode, the state of this signal is don't care for the MAC sublayer.

58.6.3 Reduced media independent interface (RMII)

The reduced media independent interface (RMII) specification reduces the pin count between Ethernet PHYs and STM32 MCU. According to the IEEE 802.3u, an MII contains 16 pins for data and control. RMII specification reduces the pin count to 7.

Part of the Ethernet peripheral, the RMII module is instantiated at the MAC output. This helps in translating the MII of the MAC into the RMII. The RMII block has the following characteristics:

RMII block diagram

Figure 802: RMII block diagram shows the position of the RMII block relative to the MAC and RMII PHY. The RMII block is placed in front of the MAC to translate the MII signals to RMII signals.

RMII block diagram showing the connection between an STM32 MCU, an 802.3 MAC, an RMII Block, and an External PHY. The MAC and RMII Block are connected via an MII interface. The RMII Block is connected to the External PHY via RMII_REF_CLK, TXD[1:0], TX_EN, RXD[1:0], and CRS_DV signals.

Figure 802. RMII block diagram

The diagram illustrates the internal architecture of the Ethernet MAC. On the left, an 'STM32 MCU' is connected to an '802.3 MAC'. The MAC is connected to an 'RMII Block' via an 'MII' interface, represented by a double-headed arrow. The 'RMII Block' is connected to an 'External PHY' on the right. The connections are as follows: 'RMII_REF_CLK' (a continuous 50 MHz reference clock) is input to the RMII Block from the External PHY; 'TXD[1:0]' (transmit data) and 'TX_EN' (transmit data enable) are output from the RMII Block to the External PHY; 'RXD[1:0]' (receive data) and 'CRS_DV' (carrier Sense and RX_Data Valid) are input from the External PHY to the RMII Block. The entire system is enclosed in a box labeled 'MSv40811V2' in the bottom right corner.

RMII block diagram showing the connection between an STM32 MCU, an 802.3 MAC, an RMII Block, and an External PHY. The MAC and RMII Block are connected via an MII interface. The RMII Block is connected to the External PHY via RMII_REF_CLK, TXD[1:0], TX_EN, RXD[1:0], and CRS_DV signals.

When high, this bit indicates that valid data are being transmitted on TXD[1:0].

Transmit bit order

Each nibble from the MII interface must be transmitted on the RMII interface di-bit at a time with the order of di-bit transmission shown in Figure 803: Transmission bit order . The lower order bits (D1 and D0) are transmitted first followed by higher order bits (D2 and D3).

Figure 803. Transmission bit order

Diagram illustrating the transmission bit order for a nibble stream on the RMII interface.

The diagram illustrates the transmission bit order for a nibble stream on the RMII interface. On the left, a 'Nibble stream' is shown as a vertical stack of four bits: D0 (LSB), D1, D2, and D3 (MSB). An arrow labeled 'mii_txd[3:0]' points to this stack. On the right, the bits are transmitted as a 'Di-bit stream' over two cycles. In the first cycle, D0 (labeled LSB) and D1 (labeled MSB) are transmitted. In the second cycle, D2 (labeled LSB) and D3 (labeled MSB) are transmitted. The transmission direction is indicated by a large upward arrow labeled 'RMII_TXD[1:0]'. The diagram is labeled 'MSv40812V2' in the bottom right corner.

Diagram illustrating the transmission bit order for a nibble stream on the RMII interface.

Receive bit order

Each nibble is transmitted to the MII interface from the di-bit received from the RMII interface in the nibble transmission order shown in Figure 804: Receive bit order . The lower order bits (D0 and D1) are received first, followed by the higher order bits (D2 and D3).

Figure 804. Receive bit order

Diagram illustrating the receive bit order. A di-bit stream from RMII_RXD[1:0] (LSB to MSB) is received into bits D0 and D1. These are then transmitted as a nibble stream mii_rxd[3:0] (LSB to MSB) containing bits D0, D1, D2, and D3.

The diagram shows the flow of data from a di-bit stream to a nibble stream. At the top, an arrow labeled 'RMII_RXD[1:0]' points down into a box containing 'D0' and 'D1'. Above this box, 'LSB' is on the left and 'MSB' is on the right. To the right of the box is the label 'Di-bit stream'. Below this, a vertical stack of four boxes contains 'D0', 'D1', 'D2', and 'D3'. To the left of 'D0' is 'LSB', and to the left of 'D3' is 'MSB'. An arrow labeled 'mii_rxd[3:0]' points left from the stack. Below the stack is the label 'Nibble stream'. Dashed lines connect 'D0' and 'D1' from the di-bit stream to the 'D0' and 'D1' in the nibble stream stack. A solid line connects 'D1' in the di-bit stream to 'D1' in the nibble stream stack. The text 'MSv40813V2' is in the bottom right corner.

Diagram illustrating the receive bit order. A di-bit stream from RMII_RXD[1:0] (LSB to MSB) is received into bits D0 and D1. These are then transmitted as a nibble stream mii_rxd[3:0] (LSB to MSB) containing bits D0, D1, D2, and D3.

58.7 Ethernet low-power modes

58.7.1 Low-power management

The Ethernet peripheral supports the following techniques to save power:

The magic packet and remote wake-up techniques are used to save power in the host system when it is idle (Sleep mode) and has to be woken up only at the reception of specific packets from the Ethernet network. In Sleep mode, the power to the host logic along with the majority of the peripheral (except the MAC receiver logic), can be shut down. On receiving the specific packets from the network, the MAC provides the trigger to restore the power to the host system and come back to normal state.

The Energy Efficient Ethernet (EEE) mode is compliant with the IEEE 802.3az-2010 standard. It is primarily targeted to save power in the Ethernet port when there is no traffic on the line. In this mode, the host indicates to the far-end that it does not have any packets to transmit in the near future and puts the transmitter port (MAC controller, PCS and PHY layers) in low-power mode. Similarly, the receiver port can also be put in low-power mode when the far-end host indicates that it does not have any traffic to transfer. This allows significant saving of power in the Ethernet port (mainly in the PHY) with intermittent and bursty traffic profile. The triggering of entry and exit out of the EEE mode is controlled by the MAC and is supported within the peripheral.

Simultaneous operation of the EEE mode along with any or both the other power saving modes is also supported.

Description of magic packet mode

This section describes how to save power through magic packet detection.

Note: The magic packet feature is based on the magic packet technology white paper from Advanced Micro Device (AMD).

The watchdog timeout limit for a magic packet is 2,048 bytes irrespective of the value programmed in WD bit in Operating mode configuration register (ETH_MACCCR) and PWE bit in Watchdog timeout register (ETH_MACWTR).

In the magic-packet-based power saving mode, the reception of a valid magic packet by the MAC receiver triggers an exit from low-power mode. The MAC enters power saving mode when PWRDWN bit of PMT control status register (ETH_MACPCSR) is programmed to 1. Exit from the magic-packet-based power saving mode is enabled by setting the MGKPKTEN bit of PMT control status register (ETH_MACPCSR) to 1.

The magic packet contains a unique pattern at any offset after the Destination address, Source address, and Length/Type fields. In addition to the unique pattern matching, the MAC receiver also checks for the following, to detect the received packet as a valid magic packet:

Magic packet data format

The content of the unique pattern in magic packets is described as follows:

If the MAC address of a node is 0x00 11 22 33 44 55, the MAC scans for the following data sequence:

Destination Address Source Address Length/Type..... FF FF FF FF FF FF
00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55
00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55
00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55
00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55
...CRC

Description of remote wake-up packet mode

This section describes the power saving mode based on remote wake-up packet.

Note: The remote wake-up packet feature implementation is based on the Device Class Power Management Reference Specification and various implementation-specific white papers.

The watchdog timeout limit for a magic packet is 2,048 bytes irrespective of the value programmed in WD bit in Operating mode configuration register (ETH_MACCCR) and PWE bit in Watchdog timeout register (ETH_MACWTR).

In the remote-wake-up-magic-packet-based power saving mode, the reception of expected remote wake-up packet by the MAC receiver triggers the exit from low-power mode. The MAC enters power saving mode when PWRDOWN bit in PMT control status register (ETH_MACPCSR) is programmed to 1. Exit from the remote-wake-up-magic-packet-based power saving mode is enabled by programming RWKPKTEN bit of PMT control status register (ETH_MACPCSR) to 1.

The MAC implements a filter lookup table (programmed through Remote wake-up packet filter register (ETH_MACRWKPFR) ) in which CRC, offset, and byte mask of the pattern embedded in remote wake-up packet and the filter operation commands are programmed.

The pattern embedded in the remote wake-up packet is located at any offset after the Destination address and Source address fields. In addition to the CRC match for the pattern, the MAC receiver also checks the following, to detect the received packet as a valid remote wake-up packet:

When a valid remote wake-up packet is received, the MAC receiver sets the RWKPRCVD bit in PMT control status register (ETH_MACPCSR) and triggers the interrupt on pmt_intr_o output port. The PMTIS bit in Interrupt status register (ETH_MACISR) is set when power-gating is not enabled in low-power mode. An interrupt is triggered to the application on the sbd_intr_o output port when interrupt is enabled (PMTIE bit in Interrupt enable register (ETH_MACIER) is set) and CSR clock is not gated off in low-power mode.

Remote wake-up packet filters

When the remote-wake-up-based power saving mode is enabled, four remote wake-up filters can be selected. The structure of the remote wake-up filters is shown in Table 554: Remote wake-up packet filter register .

Table 554. Remote wake-up packet filter register

ETH_MACRWKPFR valueField
0Filter 0 byte mask
1Filter 1 byte mask
2Filter 2 byte mask
3Filter 3 byte mask
4ReservedFilter 3 commandReservedFilter 2 commandReservedFilter 1 commandReservedFilter 0 command
5Filter 3 offsetFilter 2 offsetFilter 1 offsetFilter 0 offset
6Filter 1 CRC - 16Filter 0 CRC - 16
7Filter 3 CRC - 16Filter 2 CRC - 16

The remote wake-up filter fields are described in Table 555: Description of the remote wake-up filter fields .

Table 555. Description of the remote wake-up filter fields

RegisterDescription
Filter i Byte mask

The filter i byte mask register defines the bytes of the packet that are examined by filter i (0, 1, 2 or 3) to determine whether or not a packet is a wake-up packet.

  • – The MSB (31st bit) must be zero.
  • – Bit j [30:0] is the byte mask.
  • – If Bit j (byte number) of the byte mask is set, the CRC block processes the Filter i Offset + j of the incoming packet; otherwise Filter i Offset + j is ignored.
Filter i Command

The 4-bit filter i command controls the filter i operation.

  • – Bit 3 specifies the address type, defining the destination address type of the pattern. When the bit is set, the pattern applies to only multicast packets; when the bit is reset, the pattern applies only to unicast packet.
  • – Bit 2 (Inverse mode), when set, reverses the logic of the CRC16 Hash function signal, to reject a packet with matching CRC_16 value. Bit 2, along with Bit 1, allows a MAC to reject a subset of remote wake-up packets by creating filter logic such as "Pattern 1 AND NOT Pattern 2".
  • – Bit 1 (And_Previous) implements the Boolean logic (1) . When set, the result of the current entry is logically ANDed with the result of the previous filter. This AND logic allows a filter pattern longer than 32 bytes by splitting the mask among two, three, or four filters. This depends on the number of filters that have the And_Previous bit set.
  • – Bit 0 is the enable for filter i . If Bit 0 is not set, filter i is disabled.
Filter i Offset

This filter i offset register defines the offset (within the packet) from which the filter i examines the packets.

  • – This 8-bit pattern-offset is the offset for the filter i first byte to be examined.
  • – The minimum allowed offset is 12, which refers to the 13th byte of the packet.
  • – The offset value 0 refers to the first byte of the packet.
Filter i CRC-16

This filter i CRC-16 register contains the CRC_16 value calculated from the pattern and also the byte mask programmed to the wake-up filter register block.

  • – The 16-bit CRC calculation uses the following polynomial:
    \( G(x) = x^{16} + x^{15} + x^2 + 1 \)
    Each mask, used in the Hash function calculation, is compared with a 16-bit value associated with that mask. Each filter has the following:
    • – 32-bit Mask: Each bit in this mask corresponds to one byte in the detected packet. If the bit is 1', the corresponding byte is taken into the CRC16 calculation.
    • – 8-bit Offset Pointer: Specifies the byte to start the CRC16 computation.
    The pointer and the mask are used together to locate the bytes to be used in the CRC16 calculations.

1. The And_Previous bit setting is applicable within a set of four filters.

Setting And_Previous bit of a filter that is not enabled has no effect, that is setting And_Previous bit of lowest number filter in the set of four filters has no effect. For example, setting And_Previous bit of Filter 0 has no effect.

If And_Previous bit is set for a given filter to form an AND chained filter, the AND chain breaks when it finds a disabled filter.

For example: If Filter 2 And_Previous bit is set (bit 1 in Filter 2 command is set) but Filter 1 is not enabled (bit 0 in Filter 1 command is reset), then only Filter 2 result is considered. If Filter 2 And_Previous bit is set (bit 1 in Filter 2 command is set), Filter 3 And_Previous bit is set (bit 1 in Filter 3 command is set), but Filter 1 is not enabled (bit 0 in Filter 1 command is reset), then only Filter 2 result ANDed with Filter 3 result is considered. If Filter 2 And_Previous bit is set (bit 1 in Filter 2 command is set), Filter 3 And_Previous bit is set (bit 1 in Filter 3 command is set), but Filter 2 is not enabled (bit 0 in Filter 2 command is reset), then since setting Filter 2 And_Previous bit has no effect, only Filter 1 result ORed with Filter 3 result is considered.

If filters chained by And_Previous bit setting have complementary programming, then a frame may never pass the AND chained filter. For example, if Filter 2 And_Previous bit is set (bit 1 in Filter 2 command is set), Filter 1 Address_Type bit is set (bit 3 in Filter 1 command is set) indicating multicast detection and Filter 2 Address_Type bit is reset (bit 3 in Filter 2 command is reset) indicating unicast detection or vice versa, then a remote wake-up frame does not pass the AND chained filter as a remote wake-up frame cannot be of both unicast and multicast address types.

The remote wake-up filter registers are implemented as eight indirect access registers (wkuppktfilter_reg#i) for four remote wake-up filters, and accessed by the application through Remote wake-up packet filter register (ETH_MACRWKPFR) . The entire set of wkuppktfilter_reg registers must be written to program the remote wake-up filters. The wkuppktfilter_reg register is programmed by sequentially writing the eight register values in Remote wake-up packet filter register (ETH_MACRWKPFR) for wkuppktfilter_reg0 to wkuppktfilter_reg3, respectively. The wkuppktfilter_reg register is read in a similar way. The MAC updates the wkuppktfilter_reg register current pointer value in RWKPTR field of PMT control status register (ETH_MACPCSR) .

Note: If the Remote wake-up packet filter register (ETH_MACRWKPFR) is accessed in byte or half-word mode, the internal counter to access the appropriate wkuppktfilter_reg is incremented when the CPU accesses Lane 3.

When Remote wake-up packet filter register (ETH_MACRWKPFR) is written, the content is transferred from CSR clock domain to PHY receive clock domain after the write operation. There should not be any further write to the Remote wake-up packet filter register (ETH_MACRWKPFR) until the first write is updated in PHY receive clock domain. Otherwise, the second write operation does not get updated to the PHY receive clock domain. Therefore, the delay between two write operations to the Remote wake-up packet filter register (ETH_MACRWKPFR) should be at least 4 cycles of the PHY receive clock.

PMT interrupt

The PMT interrupt signal is asserted when a valid remote wake-up packet is received.

Table 556 lists the remote wake-up scenarios in which PMT interrupt is generated.

Table 556. Remote wake-up packet and PMT interrupt generation (1)

Filter i CommandFrame Type and CRC StatusInterrupt Generation
CASTINVENReceived Frame Cast TypeCRC StatusRWK INTR
001UnicastMATCHRemote wake-up packet is detected and PMT interrupt is generated
011UnicastMISMATCHRemote wake-up packet is detected and PMT interrupt is generated
101MulticastMATCHRemote wake-up packet is detected and PMT interrupt is generated
111MulticastMISMATCHRemote wake-up packet is detected and PMT interrupt is generated

1. In all other combinations, the Remote wake-up packet is not detected and PMT interrupt is not generated.

In addition to sbd_intr_o signal, the pmt_intr_o (synchronous to Rx clock) signal is asserted. The pmt_intr_o signal, synchronous to the Rx clock domain, is provided so that the application clock can be stopped by software when the MAC is in the power-down mode. It is ORed with lpi_intr_o signal (see Section : LPI interrupt ) and tied to the EXTI peripheral (line 86).

As the pmt_intr_o signal is generated in the PHY Rx clock domain, it is not cleared immediately when the PMT control status register (ETH_MACPCSR) is read. This is

because the resultant clear signal has to cross to the PHY Rx clock domain, and then clear the interrupt source. This delay is at least 4 clock cycles of Rx clock and can be significant when the peripheral is operating in the 10 Mbps mode. When the application clears the PWRDOWN bit in Remote wake-up packet filter register (ETH_MACRWKPFR) , the MAC comes out of the power-down mode, but this event does not generate the PMT interrupt.

Power-down sequence

The software must perform the following tasks to initiate the power-down sequence:

Note: If the feature is enabled and the MAC Transmitter is in the LPI mode when it is put into the power-down mode, then the MII interface gets clamped to assert the LPI pattern. If the MAC Transmitter is not in the LPI mode when it is put into the power-down mode, the GMII or MII interface gets clamped to all-zero.

Power-up sequence

The MAC wakes up on receiving the magic packet or remote wake-up frame. The power-up sequence is as follows:

After completing these steps, the software must initialize all registers, enable the transmitter, and program the DMA (in DMA configurations) to resume the normal operation.

58.7.2 Energy Efficient Ethernet (EEE)

EEE is an operational mode that enables the IEEE 802.3 Media Access Control (MAC) sub layer along with a family of physical layers to operate in the Low-Power Idle (LPI) mode. The EEE operational mode supports the IEEE 802.3 MAC operation at 100 Mbps. The peripheral supports the IEEE 802.3az-2010 for EEE.

The LPI mode allows saving power by switching off the parts of the communication device functionality when there is no data to be transmitted and received. The systems on both sides of the link can disable some functionalities to save power during the periods of low-link utilization. The MAC controls whether the system should enter or exit the LPI mode and communicates this to the PHY.

The EEE specifies the capabilities negotiation methods that the link partners can use to determine whether EEE is supported, and then select the set of parameters that are common to both devices.

Transmit path functions

The transmit path functions include tasks that the MAC must perform to make the PHY enter the LPI state.

In the transmit path, the software must set the LPIEN bit of the LPI control and status register (ETH_MACLCSR) to indicate to the MAC to stop transmission and initiate the LPI protocol. The MAC completes the transmission in progress, generates its transmission status, and starts transmitting the LPI pattern instead of the IDLE pattern if the link status has been up continuously for a period specified in the LPI LS TIMER LST[9:0] bitfield of LPI timers control register (ETH_MACLTCR) . The PHY Link Status PLS bit of the LPI control and status register (ETH_MACLCSR) indicates the link status of the PHY.

Note: The EEE feature is not supported when the MAC is configured to use the RMII.

According to the standard (IEEE 802.3az-2010), the PHY must not stop the TxCLK clock during the LPI state in the MII (10 or 100) mode.

To make the PHY enter the LPI state, the MAC performs the following tasks:

  1. 1. De-asserts TX_EN.
  2. 2. Asserts TX_ER.
  3. 3. Sets TXD[3:0] to 0x1 (for 100 Mbps)
  4. 4. Updates the status (TLPIEN bit of LPI control and status register (ETH_MACLCSR) ) and generates an interrupt.

Note: The MAC maintains the same state of the TX_EN, TX_ER, and TXD signals for the entire duration during which the PHY remains in the LPI state.

To bring the PHY out of the LPI state, that is when the software resets the LPIEN bit, the MAC performs the following tasks:

  1. 1. Stops transmitting the LPI pattern and starts transmitting the IDLE pattern.
  2. 2. Starts the LPI TW TIMER:
    The MAC cannot start the transmission until the wake-up time specified for the PHY expires. The auto-negotiated wake-up interval is programmed in the TWT field of the LPI timers control register (ETH_MACLTCR) .
  3. 3. Updates the LPI exit status (TLPIEX bit of the LPI control and status register (ETH_MACLCSR) ) and generates an interrupt.

Figure 805 shows the behavior of TX_EN, TX_ER, and TXD[3:0] signals during the LPI mode transitions.

Note: The MAC does not stop the TX_CLK clock. The application can stop this clock (as shown in Figure 805) if the PHY supports it and when the MAC sets the sbd_tx_clk_gating_ctrl_o signal to 1. The sbd_tx_clk_gating_ctrl_o signal is asserted after nine Tx Clock Cycles, one Pulse Synchronizer delay, and one CSR clock cycle. The assertion of the sbd_tx_clk_gating_ctrl_o signal depends on the LPITCSE bit of the LPI control and status register (ETH_MACLCSR) and can be done automatically as shown on Figure 806.

If RGMII Interface is selected, the Tx clock is required for transmitting the LPI pattern and so the Tx Clock cannot be gated.

If the MAC is in the Tx LPI mode and the Tx clock is stopped, the application should not write to CSR registers that are synchronized to Tx clock domain.

If the MAC is in the LPI mode and the application issues a soft reset or hard reset, the MAC transmitter comes out of the LPI mode.

Figure 805. LPI transitions (Transmit, 100 Mbds)

Timing diagram showing LPI transitions for Transmit at 100 Mbds. The diagram illustrates the relationship between sbd_tx_clk_gating_ctrl_o, TX_CLK, TX_EN, TXD[3:0], TX_ER, and PLS_CARRIER indication signals during the entry and exit from Low Power Idle (LPI) mode.

The diagram shows the following signal transitions and states:

Timing diagram showing LPI transitions for Transmit at 100 Mbds. The diagram illustrates the relationship between sbd_tx_clk_gating_ctrl_o, TX_CLK, TX_EN, TXD[3:0], TX_ER, and PLS_CARRIER indication signals during the entry and exit from Low Power Idle (LPI) mode.

Figure 806. LPI Tx clock gating (when LPITCSE = 1)

Figure 806. LPI Tx clock gating (when LPITCSE = 1). The diagram shows the internal logic of the MAC transmitter for LPI clock gating. A dashed box labeled 'MAC' contains a 'MAC Tx' block and a 'MAC Rx' block. The 'MAC Tx' block receives two clock signals: 'eth_mii_tx_clk' and 'sbd_tx_clk_gating_o'. The 'eth_mii_tx_clk' signal is derived from 'From RCC' through an AND gate. The 'sbd_tx_clk_gating_o' signal is derived from 'From RCC' through an inverter. The 'MAC Rx' block receives the 'eth_mii_rx_clk' signal directly from 'From RCC'.
Figure 806. LPI Tx clock gating (when LPITCSE = 1). The diagram shows the internal logic of the MAC transmitter for LPI clock gating. A dashed box labeled 'MAC' contains a 'MAC Tx' block and a 'MAC Rx' block. The 'MAC Tx' block receives two clock signals: 'eth_mii_tx_clk' and 'sbd_tx_clk_gating_o'. The 'eth_mii_tx_clk' signal is derived from 'From RCC' through an AND gate. The 'sbd_tx_clk_gating_o' signal is derived from 'From RCC' through an inverter. The 'MAC Rx' block receives the 'eth_mii_rx_clk' signal directly from 'From RCC'.

Automated entry/exit from LPI mode in transmit path

The MAC transmitter can be programmed to enter and exit LPI Idle mode automatically based on whether it is Idle for a specific period of time or has a packet to transfer. These modes are enabled and controlled by the LPI control and status register (ETH_MACLCSR) .

When LPITXA and LPIEN of LPI control and status register (ETH_MACLCSR) are set, the MAC transmitter enters LPI Idle state when the MAC transmit path (including the MTL layers and DMA layers) are idle. The MAC transmitter exits the LPI Idle state and clears the LPITXEN bit as soon as any of functions in the TX path (DMA, MTL or MAC) becomes non-idle due to initiation of a packet transfer.

In addition, when LPITE is also set, the MAC transmitter enters LPI Idle state only if the Transmit path remains in idle state (no activity) for the time period indicated by the value in LPI entry timer register (ETH_MACLETR) . In this mode also, the MAC transmitter exits the LPI Idle state as soon as any of the functions becomes non-idle. However, the LPIEN bit is not cleared but remains active so that reentry to LPI Idle state is possible without any software intervention when the MAC becomes idle again.

When both LPITE and LPITXA bits are cleared, the application can directly control the entry and exit of LPI Idle state by programming the LPIEN bit.

Receive path Functions

The receive path functions include the tasks that the PHY and MAC must perform when the PHY receives signals from the link partner to exit the LPI state.

In the receive path, when the PHY receives the signals from the link partner to enter into the LPI state, the PHY and MAC perform the following tasks:

  1. 1. The PHY asserts RX_ER.
  2. 2. The PHY sets RXD[3:0] to 0x1 (for 100 Mbps).
  3. 3. The PHY de-asserts RX_DV.
  4. 4. The MAC updates the RLPIEN bit of the LPI control and status register (ETH_MACLCSR) and immediately generates an interrupt.

Note: The PHY maintains the same state of the RX_ER, RXD, and RX_DV signals for the entire duration during which it remains in the LPI state.

If the LPI pattern is detected for a very short duration (that is, less than two cycles of Rx clock), the MAC does not enter the Rx LPI mode.

If the duration between the end of the current Rx LPI pattern and the start of the next Rx LPI pattern is very short (that is, less than two Rx clock cycles), then the MAC exits and enters again the Rx LPI mode. The MAC does not trigger the Rx LPI Exit and Entry interrupts.

When the PHY receives signals from the link partner to exit the LPI state, the PHY and MAC perform the following tasks:

  1. 1. The PHY de-asserts RX_ER and returns to a normal inter-packet state.
  2. 2. The MAC updates the RLPIEX bit of the LPI control and status register (ETH_MACLCSR) and generates an interrupt immediately. The sideband signal lpi_intr_o (synchronous to Rx clock) is also asserted.

Figure 807 shows the behavior of RX_ER, RX_DV, and RXD[3:0] signals during the LPI mode transitions.

Figure 807. LPI transitions (receive, 100 Mbps)

Timing diagram showing LPI transitions for RX_CLK, RX_DV, RXD[3:0], and RX_ER signals. The diagram illustrates the 'Enter LPI mode' and 'Exit LPI mode' events. RX_CLK is shown as a series of pulses that stop during the LPI period. RX_DV is a constant high signal. RXD[3:0] shows a sequence of 'xx xx xx 0x1' followed by 'xx xx xx xx' during the LPI period. RX_ER is a signal that goes high when entering LPI mode and goes low when exiting LPI mode. A double slash indicates a break in the timeline between the two LPI periods. A horizontal double-headed arrow labeled '≥ 9 cycles' indicates the minimum duration of the LPI state.
Timing diagram showing LPI transitions for RX_CLK, RX_DV, RXD[3:0], and RX_ER signals. The diagram illustrates the 'Enter LPI mode' and 'Exit LPI mode' events. RX_CLK is shown as a series of pulses that stop during the LPI period. RX_DV is a constant high signal. RXD[3:0] shows a sequence of 'xx xx xx 0x1' followed by 'xx xx xx xx' during the LPI period. RX_ER is a signal that goes high when entering LPI mode and goes low when exiting LPI mode. A double slash indicates a break in the timeline between the two LPI periods. A horizontal double-headed arrow labeled '≥ 9 cycles' indicates the minimum duration of the LPI state.

Note: If the RX_CLK_stoppable bit (in the PHY register written through MDIO) is asserted when the PHY is indicating LPI to the MAC, the PHY may halt the RX_CLK at any time more than nine clock cycles after the start of the LPI state as shown in Figure 807 .

If the MAC is in LPI mode and the application issues a soft reset or hard reset, the MAC receiver exits from LPI mode during reset. If the LPI pattern is still received after the reset is de-asserted, the MAC receiver enters again the LPI state.

If the RX clock is stopped in the RX LPI mode, the application should not write to the CSR registers that are being synchronized to the RX clock domain.

When the PHY sends the LPI pattern, if EEE feature is enabled, the MAC automatically enters the LPI state. There is no software control to prevent the MAC from entering the LPI state.

LPI timers

The transmitter maintains the LPI LS TIMER, LPI TW TIMER, and LPI AUTO ENTRY TIMER timers.

The following LPI timers are loaded with the respective values from the LPI timers control register (ETH_MACLTCR) and LPI entry timer register (ETH_MACLETR) :

The LPI LS TIMER counts, in milliseconds, the time expired since the link status is up. This timer is cleared every time the link goes down. It starts to increment when the link is up again and continues to increment until the value of the timer becomes equal to the terminal count. Once the terminal count is reached, the timer remains at the same value as long as the link is up. The terminal count is the value programmed in the LST[9:0] bitfield in the LPI timers control register (ETH_MACLTCR) . The LPI LS TIMER is 10-bit wide. The software can program up to 1023 milliseconds.

The LPI TW TIMER counts, in microseconds, the time expired since the de-assertion of LPI. The terminal count should be programmed in Bit[15:0] of LPI timers control register (ETH_MACLTCR) . The terminal count of the timer is the value of resolved Transmit TW that is the auto-negotiated time after which the MAC can resume the normal transmit operation. After exiting the LPI mode, the MAC resumes its normal operation after the TW timer reaches the terminal count.

The MAC supports the LPI TW TIMER in units of microsecond. The LPI TW TIMER is 16-bit wide. Therefore, the software can program up to 65535 micro seconds.

This timer counts in steps of eight microseconds, the time for which the MAC transmit path has to remain in idle state (no activity), before the MAC Transmitter enters the LPI IDLE state and starts transmitting the LPI pattern. This timer is enabled when LPITE bit in LPI control and status register (ETH_MACLCSR) is set.

LPI interrupt

The MAC generates the LPI interrupt when the Tx or Rx side enters or exits the LPI state. The interrupt sbd_intr_o is asserted when the LPI interrupt status is set. The LPI interrupt can be cleared by reading the LPI control and status register (ETH_MACLCSR) .

When the MAC exits the Rx LPI state, then in addition to the sbd_intr_o , the sideband signal lpi_intr_o (synchronous to Rx clock) is asserted. The lpi_intr_o signal can be used to trigger the external clock-gating circuitry to restore the application clock to the MAC. The lpi_intr_o signal, synchronous to the Rx clock domain, is provided so that the application clock can be stopped by software when the MAC is in the LPI state. It is ORed with pmt_intr_o signal (see Section : PMT interrupt ) and tied to the EXTI peripheral (line 86).

The lpi_intr_o signal is generated in the Rx clock domain. It may not be cleared immediately after the LPI control and status register (ETH_MACLCSR) is read. This is because the clear signal, generated in CSR clock domain, has to cross the Rx clock domain, and then clear the interrupt source. This delay is at least four clock cycles of Rx clock and can be significant when the peripheral is operating in the 10 Mbps mode.

Programming guidelines for Energy Efficient Ethernet

For detailed guidelines on the programming guidelines, see Section 58.9.11: Programming guidelines for Energy Efficient Ethernet (EEE) on page 2888 .

58.8 Ethernet interrupts

The Ethernet peripheral generates a single interrupt signal (eth_sbd_intr_it). This signal can be raised as a result of various events. These events are captured in status registers and interrupt enables are provided for each source of interrupt such that the interrupt signal is asserted for an event only when the corresponding interrupt enable is set.

The interrupt status and corresponding enable registers are organized in a hierarchical manner so that it is easier for software to traverse and identify the source of interrupt event quickly. When interrupt is asserted, the Interrupt status register (ETH_DMAISR) register is first level that indicates the major blocks for the interrupt event source. This register is read-only, and it contains bits corresponding to each DMA channel (TX & RX pair), the MTL, and the MAC. The software application must then read one (or more) of the following registers corresponding to the bits that are set:

58.8.1 DMA interrupts

Interrupt registers description

The ETH_DMACSR: Channel Status register (see Channel status register (ETH_DMACSR) ) captures all the interrupt events of that TxDMA and RxDMA channel. The ETH_DMAIER: Channel Interrupt Enable register (see Channel interrupt enable register (ETH_DMAIER) ) contains the corresponding enable bits for each of the interrupt event.

There are two groups of interrupts in the DMA channel namely Normal and Abnormal interrupts. They are indicated by Bits[15:14] of ETH_DMACSR register respectively. The normal group is for events that happen during the normal transfer of packets (TI: transmit interrupt, RI: receive interrupt, TBU: Transmit buffer unavailable) while the abnormal interrupt events are for error events.

Interrupts are not queued. If the same interrupt event occurs again before the driver responds to the previous one, no additional interrupts are generated. An interrupt is generated only once for multiple events. The driver must scan the Interrupt status register (ETH_DMAISR) for the cause of the interrupt and clear the source in the respective Status register. The interrupt is cleared only when all the bits of Interrupt status register (ETH_DMAISR) are cleared.

Periodic scheduling of Transmit and Receive Interrupt

It is not preferable to generate interrupts for every packet transferred by DMA (RI and TI) for system throughput performance reasons. The Ethernet peripheral gives the flexibility to schedule the interrupt at regular intervals using two methods:

  1. 1. Set Interrupt on Completion bit in Transmit descriptor (TDES2[31] in Table 560: TDES2 normal descriptor (read format) ) once for every “required” number of packets to be transmitted.
  2. 2. Similarly, set the IOC (RDES3[30] in Table 573: RDES3 normal descriptor (read format) ) bit only at some specific intervals of Receive descriptors. This way, whenever a received packet transfer to system memory is complete and any of the descriptors used for that packet transfer has the IOC bit set, only then the RI event is generated.

In addition to above, an interrupt timer (ETH_DMACRXIWTR: Channel Rx Interrupt Watchdog Timer) is given for flexible control and periodic scheduling of Receive Interrupt. When this interrupt timer is programmed with a nonzero value, it gets activated as soon as the Rx DMA completes a transfer of a received packet to system memory without asserting the Receive Interrupt because the corresponding interrupt of completion IOC bit (RDES3[30] in Table 573: RDES3 normal descriptor (read format) ) is not set. When this timer runs out as per the programmed value, RI bit is set and the interrupt is asserted if the corresponding RIE is enabled in ETH_DMACIER register (see Channel interrupt enable register (ETH_DMACIER) ). The timer is stopped and cleared before it expires, if the RI is set for a packet transfer whose descriptor's IOC was set. The timer is reactivated automatically after the next packet transfer is complete without the RI event being generated.

Channel transfer complete interrupt

The Transmit Transfer complete interrupt (TI) and Receive Transfer complete interrupt (RI) is reflected in the Channel Status register ( Channel status register (ETH_DMACSR) ). The TI bit is set whenever the Tx DMA channel closes the descriptor in which the IOC bit is set (Interrupt On Completion - TDES2[31]). Similarly, the RI bit is set whenever the Rx DMA channel closes the descriptor with the LD bit set and, in any of the descriptors used for transferring that packet, IOC bit is set (Interrupt Enable on completion - RDES3[30]).

The interrupt signal is asserted for the Transfer complete interrupts only when the corresponding interrupts are enabled in the channel interrupt enable register ( Channel interrupt enable register (ETH_DMACIER) ).

The behavior of the RI/TI interrupts changes depending on the settings of INTM field (bits[17:16]) in the ETH_DMAMR register ( DMA mode register (ETH_DMAMR) ). Table 557 explains the behavior of the Transfer Complete interrupt.

Table 557. Transfer complete interrupt behavior

Interrupt ModeBehavior of TI/RI and interrupt signal
INTM=0The TI/RI status signals are set whenever the Transfer complete event is detected.
These bits are cleared whenever the software driver writes 1 to these bits.
The interrupt signal is asserted whenever the corresponding interrupts are also enabled in ETH_DMACIER register.
INTM=1The TI/RI is set as explained above. However, the interrupt is not asserted for any RI/TI event.
INTM=2The RI/TI status bits are set whenever the Transfer Complete event is detected and are reset whenever software driver clears them by writing 1. However, if another Transfer complete event is detected before it is cleared (serviced) by the software, then these status bits are automatically set again. However, the interrupt is not generated based on TI/RI.

58.8.2 MTL interrupts

MTL interrupt events are combined with the events in the DMA to generate the interrupt signal.

Interrupt status Register (ETH_MTLISR) reports the queue number responsible for the event. ETH_MTLQICSR: Queue Interrupt Control Status must be read for event description.

The MTL interrupts are enabled by default. Each event can be prevented from asserting the interrupt by setting the corresponding mask bits in the Interrupt status Register (ETH_MTLISR) register.

MTL interrupt signal is driven by one of these events:

58.8.3 MAC Interrupts

MAC interrupt events are combined with the events in the DMA to generate the interrupt signal.

The MAC interrupts are of level type, that is, the interrupt remains asserted (high) until it is cleared by the application or software.

The Interrupt status register (ETH_MACISR) describes the events that can cause an interrupt from the MAC. The MAC interrupts are enabled by default. Each event can be prevented from asserting the interrupt by setting the corresponding mask bits in the Interrupt status register (ETH_MACISR) .

The interrupt register bits only indicate the block from which the event is reported. You must read the corresponding status registers and other registers to clear the interrupt.

MAC interrupt signal is driven by one of these events:

Note: Two sidebands signals are generated together with LPI and PMT interrupts: lpi_intr_o and pmt_intr_o. They are used for wake-up event detection at EXTI level.

58.9 Ethernet programming model

This chapter provides the instructions for initializing the DMA or MAC registers in the proper sequence. It contains the following sections:

58.9.1 DMA initialization

Complete the following steps to initialize the DMA:

  1. 1. Provide a software reset to reset all MAC internal registers and logic (bit 0 of DMA mode register (ETH_DMAMR) ).
  2. 2. Wait for the completion of the reset process (poll bit 0 of the DMA mode register (ETH_DMAMR) , which is cleared when the reset operation is completed).
  3. 3. Program the following fields to initialize the System bus mode register (ETH_DMASBMR) :
    1. a) AAL
    2. b) Fixed burst or undefined burst
    3. c) Burst mode values in case of AHB bus interface.
  4. 4. Create a transmit and a receive descriptor list. In addition, ensure that the receive descriptors are owned by the DMA (set bit 31 of TDES3/RDES3 descriptor). For more information on descriptors, refer to Section 58.10: Descriptors .

Note: Descriptor address from start to end of the ring should not cross the 4GB boundary.

  1. 5. Program ETH_DMAC TXRLR and ETH_DMAC RXRLR registers (see Channel Tx descriptor ring length register (ETH_DMAC TXRLR) and Channel Rx descriptor ring length register (ETH_DMAC RXRLR) ). The programmed ring length must be at least 4.
  2. 6. Initialize receive and transmit descriptor list address with the base address of transmit and receive descriptor ( Channel Tx descriptor list address register (ETH_DMAC TXDLAR) , Channel Rx descriptor list address register (ETH_DMAC RXDLAR) ). In addition, program the transmit and receive tail pointer registers that inform the DMA about the available descriptors (see Channel Tx descriptor tail pointer register (ETH_DMAC TXTPR) and Channel Rx descriptor tail pointer register (ETH_DMAC RXTPR) ).
  3. 7. Program ETH_DMAC CR, ETH_DMAC TXCR and ETH_DMAC RXCR registers (see Channel control register (ETH_DMAC CR) , Channel transmit control register (ETH_DMAC TXCR) and Channel receive control register (ETH_DMAC RXCR) ) to

configure the parameters such as the maximum burst-length (PBL) initiated by the DMA, descriptor skip lengths, OSP for TxDMA, RBSZ[13:0] for RxDMA, and so on.

  1. 8. Enable the interrupts by programming the ETH_DMACIER register (see Channel interrupt enable register (ETH_DMACIER) ).
  2. 9. Start the Receive and Transmit DMAs by setting SR (bit 0) of Channel receive control register (ETH_DMACRXCR) and ST (bit 0) of the ETH_DMACTXCR (see Channel transmit control register (ETH_DMACTXCR) ).

58.9.2 MTL initialization

Complete the following steps to initialize the MTL registers:

  1. 1. Program the following fields to initialize the operating mode in Tx queue operating mode Register (ETH_MTLTXQOMR) .
    1. a) Transmit Store And Forward (TSF) or Transmit Threshold Control (TTC) if the Threshold mode is used.
    2. b) Transmit Queue Enable (TXQEN) to value 2'b10 to enable Transmit Queue 0.
    3. c) Transmit Queue Size (TQS).
  2. 2. Program the following fields to initialize the operating mode in the ETH_MTLRXQOMR register (see Rx queue operating mode register (ETH_MTLRXQOMR) ):
    1. a) Receive Store and Forward (RSF) or RTC if Threshold mode is used.
    2. b) Flow Control Activation and De-activation thresholds for MTL Receive FIFO (RFA and RFD).
    3. c) Error Packet and undersized good Packet forwarding enable (FEP and FUP).
    4. d) Receive Queue Size (RQS).

58.9.3 MAC initialization

The MAC configuration registers establish the operating mode of the MAC. If possible, these registers must be initialized before initializing the DMA. The following MAC Initialization operations can also be performed after DMA initialization. If the MAC initialization is complete before the DMA is configured, enable the MAC receiver (last step in the following sequence) only after the DMA is active. Otherwise, received frames fill the Rx FIFO and overflow.

  1. 1. Provide the MAC address registers: MAC Address x low register (ETH_MACAxLR) , MAC Address 0 high register (ETH_MACA0HR) and MAC Address x high register (ETH_MACAxHR) .
  2. 2. Program the following fields to set the appropriate filters for the incoming frames in the Packet filtering control register (ETH_MACPFR) :
    1. a) Receive All.
    2. b) Promiscuous mode.
    3. c) Hash or Perfect Filter.
    4. d) Unicast, multicast, broadcast, and control frames filter settings.
  3. 3. Program the following fields for proper flow control in the Tx Queue flow control register (ETH_MACQTXFCR) :
    1. a) Pause time and other Pause frame control bits.
    2. b) Transmit Flow control bits.
    3. c) Flow Control Busy.
  1. 4. Program the Interrupt enable register (ETH_MACIER) as required, if it is applicable for your configuration.
  2. 5. Program the appropriate fields in the Operating mode configuration register (ETH_MACCR) register. For example, Inter-packet gap while transmission and jabber disable.
  3. 6. Set bit 0 and 1 in Operating mode configuration register (ETH_MACCR) register to start the MAC transmitter and receiver.

To support Jumbo Transmit/Receive packets, follow these steps:

To support Transmit/Receive packets, up to 16K, follow these steps:

58.9.4 Performing normal receive and transmit operation

For normal operation, complete the following steps:

  1. 1. For normal transmit and receive interrupts, read the interrupt status. Then, poll the descriptor by reading the status of the descriptor owned by the Host (either transmit or receive).
  2. 2. Set the descriptors to appropriate values. Make sure that transmit and receive descriptors are owned by the DMA to resume the transmission and reception of data.
  3. 3. If the descriptors are not owned by the DMA (or no descriptor is available), the DMA goes into Suspend state. The transmission or reception can be resumed by freeing the descriptors and writing the ETH_DMACCTXDTPR (see Channel Tx descriptor tail pointer register (ETH_DMACCTXDTPR) ) and ETH_DMACRXDTPR (see Channel Rx descriptor tail pointer register (ETH_DMACRXDTPR) ).
  4. 4. In debug mode, the values of the current host transmitter or receiver descriptor address pointer can be read in ETH_DMACCATXDR and ETH_DMACCARXDR registers (see Channel current application transmit descriptor register (ETH_DMACCATXDR) and Channel current application receive descriptor register (ETH_DMACCARXDR) ).
  5. 5. In debug mode, the values of the current host transmit buffer address pointer and receive buffer address pointer can be read in ETH_DMACCATXDR and ETH_DMACCARXDR registers (see Channel current application transmit descriptor register (ETH_DMACCATXDR) and Channel current application receive descriptor register (ETH_DMACCARXDR) ).

58.9.5 Stopping and starting transmission

Complete the following steps to pause the transmission for some time:

  1. 1. Disable the Transmit DMA (if applicable) by clearing Bit 0 (ST) of ETH_DMACCTXCR register (see Channel transmit control register (ETH_DMACCTXCR) ).
  2. 2. Wait for any previous frame transmissions to complete. You can check this by reading the appropriate bits of Tx queue debug register (ETH_MTLTXQDR) (TRCSTS[1:0] is not 01 and TXQSTS = 0).
  3. 3. Disable the MAC transmitter and MAC receiver by clearing RE and TE bits of the Operating mode configuration register (ETH_MACCR) Register.
  4. 4. Disable the Receive DMA (if applicable), after making sure that the data in the Rx FIFO is transferred to the system memory (by reading the appropriate bits of Tx queue debug register (ETH_MTLTXQDR) , PRXQ=0 and RXQSTS[1:0] = 00).
  5. 5. Make sure that both Tx queue and Rx queue are empty (TXQSTS is 0 in Tx queue debug register (ETH_MTLTXQDR) and RXQSTS[1:0] is set to 00).
  6. 6. To restart the operation, first start the DMAs, and then enable the MAC Transmitter and Receiver.

Note: Do not change the configuration (such as duplex mode, speed, port, or loopback) when the MAC is actively transmitting or receiving. These parameters are changed by software only when the MAC transmitter and receiver are not active.

Similarly, do not change the DMA-related configuration when Transmit and Receive DMA are active.

58.9.6 Programming guidelines for switching to new descriptor list in RxDMA

Switching to a new descriptor list is different in the Rx DMA compared to the Tx DMA. Switching to a new descriptor list is permitted when the RxDMA is in Suspend state, as explained below:

58.9.7 Programming guidelines for switching the AHB clock frequency

To dynamically change the AHB clock frequency (without applying soft reset or hard reset), follow these steps:

  1. 1. Disable the Transmit DMA (if applicable) and wait for any previous frame transmissions to complete. When the frame transmissions is complete, the Tx FIFO becomes empty and the Tx DMA enters Stop state. The Tx FIFO status is given in the Tx queue debug

register (ETH_MTLTXQDR) and the status of DMA is given in Debug status register (ETH_DMADSR) .

  1. 2. Disable the MAC transmitter and the MAC receiver by clearing the appropriate bits in Operating mode configuration register (ETH_MACCR) .
  2. 3. Disable the Receive DMA (if applicable) after making sure that the data in the Rx FIFO is transferred to the system memory. The Rx FIFO empty status is given in Rx queue debug register (ETH_MTLRXQDR) .
  3. 4. Ensure that the application does not perform any register read or write operation.
  4. 5. Change the frequency of the AHB clock.
  5. 6. Enable the MAC Transmitter or the MAC Receiver and the Transmit or Receive DMA. These steps ensure that no valid data is present in the Tx FIFO or Rx FIFO at the time of clock frequency switching and prevent any data corruption.

Complete the following steps when the link is down while the Transmit and Receive clocks are running:

  1. 1. Disable the Transmit DMA (if applicable) by clearing bit 0 (ST) of Channel control register (ETH_DMACCR) .
  2. 2. Disable the MAC receiver by clearing RE bit of Operating mode configuration register (ETH_MACCR) .
  3. 3. Wait for any previous frame transmissions to complete. You can check this by reading the appropriate bits of Tx queue debug register (ETH_MTLTXQDR) (TRCSTS[1:0] is not 01).
    or
    Flush the Tx FIFO for faster empty operation.
  4. 4. Disable the MAC transmitter by clearing TE bit of the Operating mode configuration register (ETH_MACCR) Register.
  5. 5. Make sure that both Tx and Rx queues are empty (TXQSTS is set to 0 in Tx queue debug register (ETH_MTLTXQDR) and RXQSTS[1:0] to 00 in Rx queue debug register (ETH_MTLRXQDR) ).
  6. 6. After the link is up, read the PHY registers to identify the latest configuration and program the MAC registers accordingly.
  7. 7. Restart the operation by starting the Tx DMA. Then enable the MAC Transmitter and Receiver.

The Rx DMA does not need to be enabled: since the Receiver is disabled, there are no data in the Rx FIFO.

Complete the following steps when the link is down and the Transmit and Receive clocks are stopped:

  1. 1. Disable the MAC Transmitter and Receiver by clearing RE and TE bits in the Operating mode configuration register (ETH_MACCR) . This does not take immediate effect as the clocks are absent.
  2. 2. Wait till the link is up and the clocks are restored.
  3. 3. Wait until the transfer of any partial frame is complete if any was ongoing when the Transmit/Receive clock is stopped. This can be checked by reading the Debug register (ETH_MACDR) (all bits should be set to 0). Some old packets may still remain in the TXFIFO as the MAC Transmitter is stopped.
  4. 4. Read the PHY registers to identify the latest operating mode and program the MAC registers accordingly.
  5. 5. Restart the MAC Transmitter and Receiver by setting RE and TE bits.

58.9.9 Programming guidelines for IEEE 1588 timestamping

Initializing the System time generation

The timestamp feature can be enabled by setting bit 0 of the Timestamp control Register (ETH_MACTSCR) . However, it is essential that the timestamp counter is initialized after this bit is set. Complete the following steps to perform the peripheral initialization:

  1. 1. Mask the Timestamp Trigger interrupt by clearing bit 12 of Interrupt enable register (ETH_MACIER) .
  2. 2. Set bit 0 of Timestamp control Register (ETH_MACTSCR) to enable timestamping.
  3. 3. Program Subsecond increment register (ETH_MACSSIR) based on the PTP clock frequency.
  4. 4. If you use the Fine Correction method, program Timestamp addend register (ETH_MACTSAR) and set bit 5 of Timestamp control Register (ETH_MACTSCR) .
  5. 5. Poll the Timestamp control Register (ETH_MACTSCR) until bit 5 is cleared.
  6. 6. Program bit 1 of Timestamp control Register (ETH_MACTSCR) to select the Fine Update method (if required).
  7. 7. Program System time seconds update register (ETH_MACSTSUR) and System time nanoseconds update register (ETH_MACSTNUR) with the appropriate time value.
  8. 8. Set bit 2 in Timestamp control Register (ETH_MACTSCR) .

The timestamp counter starts as soon as it is initialized with the value written in the timestamp update registers. If one-step timestamping is required:

    1. a) Enable one-step timestamping by programming bit 27 of the TDES3 Context Descriptor.
    2. b) Program Timestamp Ingress asymmetric correction register (ETH_MACTSIACR) to update the correction field in PDelay_Req PTP messages.
    1. 9. Enable the MAC receiver and transmitter for proper timestamping.

Note: If timestamp operation is disabled by clearing bit 0 of Timestamp control Register (ETH_MACTSCR) , repeat all these steps to restart the timestamp operation.

System time correction

To synchronize or update the system time in one shot (coarse correction method), complete the following steps:

  1. 1. Set the offset (positive or negative) in the timestamp update registers ( System time seconds update register (ETH_MACSTSUR) and System time nanoseconds update register (ETH_MACSTNUR) ).
  2. 2. Set bit 3 (TSUPDT) of the Timestamp control Register (ETH_MACTSCR) .
    The value in the timestamp update registers is added to or subtracted from the system time when the TSUPDT bit is cleared.

To synchronize or update the system time to reduce system-time jitter (fine correction method), complete the following steps:

  1. 1. With the help of the algorithm described in Section : System time register module , calculate at which rate you intend to increment or decrement the system time.
  2. 2. Update the Timestamp addend register (ETH_MACTSAR) with the new value and set bit 5 of the Timestamp control Register (ETH_MACTSCR) Register.
  3. 3. Wait for the time during which you want the new value of the Addend register to be active. This can be done by enabling the Timestamp Trigger interrupt after the system time reaches the target value.
  4. 4. Program the required target time in PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) .
  5. 5. Enable the Timestamp interrupt in bit 12 of Interrupt enable register (ETH_MACIER) .
  6. 6. Set bit 4 in Register Timestamp control Register (ETH_MACTSCR) .
  7. 7. When this trigger generates an interrupt, read Interrupt status register (ETH_MACISR) .
  8. 8. Reprogram Timestamp addend register (ETH_MACTSAR) with the old value and set bit 5 again.

58.9.10 Programming guidelines for PTP offload feature

Programming guidelines to enable automatic periodic generation of PTP sync messages

Follow these steps to enable automatic periodic generation of PTP sync messages:

  1. 1. Program SNAPTYPESEL, TSMSTRENA, and TSEVNTENA fields of Timestamp control Register (ETH_MACTSCR) to 0, 1, and 1 respectively, to configure the node as Ordinary or Boundary Master (1, 1, and 1 for Transparent Master).
  2. 2. Program the PTOEN bit and DN field of PTP Offload control register (ETH_MACPOCR) to enable PTP Offload feature and domain number to send in egress PTP Sync message.
  3. 3. Program the ASYNCEN bit of PTP Offload control register (ETH_MACPOCR) to enable periodic generation of PTP Sync messages.
  4. 4. Program the 80-bit Source Port Identity in PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP

Source port identity 2 register (ETH_MACSPI2R) to send in egress PTP Sync message.

  1. 5. Program the LSI field of Log message interval register (ETH_MACLMIR) to program the periodicity of the PTP Sync messages.
    For example, a value of 1 corresponds to \( 2^1 \) which translates to PTP Sync message every 2 seconds, and a value of 0xFF (twos complement of -1) corresponds to \( 2^{-1} \) which translates to PTP Sync message every 0.536 seconds.
  2. 6. Program the TSIE bit of Interrupt enable register (ETH_MACIER) to enable generation of Timestamp interrupt.
  3. 7. Wait for sbd_intr_o interrupt generated by setting TXTSSIS bit in Timestamp status register (ETH_MACTSSR) . It indicates that the timestamp for PTP Sync message is captured in Tx timestamp status seconds register (ETH_MACTXTSSSR) and Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) .

Programming guidelines to enable periodic generation of PTP Pdelay_Req messages

Follow these steps to enable automatic periodic generation of PTP Pdelay_Req messages

  1. 1. Program SNAPTYPESEL, TSMSTRENA and TSEVTNENA fields of Timestamp control Register (ETH_MACTSCR) to 1, 0, and 1 respectively to configure the node as Transparent Slave (1, 1, and 1 for Transparent Master OR 3, X, and X for Peer-to-Peer Transparent).
  2. 2. Program the PTOEN bit and DN field of PTP Offload control register (ETH_MACPOCR) to enable PTP Offload feature and domain number to send in egress PTP Pdelay_Req message.
  3. 3. Program the APDREQEN bit of PTP Offload control register (ETH_MACPOCR) to enable periodic generation of PTP Pdelay_Req messages.
  4. 4. Program the 80-bit Source Port Identity in PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP Source port identity 2 register (ETH_MACSPI2R) to send in egress PTP Pdelay_Req message.
  5. 5. Program the LMPDRI field of Log message interval register (ETH_MACLMIR) to program the periodicity of the PTP Pdelay_Req messages.
    For example, a value of 1 corresponds to \( 2^1 \) which translates to PTP Pdelay_Req message every 2 seconds, and a value of 0xFF (twos complement of -1) corresponds to \( 2^{-1} \) which translates to PTP Pdelay_Req message every 0.536 seconds.
  6. 6. Program the TSIE bit of Interrupt enable register (ETH_MACIER) to enable generation of Timestamp interrupt.
  7. 7. Wait for sbd_intr_o interrupt generated by setting TXTSSIS bit in Timestamp status register (ETH_MACTSSR) . It indicates that the timestamp for PTP Sync message is captured in Tx timestamp status seconds register (ETH_MACTXTSSSR) and Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) .

Programming guidelines to enable the generation of PTP response messages for Ordinary or Boundary Master mode

Follow these steps to enable the generation of PTP response messages for Ordinary or Boundary Master mode (Periodic PTP Sync messages generated and PTP Delay_Resp message generated in response to PTP Delay_Req message):

  1. 1. Program SNAWTYPSEL, TSMSTRENA and TSEVNTENA fields of Timestamp control Register (ETH_MACTSCR) to 0, 1, and 1 respectively.
  2. 2. Program the PTOEN bit and DN field of PTP Offload control register (ETH_MACPOCR) to enable PTP Offload feature and domain number to match with ingress PTP Delay_Req message and send in egress PTP Delay_Resp message.
  3. 3. Program the 80-bit Source Port Identity in PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP Source port identity 2 register (ETH_MACSPI2R) to match with ingress PTP Delay_Req message and send in egress PTP Delay_Resp message.
  4. 4. Program the DRSYNCR and LSI fields in Log message interval register (ETH_MACLMIR) . The sum of both fields is updated in logMinDelayReqInterval field of PTP Delay_Resp message.

Programming guidelines to enable the generation of PTP response messages for Ordinary or Boundary Slave mode

Follow these steps to enable generation of PTP response messages for Ordinary or Boundary Slave mode (PTP Delay_Req message generated in response to PTP Sync message):

  1. 1. Program SNAWTYPSEL, TSMSTRENA and TSEVNTENA fields of Timestamp control Register (ETH_MACTSCR) to 0, 0, and 1 respectively.
  2. 2. Program the PTOEN bit and DN field of PTP Offload control register (ETH_MACPOCR) to enable PTP Offload feature and domain Number to match with ingress PTP Sync message and send in egress PTP Delay_Req message.
  3. 3. Program the 80-bit Source Port Identity in PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP Source port identity 2 register (ETH_MACSPI2R) to match with ingress PTP Sync message and send in egress PTP Delay_Req message.
  4. 4. Program the DRSYNCR field in Log message interval register (ETH_MACLMIR) to indicate one PTP Delay_Req message is generated in response to how many received PTP Sync messages.

Programming guidelines to enable the generation of PTP response messages for Transparent Slave mode

Follow these steps to enable generation of PTP response messages for Transparent Slave mode (PTP Delay_Req message generated in response to PTP Sync message, PTP Pdelay_Resp message generated in response to PTP Pdelay_Req message and Periodic PTP Pdelay_Req messages generated)

  1. 1. Program SNAWTYPSEL, TSMSTRENA and TSEVNTENA fields of Timestamp control Register (ETH_MACTSCR) to 1, 0, and 1 respectively.
  2. 2. Program the PTOEN bit and DN field of PTP Offload control register (ETH_MACPOCR) to enable PTP Offload feature and domain Number to match with ingress PTP Sync or Pdelay_Req message and send in egress PTP Delay_Req or Pdelay_Resp or Pdelay_Req message.
  3. 3. Program the 80-bit Source Port Identity in PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP Source port identity 2 register (ETH_MACSPI2R) to match with ingress PTP Sync or

Pdelay_Req message and send in egress PTP Delay_Req or Pdelay_Resp or Pdelay_Req message.

  1. 4. Program the DRSYNCR and LMPDRI fields in Log message interval register (ETH_MACLMIR) to indicate one PTP Delay_Req message is generated in response to how many received PTP Sync messages and periodicity of the PTP Pdelay_Req messages.
  2. 5. Program the TSIE bit of Interrupt enable register (ETH_MACIER) to enable generation of Timestamp interrupt.
  3. 6. Wait for sbd_intr_o interrupt generated by setting TXTSSIS bit in Timestamp status register (ETH_MACTSSR) . It indicates that the timestamp for PTP Sync message is captured in Tx timestamp status seconds register (ETH_MACTXTSSSR) and Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) for egress PTP Pdelay_Req and Pdelay_Resp messages.

Programming guidelines to enable the generation of PTP response messages for Transparent Master mode

Follow these steps to enable generation of PTP response messages for Transparent Master mode (PTP Delay_Resp message generated in response to PTP Delay_Req message, PTP Pdelay_Resp message generated in response to PTP Pdelay_Req message and Periodic PTP Pdelay_Req or Sync messages generated):

  1. 1. Program SNAPTYPSEL, TSMSTRENA and TSEVNTENA fields of Timestamp control Register (ETH_MACTSCR) to 1, 1, and 1 respectively.
  2. 2. Program the PTOEN bit and DN field of PTP Offload control register (ETH_MACPOCR) to enable PTP Offload feature and domain number to match with ingress PTP Delay_Req or Pdelay_Req message and send in egress PTP Delay_Resp or Pdelay_Resp or Pdelay_Req or Sync message.
  3. 3. Program the 80-bit Source Port Identity in PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP Source port identity 2 register (ETH_MACSPI2R) to match with ingress PTP Delay_Req or Pdelay_Req message and send in egress PTP Delay_Resp or Pdelay_Resp or Pdelay_Req or Sync message.
  4. 4. Program the DRSYNCR, LSI and LMPDRI fields in Log message interval register (ETH_MACLMIR) , the sum of DRSYNCR and LSI is updated in logMinDelayReqInterval field of PTP Delay_Resp message and periodicity of the PTP Sync or Pdelay_Req messages.
  5. 5. Program the TSIE bit of Interrupt enable register (ETH_MACIER) to enable generation of Timestamp interrupt.
  6. 6. Wait for sbd_intr_o interrupt generated by setting TXTSSIS bit in Timestamp status register (ETH_MACTSSR) . It indicates that the timestamp for PTP Sync message is captured in Tx timestamp status seconds register (ETH_MACTXTSSSR) and Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) for egress PTP Sync, Pdelay_Req and Pdelay_Resp messages.

Programming guidelines to enable the generation of PTP response messages for Peer-to-Peer Transparent mode

Follow these steps to enable generation of PTP response messages for Peer-to-Peer Transparent mode (PTP Pdelay_Resp message generated in response to PTP Pdelay_Req message and Periodic PTP Pdelay_Req messages generated):

  1. 1. Program the SNAPTYPSEL, TSMSTRENA and TSEVNTENA fields of Timestamp control Register (ETH_MACTSCR) to 3, X, and X respectively.
  2. 2. Program the PTOEN bit and DN field of PTP Offload control register (ETH_MACPOCR) to enable PTP Offload feature and domain Number to match with ingress PTP Pdelay_Req message and send in egress PTP Pdelay_Resp message.
  3. 3. Program the 80-bit Source Port Identity in PTP Source Port Identity 0 Register (ETH_MACSPI0R) , PTP Source port identity 1 register (ETH_MACSPI1R) and PTP Source port identity 2 register (ETH_MACSPI2R) to match with ingress PTP Pdelay_Req message and send in egress PTP Pdelay_Resp message.
  4. 4. Program the LMPDRI field in Log message interval register (ETH_MACLMIR) to indicate periodicity of the PTP Pdelay_Req messages
  5. 5. Program the TSIE bit of Interrupt enable register (ETH_MACIER) to enable generation of Timestamp interrupt
  6. 6. Wait for sbd_intr_o interrupt generated by setting TXTSSIS bit in Timestamp status register (ETH_MACTSSR) . It indicates that the timestamp for PTP Sync message is captured in Tx timestamp status seconds register (ETH_MACTXTSSSR) and Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) for egress PTP Pdelay_Req and Pdelay_Resp messages.

58.9.11 Programming guidelines for Energy Efficient Ethernet (EEE)

Entering and exiting Tx LPI mode

EEE enables the IEEE 802.3 Media Access Control (MAC) sublayer along with a family of physical layers to operate in the Low-power idle (LPI) mode. In the Transmit path, the software must set the LPIEN bit of the LPI control and status register (ETH_MACLCSR) to indicate to the MAC to stop transmission and initiate the LPI protocol.

Complete the following steps during MAC initialization:

  1. 1. Read the PHY register through the MDIO interface and check if the remote end has the EEE capability. Then negotiate the timer values.
  2. 2. Program the PHY registers through the MDIO interface (including the RX_CLK_stoppable bit that indicates to the PHY whether to stop Rx clock in LPI mode or not).
  3. 3. Program bits 25 to 16 and bits 15 to 0 in LPI timers control register (ETH_MACLTCR) .
  4. 4. Read the PHY link status by using the MDIO interface and update bit 17 of LPI control and status register (ETH_MACLCSR) .

Update LPI control and status register (ETH_MACLCSR) accordingly. This update should be done whenever the link status in the PHY chip changes.

  1. 5. Program One-microsecond-tick counter register (ETH_MAC1USTCR) as per the frequency of the clock used for accessing the CSR slave port.
  2. 6. Program the LPIET bit in the LPI entry timer register (ETH_MACLETR) with the IDLE time for which the MAC should wait before entering the LPI state on its own.
  1. 7. Set LPITE and LPITXA (bits 20 to 19) of LPI control and status register (ETH_MACLCSR) to enable LPI auto-entry and MAC auto-exit from LPI state.
  2. 8. Set bit 16 of LPI control and status register (ETH_MACLCSR) to put the MAC transmitter in LPI state.
    The MAC enters the LPI state when all scheduled packets are completed. It remains IDLE for the time indicated by LPIET bits. It sets the TLPIEN (bit 0) after entering LPI state.
  3. 9. When a packet transmission is scheduled (when the TxDMA exits IDLE state or when a packet is presented at ATI or MTI interface), the MAC Transmitter automatically exits LPI state. It waits for TWT time before setting the TLPIEX interrupt status bit and then resume the packet transmission.
  4. 10. The MAC Transmitter enters again LPI state if it remains IDLE for LPIET time. It then sets the TLPIEN bit and the entry-exit cycle continues.
  5. 11. Reset LPIEN bit if the application needs to override the auto-entry/exit modes and directly exit the MAC Transmitter from LPI state.

Note: To make sure the MAC enters the LPI state only after the transmission of all the queued frames in the Tx FIFO is complete, set LPITXA bit in LPI control and status register (ETH_MACLCSR) .

To switch off the CSR clock or power to the rest of the system during the LPI state, wait for the TLPIEN interrupt of LPI control and status register (ETH_MACLCSR) to be generated. Restore the clocks before performing step 6 when you want to come out of the LPI state.

Gating Off the CSR Clock in the LPI mode

You can gate off the CSR clock to save the power when the MAC is in the Low-Power Idle (LPI) mode.

Gating off the CSR clock in the Rx LPI mode

The following operations are performed when the MAC receives the LPI pattern from the PHY:

  1. 1. The MAC RX enters the LPI mode and the Rx LPI entry interrupt status (RLPIEN interrupt of LPI control and status register (ETH_MACLCSR) ) is set.
  2. 2. The interrupt pin (sbd_intr_o) is asserted. The sbd_intr_o interrupt is cleared when the host reads the LPI control and status register (ETH_MACLCSR) .

After the sbd_intr_o interrupt is asserted and the MAC Tx is also in the LPI mode, the CSR clock can be gated off. If the MAC TX is not in LPI mode when the CSR clock is gated off, the events on the MAC transmitter do not get reported or updated in the CSR. To restore the CSR clock, wait for the LPI exit indication from the PHY after which the MAC asserts the LPI exit interrupt on lpi_intr_o (synchronous to clk_rx_i). The lpi_intr_o interrupt is cleared when LPI control and status register (ETH_MACLCSR) is read.

Gating off the CSR clock in the Tx LPI mode

The following operations are performed when bit 16 (LPIEN) of LPI control and status register (ETH_MACLCSR) is set:

  1. 1. The Transmit LPI Entry interrupt (TLPIEN bit of LPI control and status register (ETH_MACLCSR) ) is set.
  2. 2. The interrupt pin (sbd_intr_o) is asserted. The sbd_intr_o interrupt is cleared when the host reads the LPI control and status register (ETH_MACLCSR) .

After the sbd_intr_o interrupt is asserted and the MAC RX is also in the LPI mode, the CSR clock can be gated off. If the MAC RX is not in LPI mode when the CSR clock is gated off, the events on the MAC receiver do not get reported or updated in the CSR. To restore the CSR clock, switch on the CSR clock when the MAC has exited TX LPI mode. After the CSR clock is resumed, reset bit 16 (LPIEN) of LPI control and status register (ETH_MACLCSR) to exit the MAC from LPI mode.

58.9.12 Programming guidelines for flexible pulse-per-second (PPS) output

Generating a single pulse on PPS

To generate a single pulse on PPS:

  1. 1. Program TRGTMODSEL[1:0] bit to 11 or 10 (for interrupt) in PPS control register (ETH_MACPPSCR) . This instructs the MAC to use the Target Time registers ( PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) ) as start time of PPS signal output.
  2. 2. Program the start time value in the Target Time registers (register PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) ).
  3. 3. Program the width of the PPS signal output in PPS width register (ETH_MACPPSWR) Register.
  4. 4. Program PPSCMD[3:0] of PPS control register (ETH_MACPPSCR) to 0001. This instructs the MAC to generate a single pulse on the PPS signal output at the time programmed in the Target Time registers.

Generating next pulse on PPS

When the PPSCMD is executed (PPSCMD bits = 0), you can cancel the pulse generation by giving the Cancel Start Command (PPSCMD=0011) before the programmed start time has elapsed. You can also program the behavior of the next pulse in advance. To program the next pulse:

  1. 1. Program the start time for the next pulse in the Target Time registers. This time should be higher than the time at which the falling edge occurs for the previous pulse.
  2. 2. Program the width of the next PPS signal output in PPS width register (ETH_MACPPSWR) .
  3. 3. Program PPSCMD[3:0] bits of PPS control register (ETH_MACPPSCR) to generate a single pulse after the previous pulse is deasserted. This instructs the MAC to generate a single pulse on the PPS signal output at the time programmed in Target Time registers.

If this command is given before the previous pulse becomes low, then the new command overwrites the previous command and the peripheral may generate only 1 extended pulse.

Generating a pulse train on PPS

To generate a pulse train on PPS:

  1. 1. Program TRGTMODSEL[1:0] bits to 11 or 10 (for interrupt) in PPS control register (ETH_MACPPSCR) . This instructs the MAC to use the Target Time registers ( PPS

target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) for start time of the PPS signal output.

  1. 2. Program the start time value in the Target Time registers (register PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) ).
  2. 3. Program the interval value between the train of pulses on the PPS signal output in PPS interval register (ETH_MACPPSIR) .
  3. 4. Program the width of the PPS signal output in PPS width register (ETH_MACPPSWR) .
  4. 5. Program PPSCMD[3:0] bits in PPS control register (ETH_MACPPSCR) to 0010. This instructs the MAC to generate a train of pulses on the PPS signal output at the start time programmed in Target Time registers.

By default, the PPS pulse train is free-running unless it is stopped by issuing a 'STOP Pulse train at time' or 'STOP Pulse Train immediately' commands.

  1. 6. Program the stop value in the Target Time registers. Ensure that TSTRBUSY bit in PPS target time nanoseconds register (ETH_MACPPSTTNR) is reset before programming the Target Time registers again.
  2. 7. Program the PPSCMD[3:0] bits in PPS control register (ETH_MACPPSCR) to 0100 to stop the train of pulses on PPS signal output after the programmed stop time specified at step 6 has elapsed.

The pulse train can be stopped at any time by programming 0101 in the PPSCMD[3:0] field.

Similarly, the Stop Pulse train command (given in Step 7) can be canceled by programming PPSCMD[3:0] bits to 0110 before the time (programmed at step 6) has elapsed.

The pulse train generation can be stopped by programming PPSCMD[3:0] to 0011 before the start time programmed at step 2) has elapsed.

Generating an interrupt without affecting the PPS

TRGTMODSEL[1:0] bits in PPS control register (ETH_MACPPSCR) enable you to program the Target Time registers ( PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) ) to do any one of the following:

To program the Target Time registers to generate only interrupt event:

  1. 1. Program TRGTMODSEL[1:0] bits of PPS control register (ETH_MACPPSCR) to 00 (for interrupt). This instructs the MAC to use the Target Time registers for target time interrupt.
  2. 2. Program a target time value in the Target Time registers. This instructs the MAC to generate an interrupt when the target time elapses.

If TRGTMODSEL[1:0] bits are changed (for example, to control the PPS), then the interrupt generation is overwritten with the new mode and new programmed Target Time register value.

Note: The TSTRGTERRO bit in Timestamp status register (ETH_MACTSSR) is set when the programmed target time is smaller (that is corresponds to a time in the past) compared to

the system time in the System time seconds register (ETH_MACSTSR) and System time nanoseconds register (ETH_MACSTNR) .

An interrupt is generated ( sbd_intr_o ) if the TSIE bit in the Interrupt enable register (ETH_MACIER) is set.

Therefore, to avoid unwanted interrupt, the correct writing order is as follow:

  1. 1. PPS target time nanoseconds register (ETH_MACPPSTTNR) .
  2. 2. PPS target time seconds register (ETH_MACPPSTTSR) .
  3. 3. PPS interval register (ETH_MACPPSIR) .
  4. 4. PPS width register (ETH_MACPPSWR) .
  5. 5. PPSCTRL[3:0] and PPSEN0 bitfields of PPS control register (ETH_MACPPSCR) .

58.9.13 Programming guidelines for TSO

The TCP Segmentation Offload (TSO) engine is used to offload the TCP segmentation functions to the hardware. To program the TSO, set the TSE bit to enable TCP packet segmentation, and program descriptor fields to enable TSO for the current packet.

Follow the steps below to program TSO:

  1. 1. Program TSE bit of the corresponding Channel transmit control register (ETH_DMACCTXCR) to enable TCP packet segmentation in that DMA.
  2. 2. In addition to the normal transfer descriptor setting, the following descriptor fields must be programmed to enable TSO for the current packet:
    1. a) Enable TSE of TDES3 (bit 18).
    2. b) Program the length of the unsegmented TCP/IP packet payload in bits 17 to 0 of TDES3, and the TCP header in bits 22 to 19 of TDES3.
    3. c) Program the maximum size of the segment in:
      • – MSS[13:0] of Channel control register (ETH_DMACCR)
      • – or MSS in the context descriptor
      If MSS[13:0] field is programmed in both Channel control register (ETH_DMACCR) and in the context descriptor, the latest software programmed sequence is considered.
  3. 3. The unsegmented TCP/IP packet header should be stored in Buffer 1 of the first descriptor. This buffer must not hold any payload bytes. The payload is allocated to Buffer 2 and the buffers of the subsequent descriptors.

Caution: If TSE is enabled in TDES3 for a non-TCP-IP packet, the result is unpredictable.

58.9.14 Programming guidelines to perform VLAN filtering on the receive

Follow the sequence below to perform VLAN filtering on the receiver:

  1. 1. Program VLAN tag register (ETH_MACVTR) for the following bit to select the filtering method:
    • – ETV: Enable 12-bit VLAN Tag Comparison or 16-bit VLAN Tag comparison.
    • – VTHM: VLAN Tag Hash Table Match Enable.
    • – ERIVLT: Enable inner VLAN Tag or outer VLAN Tag (to enable the inner or outer VLAN Tag filtering, Double VLAN Processing should enabled by setting EDVLP)
    • – ERSVLM: Enable Receive S-VLAN Match or C-VLAN match (for S-VLAN processing to be enabled, set ESVL)
    • – DOV LTC: Ignores VLAN Type for Tag Match
    • – VTIM: to enable VLAN Tag Inverse Match instead of the normal VLAN Tag matching
  2. 2. Program VL bit in VLAN tag register (ETH_MACVTR) for the 12-bit or 16-bit VLAN tag.
  3. 3. If VLAN tag Hash filtering is enabled, program VLAN Hash table register (ETH_MACVHTR) .
    • – When the ETV bit is reset, the upper 4 bits of the calculated CRC-32 of VLAN tag are inverted and used to index the content of the VLAN Hash table register (ETH_MACVHTR) .
    • – When ETV bit is set, the upper 4 bits of the calculated CRC-32 of VLAN tag are used to index the content of VLAN Hash table register (ETH_MACVHTR) .

For example, when ETV bit is set, a hash value of 0b1000 selects bit 8 of the VLAN Hash table. When ETV bit is reset, a hash value of 0b1000 selects bit 7 of the VLAN Hash table.

58.10 Descriptors

58.10.1 Descriptor overview

In the Ethernet peripheral, the DMA transfers data based on a linked list of descriptors. The application creates the descriptors in the system memory (SRAM). The following two types of descriptors are supported:

The normal descriptors are used for packet data and to provide control information applicable to the packets to be transmitted.

The context descriptors are used to provide control information applicable to the packet to be transmitted.

Each normal descriptor contains two buffers and two address pointers. These buffers enable the adapter port to be compatible with various types of memory management schemes.

There is no limit to the number of descriptors that can be used for a single packet.

58.10.2 Descriptor structure

The Ethernet peripheral supports the ring structure for DMA descriptors.

Figure 808. Descriptor ring structure

Diagram illustrating the descriptor ring structure. It shows a vertical stack of descriptors: Descriptor 0, Descriptor 1, Descriptor 2, a vertical ellipsis, and Descriptor N. Each descriptor has two arrows pointing to a pair of buffers labeled Buffer 1 and Buffer 2. A feedback arrow on the left side connects the bottom of the stack (after Descriptor N) back to the top (before Descriptor 0), indicating a continuous ring structure. The diagram is labeled MSv40392V1 in the bottom right corner.
Diagram illustrating the descriptor ring structure. It shows a vertical stack of descriptors: Descriptor 0, Descriptor 1, Descriptor 2, a vertical ellipsis, and Descriptor N. Each descriptor has two arrows pointing to a pair of buffers labeled Buffer 1 and Buffer 2. A feedback arrow on the left side connects the bottom of the stack (after Descriptor N) back to the top (before Descriptor 0), indicating a continuous ring structure. The diagram is labeled MSv40392V1 in the bottom right corner.

In a ring structure, descriptors are separated by the 32-bit word number programmed in the DSL field of the Channel control register (ETH_DMACCR) . The application needs to program the total ring length, that is the total number of descriptors in ring span, in the following registers of a DMA channel:

The Channel Tx descriptor tail pointer register (ETH_DMACCTXDTPR) or Channel Rx descriptor tail pointer register (ETH_DMACRXDTPR) contains the pointer to the descriptor address ( N ). The base address and the current descriptor pointer decide the address of the current descriptor that the DMA can process. The descriptors up to one location less than the one indicated by the descriptor tail pointer ( N - 1 ) are owned by the DMA. The DMA continues to process the descriptors until the following condition occurs:

Current Descriptor Pointer == Descriptor Tail Pointer;

The DMA enters the Suspend state when this condition occurs. The application must perform a write operation to the Descriptor tail pointer register and update the tail pointer so that the following condition is met:

Current Descriptor Pointer < Descriptor Tail Pointer;

The DMA automatically wraps around the base address when the end of ring is reached, as shown in Figure 809: DMA descriptor ring .

Figure 809. DMA descriptor ring

Diagram of a DMA descriptor ring showing 10 descriptors. The first 7 are owned by the DMA (white), and the last 3 are owned by the application (grey). The ring wraps around from the last descriptor back to the first. The 'Descriptor base address' points to the first descriptor, 'Current descriptor pointer' points to the second, and 'Last descriptor owned by the DMA / Descriptor tail pointer' points to the seventh. A vertical double-headed arrow on the right indicates the 'Descriptor ring length (Number of descriptor = 10)'.

Descriptor base address

Current descriptor pointer

Wrap around the base address to start of the ring

Last descriptor owned by the DMA

Descriptor tail pointer

Descriptor ring length (Number of descriptor = 10)

Descriptor owned by the DMA

Descriptor owned by the application

MSv40393V1

Diagram of a DMA descriptor ring showing 10 descriptors. The first 7 are owned by the DMA (white), and the last 3 are owned by the application (grey). The ring wraps around from the last descriptor back to the first. The 'Descriptor base address' points to the first descriptor, 'Current descriptor pointer' points to the second, and 'Last descriptor owned by the DMA / Descriptor tail pointer' points to the seventh. A vertical double-headed arrow on the right indicates the 'Descriptor ring length (Number of descriptor = 10)'.

For descriptors owned by the application, the OWN bit of DES3 is reset to 0.

For descriptors owned by the DMA, the OWN bit is set to 1.

At the beginning, if the application has only one descriptor, it sets the last descriptor address (tail pointer) to Descriptor Base Address + 1. The DMA then processes the first descriptor and waits for the application to increment the tail pointer.

58.10.3 Transmit descriptor

The Ethernet peripheral DMA requires at least one descriptor for a transmit packet. In addition to two buffers, two byte-count buffers, and two address pointers, the transmit descriptor features control fields which can be used to manage the MAC operation on per-transmit packet basis. The Transmit normal descriptor has the following two formats: Read format and Write-back format

Transmit normal descriptor (read format)

Figure 810 shows the Read format for Transmit normal descriptor. Table 558 to Table 561 provide a detailed description of all Transmit normal descriptors (read format).

Figure 810. Transmit descriptor (read format)

Diagram of the Transmit descriptor (read format) showing four 32-bit words: TDES0 (Header or Buffer 1 Address[31:0]), TDES1 (Buffer 2 Address [31:0] or Buffer 1 Address[63:32]), TDES2 (IOC, TTSE, Buffer 2 Length[29:16], VTIR, Header or Buffer 1 Length[13:0]), and TDES3 (OWN, Control[30:16], Control[30:18], Frame length[14:0], Payload length[17:0]).

The diagram illustrates the structure of a transmit descriptor in read format, consisting of four 32-bit words (TDES0 to TDES3). Bit positions 31 and 0 are indicated at the top. TDES0 contains the 'Header or Buffer 1 Address[31:0]'. TDES1 contains 'Buffer 2 Address [31:0] or Buffer 1 Address[63:32]'. TDES2 is split into fields: IOC, TTSE, Buffer 2 Length[29:16], VTIR, and Header or Buffer 1 Length[13:0]. TDES3 includes OWN, Control[30:16], Control[30:18], Frame length[14:0], and Payload length[17:0]. A dashed line separates the Control[30:16] and Control[30:18] fields. The identifier MSV40394V1 is in the bottom right corner.

Diagram of the Transmit descriptor (read format) showing four 32-bit words: TDES0 (Header or Buffer 1 Address[31:0]), TDES1 (Buffer 2 Address [31:0] or Buffer 1 Address[63:32]), TDES2 (IOC, TTSE, Buffer 2 Length[29:16], VTIR, Header or Buffer 1 Length[13:0]), and TDES3 (OWN, Control[30:16], Control[30:18], Frame length[14:0], Payload length[17:0]).

Table 558. TDES0 normal descriptor (read format)

BitNameDescription
31:0BUF1APBuffer 1 Address Pointer or TSO Header Address Pointer
These bits indicate either the physical address of Buffer 1 or the TSO Header Address pointer when the following bits are set:
– TSE bit of TDES3
– FD bit of TDES3

Table 559. TDES1 normal descriptor (read format)

BitNameDescription
31:0BUF2APBuffer 2 or Buffer 1 Address Pointer:
These bits indicate the physical address of Buffer 2 when a descriptor ring structure is used. There is no limitation to the buffer address alignment.
31302928272625242322212019181716
IOCTTSEB2L
1514131211109876543210
VTIRHL or B1L

Table 560. TDES2 normal descriptor (read format)

BitsNameDescription
31IOCInterrupt on completion:
This bit sets the TI bit in the Channel status register (ETH_DMACSR) when the present packet transmission is complete.
30TTSETransmit Timestamp Enable
This bit enables the IEEE1588 timestamping for Transmit packet referenced by the descriptor.
29:16B2LBuffer 2 Length
The driver sets this field. When set, this field indicates Buffer 2 length.
15:14VTIRVLAN Tag Insertion or Replacement:
These bits request the MAC to perform VLAN tagging or untagging before transmitting the packets. The application must set the CRC Pad Control bits appropriately when VLAN tag insertion, replacement, or deletion is enabled for the packet. The values of these bits are as follows:
00: Do not add a VLAN tag.
01: Remove the VLAN tag from the packets before transmission. This option should be used only with the VLAN packets.
10: Insert a VLAN tag with the tag value programmed in the VLAN inclusion register (ETH_MACVIR) or context descriptor.
11: Replace the VLAN tag in packets with the tag value programmed in the VLAN inclusion register (ETH_MACVIR) or context descriptor. This option should be used only with the VLAN packets.

Table 560. TDES2 normal descriptor (read format) (continued)

BitsNameDescription
13:0HL or B1LHeader length or buffer 1 length
For Header length, only bits [9:0] are taken into account. Bits 13 to 0 are applicable only to buffer 1 length.
If the TCP Segmentation Offload feature is enabled through the TSE bit of TDES3, this field is equal to the header length. When the TSE bit is set in TDES3, the header length includes the length (expressed in bytes) from Ethernet Source address till the end of the TCP header. The maximum header length supported for TSO feature is 1023 bytes.
If the TCP Segmentation Offload feature is not enabled, this field is equal to Buffer 1 length.
31302928272625242322212019181716
OWNCTXTFDLDCPCSAICTHLTSETPL
1514131211109876543210
FT/L

Table 561. TDES3 normal descriptor (read format)

BitsNameDescription
31OWNOwn bit
1: the DMA owns the descriptor.
0: the application owns the descriptor.
The DMA clears this bit after it completes the transfer of data given in the associated buffer(s).
30CTXTContext Type
This bit should be set to 0 for normal descriptor.
29FDFirst Descriptor
When this bit is set, it indicates that the buffer contains the first segment of a packet.
28LDLast Descriptor
When this bit is set, it indicates that the buffer contains the last segment of the packet. B1L or B2L field should have a non-zero value.

Table 561. TDES3 normal descriptor (read format) (continued)

BitsNameDescription
27:26CPC

CRC Pad Control

This field controls the CRC and Pad Insertion for Tx packet. It is valid only when the first descriptor bit (TDES3[29]) is set. The values of bits[27:26] are the following:

00: CRC and Pad Insertion

The MAC appends the cyclic redundancy check (CRC) at the end of the transmitted packets whose length greater than or equal to 60 bytes. The MAC automatically appends padding and CRC to a packet with length less than 60 bytes.

01: CRC Insertion (Disable Pad Insertion)

The MAC appends the CRC at the end of the transmitted packet but it does not append padding. The application should ensure that the padding bytes are present in the packet being transferred from the Transmit buffer, that is, the packet being transferred from the Transmit Buffer is of length greater than or equal to 60 bytes.

10: Disable CRC Insertion

The MAC does not append the CRC at the end of the transmitted packet. The application should ensure that the padding and CRC bytes are present in the packet being transferred from the Transmit Buffer.

11: CRC Replacement

The MAC replaces the last four bytes of the transmitted packet with recalculated CRC bytes. The application should ensure that the padding and CRC bytes are present in the packet being transferred from the Transmit Buffer.

When the TSE bit is set, the MAC ignores this field because the CRC and pad insertion is always done for segmentation.

25:23SAIC

SA Insertion Control

These bits request the MAC to add or replace the Source Address field in the Ethernet packet with the value given in the MAC Address 0 register. The application must appropriately set the CRC Pad Control bits when SA Insertion Control is enabled for the packet.

Bit 25 specifies the MAC Address Register (1 or 0) value that is used for Source Address insertion or replacement.

The following list describes the values of Bits[24:23]:

00: Do not include the source address

01: Include or insert the source address. For reliable transmission, the application must provide frames without source addresses.

10: Replace the source address. For reliable transmission, the application must provide frames with source addresses.

11: Reserved

These bits are valid when the First Segment control bit (TDES3 [29]) is set.

22:19THL

THL: TCP Header Length

If the TSE bit is set, this field contains the length of the TCP/UDP header. The minimum value of this field must be 5 for TCP header. THL value must be equal to 2 for UDP header. This field is valid only for the first descriptor.

18TSE

TCP Segmentation Enable

When this bit is set, the DMA performs the TCP/UDP segmentation for a packet. This bit is valid only if the FD bit is set.

Table 561. TDES3 normal descriptor (read format) (continued)

BitsNameDescription
17:16CIC/TPLChecksum Insertion Control or TCP Payload Length
These bits control the checksum calculation and insertion. They can take the following values:
00: Checksum insertion disabled.
01: Only IP header checksum calculation and insertion are enabled.
10: IP header checksum and payload checksum calculation and insertion are enabled, but pseudo-header checksum is not calculated in hardware.
11: IP header checksum and payload checksum calculation and insertion are enabled, and pseudo-header checksum is calculated in hardware.
This field is valid when the TSE bit is reset. When the TSE bit is set, it contains the upper bits [17:16] of the TCP Payload length. This allows the TCP packet length field to be spanned across TDES3[17:0] to provide 256 Kbyte packet length support.
15TPLReserved or TCP Payload Length
When the TSE bit is reset, this bit is reserved. When the TSE bit is set, this is bit 15 of the TCP payload length [17:0].
14:0FL/TPLReserved or TCP Payload Length
When the TSE bit is set, this field is equal to the lower 15 bits of the TCP payload length. This length does not include Ethernet header or TCP/UDP/IP header length.
When the TSE bit is reset, this bit is reserved.

Transmit normal descriptor (write-back format)

The write-back format is applicable only for the last descriptor of the corresponding packet. The LD bit (TDES3[28]) is set in the descriptor where the DMA writes back the status and timestamp information for the corresponding Transmit packet.

Figure 811 shows the write-back format for Transmit normal descriptors. Table 562 to Table 565 provide a detailed description of all Transmit Normal descriptors (Write-Back Format).

Figure 811. Transmit descriptor write-back format

Diagram of Transmit descriptor write-back format showing four descriptors: TDES0 (Timestamp Low), TDES1 (Timestamp high), TDES2 (Reserved), and TDES3 (OWN bit and Status[30:0]).

The diagram illustrates the layout of four transmit descriptors (TDES0 to TDES3) in a 32-bit word format. Bit 31 is on the left and bit 0 is on the right.

MSV40395V1

Diagram of Transmit descriptor write-back format showing four descriptors: TDES0 (Timestamp Low), TDES1 (Timestamp high), TDES2 (Reserved), and TDES3 (OWN bit and Status[30:0]).
Table 562. TDES0 normal descriptor (write-back format) (1)
BitNameDescription
31:0TTSLTransmit Packet Timestamp Low
The DMA updates this field with least significant 32 bits of the timestamp captured for the corresponding Transmit packet. The DMA writes the timestamp only if TTSE bit of TDES2 is set in the first descriptor of the packet. This field holds the timestamp only if the Last Segment bit (LS) in the descriptor is set and the Timestamp status (TTSS) bit is set.

1. This format is only applicable to the last descriptor of a packet.

Table 563. TDES1 normal descriptor (write-back format) (1)
BitNameDescription
31:0TTSHTransmit Packet Timestamp High
The DMA updates this field with the most significant 32 bits of the timestamp captured for corresponding Receive packet. The DMA writes the timestamp only if the TTSE bit of TDES2 is set in the first descriptor of the packet. This field has the timestamp only if the Last Segment bit (LS) in the descriptor is set and Timestamp status (TTSS) bit is set.

1. This format is only applicable to the last descriptor of a packet.

Table 564. TDES2 normal descriptor (write-back format) (1)
BitDescription
31:0Reserved

1. This format is only applicable to the last descriptor of a packet.

31302928272625242322212019181716
OWNCTXTFDLDReservedTTSSRes.
1514131211109876543210
ESJTFFPCELoCNCLCECCCEDUFDB
Table 565. TDES3 normal descriptor (write-back format) (1)
BitNameDescription
31OWNOwn bit
When this bit is set, it indicates that the DMA owns the descriptor. The DMA clears this bit when it completes the packet transmission. After the write-back is complete, this bit is set to 0.
30CTXTContext Type
This bit should be set to 0 for normal descriptors.
29FDFirst Descriptor
This bit indicates that the buffer contains the first segment of a packet.
28LDLast Descriptor
This bit is set 1 for last descriptor of a packet. The DMA writes the status fields only in the last descriptor of the packet.
27:18Reserved
17TTSSTx Timestamp Status
This status bit indicates that a timestamp has been captured for the corresponding transmit packet. When this bit is set, TDES0 and TDES1 have timestamp values that were captured for the Transmit packet. This field is valid only when the Last Segment control bit (TDES3 [28]) in a descriptor is set.
16Reserved
Table 565. TDES3 normal descriptor (write-back format) (1) (continued)
BitNameDescription
15ESError Summary
This bit indicates the logical OR of the following bits:
TDES3[0]: IP Header Error
TDES3[14]: Jabber Timeout
TDES3[13]: Packet Flush
TDES3[12]: Payload Checksum Error
TDES3[11]: Loss of Carrier
TDES3[10]: No Carrier
TDES3[9]: Late Collision
TDES3[8]: Excessive Collision
TDES3[3]: Excessive Deferral
TDES3[2]: Underflow Error
14JTJabber Timeout
This bit indicates that the MAC transmitter has experienced a jabber timeout. This bit is set only when the JD bit of the Operating mode configuration register (ETH_MACCR) is not set.
13FFPacket Flushed
This bit indicates that the DMA or MTL flushed the packet because of a software flush command given by the CPU.
12PCEPayload Checksum Error
This bit indicates that the Checksum Offload engine had a failure and did not insert any checksum into the encapsulated TCP, UDP, or ICMP payload. This failure can be either caused by insufficient bytes, as indicated by the Payload Length field of the IP Header, or by the MTL starting to forward the packet to the MAC transmitter in Store-and-Forward mode without the checksum having been calculated yet. This second error condition only occurs when the Transmit FIFO depth is less than the length of the Ethernet packet being transmitted to avoid deadlock, the MTL starts forwarding the packet when the FIFO is full, even in the store-and-forward mode. This error can also occur when a Bus error is detected during packet transfer.
11LoCLoss of Carrier
This bit indicates that Loss of Carrier occurred during packet transmission (that is, the ETH_CRS signal was inactive for one or more transmit clock periods during packet transmission). This is valid only for the packets transmitted without collision and when the MAC operates in the Half-duplex mode.
10NCNo Carrier
This bit indicates that the carrier sense signal from the PHY was not asserted during transmission.
9LCLate Collision
This bit indicates that packet transmission was aborted because a collision occurred after the collision window (64 byte times including Preamble in MII mode ). This bit is not valid if Underflow Error is set.
Table 565. TDES3 normal descriptor (write-back format) (1) (continued)
BitNameDescription
8ECExcessive Collision
This bit indicates that the transmission was aborted after 16 successive collisions while attempting to transmit the current packet. If the DR bit is set in the Operating mode configuration register (ETH_MACCR) , this bit is set after first collision and the transmission of the packet is aborted.
7:4CCCollision Count
This 4-bit counter value indicates the number of collisions occurred before the packet was transmitted. The count is not valid when the EC bit is set.
3EDExcessive Deferral
This bit indicates that the transmission ended because of excessive deferral of over 24,288 bit times if DC bit is set in the Operating mode configuration register (ETH_MACCR) .
2UFUnderflow Error
This bit indicates that the MAC aborted the packet because the data arrived late from the system memory. The underflow error can occur because of either of the following conditions:
The DMA encountered an empty Transmit Buffer while transmitting the packet
The application filled the MTL Tx FIFO slower than the MAC transmit rate
The transmission process enters the Suspend state and sets the underflow bit corresponding to a queue in the ETH_MTLISR register.
1DBDeferred Bit
This bit indicates that the MAC deferred before transmitting because of presence of carrier. This bit is valid only in the Half-duplex mode.
0IHEIP Header Error
When IP Header Error is set, this bit indicates that the Checksum Offload engine detected an IP header error. If COE detects an IP header error, it still inserts an IPv4 header checksum if the Ethernet Type field indicates an IPv4 payload.

1. This format is only applicable to the last descriptor of a packet.

Transmit context descriptor

The Transmit context descriptor can be provided any time before a packet descriptor. The context is valid for the current packet and subsequent packets. The context descriptor is used to provide the timestamps for one-step timestamp correction, and VLAN Tag ID for VLAN insertion feature. Write-back is only done on a context descriptor to reset the OWN bit.

Note: The VLAN tag IDs and MSS values, which are provided by the application in a context descriptor with their corresponding Valid bits set, are stored internally by the DMA.
When the outer or inner VLAN tag is provided with the Valid bit set, the DMA always passes the last valid VLAN tag to the MTL. The application cannot invalidate the valid VLAN tag

stored by the DMA. The VLAN tag is inserted or replaced based on the control inputs provided for the packet.

The Inner VLAN Tag Control input is used only for the packet that immediately follows the context descriptor. The application must provide a context descriptor before the normal descriptor of each packet for which the DMA should use the inner VLAN Tag control input.

Figure 812 shows the format for Transmit context descriptors. Table 566 to Table 569 provide a detailed description of all Transmit context descriptors.

Figure 812. Transmit context descriptor format

Diagram of Transmit context descriptor format showing four 32-bit words (TDES0-TDES3) and their bit fields.

The diagram illustrates the format of four 32-bit context descriptors (TDES0 to TDES3) for transmit operations. The bit numbering ranges from 31 on the left to 0 on the right.

MSv40396V2

Diagram of Transmit context descriptor format showing four 32-bit words (TDES0-TDES3) and their bit fields.

Table 566. TDES0 context descriptor

BitNameDescription
31:0TTSLTransmit Packet Timestamp Low
For one-step correction, the driver can provide the lower 32 bits of timestamp in this descriptor word. The DMA uses this value as the low word for doing one-step timestamp correction. This field is valid only if the OSTC and TCMSSV bits of TDES3 context descriptor are set.

Table 567. TDES1 context descriptor

BitNameDescription
31:0TTSHTransmit Packet Timestamp High
For one-step correction, the driver can provide the upper 32 bits of timestamp in this descriptor. The DMA uses this value as the high word for doing one-step timestamp correction. This field is valid only if the OSTC and TCMSSV bits of TDES3 context descriptor are set.

Table 568. TDES2 context descriptor

BitNameDescription
31:16IVTInner VLAN Tag
When the IVLTV bit of TDES3 context descriptor is set and the TCMSSV and OSTC bits of TDES3 context descriptor are reset, TDES2[31:16] contains the inner VLAN Tag to be inserted in the subsequent Transmit packets.
15:14Reserved
13:0MSSMaximum Segment Size
This segment size is used while segmenting the TCP/IP payload. This field is valid only if the TCMSSV bit of TDES3 context descriptor is set and the OSTC bit of the TDES3 context descriptor is reset.
31302928272625242322212019181716
OWNCTXTReservedOSTCTCMSSVReservedCDEReservedIVLTVVLT
1514131211109876543210
VT

Table 569. TDES3 context descriptor

BitNameDescription
31OWNOwn bit
1: the DMA owns the descriptor.
0: the application owns the descriptor.
The DMA clears this bit immediately after a read operation.
30CTXTContext Type
This bit should be set to 1 for context descriptor.
29:28Reserved
27OSTCOne-Step Timestamp Correction Enable
When this bit is set, the DMA performs a one-step timestamp correction with reference to the timestamp values provided in TDES0 and TDES1.

Table 569. TDES3 context descriptor (continued)

BitNameDescription
26TCMSSVOne-Step Timestamp Correction Input or MSS Valid
When this bit and the OSTC bit are set, it indicates that the Timestamp Correction input provided in TDES0 and TDES1 is valid.
When the OSTC bit is reset and this bit and the TSE bit of TDES3 are set in subsequent normal descriptor, it indicates that the MSS input in TDES2 is valid.
25:24Reserved
23CDEContext Descriptor Error
When this bit is set, it indicates that the context descriptor is incorrect. The DMA sets this bit during write-back while closing the context descriptor.
The Context Descriptor errors can be:
– Incorrect sequence from the context descriptor. For example, a location before the first descriptor for a packet.
– All 1s.
– CD, LD, and FD bits set to 1.
Note: When a Context Descriptor error occurs due to All 1s or CTXT, LD, and FD bits set to 1, the Transmit DMA closes the transmit descriptor with DE and LD bits set to 1. When IOC bit in TDES2 of corresponding first descriptor is set to 1, Transmit DMA sets the TI bit in the Channel status register (ETH_DMACSR).
Based on CTXT, LD, and FD bits of the transmit descriptor, the subsequent descriptor might be considered as the First Descriptor (even if FD bit is not set) and partial packet is sent. This error is categorized as an abnormal event; recovery is only by issuing a software reset (DMA stopping-reconfiguring-restarting recovery mechanism is not supported)
22:20Reserved
19:18IVTIRInner VLAN Tag Insert or Replace
When these bits are set, they request the MAC to perform Inner VLAN tagging or untagging before transmitting the packets. If the packet is modified for VLAN tags, the MAC automatically recalculates and replaces the CRC bytes.
This bitfield has the following values:
00: Do not add the inner VLAN tag.
01: Remove the inner VLAN tag from the packets before transmission. This option should be used only with the VLAN frames.
10: Insert an inner VLAN tag with the tag value programmed in the Inner VLAN inclusion register (ETH_MACIVIR) or context descriptor.
11: Replace the inner VLAN tag in packets with the tag value programmed in the Inner VLAN inclusion register (ETH_MACIVIR) or context descriptor. This option should be used only with the VLAN frames.
17IVLTVInner VLAN Tag Valid
When this bit is set, it indicates that the IVT field of TDES2 is valid.

Table 569. TDES3 context descriptor (continued)

BitNameDescription
16VLT VVLAN Tag Valid
When this bit is set, it indicates that the VT field of TDES3 is valid.
15:0VTVLAN Tag
This field contains the VLAN Tag to be inserted or replaced in the packet. This field is used as VLAN Tag only when the VLT I bit of the VLAN inclusion register (ETH_MACVIR) is reset.

58.10.4 Receive descriptor

The DMA in the Ethernet peripheral attempts to read a descriptor only if the Tail pointer is different from the Base pointer or current pointer. It is recommended to have a descriptor ring with a length that can accommodate at least two complete packets received by the MAC; otherwise, the performance of the DMA is greatly impacted because of the unavailability of the descriptors. In such a situation, the MTL RxFIFO becomes full and starts dropping packets.

The following Receive descriptors are present:

All received descriptors are prepared by the software and given to the DMA as “normal” descriptors (see Figure 813: Receive normal descriptor (read format) for a description of their content). The DMA reads this descriptor and, after transferring a received packet (or part of it) to the buffers indicated by the descriptor, the Rx DMA closes the descriptor with the corresponding packet status. The status format is given in Figure 814: Receive normal descriptor (write-back format) .

For some packets, the normal descriptor bits are not sufficient to write the complete status. For such packets, the Rx DMA writes the extended status to the next descriptor (without processing or using the Buffers pointers embedded in that descriptor). The format and content of this write-back descriptor is described in Figure 815: Receive context descriptor .

Receive normal descriptor (read format)

Figure 813 shows the read format for Receive normal descriptors. Table 570 to Table 573 provide a detailed description of all Receive normal descriptors (read format).

Figure 813. Receive normal descriptor (read format)

RDES0Buffer 1 Address[31:0]
RDES1Reserved
RDES2Buffer 2 Address[31:0]
RDES3OWNIOCRes.
[29:26]
BUF2V[25]BUF1V[24]Reserved[23:0]

MSV40397V4

Note: In the Receive descriptor (read format), if the Buffer Address field contains only 0s, the MAC does not transfer data to this buffer and skips to the next buffer or next descriptor.

Table 570. RDES0 normal descriptor (read format)

BitNameDescription
31:0BUF1APBuffer 1 Address Pointer
These bits indicate the physical address of Buffer 1.
The application can program a byte-aligned address for this buffer, which means that the LS bits of this field can be non-zero. However, while transferring the start of packet, the DMA performs a write operation with RDES2[1:0]=0 in case of 64-/128-bit configuration) as zero. However, the packet data is shifted by the actual offset as given in the buffer address pointer. If the address pointer points to a buffer where the middle or last part of the packet is stored, the DMA ignores the offset address and writes to the full location as indicated by the data-width.

Table 571. RDES1 normal descriptor (read format)

BitNameDescription
31:0ReservedField reserved.

Table 572. RDES2 normal descriptor (read format)

BitNameDescription
31:0BUF2APBuffer 2 Address Pointer
These bits indicate Buffer 2 physical address.
The RxDMA uses the LS bits of the pointer address only while transferring the start bytes of a packet. If the BUF2AP is giving the address of a buffer in which the middle or last part of a packet is stored, the DMA ignores RDES2[1:0]=0 and writes to the complete location.
31302928272625242322212019181716
OWNIOCReservedBUF2VBUF1VReserved
1514131211109876543210
Reserved

Table 573. RDES3 normal descriptor (read format)

BitNameDescription
31OWNOwn bit
When this bit is set, it indicates that the DMA owns the descriptor. When this bit is reset, it indicates that the application owns the descriptor. The DMA clears this bit when either of the following conditions is true:
– The DMA completes the packet reception
– The buffers associated with the descriptor are full
30IOCInterrupt Enabled on Completion
When this bit is set, an interrupt is issued to the application when the DMA closes this descriptor.
29:26Reserved
25BUF2VBuffer 2 Address Valid
When this bit is set, it indicates to the DMA that the buffer 2 address specified in RDES2 is valid. The application must set this bit so that the DMA can use the address to which the Buffer 2 address in RDES0 is pointing, to write received packet data.
24BUF1VBuffer 1 Address Valid
When set, this indicates to the DMA that the buffer 1 address specified in RDES0 is valid.
The application must set this value if the address to which Buffer 1 address points in RDES0, can be used by the DMA to write received packet data.
23:0Reserved

Receive normal descriptor (write-back format)

Figure 814 shows the write-back format for Receive normal descriptors. Table 574 to Table 577 provide a detailed description of all Receive normal descriptors (write-back format).

Figure 814. Receive normal descriptor (write-back format)

Diagram of Receive normal descriptor (write-back format) showing four rows of fields: RDES0 (Inner VLAN tag [31:16], Outer VLAN tag [15:0]), RDES1 (OAM code or MAC control Opcode [31:16], Extended status), RDES2 (MAC filter status [31:16], VF[15], Res. [14:11], ARPNR [10], Res[9:0]), and RDES3 (OWN, CTXT, ED, E, Status[27:15], ES, Packet length[14:0]).
Diagram of Receive normal descriptor (write-back format) showing four rows of fields: RDES0 (Inner VLAN tag [31:16], Outer VLAN tag [15:0]), RDES1 (OAM code or MAC control Opcode [31:16], Extended status), RDES2 (MAC filter status [31:16], VF[15], Res. [14:11], ARPNR [10], Res[9:0]), and RDES3 (OWN, CTXT, ED, E, Status[27:15], ES, Packet length[14:0]).

MSv40398V2

Table 574. RDES0 normal descriptor (write-back format)

BitNameDescription
31:16IVTInner VLAN Tag
This field contains the Inner VLAN tag of the received packet if the RS0V bit of RDES3 is set. This is valid only when Double VLAN tag processing and VLAN tag stripping are enabled.
15:0OVTOuter VLAN Tag
This field contains the Outer VLAN tag of the received packet if the RS0V bit of RDES3 is set.
Bit field diagram for RDES1 normal descriptor showing bits 31-16 (OPC) and bits 15-0 (TD, TSA, PV, PFT, PMT, IPCE, IPCB, IPV6, IPV4, IPHE, PT).
Bit field diagram for RDES1 normal descriptor showing bits 31-16 (OPC) and bits 15-0 (TD, TSA, PV, PFT, PMT, IPCE, IPCB, IPV6, IPV4, IPHE, PT).
Table 575. RDES1 normal descriptor (write-back format) (1)
BitNameDescription
31:16OPCOAM Subtype Code, or MAC Control Packet opcode
OAM Subtype Code
If bits[18:16] of RDES3 are set to 111, this field contains the OAM subtype and code fields.
MAC Control Packet opcode
If bits[18:16] of RDES3 are set to 110, this field contains the MAC Control packet opcode field.
15TDTimestamp Dropped
This bit indicates that the timestamp was captured for this packet but got dropped in the MTL Rx FIFO because of overflow.
14TSATimestamp Available
When Timestamp is present, this bit indicates that the timestamp value is available in a context descriptor word 2 (RDES2) and word 1(RDES1). This is valid only when the Last Descriptor bit (RDES3 [28]) is set.
The context descriptor is written in the next descriptor just after the last normal descriptor for a packet.
13PVPTP Version
1: Received PTP message in IEEE 1588 version 2 format
0: Received PTP message in IEEE 1588 version 1 format
12PFTPTP Packet Type
This bit indicates that the PTP message is sent directly over Ethernet.
11:8PMTPTP Message Type
These bits are encoded to give the type of the message received:
0000: No PTP message received
0001: SYNC (all clock types)
0010: Follow_Up (all clock types)
0011: Delay_Req (all clock types)
0100: Delay_Resp (all clock types)
0101: Pdelay_Req (in peer-to-peer transparent clock)
0110: Pdelay_Resp (in peer-to-peer transparent clock)
0111: Pdelay_Resp_Follow_Up (in peer-to-peer transparent clock)
1000: Announce
1001: Management
1010: Signaling
1011–1110: Reserved
1111: PTP packet with Reserved message type
7IPCEIP Payload Error
When this bit is set, it indicates either of the following:
– The 16-bit IP payload checksum (that is, the TCP, UDP, or ICMP checksum) calculated by the MAC does not match the corresponding checksum field in the received segment.
– The TCP, UDP, or ICMP segment length does not match the payload length value in the IP Header field.
– The TCP, UDP, or ICMP segment length is less than minimum allowed segment length for TCP, UDP, or ICMP.
Bit 15 (ES) of RDES3 is not set when this bit is set.
Table 575. RDES1 normal descriptor (write-back format) (1) (continued)
BitNameDescription
6IPCBIP Checksum Bypassed
This bit indicates that the checksum offload engine is bypassed.
5IPV6IPv6 header Present
This bit indicates that an IPv6 header is detected.
4IPV4IPv4 Header Present
This bit indicates that an IPv4 header is detected.
3IPHEIP Header Error
  • – When this bit is set, it indicates either of the following:
  • – The 16-bit IPv4 header checksum calculated by the MAC does not match the received checksum bytes.
  • – The IP datagram version is not consistent with the Ethernet Type value.
  • – Ethernet packet does not have the expected number of IP header bytes.
This bit is valid when either bit 5 or bit 4 is set.
2:0PTPayload Type
These bits indicate the type of payload encapsulated in the IP datagram processed by the Receive Checksum Offload Engine (COE):
000: Unknown type or IP/AV payload not processed
001: UDP
010: TCP
011: ICMP
100: IGMP if IPv4 Header Present bit is set
Others: reserved.
If the COE does not process the payload of an IP datagram because there is an IP header error or fragmented IP, it sets these bits to 3'b000.

1. The Status fields in write-back format are valid only for the last descriptor (RDES3[28] is set).

31302928272625242322212019181716
L3L4FML4FML3FMMADRMHFDAFSAF
1514131211109876543210
VFReservedARPRNReserved

Table 576. RDES2 normal descriptor (write-back format)

BitNameDescription
31:29L3L4FMLayer 3 and Layer 4 Filter Number Matched
These bits indicate the number of the Layer 3 and Layer 4 Filter that matched the received packet:
– 000: Filter 0
– 001: Filter 1
– 010: Filter 2
– 011: Filter 3
– 100: Filter 4
– 101: Filter 5
– 110: Filter 6
– 111: Filter 7
This field is valid only when bit 28 or bit 27 is set high. When more than one filter matches, these bits give the number of lowest filter.
28L4FMLayer 4 Filter Match
When this bit is set, it indicates that the received packet matches one of the enabled Layer 4 Port Number fields. This status is given only when one of the following conditions is true:
– Layer 3 fields are not enabled and all enabled Layer 4 fields match
– All enabled Layer 3 and Layer 4 filter fields match
When more than one filter matches, this bit gives the layer 4 filter status of filter indicated by bits[31:29].
27L3FMLayer 3 Filter Match
When this bit is set, it indicates that the received packet matches one of the enabled Layer 3 IP Address fields. This status is given only when one of the following conditions is true:
– All enabled Layer 3 fields match and all enabled Layer 4 fields are bypassed
– All enabled filter fields match
When more than one filter matches, this bit gives the layer 3 filter status of filter indicated by bits[31:29].
26:19MADRMMAC Address Match or Hash Value
When the HF bit is reset, this field contains the MAC address register number that matched the Destination address of the received packet. This field is valid only if the DAF bit is reset.
When the HF bit is set, this field contains the Hash value computed by the MAC. A packet passes the Hash filter when the bit corresponding to the Hash value is set in the Hash filter register.
18HFHash Filter Status
When this bit is set, it indicates that the packet passed the MAC address Hash filter. bits[26:19] indicate the Hash value.
17DAFDestination Address Filter Fail
When this bit is set, it indicates that the packet failed the DA Filter in the MAC.
16SAFSA Address Filter Fail
When this bit is set, it indicates that the packet failed the SA Filter in the MAC.

Table 576. RDES2 normal descriptor (write-back format) (continued)

BitNameDescription
15VFVLAN Filter Status
When this bit is set, it indicates that the VLAN Tag of received packet passed the VLAN filter.
14:11Reserved
10ARPNRARP Reply Not Generated
When this bit is set, it indicates that the MAC did not generate the ARP Reply for received ARP Request packet. This bit is set when the MAC is busy transmitting ARP reply to earlier ARP request (only one ARP request is processed at a time).
9:0Reserved
31302928272625242322212019181716
OWNCTXFDLDRS2VRS1VRS0VCEGPRWTOEREDELT
1514131211109876543210
ESPL

Table 577. RDES3 normal descriptor (write-back format)

BitNameDescription
31OWNOwn bit
1: The DMA owns the descriptor.
0: The application owns the descriptor.
The DMA clears this bit when either of the following conditions is true:
The DMA completes the packet reception
The buffers associated with the descriptor are full
30CTXReceive Context Descriptor
When this bit is set, it indicates that the current descriptor is a context type descriptor. The DMA writes 0 to this bit for normal receive descriptor.
When CTXT and FD bits are used together, {CTX, FD} possible values are:
00: Intermediate Descriptor
01: First Descriptor
10: Reserved
11: Descriptor error (due to all 1s)
Note: When a Descriptor error occurs, the Receive DMA closes the receive descriptor indicating a Descriptor error. This receive descriptor is skipped and the buffer addresses are not used to write the packet data. The receive DMA sets the CDE field of the Channel status register (ETH_DMACSR) but does not set the RI field, even when IOC field is set, as this is not marked as last receive descriptor for the packet. The subsequent valid receive descriptor is used to write the packet data.

Table 577. RDES3 normal descriptor (write-back format) (continued)

BitNameDescription
29FDFirst Descriptor
When this bit is set, it indicates that this descriptor contains the first buffer of the packet. If the size of the first buffer is 0, the second buffer contains the beginning of the packet. If the size of the second buffer is also 0, the next descriptor contains the beginning of the packet.
Refer to the CTXT bit description for details on how to use the CTXT bit and FD bit together.
28LDLast Descriptor
When this bit is set, it indicates that the buffers to which this descriptor is pointing are the last buffers of the packet.
27RS2VReceive Status RDES2 Valid
When this bit is set, it indicates that the status in RDES2 is valid and it is written by the DMA. This bit is valid only when the LD bit of RDES3 is set.
26RS1VReceive Status RDES1 Valid
When this bit is set, it indicates that the status in RDES1 is valid and it is written by the DMA. This bit is valid only when the LD bit of RDES3 is set.
25RS0VReceive Status RDES0 Valid
When this bit is set, it indicates that the status in RDES0 is valid and it is written by the DMA. This bit is valid only when the LD bit of RDES3 is set.
24CECRC Error
When this bit is set, it indicates that a Cyclic Redundancy Check (CRC) Error occurred on the received packet. This field is valid only when the LD bit of RDES3 is set.
23GPGiant Packet
When this bit is set, it indicates that the packet length exceeds the specified maximum Ethernet size of 1518, 1522, or 2000 bytes (9018 or 9022 bytes if jumbo packet enable is set).
Giant packet indicates only the packet length. It does not cause any packet truncation.
22RWTReceive Watchdog Timeout
When this bit is set, it indicates that the Receive Watchdog Timer has expired while receiving the current packet. The current packet is truncated after watchdog timeout.
21OEOverflow Error
When this bit is set, it indicates that the received packet is damaged because of buffer overflow in Rx FIFO.
This bit is set only when the DMA transfers a partial packet to the application. This happens only when the Rx FIFO is operating in the threshold mode. In the store-and-forward mode, all partial packets are dropped completely in Rx FIFO.
20REReceive Error
When this bit is set, it indicates that the ETH_RX_ER signal is asserted while the ETH_RX_DV signal is asserted during packet reception.

Table 577. RDES3 normal descriptor (write-back format) (continued)

BitNameDescription
19DEDribble Bit Error
When this bit is set, it indicates that the received packet has a non-integer multiple of bytes (odd nibbles). This bit is valid only in the MII Mode.
18:16LTLength/Type Field
This field indicates if the packet received is a length packet or a type packet. The encoding of the 3 bits is as follows:
000: The packet is a length packet
001: The packet is a type packet.
011: The packet is a ARP Request packet type
100: The packet is a type packet with VLAN Tag
101: The packet is a type packet with Double VLAN tag
110: The packet is a MAC Control packet type
111: The packet is a OAM packet type
010: Reserved
15ESError Summary
When this bit is set, it indicates the logical OR of the following bits:
RDES3[19]: Dribble Error
RDES3[20]: Receive Error
RDES3[21]: Overflow Error
RDES3[22]: Watchdog Timeout
RDES3[23]: Giant Packet
RDES3[24]: CRC Error
This field is valid only when the LD bit of RDES3 is set.
14:0PLPacket Length
These bits indicate the byte length of the received packet that was transferred to system memory (including CRC).
This field is valid when both the LD bit of RDES3 is set and the Overflow Error bit is reset. The packet length also includes the two bytes appended to the Ethernet packet when IP checksum calculation is enabled and the received packet is not a MAC control packet.
When LD bit of RDES3 is reset, this field contains the accumulated number of bytes (partial) that have been transferred for the current packet.

Receive context descriptor

This descriptor is read-only for the application. This descriptor can be written only by the DMA.

The context descriptor provides information about the extended status related to the last received packet. Bit 30 of RDES3 indicates the context type descriptor.

Figure 815 shows the format for Receive context descriptors. Table 578 to Table 581 provide a detailed description of all Receive context descriptors.

Figure 815. Receive context descriptor

Diagram of Receive context descriptor structure showing RDES0 (Timestamp Low), RDES1 (Timestamp High), RDES2 (Reserved), and RDES3 (OWN, CTXT, Reserved).
RDES0Timestamp Low[31:0]
RDES1Timestamp High[31:0]
RDES2Reserved
RDES3OWN
CTXT
Reserved[29:0]

MSv40399V1

Diagram of Receive context descriptor structure showing RDES0 (Timestamp Low), RDES1 (Timestamp High), RDES2 (Reserved), and RDES3 (OWN, CTXT, Reserved).

Table 578. RDES0 context descriptor

BitNameDescription
31:0RTSLReceive Packet Timestamp Low
The DMA updates this field with least significant 32 bits of the timestamp captured for corresponding Receive packet. When this field and the RTSH field of RDES1 show all-ones value, the timestamp must be considered as corrupt.

Table 579. RDES1 context descriptor

BitFieldDescription
31:0RTSHReceive Packet Timestamp High
The DMA updates this field with most significant 32 bits of the timestamp captured for corresponding receive packet. When this field and the RTSL field of RDES0 show all-ones value, the timestamp must be considered as corrupt.

Table 580. RDES2 context descriptor

BitDescription
31:0Reserved

Table 581. RDES3 context descriptor

BitNameDescription
31OWNOwn Bit
1: The DMA owns the descriptor
0: The application owns the descriptor.
The DMA clears this bit when either of the following conditions is true:
The DMA completes the packet reception
The buffers associated with the descriptor are full
30CTXTReceive Context Descriptor
When this bit is set, it indicates that the current descriptor is a context descriptor. The DMA writes 1'b1 to this bit for context descriptor.
29:0Reserved

58.11 Ethernet registers

58.11.1 Ethernet register maps

This section provides the following register maps:

58.11.2 Ethernet DMA registers

DMA mode register (ETH_DMAMR)

Address offset: 0x1000

Reset value: 0x0000 0000

The DMA mode register establishes the bus operating modes for the DMA.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.INTM[1:0]
rwrw
1514131211109876543210
Res.PR[2:0]TXPRRes.Res.Res.Res.Res.Res.Res.Res.Res.DASWR
rwrwrwrwrwrw

Bits 31:18 Reserved, must be kept at reset value.

Bits 17:16 INTM[1:0] : Interrupt Mode

This field defines the interrupt mode of the Ethernet peripheral.

The behavior of the interrupt signal and of the RI/TI bits in the ETH_DMACSR register changes depending on the INTM value (refer to Table 557: Transfer complete interrupt behavior ).

Bit 15 Reserved, must be kept at reset value.

Bits 14:12 PR[2:0] : Priority ratio

These bits control the priority ratio in weighted round-robin arbitration between the Rx DMA and Tx DMA. These bits are valid only when the DA bit is reset. The priority ratio is Rx:Tx or Tx:Rx depending on whether the TXPR bit is reset or set.

000: The priority ratio is 1:1

001: The priority ratio is 2:1

010: The priority ratio is 3:1

011: The priority ratio is 4:1

100: The priority ratio is 5:1

101: The priority ratio is 6:1

110: The priority ratio is 7:1

111: The priority ratio is 8:1

Bit 11 TXPR : Transmit priority

When set, this bit indicates that the Tx DMA has higher priority than the Rx DMA during arbitration for the system-side bus.

Bits 10:2 Reserved, must be kept at reset value.

Bit 1 DA : DMA Tx or Rx Arbitration Scheme

This bit specifies the arbitration scheme between the Transmit and Receive paths of all channels:

0: Weighted Round-Robin with Rx:Tx or Tx:Rx

The priority between the paths is according to the priority specified in Bits[14:12] and the priority weight is specified in the TXPR bit.

1: Fixed priority

The Tx path has priority over the Rx path when the TXPR bit is set. Otherwise, the Rx path has priority over the Tx path.

Bit 0 SWR : Software Reset

When this bit is set, the MAC and the DMA controller reset the logic and all internal registers of the DMA, MTL, and MAC. This bit is automatically cleared after the reset operation is complete in all clock domains. Before reprogramming any register, a value of zero should be read in this bit.

Note: The reset operation is complete only when all resets in all active clock domains are deasserted. Therefore, it is essential that all PHY inputs clocks (applicable for the selected PHY interface) are present for software reset completion. The time to complete the software reset operation depends on the frequency of the slowest active clock.

System bus mode register (ETH_DMASBMR)

Address offset: 0x1004

Reset value: 0x0000 0000

The System bus mode register controls the behavior of the AHB master. It mainly controls burst splitting and number of outstanding requests.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
RBMBRes.AALRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FB
rrnwnw

Bits 31:16 Reserved, must be kept at reset value.

Bit 15 RB: Rebuild INCRx Burst

When this bit is set high and the AHB master gets SPLIT, RETRY, or Early Burst Termination (EBT) response, the AHB master interface rebuilds the pending beats of any initiated burst transfer with INCRx and SINGLE transfers. By default, the AHB master interface rebuilds pending beats of an EBT with an unspecified (INCR) burst.

Bit 14 MB: Mixed Burst

When this bit is set high and the FB bit is low, the AHB master performs undefined bursts transfers (INCR) for burst length of 16 or more. For burst length of 16 or less, the AHB master performs fixed burst transfers (INCRx and SINGLE).

Bit 13 Reserved, must be kept at reset value.

Bit 12 AAL: Address-Aligned Beats

When this bit is set to 1, the master performs address-aligned burst transfers on Read and Write channels.

Bits 11:1 Reserved, must be kept at reset value.

Bit 0 FB: Fixed Burst Length

When this bit is set to 1, the AHB master will initiate burst transfers of specified length (INCRx or SINGLE).

When this bit is set to 0, the AHB master will initiate transfers of unspecified length (INCR) or SINGLE transfers.

Interrupt status register (ETH_DMAISR)

Address offset: 0x1008

Reset value: 0x0000 0000

The application reads this Interrupt Status register during interrupt service routine or polling to determine the interrupt status of DMA channels, MTL queues, and the MAC.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MACISMTLIS
rr
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DC0IS
r

Bits 31:18 Reserved, must be kept at reset value.

Bit 17 MACIS: MAC Interrupt Status

This bit indicates an interrupt event in the MAC. To reset this bit to 1'b0, the software must read the corresponding register in the MAC to get the exact cause of the interrupt and clear its source.

Bit 16 MTLIS: MTL Interrupt Status

This bit indicates an interrupt event in the MTL. To reset this bit to 1'b0, the software must read the corresponding register in the MTL to get the exact cause of the interrupt and clear its source.

Bits 15:1 Reserved, must be kept at reset value.

Bit 0 DC0IS: DMA Channel Interrupt Status

This bit indicates an interrupt event in DMA Channel. To reset this bit to 0, the software must read the corresponding register in DMA Channel to get the exact cause of the interrupt and clear its source.

Debug status register (ETH_DMADSR)

Address offset: 0x100C

Reset value: 0x0000 0000

The Debug status register gives the Receive and Transmit process status for DMA Channel for debugging purpose.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
TPS0[3:0]RPS0[3:0]Res.Res.Res.Res.Res.Res.Res.AXWH
STS
rrrrrrrrr

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:12 TPS0[3:0] : DMA Channel Transmit Process State

This field indicates the Tx DMA FSM state for Channel:

The MSB of this field always returns 0. This field does not generate an interrupt.

Bits 11:8 RPS0[3:0] : DMA Channel Receive Process State

This field indicates the Rx DMA FSM state for Channel:

The MSB of this field always returns 0. This field does not generate an interrupt.

Bits 7:1 Reserved, must be kept at reset value.

Bit 0 AXWHSTS : AHB Master Write Channel

When high, this bit indicates that the write channel of the AHB master FSMs are in non-idle state.

Channel control register (ETH_DMACCR)

Address offset: 0x1100

Reset value: 0x0000 0000

The DMA Channel control register specifies the MSS value for segmentation, length to skip between two descriptors, and also the features such as header splitting and 8xPBL mode.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DSL[2:0]Res.PBLX8
rwrwrwrw

1514131211109876543210
Res.Res.MSS[13:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:21 Reserved, must be kept at reset value.

Bits 20:18 DSL[2:0] : Descriptor Skip Length

This bit specifies the 32-bit word number to skip between two unchained descriptors. The address skipping starts from the end of the current descriptor to the start of the next descriptor.

When the DSL value is equal to zero, the DMA takes the descriptor table as contiguous.

Bit 17 Reserved, must be kept at reset value.

Bit 16 PBLX8 : 8xPBL mode

When this bit is set, the PBL value programmed in Bits[21:16] in Channel transmit control register (ETH_DMACTXCR) is multiplied eight times. Therefore, the DMA transfers the data in 8, 16, 32, 64, 128, and 256 beats depending on the PBL value.

Bits 15:14 Reserved, must be kept at reset value.

Bits 13:0 MSS[13:0] : Maximum Segment Size

This field specifies the maximum segment size that should be used while segmenting the packet. This field is valid only if the TSE bit of Channel transmit control register (ETH_DMACTXCR) is set.

The value programmed in this field must be more than the configured Data width in bytes. It is recommended to use a MSS value of 64 bytes or more.

Channel transmit control register (ETH_DMACTXCR)

Address offset: 0x1104

Reset value: 0x0000 0000

The DMA Channel Transmit Control register controls the Tx features such as PBL, TCP segmentation, and Tx Channel weights.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TXPBL[5:0]
rwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.TSERes.Res.Res.Res.Res.Res.Res.OSFRes.Res.Res.ST
rwrwrw

Bits 31:22 Reserved, must be kept at reset value.

Bits 21:16 TXPBL[5:0] : Transmit Programmable Burst Length

These bits indicate the maximum number of beats to be transferred in one DMA data transfer. This is the maximum value that is used in a single block Read or Write. The DMA always attempts to burst as specified in PBL each time it starts a burst transfer on the application bus. You can program PBL with any of the following values: 1, 2, 4, 8, 16, or 32. Any other value results in undefined behavior.

To transfer more than 32 beats, perform the following steps:

  1. Set the PBLx8 mode in ETH_DMACCR.
  2. Set the TXPBL[5:0].

Note: The maximum value of TXPBL must be less than or equal to half the Tx Queue size (TQS field of Tx queue operating mode Register (ETH_MTLTXQOMR) ) in terms of beats. This is required so that the Tx Queue has space to store at least another Tx PBL worth of data while the MTL Tx Queue Controller is transferring data to MAC. The total locations in Tx Queue of size 2048 bytes is 512, TXPBL and 8xPBL needs to be programmed to less than or equal to 512/2.

Bits 15:13 Reserved, must be kept at reset value.

Bit 12 TSE : TCP Segmentation Enabled

When this bit is set, the DMA performs the TCP segmentation for packets in Channel x. The TCP segmentation is done only for those packets for which the TSE bit (TDES0[19]) is set in the Tx Normal descriptor. When this bit is set, the TxPBL value must be greater than or equal to 4.

Bits 11:5 Reserved, must be kept at reset value.

Bit 4 OSF : Operate on Second Packet

When this bit is set, it instructs the DMA to process the second packet of the Transmit data even before the status for the first packet is obtained.

Bits 3:1 Reserved, must be kept at reset value.

Bit 0 ST : Start or Stop Transmission Command

When this bit is set, transmission is placed in the Running state. The DMA checks the Transmit list at the current position for a packet to be transmitted.

The DMA tries to acquire descriptor from either of the following positions:

If the DMA does not own the current descriptor, the transmission enters the Suspended state and the TBU bit of the ETH_DMACSR is set. The Start Transmission command is effective only when the transmission is stopped. If the command is issued before setting the ETH_DMACTXDLAR register, the DMA behavior is unpredictable.

When this bit is reset, the transmission process is placed in the Stopped state after completing the transmission of the current packet. The Next Descriptor position in the Transmit list is saved, and it becomes the current position when the transmission is restarted. To change the list address, you need to program ETH_DMACTXDLAR register with a new value when this bit is reset. The new value is considered when this bit is set again. The stop transmission command is effective only when the transmission of the current packet is complete or the transmission is in the Suspended state.

Channel receive control register (ETH_DMACRXCR)

Address offset: 0x1108

Reset value: 0x0000 0000

The DMA Channel Receive Control register controls the Rx features such as PBL, buffer size, and extended status.

31302928272625242322212019181716
RPFRes.Res.Res.Res.Res.Res.Res.Res.Res.RXPBL[5:0]
rwrwrwrwrwrwrw
1514131211109876543210
Res.RBSZ[13:0]SR
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 RPF: DMA Rx Channel Packet Flush

When this bit is set to 1, the Ethernet peripheral automatically flushes the packet from the Rx queues destined to DMA Rx Channel when the DMA Rx Channel is stopped after a system bus error has occurred. When this bit remains set and the DMA is re-started by the software driver, the packets residing in the Rx Queues that were received when this RxDMA was stopped, are flushed out. The packets that are received by the MAC after the RxDMA is re-started are routed to the RxDMA. The flushing happens on the Read side of the Rx queue. When this bit is set to 0 the Ethernet peripheral does not flush the packet in the Rx queue destined to DMA Rx Channel after the DMA is stopped due to a system bus error. This might cause head-of-line blocking in the corresponding RxQueue.

Note: The stopping of packet flow from a Rx DMA Channel to the application by setting RPF works only when there is one-to-one mapping of Rx Queue to Rx DMA channels. In Dynamic mapping mode, setting RPF bit in ETH_DMACRXCR register might flush packets from unintended Rx Queues which are destined to the stopped Rx DMA Channel.

Bits 30:22 Reserved, must be kept at reset value.

Bits 21:16 RXPBL[5:0]: Receive Programmable Burst Length

These bits indicate the maximum number of beats to be transferred in one DMA data transfer. This is the maximum value that is used in a single block Read or Write. The DMA always attempts to burst as specified in PBL each time it starts a burst transfer on the application bus. You can program PBL with any of the following values: 1, 2, 4, 8, 16, or 32. Any other value results in undefined behavior.

To transfer more than 32 beats, perform the following steps:

  1. Set the PBLx8 mode in the ETH_DMACCCR.
  2. Set the RXPBL[5:0].

Note: The maximum value of RXPBL must be less than or equal to half the Rx Queue size (RQS field of Rx queue operating mode register (ETH_MTLRXQOMR)) in terms of beats. This is required so that the Rx Queue has space to store at least another Rx PBL worth of data while the MTL Rx Queue Controller is transferring data to MAC. The total locations in Rx Queue of size 2048 bytes is 512, RXPBL and 8xPBL needs to be programmed to less than or equal to 512/2.

Bit 15 Reserved, must be kept at reset value.

Bits 14:1 RBSZ[13:0] : Receive Buffer size

This field indicates the size of the Rx buffers specified in bytes. The maximum buffer size is limited to 16 Kbytes.

Note: The buffer size must be a multiple of 4. This is required even if the value of buffer address pointer is not aligned to bus width. If the buffer size is not a multiple of 4, it may result into an undefined behavior.

The LSB bits (1:0) are ignored and the DMA internally takes the LSB bits as all-zero. Therefore, these LSB bits are read-only (RO).

Bit 0 SR : Start or Stop Receive

When this bit is set, the DMA tries to acquire the descriptor from the Receive list and processes the incoming packets.

The DMA tries to acquire descriptor from either of the following positions:

If the DMA does not own the current descriptor, the reception is suspended and the RBU bit of the ETH_DMACSR is set. The Start Receive command is effective only when the reception is stopped. If the command is issued before setting the Channel Rx descriptor list address register (ETH_DMOCRXDLAR) , the DMA behavior is unpredictable.

When this bit is reset, the Rx DMA operation is stopped after the transfer of the current packet. The next descriptor position in the Receive list is saved, and it becomes the current position after the Rx process is restarted. The Stop Receive command is effective only when the Rx process is in the Running (waiting for Rx packet) or Suspended state.

Channel Tx descriptor list address register (ETH_DMACTXDLAR)

Address offset: 0x1114

Reset value: 0x0000 0000

Channel Tx Descriptor List Address register points the DMA to the start of Transmit descriptor list. The descriptor lists reside in the physical memory space of the application and must be word-aligned. The DMA internally converts it to bus width aligned address by making the corresponding LSB to low.

You can write to this register only when the Tx DMA has stopped, that is, the ST bit is set to zero in ETH_DMACTXCR register. When stopped, this register can be written with a new descriptor list address. When you set ST bit to 1, the DMA takes the newly-programmed descriptor base address. If this register is not changed when ST bit is set to 0, the DMA takes the descriptor address where it was stopped earlier.

31302928272625242322212019181716
TDESLA[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TDESLA[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrr

Bits 31:0 TDESLA[31:0] : Start of Transmit List

This field contains the base address of the first descriptor in the Transmit descriptor list. The DMA ignores the LSB bits (1:0) for 32-bit bus width and internally takes these bits as all-zero. Therefore, these LSB bits are read-only (RO).

Channel Rx descriptor list address register (ETH_DMACRXDLAR)

Address offset: 0x111C

Reset value: 0x0000 0000

The Channel Rx Descriptor List Address register points the DMA to the start of Receive descriptor list.

This register points to the start of the Receive Descriptor List. The descriptor lists reside in the physical memory space of the application and must be word-aligned. The DMA internally converts it to bus width aligned address by making the corresponding LS bits low. Writing to this register is permitted only when reception is stopped. When stopped, this register must be written to before the receive Start command is given. You can write to this register only when Rx DMA has stopped, that is, SR bit is set to zero in ETH_DMACRXCR register. When stopped, this register can be written with a new descriptor list address.

When you set the SR bit to 1, the DMA takes the newly programmed descriptor base address.

31302928272625242322212019181716
RDESLA[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
RDESLA[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrr

Bits 31:0 RDESLA[31:0] : Start of Receive List

This field contains the base address of the first descriptor in the Rx Descriptor list. The DMA ignores the LSB bits (1:0) for 32-bit bus width and internally takes these bits as all-zero. Therefore, these LSB bits are read-only (RO).

Channel Tx descriptor tail pointer register (ETH_DMACTXDTPR)

Address offset: 0x1120

Reset value: 0x0000 0000

The Channel Tx Descriptor Tail Pointer register points to an offset from the base and indicates the location of the last valid descriptor.

31302928272625242322212019181716
TDT[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TDT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrr

Bits 31:0 TDT[31:0] : Transmit Descriptor Tail Pointer

This field contains the tail pointer for the Tx descriptor ring. The software writes the tail pointer to add more descriptors to the Tx channel. The hardware tries to transmit all packets referenced by the descriptors between the head and the tail pointer registers.

Channel Rx descriptor tail pointer register (ETH_DMACRXDTPR)

Address offset: 0x1128

Reset value: 0x0000 0000

The Channel Rx Descriptor Tail Pointer Points to an offset from the base and indicates the location of the last valid descriptor.

31302928272625242322212019181716
RDT[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
RDT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrr

Bits 31:0 RDT[31:0] : Receive Descriptor Tail Pointer

This field contains the tail pointer for the Rx descriptor ring. The software writes the tail pointer to add more descriptors to the Rx channel. The hardware tries to write all received packets to the descriptors referenced between the head and the tail pointer registers.

Channel Tx descriptor ring length register (ETH_DMACTXRLR)

Address offset: 0x112C

Reset value: 0x0000 0000

The Tx Descriptor Ring Length register contains the length of the Transmit descriptor ring.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.TDRL[9:0]
rwrwrwrwrwrwrwrwrwrw

Bits 31:10 Reserved, must be kept at reset value.

Bits 9:0 TDRL[9:0] : Transmit Descriptor Ring Length

This field sets the maximum number of Tx descriptors in the circular descriptor ring. The maximum number of descriptors is limited to 1K descriptors. It is recommended to put a minimum ring descriptor length of 4.

For example, you can program any value up to 0x3FF in this field. This field is 10 bits wide, if you program 0x3FF, you can have 1024 descriptors. If you want to have 10 descriptors, program it to a value of 0x9.

Channel Rx descriptor ring length register (ETH_DMACRXRLR)

Address offset: 0x1130

Reset value: 0x0000 0000

The Channel Rx Descriptor Ring Length register contains the length of the Receive descriptor circular ring.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.ARBS[7:0]
rwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.RDRL[9:0]
rwrwrwrwrwrwrwrwrwrw

Bits 31:24 Reserved, must be kept at reset value.

Bits 23:16 ARBS[7:0] : Alternate Receive Buffer Size

Indicates size in bytes for Buffer 1 when ARBS[7:0] is programmed to a non-zero value.

When ARBS[7:0] = 0, Rx Buffer1 and Rx Buffer2 sizes are based on RBSZ[13:0] field of Channel receive control register (ETH_DMACRXCR) .

Bits 15:10 Reserved, must be kept at reset value.

Bits 9:0 RDRL[9:0] : Receive Descriptor Ring Length

This register sets the maximum number of Rx descriptors in the circular descriptor ring. The maximum number of descriptors is limited to 1K descriptors.

For example, you can program any value up to 0x3FF in this field. This field is 10-bit wide. If you program 0x3FF, you can have 1024 descriptors. If you want to have 10 descriptors, program it to a value of 0x9.

Channel interrupt enable register (ETH_DMAICIER)

Address offset: 0x1134

Reset value: 0x0000 0000

The Channel Interrupt Enable register enables the interrupts reported by the Status register.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
NIEAIECDEEFBEEERIEETIERWTERSERBUERIERes.Res.Res.TBUETXSETIE
rwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bit 15 NIE : Normal Interrupt Summary Enable

When this bit is set, the normal interrupt summary is enabled. This bit enables the following interrupts in the Channel status register (ETH_DMACSR) :

Bit 0: Transmit Interrupt

Bit 2: Transmit Buffer Unavailable

Bit 6: Receive Interrupt

Bit 11: Early Receive Interrupt

When this bit is reset, the normal interrupt summary is disabled.

Bit 14 AIE : Abnormal Interrupt Summary Enable

When this bit is set, the abnormal interrupt summary is enabled. This bit enables the following interrupts in the Channel status register (ETH_DMACSR) :

Bit 1: Transmit Process Stopped

Bit 7: Rx Buffer Unavailable

Bit 8: Receive Process Stopped

Bit 9: Receive Watchdog Timeout

Bit 10: Early Transmit Interrupt

Bit 12: Fatal Bus Error

When this bit is reset, the abnormal interrupt summary is disabled.

Bit 13 CDEE : Context Descriptor Error Enable

When this bit is set along with the AIE bit, the Context Descriptor error interrupt is enabled.

When this bit is reset, the Context Descriptor error interrupt is disabled.

Bit 12 FBEE : Fatal Bus Error Enable

When this bit is set along with the AIE bit, the Fatal Bus error interrupt is enabled. When this bit is reset, the Fatal Bus Error error interrupt is disabled.

Bit 11 ERIE : Early Receive Interrupt Enable

When this bit is set along with the NIE bit, the Early Receive interrupt is enabled. When this bit is reset, the Early Receive interrupt is disabled.

Bit 10 ETIE : Early Transmit Interrupt Enable

When this bit is set along with the AIE bit, the Early Transmit interrupt is enabled. When this bit is reset, the Early Transmit interrupt is disabled.

Bit 9 RWTE : Receive Watchdog Timeout Enable

When this bit is set along with the AIE bit, the Receive Watchdog Timeout interrupt is enabled. When this bit is reset, the Receive Watchdog Timeout interrupt is disabled.

Bit 8 RSE : Receive Stopped Enable

When this bit is set along with the AIE bit, the Receive Stopped Interrupt is enabled. When this bit is reset, the Receive Stopped interrupt is disabled.

Bit 7 RBUE : Receive Buffer Unavailable Enable

When this bit is set along with the AIE bit, the Receive Buffer Unavailable interrupt is enabled. When this bit is reset, the Receive Buffer Unavailable interrupt is disabled.

Bit 6 RIE : Receive Interrupt Enable

When this bit is set along with the NIE bit, the Receive Interrupt is enabled. When this bit is reset, the Receive Interrupt is disabled.

Bits 5:3 Reserved, must be kept at reset value.

Bit 2 TBUE : Transmit Buffer Unavailable Enable

When this bit is set along with the NIE bit, the Transmit Buffer Unavailable interrupt is enabled. When this bit is reset, the Transmit Buffer Unavailable interrupt is disabled.

Bit 1 TXSE : Transmit Stopped Enable

When this bit is set along with the AIE bit, the Transmission Stopped interrupt is enabled. When this bit is reset, the Transmission Stopped interrupt is disabled.

Bit 0 TIE : Transmit Interrupt Enable

When this bit is set along with the NIE bit, the Transmit Interrupt is enabled. When this bit is reset, the Transmit Interrupt is disabled.

Figure 816. Generation of ETH_DMAISR flags

Logic diagram showing the generation of ETH_DMAISR flags (MTLIS, MACIS, DC#IS) from various Ethernet status and interrupt enable signals. The diagram is divided into three main sections: MTLIS generation, MACIS generation, and DC#IS generation. All three final flags are OR-ed together to produce the sbd_intr_o output.

The diagram illustrates the logic for generating three main interrupt flags: MTLIS , MACIS , and DC#IS , which are then combined via a final OR gate to produce the sbd_intr_o output.

Finally, MTLIS , MACIS , and DC#IS are OR-ed together to generate the sbd_intr_o output.

MSv40824V2

Logic diagram showing the generation of ETH_DMAISR flags (MTLIS, MACIS, DC#IS) from various Ethernet status and interrupt enable signals. The diagram is divided into three main sections: MTLIS generation, MACIS generation, and DC#IS generation. All three final flags are OR-ed together to produce the sbd_intr_o output.

Channel Rx interrupt watchdog timer register (ETH_DMACRXIWTR)

Address offset: 0x1138

Reset value: 0x0000 0000

The Receive Interrupt Watchdog Timer register indicates the watchdog timeout for Receive Interrupt (RI) from the DMA. When this register is written with a non-zero value, it enables the watchdog timer for the RI bit of the Channel status register (ETH_DMACSR) .

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RWTU[1:0]
rwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.RWT[7:0]
rwrwrwrwrwrwrwrw

Bits 31:18 Reserved, must be kept at reset value.

Bits 17:16 RWTU[1:0] : Receive Interrupt Watchdog Timer Count Units

This field indicates the number of system clock cycles corresponding to one unit in RWT[7:0] field.

00: 256

01: 512

10: 1024

11: 2048

For example, when RWT[7:0] = 2 and RWTU[1:0] = 1, the watchdog timer is set for \( 2 * 512 = 1024 \) system clock cycles.

Bits 15:8 Reserved, must be kept at reset value.

Bits 7:0 RWT[7:0] : Receive Interrupt Watchdog Timer Count

This field indicates the number of system clock cycles, multiplied by factor indicated in RWTU field, for which the watchdog timer is set.

The watchdog timer is triggered with the programmed value after the Rx DMA completes the transfer of a packet for which the RI bit is not set in the ETH_DMACSR, because of the setting of Interrupt Enable bit in the corresponding descriptor RDES3[30].

When the watchdog timer runs out, the RI bit is set and the timer is stopped. The watchdog timer is reset when the RI bit is set high because of automatic setting of RI as per the Interrupt Enable bit RDES3[30] of any received packet.

Channel current application transmit descriptor register (ETH_DMACCATXDR)

Address offset: 0x1144

Reset value: 0x0000 0000

The Channel Current Application Transmit Descriptor register points to the current Transmit descriptor read by the DMA.

31302928272625242322212019181716
CURTDESAPTR[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
CURTDESAPTR[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 CURTDESAPTR[31:0] : Application Transmit Descriptor Address Pointer

The DMA updates this pointer during Tx operation. This pointer is cleared on reset.

Channel current application receive descriptor register (ETH_DMACCARXDR)

Address offset: 0x114C

Reset value: 0x0000 0000

The Channel Current Application Receive Descriptor register points to the current Receive descriptor read by the DMA.

31302928272625242322212019181716
CURRDESAPTR[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
CURRDESAPTR[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 CURRDESAPTR[31:0] : Application Receive Descriptor Address Pointer

The DMA updates this pointer during Rx operation. This pointer is cleared on reset.

Channel current application transmit buffer register (ETH_DMACCATXBR)

Address offset: 0x1154

Reset value: 0x0000 0000

The Channel Current Application Transmit Buffer Address register points to the current Tx buffer address read by the DMA.

31302928272625242322212019181716
CURTBUFAPTR[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
CURTBUFAPTR[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 CURTBUFAPTR[31:0] : Application Transmit Buffer Address Pointer

The DMA updates this pointer during Tx operation. This pointer is cleared on reset.

Channel current application receive buffer register (ETH_DMACCARXBR)

Address offset: 0x115C

Reset value: 0x0000 0000

The Channel Current Application Receive Buffer Address register points to the current Rx buffer address read by the DMA.

31302928272625242322212019181716
CURRBUFAPTR[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
CURRBUFAPTR[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 CURRBUFAPTR[31:0] : Application Receive Buffer Address Pointer

The DMA updates this pointer during Rx operation. This pointer is cleared on reset.

Channel status register (ETH_DMACSR)

Address offset: 0x1160

Reset value: 0x0000 0000

The software driver (application) reads the Status register during interrupt service routine or polling to determine the status of the DMA.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.REB[2:0]TEB[2:0]
rrrrrr
1514131211109876543210
NISAISCDEFBEERIETIRWTRPSRBURIRes.Res.Res.TBUTPSTI
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rwrc_w1rc_w1rc_w1rc_w1rc_w1rc_w1

Bits 31:22 Reserved, must be kept at reset value.

Bits 21:19 REB[2:0] : Rx DMA Error Bits

This field indicates the type of error that caused a Bus Error. For example, error response on the AHB interface.

Bit [2]: Error during data transfer by Rx DMA when 1, no Error during data transfer by Rx DMA when 0.

Bit[1]: Error during descriptor access when 1, Error during data buffer access when 0

Bit[0]: Error during read transfer when 1, Error during write transfer when 0

This field is valid only when the FBE bit is set. This field does not generate an interrupt.

Bits 18:16 TEB[2:0] : Tx DMA Error Bits

This field indicates the type of error that caused a Bus Error. For example, error response on the AHB interface.

Bit[2]: Error during data transfer by Tx DMA when 1, no Error during data transfer by Tx DMA when 0

Bit[1]: Error during descriptor access when 1, Error during data buffer access when 0

Bit[0]: Error during read transfer when 1, Error during write transfer when 0

This field is valid only when the FBE bit is set. This field does not generate an interrupt.

Bit 15 NIS : Normal Interrupt Summary

Normal Interrupt Summary bit value is the logical OR of the following bits when the corresponding interrupt bits are enabled in the ETH_DMACIER register:

Bit 0: Transmit Interrupt

Bit 2: Transmit Buffer Unavailable

Bit 6: Receive Interrupt

Bit 11: Early Receive Interrupt

Only unmasked bits (interrupts for which interrupt enable is set in ETH_DMACIER register) affect the Normal Interrupt Summary bit.

This is a sticky bit. You must clear this bit (by writing 1 to this bit) each time a corresponding bit which causes NIS to be set is cleared.

Bit 14 AIS : Abnormal Interrupt Summary

Abnormal Interrupt Summary bit value is the logical OR of the following when the corresponding interrupt bits are enabled in the ETH_DMACIER register:

Bit 1: Transmit Process Stopped

Bit 7: Receive Buffer Unavailable

Bit 8: Receive Process Stopped

Bit 10: Early Transmit Interrupt

Bit 12: Fatal Bus Error

Bit 13: Context Descriptor Error

Only unmasked bits affect the Abnormal Interrupt Summary bit.

This is a sticky bit. You must clear this bit (by writing 1 to this bit) each time a corresponding bit, which causes AIS to be set, is cleared.

Bit 13 CDE : Context Descriptor Error

This bit indicates that the DMA Tx/Rx engine received a descriptor error, which indicates invalid context in the middle of packet flow (intermediate descriptor) or all one's descriptor in Tx case and on Rx side it indicates DMA has read a descriptor with either of the buffer address as ones which is considered to be invalid.

Bit 12 FBE : Fatal Bus Error

This bit indicates that a bus error occurred (as described in the EB field). When this bit is set, the corresponding DMA channel engine disables all bus accesses.

Channel missed frame count register (ETH_DMACMFCR)

Address offset: 0x116C

Reset value: 0x0000 0000

This register has the number of packet counter that got dropped by the DMA either due to Bus Error or due to programming RPF field in Channel receive control register (ETH_DMACRXCR) register.

31302928272625242322212019181716
ResResResResResResResResResResResResResResResRes
1514131211109876543210
MFCORes.Res.Res.Res.MFC[10:0]
rc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_r

Bits 31:16 Reserved, must be kept at reset value.

Bit 15 MFCO : Overflow status of the MFC Counter

When this bit is set then the MFC counter does not get incremented further. The bit gets cleared when this register is read.

Bits 14:11 Reserved, must be kept at reset value.

Bits 10:0 MFC[10:0] : Dropped Packet Counters

This counter indicates the number of packet counters that are dropped by the DMA either because of bus error or because of programming RPF field in Channel receive control register (ETH_DMACRXCR) . The counter gets cleared when this register is read.

Ethernet DMA register map and reset values

Table 582. ETH_DMA common register map and reset values

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x1000ETH_DMAMRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.INTM[1:0]Res.PR[2:0]Res.TXPRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.DASWR
Reset value00000000
0x1004ETH_DMASBMRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RBMBRes.AALRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FB
Reset value0000
0x1008ETH_DMAISRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MACISMTLISRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DC0IS
Reset value000
0x100CETH_DMADSRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TPS0[3:0]RPS0[3:0]Res.Res.Res.Res.Res.Res.Res.Res.AXWHSTS
Reset value000000000

Table 583. ETH_DMA_CH register map and reset values

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x1100ETH_DMACCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DSL[2:0]Res.PBLX8Res.Res.MSS[13:0]
Reset value000000000000000000
0x1104ETH_DMACTXCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TXPBL[5:0]Res.Res.Res.TSERes.Res.Res.Res.Res.Res.Res.OSFRes.Res.ST
Reset value000000000
0x1108ETH_DMACRXCRRPFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.RXPBL[5:0]Res.RBSZ[13:0]SR
Reset value000000000000000000000
0x110C - 01110Reserved
0x1114ETH_DMACTXDLARTDESLA[31:0]
Reset value00000000000000000000000000000000
0x1118Reserved
0x111CETH_DMACRXDLARRDESLA[31:0]
Reset value00000000000000000000000000000000
0x1120ETH_DMACTXDTPRTDT[31:0]
Reset value00000000000000000000000000000000

Table 583. ETH_DMA_CH register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x1124Reserved
0x1128ETH_DMACRXDTPRRDT[31:0]
Reset value00000000000000000000000000000000
0x112CETH_DMACRXRLRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TDRL[9:0]
Reset value0000000000
0x1130ETH_DMACRXRLRRes.Res.Res.Res.Res.Res.Res.Res.ARBS[7:0]Res.Res.Res.Res.Res.Res.RDRL[9:0]
Reset value000000000000000000
0x1134ETH_DMACIERRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.NIEAIECDEEFBEEERIEETIERWTERSERBUERIERes.Res.Res.TBJETXSETIE
Reset value0000000000000
0x1138ETH_DMACRXWTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RWTU[1:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.RWT[7:0]
Reset value0000000000
0x113C-
0x1140
Reserved
0x1144ETH_DMACCATXDRCURTDESAPTR[31:0]
Reset value00000000000000000000000000000000
0x1148Reserved
0x114CETH_DMACCARXDRCURRDESAPTR[31:0]
Reset value00000000000000000000000000000000
0x1150Reserved
0x1154ETH_DMACCATXBRCURTBUFAPTR[31:0]
Reset value00000000000000000000000000000000
0x1158Reserved
0x115CETH_DMACCARXBRCURRBUFAPTR[31:0]
Reset value00000000000000000000000000000000
0x1160ETH_DMACSRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.REB[2:0]TEB[2:0]NISAISCDEFBEERIETIRWTRPSRBRIRes.Res.Res.TBUTPSTI
Reset value0000000000000000
0x1164 -
0x1168
Reserved

Table 583. ETH_DMA_CH register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x116CETH
DMACMFCR
ResResResResResResResResResResResResResResResResMFCOResResResResMFC[10:0]
Reset value00000000000

Refer to Section 2.3 on page 129 for the register boundary addresses.

58.11.3 Ethernet MTL registers

Operating mode Register (ETH_MTLOMR)

Address offset: 0x0C00

Reset value: 0x0000 0000

The Operating Mode register establishes the Transmit and Receive operating modes and commands.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.CNT CLRCNT PRSTRes.Res.Res.Res.Res.Res.DTX STSRes.
rwrwrw

Bits 31:10 Reserved, must be kept at reset value.

Bit 9 CNTCLR : Counters Reset

When this bit is set, all counters are reset. This bit is cleared automatically after 1 clock cycle. If this bit is set along with CNTPRST bit, CNTPRST has precedence.

Bit 8 CNTPRST : Counters Preset

When this bit is set:

This bit is cleared automatically.

Bit 7 Reserved, must be kept at reset value.

Bits 6:2 Reserved, must be kept at reset value.

Bit 1 DTXSTS : Drop Transmit Status

When this bit is set, the Tx packet status received from the MAC is dropped in the MTL. When this bit is reset, the Tx packet status received from the MAC is forwarded to the application.

Bit 0 Reserved, must be kept at reset value.

Interrupt status Register (ETH_MTLISR)

Address offset: 0x0C20

Reset value: 0x0000 0000

The software driver (application) reads this register during interrupt service routine or polling to determine the interrupt status of MTL queues and the MAC.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.QOIS
r

Bits 31:1 Reserved, must be kept at reset value.

Bit 0 QOIS : Queue interrupt status

This bit indicates that an interrupt has been generated by Queue. To reset this bit, read ETH_MTLQICSR register to identify the interrupt cause and clear the source.

Tx queue operating mode Register (ETH_MTLTXQOMR)

Address offset: 0x0D00

Reset value: 0x0007 0008

The Queue Transmit Operating Mode register establishes the Transmit queue operating modes and commands.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TQS[2:0]
rwrwrw
1514131211109876543210
Res.TTC[2:0]TXQEN[1:0]TSFFTQ
rwrwrwrrrwrw

Bits 31:19 Reserved, must be kept at reset value.

Bits 18:16 TQS[2:0] : Transmit queue size

This field indicates the size of the allocated transmit queues in blocks of 256 bytes.

Queue size range from 256 bytes (TQS=0b000) to 2048 bytes (TQS=0b111).

Bits 15:7 Reserved, must be kept at reset value.

Bits 6:4 TTC[2:0] : Transmit Threshold Control

These bits control the threshold level of the MTL Tx queue. The transmission starts when the packet size within the MTL Tx queue is larger than the threshold. In addition, full packets with length less than the threshold are also transmitted. These bits are used only when the TSF bit is reset.

Bits 3:2 TXQEN[1:0] : Transmit Queue Enable

This field is used to enable/disable the transmit queue .

Note: In multiple Tx queues configuration, all the queues are disabled by default. Enable the Tx queue by programming this field.

Bit 1 TSF : Transmit Store and Forward

When this bit is set, the transmission starts when a full packet resides in the MTL Tx queue. When this bit is set, the TTC values specified in Bits[6:4] of this register are ignored. This bit should be changed only when the transmission is stopped.

Bit 0 FTQ : Flush Transmit Queue

When this bit is set, the Tx queue controller logic is reset to its default values. Therefore, all the data in the Tx queue is lost or flushed. This bit is internally reset when the flushing operation is complete. Until this bit is reset, you should not write to the ETH_MTLTXQOMR register. The data which is already accepted by the MAC transmitter is not flushed. It is scheduled for transmission and results in underflow and runt packet transmission.

Note: The flush operation is complete only when the Tx queue is empty and the application has accepted the pending Tx Status of all transmitted packets. To complete this flush operation, the PHY Tx clock (eth_mii_tx_clk) should be active.

Tx queue underflow register (ETH_MTLTXQUR) Address offset: 0x0D04
Reset value: 0x0000 0000

The Queue Underflow Counter register contains the counter for packets aborted because of Transmit queue underflow and packets missed because of Receive queue packet flush

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.UFCNT
OVF
UFFRMCNT[10:0]
rc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_r

Bits 31:12 Reserved, must be kept at reset value.

Bit 11 UFCNTOVF : Overflow Bit for Underflow Packet Counter

This bit is set every time the Tx queue Underflow Packet Counter field overflows, that is, it has crossed the maximum count. In such a scenario, the overflow packet counter is reset to all-zeros and this bit indicates that the rollover happened.

Bits 10:0 UFFRCNT[10:0] : Underflow Packet Counter

This field indicates the number of packets aborted by the controller because of Tx queue Underflow. This counter is incremented each time the MAC aborts outgoing packet because of underflow. The counter is cleared when this register is read.

Tx queue debug register (ETH_MTLTXQDR)

Address offset: 0x0D08

Reset value: 0x0000 0000

The Queue Transmit Debug register gives the debug status of various blocks related to the Transmit queue.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.STXSTSF[2:0]Res.PTXQ[2:0]
rrrrrr
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TXSTS
FSTS
TXQ
STS
TWC
STS
TRCSTS[1:0]TXQPA
USED
rrrrrr

Bits 31:23 Reserved, must be kept at reset value.

Bits 22:20 STXSTSF[2:0] : Number of Status Words in Tx Status FIFO of Queue

This field indicates the current number of status in the Tx Status FIFO of this queue. When the DTXSTS bit of ETH_MTLOMR register is set to 1, this field does not reflect the number of status words in Tx Status FIFO.

Bit 19 Reserved, must be kept at reset value.

Bits 18:16 PTXQ[2:0] : Number of Packets in the Transmit Queue

This field indicates the current number of packets in the Tx queue. When the DTXSTS bit of Operating mode Register (ETH_MTLOMR) register is set to 1, this field does not reflect the number of packets in the Transmit queue.

Bits 15:6 Reserved, must be kept at reset value.

Bit 5 TXSTS FSTS : MTL Tx Status FIFO Full Status

When high, this bit indicates that the MTL Tx Status FIFO is full. Therefore, the MTL cannot accept any more packets for transmission.

Bit 4 TXQSTS : MTL Tx Queue Not Empty Status

When this bit is high, it indicates that the MTL Tx queue is not empty and some data is left for transmission.

Bit 3 TWCSTS : MTL Tx Queue Write Controller Status

When high, this bit indicates that the MTL Tx queue Write Controller is active, and it is transferring the data to the Tx queue.

Bits 2:1 TRCSTS[1:0] : MTL Tx Queue Read Controller Status

This field indicates the state of the Tx Queue Read Controller:

00: Idle state

01: Read state (transferring data to the MAC transmitter)

10: Waiting for pending Tx Status from the MAC transmitter

11: Flushing the Tx queue because of the Packet Abort request from the MAC

Bit 0 TXQPAUSED : Transmit Queue in Pause

When this bit is high and the Rx flow control is enabled, it indicates that the Tx queue is in the Pause condition (in the Full-duplex only mode) because of the following:

Queue interrupt control status Register (ETH_MTLQICSR)

Address offset: 0x0D2C

Reset value: 0x0000 0000

This register contains the interrupt enable and status bits for the queue interrupts.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.RXOIERes.Res.Res.Res.Res.Res.Res.RXOVFIS
rwrc_w1
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.TXOIERes.Res.Res.Res.Res.Res.Res.TXUNFIS
rwrc_w1

Bits 31:25 Reserved, must be kept at reset value.

Bit 24 RXOIE : Receive Queue Overflow Interrupt Enable

When this bit is set, the Receive Queue Overflow interrupt is enabled. When this bit is reset, the Receive Queue Overflow interrupt is disabled.

Bits 23:17 Reserved, must be kept at reset value.

Bit 16 RXOVFIS : Receive Queue Overflow Interrupt Status

This bit indicates that the Receive Queue had an overflow while receiving the packet. If a partial packet is transferred to the application, the overflow status is set in RDES3[21]. This bit is cleared when the application writes 1 to this bit.

Bits 15:9 Reserved, must be kept at reset value.

Bit 8 TXUIE : Transmit Queue Underflow Interrupt Enable

When this bit is set, the Transmit Queue Underflow interrupt is enabled. When this bit is reset, the Transmit Queue Underflow interrupt is disabled.

Bits 7:1 Reserved, must be kept at reset value.

Bit 0 TXUNFIS : Transmit Queue Underflow Interrupt Status

This bit indicates that the Transmit Queue had an underflow while transmitting the packet. Transmission is suspended and an Underflow Error TDES3[2] is set. This bit is cleared when the application writes 1 to this bit.

Rx queue operating mode register (ETH_MTLRXQOMR)

Address offset: 0x0D30

Reset value: 0x0070 0000

The Queue Receive operating Mode register establishes the Receive queue operating modes and command.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.RQS[2:0]Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.DIS
TCP_EF
RSFFEPFUPRes.RTC[1:0]
rwrwrwrwrwrw

Bits 31:23 Reserved, must be kept at reset value.

Bits 22:20 RQS[2:0] : Receive Queue Size

This field is read-only and the configured Rx FIFO size in blocks of 256 bytes is reflected in the reset value. The size of the Queue is \( (RQS + 1) * 256 \) bytes.

Bits 19:7 Reserved, must be kept at reset value.

Bit 6 DIS_TCP_EF : Disable Dropping of TCP/IP Checksum Error Packets

When this bit is set, the MAC does not drop the packets which only have the errors detected by the Receive Checksum Offload engine. Such packets have errors only in the encapsulated payload. There are no errors (including FCS error) in the Ethernet packet received by the MAC.

When this bit is reset, all error packets are dropped if the FEP bit is reset.

Bit 5 RSF : Receive Queue Store and Forward

When this bit is set, the Ethernet peripheral reads a packet from the Rx queue only after the complete packet has been written to it, ignoring the RTC field of this register. When this bit is reset, the Rx queue operates in the Threshold (cut-through) mode, subject to the threshold specified by the RTC field of this register.

Bit 4 FEP : Forward Error Packets

When this bit is reset, the Rx queue drops packets with error status (CRC error, receive error, watchdog timeout, or overflow). However, if the start byte (write) pointer of a packet is already transferred to the read controller side (in Threshold mode), the packet is not dropped.

When this bit is set, all packets except the runt error packets are forwarded to the application or DMA. If the RSF bit is set and the Rx queue overflows when a partial packet is written, the packet is dropped irrespective of the setting of this bit. However, if the RSF bit is reset and the Rx queue overflows when a partial packet is written, a partial packet may be forwarded to the application or DMA.

Bit 3 FUP : Forward Undersized Good Packets

When this bit is set, the Rx queue forwards the undersized good packets (packets with no error and length less than 64 bytes), including pad-bytes and CRC. When this bit is reset, the Rx queue drops all packets of less than 64 bytes, unless a packet is already transferred because of the lower value of Rx Threshold, for example, RTC = 01.

Bit 2 Reserved, must be kept at reset value.

Bits 1:0 RTC[1:0] : Receive Queue Threshold Control

These bits control the threshold level of the MTL Rx queue (in bytes):

00: 64

01: 32

10: 96

11: 128

The received packet is transferred to the application or DMA when the packet size within the MTL Rx queue is larger than the threshold. In addition, full packets with length less than the threshold are automatically transferred.

This field is valid only when the RSF bit is zero. This field is ignored when the RSF bit is set to 1.

Rx queue missed packet and overflow counter register
(ETH_MTLRXQMPOCR)

Address offset: 0x0D34

Reset value: 0x0000 0000

The Queue missed packet and overflow counter registers contain the counter for packets missed because of Receive queue packet flush and packets discarded because of Receive queue overflow.

31302928272625242322212019181716
Res.Res.Res.Res.MISCN
TOVF
MISPKTCNT[10:0]
rc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_r
1514131211109876543210
Res.Res.Res.Res.OVFCN
TOVF
OVFPKTCNT[10:0]
rc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_r

Bits 31:28 Reserved, must be kept at reset value.

Bit 27 MISCNTOVF : Missed Packet Counter Overflow Bit

When set, this bit indicates that the Rx Queue Missed Packet Counter crossed the maximum limit.

Bits 26:16 MISPKTCNT[10:0] : Missed Packet Counter

This field indicates the number of packets missed by the Ethernet peripheral because the application requested to flush the packets for this queue. This counter is reset when this register is read.

This counter is incremented by 1 when the DMA discards the packet because of buffer unavailability.

Bits 15:12 Reserved, must be kept at reset value.

Bit 11 OVFCNTOVF : Overflow Counter Overflow Bit

When set, this bit indicates that the Rx Queue Overflow Packet Counter field crossed the maximum limit.

Bits 10:0 OVFPKTCNT[10:0] : Overflow Packet Counter

This field indicates the number of packets discarded by the Ethernet peripheral because of Receive queue overflow. This counter is incremented each time the Ethernet peripheral discards an incoming packet because of overflow. This counter is reset when this register is read.

Rx queue debug register (ETH_MTLRXQDR)

Address offset: 0x0D38

Reset value: 0x0000 0000

The Queue Receive Debug register gives the debug status of various blocks related to the Receive queue.

31302928272625242322212019181716
Res.Res.PRXQ[13:0]
rrrrrrrrrrrrrr
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RXQSTS[1:0]Res.RRCSTS[1:0]RWCSTS
rrrrr

Bits 31:30 Reserved, must be kept at reset value.

Bits 29:16 PRXQ[13:0] : Number of Packets in Receive Queue

This field indicates the current number of packets in the Rx queue. The theoretical maximum value for this field is \( 256\text{Kbyte}/16\text{bytes} = 16\text{K} \) Packets, that is, \( \text{Max\_Queue\_Size}/\text{Min\_Packet\_Size} \) .

Bits 15:6 Reserved, must be kept at reset value.

Bits 5:4 RXQSTS[1:0] : MTL Rx Queue Fill-Level Status

This field gives the status of the fill-level of the Rx queue:

00: Rx queue empty

01: Rx queue fill-level below flow-control deactivate threshold

10: Rx queue fill-level above flow-control activate threshold

11: Rx queue full

Bit 3 Reserved, must be kept at reset value.

Bits 2:1 RRCSTS[1:0] : MTL Rx Queue Read Controller State

This field gives the state of the Rx queue Read controller:

00: Idle state

01: Reading packet data

10: Reading packet status (or timestamp)

11: Flushing the packet data and status

Bit 0 RWCSTS : MTL Rx Queue Write Controller Active Status

When high, this bit indicates that the MTL Rx queue Write controller is active, and it is transferring a received packet to the Rx queue.

Ethernet MTL register map and reset values

Table 584. ETH_MTL register map and reset values

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0C00ETH_MTLOMRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CNTCLRCNTPRSTRes.Res.Res.Res.Res.Res.DTXSTSRes.
Reset value000
0x0C04 -
0x0C1C
Reserved
0x0C20ETH_MTLISRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Q0IS
Reset value0
0x0C24 -
0x0CFC
Reserved
0x0C40Reserved
0x0D00ETH_MTLTXQOMRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TQS[2:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TTC[2:0]Res.Res.TXQEN[1:0]TSFFTQ
Reset value1110001000
0x0D04ETH_MTLTXQURRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.UFCNTOVFUFFRMCNT[10:0]
Reset value00000000000
0x0D08ETH_MTLTXQDRRes.Res.Res.Res.Res.Res.Res.Res.Res.STXSTS[2:0]Res.Res.PTXQ[2:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TXSTS[2:0]TXQSTSTWCSTSTRCSTS[1:0]TXQPAUSED
Reset value000000000000
0x0D0C -
0x0D28
Reserved
0x0D2CETH_MTLQICSRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RXOVFISRes.Res.Res.Res.Res.Res.Res.TXUIERes.Res.Res.Res.Res.Res.TXUNFIS
Reset value000
0x0D30ETH_MTLRXQOMRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.RQS[2:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DISTCPEFRSFFEPFUPRTC[1:0]
Reset value11100000000

Table 584. ETH_MTL register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0D34ETH_MTLRXQMPO
CR
ResResResResMIS CNTOVFMIS PKTCNT[10:0]ResResResResOVF CNTOVFOVF PKTCNT[10:0]
Reset value000000000000000000000000
0x0D38ETH_MTLRXQDRResResPRXQ[13:0]ResResResResResResResResResResResResResResResRWCSTS
Reset value0000000000000000
0xD3C-
0xD58
Reserved

Refer to Section 2.3 on page 129 for the register boundary addresses.

58.11.4 Ethernet MAC and MMC registers

Operating mode configuration register (ETH_MACCR)

Address offset: 0x0000

Reset value: 0x0000 0000

The MAC Configuration Register establishes the operating mode of the MAC.

31302928272625242322212019181716
ARPENSARC[2:0]IPCIPG[2:0]GPSLCES2KPCSTACSWDRes.JDJE
r/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w
1514131211109876543210
Res.FESDMLMECRSFDDODCRSDRRes.BL[1:0]DCPRELEN[1:0]TERE
r/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w

Bit 31 ARPEN: ARP Offload Enable

When this bit is set, the MAC can recognize an incoming ARP request packet and schedules the ARP packet for transmission. It forwards the ARP packet to the application and also indicate the events in the RxStatus.

When this bit is reset, the MAC receiver does not recognize any ARP packet and indicates them as Type frame in the RxStatus.

Bits 30:28 SARC[2:0]: Source Address Insertion or Replacement Control

This field controls the source address insertion or replacement for all transmitted packets. Bit 30 specifies which MAC Address register (0 or 1) is used for source address insertion or replacement based on the values of Bits[29:28]:

010: the MAC inserts the content of the MAC Address 0 registers ( MAC Address 0 high register (ETH_MACA0HR) and MAC Address 0 low register (ETH_MACA0LR) ) in the SA field of all transmitted packets.

011: the MAC replaces the content of the MAC Address 0 registers ( MAC Address 0 high register (ETH_MACA0HR) and MAC Address 0 low register (ETH_MACA0LR) ) in the SA field of all transmitted packets.

110: the MAC inserts the content of the MAC Address 1 registers ( MAC Address 1 high register (ETH_MACA1HR) and MAC Address 1 low register (ETH_MACA1LR) ) in the SA field of all transmitted packets.

111: the MAC replaces the content of the MAC Address 1 registers ( MAC Address 1 high register (ETH_MACA1HR) and MAC Address 1 low register (ETH_MACA1LR) ) in the SA field of all transmitted packets.

Others: Reserved, must not be used.

Note: Changes to this field take effect only on the start of a packet. If you write to this register field when a packet is being transmitted, only the subsequent packet can use the updated value, that is, the current packet does not use the updated value.

Bit 27 IPC: Checksum Offload

When set, this bit enables the IPv4 header checksum checking and IPv4 or IPv6 TCP, UDP, or ICMP payload checksum checking. When this bit is reset, the COE function in the receiver is disabled.

The Layer 3 and Layer 4 Packet Filter feature automatically selects the IPC Full Checksum Offload Engine on the Receive side. When this feature is enabled, you must set the IPC bit.

Bits 26:24 IPG[2:0]: Inter-Packet Gap

These bits control the minimum IPG between packets during transmission.

000: 96 bit times

001: 88 bit times

010: 80 bit times

...

111: 40 bit times

This range of minimum IPG is valid in Full-duplex mode.

In the Half-duplex mode, the minimum IPG can be configured only for 64-bit times (IPG = 100). Lower values are not considered.

When a JAM pattern is being transmitted because of backpressure activation, the MAC does not consider the minimum IPG.

The above function (IPG less than 96 bit times) is valid only when EIPGEN bit in ETH_MACECR register is reset. When EIPGEN is set, then the minimum IPG (greater than 96 bit times) is controlled as per the description given in EIPG field in ETH_MACECR register.

Bit 23 GPSLCE: Giant Packet Size Limit Control Enable

When this bit is set, the MAC considers the value in GPSL field in ETH_MACECR register to declare a received packet as Giant packet. This field must be programmed to more than 1,518 bytes. Otherwise, the MAC considers 1,518 bytes as giant packet limit.

When this bit is reset, the MAC considers a received packet as Giant packet when its size is greater than 1,518 bytes (1522 bytes for tagged packet).

The watchdog timeout limit, Jumbo Packet Enable and 2K Packet Enable have higher precedence over this bit, that is the MAC considers a received packet as Giant packet when its size is greater than 9,018 bytes (9,022 bytes for tagged packet) with Jumbo Packet Enabled and greater than 2,000 bytes with 2K Packet Enabled. The watchdog timeout, if enabled, terminates the received packet when watchdog limit is reached. Therefore, the programmed giant packet limit should be less than the watchdog limit to get the giant packet status.

Bit 22 S2KP: IEEE 802.3as Support for 2K Packets

When this bit is set, the MAC considers all packets with up to 2,000 bytes length as normal packets. When the JE bit is not set, the MAC considers all received packets of size more than 2K bytes as Giant packets.

When this bit is reset and the JE bit is not set, the MAC considers all received packets of size more than 1,518 bytes (1,522 bytes for tagged) as giant packets. For more information about how the setting of this bit and the JE bit impact the Giant packet status, see Table 585: Giant Packet Status based on S2KP and JE Bits .

Note: When the JE bit is set, setting this bit has no effect on the giant packet status.

Bit 21 CST: CRC stripping for Type packets

When this bit is set, the last four bytes (FCS) of all packets of Ether type (type field greater than 1,536) are stripped and dropped before forwarding the packet to the application. This function is not valid when the IP Checksum Engine (Type 1) is enabled in the MAC receiver. This function is valid when Type 2 Checksum Offload Engine is enabled.

Note: For information about how the settings of the ACS bit and this bit impact the packet length, see Table 586: Packet Length based on the CST and ACS bits .

Bit 20 ACS: Automatic Pad or CRC Stripping

When this bit is set, the MAC strips the Pad or FCS field on the incoming packets only if the value of the length field is less than 1,536 bytes. All received packets with length field greater than or equal to 1,536 bytes are passed to the application without stripping the Pad or FCS field.

When this bit is reset, the MAC passes all incoming packets to the application, without any modification.

Note: For information about how the settings of CST bit and this bit impact the packet length, see Table 586: Packet Length based on the CST and ACS bits .

Bit 19 WD: Watchdog Disable

When this bit is set, the MAC disables the watchdog timer on the receiver. The MAC can receive packets of up to 16,383 bytes.

When this bit is reset, the MAC does not allow more than 2,048 bytes (10,240 if JE is set high) of the packet being received. The MAC cuts off any bytes received after 2,048 bytes.

Bit 18 Reserved, must be kept at reset value. Bit 17 JD: Jabber Disable

When this bit is set, the MAC disables the jabber timer on the transmitter. The MAC can transfer packets of up to 16,383 bytes.

When this bit is reset, if the application sends more than 2,048 bytes of data (10,240 if JE is set high) during transmission, the MAC does not send rest of the bytes in that packet.

Bit 16 JE: Jumbo Packet Enable

When this bit is set, the MAC allows jumbo packets of 9,018 bytes (9,022 bytes for VLAN tagged packets) without reporting a giant packet error in the Rx packet status.

For more information about how the setting of this bit and the JE bit impact the Giant packet status, see Table 585: Giant Packet Status based on S2KP and JE Bits .

Bit 15 Reserved, must be kept at reset value. Bit 14 FES: MAC Speed

This bit selects the speed in the 10/100 Mbps mode:

0: 10 Mbps

1: 100 Mbps

Bit 13 DM: Duplex Mode

When this bit is set, the MAC operates in the Full-duplex mode in which it can transmit and receive simultaneously.

Bit 12 LM: Loopback Mode

When this bit is set, the MAC operates in the loopback mode at MII. The MII Rx clock input (eth_mii_rx_clk) is required for the loopback to work properly. This is because the Tx clock is not internally looped back.

Bit 11 ECRSFD: Enable Carrier Sense Before Transmission in Full-duplex mode

When this bit is set, the MAC transmitter checks the CRS signal before packet transmission in the Full-duplex mode. The MAC starts the transmission only when the CRS signal is low.

When this bit is reset, the MAC transmitter ignores the status of the CRS signal.

Bit 10 DO: Disable Receive Own

When this bit is set, the MAC disables the reception of packets when the ETH_TX_EN is asserted in the Half-duplex mode. When this bit is reset, the MAC receives all packets given by the PHY.

This bit is not applicable in the Full-duplex mode. This bit is reserved and read-only (RO) with default value in the Full-duplex-only configurations.

Bit 9 DCRS: Disable Carrier Sense During Transmission
When this bit is set, the MAC transmitter ignores the MII CRS signal during packet transmission in the Half-duplex mode. As a result, no errors are generated because of Loss of Carrier or No Carrier during transmission.
When this bit is reset, the MAC transmitter generates errors because of Carrier Sense. The MAC can even abort the transmission. Bit 8 DR: Disable Retry
When this bit is set, the MAC attempts only one transmission. When a collision occurs on the MII interface, the MAC ignores the current packet transmission and reports a Packet Abort with excessive collision error in the Tx packet status.
When this bit is reset, the MAC retries based on the settings of the BL field. This bit is applicable only in the Half-duplex mode. Bit 7 Reserved, must be kept at reset value. Bits 6:5 BL[1:0]: Back-Off Limit

The back-off limit determines the random integer number ( \( r \) ) of slot time delays (512 bit times for 10/100 Mbps) for which the MAC waits before rescheduling a transmission attempt during retries after a collision:

00: \( k = \min(n, 10) \)
01: \( k = \min(n, 8) \)
10: \( k = \min(n, 4) \)
11: \( k = \min(n, 1) \)

where \( n \) = retransmission attempt

The random integer \( r \) takes the value in the range \( 0 \leq r < 2^k \) .

This bit is applicable only in the Half-duplex mode.

Bit 4 DC: Deferral Check

When this bit is set, the deferral check function is enabled in the MAC. The MAC issues a Packet Abort status, along with the excessive deferral error bit set in the Tx packet status, when the Tx state machine is deferred for more than 24,288 bit times in 10 or 100 Mbps mode.

Deferral begins when the transmitter is ready to transmit, but it is prevented because of an active carrier sense signal (CRS) on MII.

The defer time is not cumulative. For example, if the transmitter defers for 10,000 bit times because the CRS signal is active and the CRS signal becomes inactive, the transmitter transmits and collision happens. Because of collision, the transmitter needs to back off and then defer again after back off completion. In such a scenario, the deferral timer is reset to 0, and it is restarted.

When this bit is reset, the deferral check function is disabled and the MAC defers until the CRS signal goes inactive.

This bit is applicable only in the Half-duplex mode.

Bits 3:2 PRELEN[1:0]: Preamble Length for Transmit packets

These bits control the number of preamble bytes that are added to the beginning of every Tx packet. The preamble reduction occurs only when the MAC is operating in the Full-duplex mode.

00: 7 bytes of preamble
01: 5 bytes of preamble
10: 3 bytes of preamble
11: Reserved, must not be used

Bit 1 TE : Transmitter Enable

When this bit is set, the Tx state machine of the MAC is enabled for transmission on the MII interface. When this bit is reset, the MAC Tx state machine is disabled after it completes the transmission of the current packet. The Tx state machine does not transmit any more packets.

Bit 0 RE : Receiver Enable

When this bit is set, the Rx state machine of the MAC is enabled for receiving packets from the MII interface. When this bit is reset, the MAC Rx state machine is disabled after it completes the reception of the current packet. The Rx state machine does not receive any more packets from the MII interface.

Table 585 shows how the settings of S2KP and JE bits of the ETH_MACCR register impact the giant packet status.

Table 585. Giant Packet Status based on S2KP and JE Bits (1)

Length/Type FieldReceived Packet LengthS2KPJEGiant Packet Status
Untagged packet> 1,518001
> 2,000101
> 9,018x11
VLAN tagged packet> 1,522001
> 2,000101
> 9,022x11

1. For all other combinations, the Giant Packet status is 0.

Table 586 shows how the settings of the CST and ACS bits of the ETH_MACCR register impact whether CRC length is included in the packet length.

Table 586. Packet Length based on the CST and ACS bits

Received Packet LengthCSTACSFCS Stripping Done
< 1,536x0No
x1Yes (for Ethernet packets)
≥ 1,5360xNo
1xYes (for Type packets)
Extended operating mode configuration register (ETH_MACECR)

Address offset: 0x0004

Reset value: 0x0000 0000

The MAC Extended Configuration Register establishes the operating mode of the MAC.

31302928272625242322212019181716
Res.Res.EIPG[4:0]EIPGENRes.Res.Res.Res.Res.USPSPENDCRCC
rwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.GFS[13:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 Reserved, must be kept at reset value.

Bits 29:25 EIPG[4:0] : Extended Inter-Packet Gap

The value in this field is applicable when the EIPGEN bit is set. This field (as Most Significant bits) along with IPG field in Operating mode configuration register (ETH_MACCR) , gives the minimum IPG greater than 96 bit times in steps of 8 bit times. For example:

Bit 24 EIPGEN : Extended Inter-Packet Gap Enable

When this bit is set, the MAC interprets EIPG field and IPG field in Operating mode configuration register (ETH_MACCR) together as minimum IPG greater than 96 bit times in steps of 8 bit times.

When this bit is reset, the MAC ignores EIPG field and interprets IPG field in Operating mode configuration register (ETH_MACCR) as minimum IPG less than or equal to 96 bit times in steps of 8 bit times.

Note: The extended Inter-Packet Gap feature must be enabled when operating in Full-duplex mode only. There may be undesirable effects on back-pressure function and frame transmission if it is enabled in Half-duplex mode.

Bits 23:19 Reserved, must be kept at reset value.

Bit 18 USP : Unicast Slow Protocol Packet Detect

When this bit is set, the MAC detects the Slow Protocol packets with unicast address of the station specified in the MAC Address 0 high register (ETH_MACA0HR) and MAC Address 0 low register MAC Address x low register (ETH_MACAxLR) . The MAC also detects the Slow Protocol packets with the Slow Protocols multicast address (01-80-C2-00-00-02).

When this bit is reset, the MAC detects only Slow Protocol packets with the Slow Protocol multicast address specified in the IEEE 802.3-2008, Section 5.

Bit 17 SPEN : Slow Protocol Detection Enable

When this bit is set, MAC processes the Slow Protocol packets (Ether Type 0x8809) and provides the Rx status. The MAC discards the Slow Protocol packets with invalid subtypes. When this bit is reset, the MAC forwards all error-free Slow Protocol packets to the application. The MAC considers such packets as normal Type packets.

Bit 16 DCRCC : Disable CRC Checking for Received Packets

When this bit is set, the MAC receiver does not check the CRC field in the received packets. When this bit is reset, the MAC receiver always checks the CRC field in the received packets.

Bits 15:14 Reserved, must be kept at reset value.

Bits 13:0 GPSL[13:0] : Giant Packet Size Limit

If the received packet size is greater than the value programmed in this field in units of bytes, the MAC declares the received packet as Giant packet. The value programmed in this field must be greater than or equal to 1,518 bytes. Any other programmed value is considered as 1,518 bytes.

For VLAN tagged packets, the MAC adds 4 bytes to the programmed value. For double VLAN tagged packets, the MAC adds 8 bytes to the programmed value. The value in this field is applicable when the GPSLCE bit is set in ETH_MACCCR register.

Packet filtering control register (ETH_MACPFR)

Address offset: 0x0008

Reset value: 0x0000 0000

The MAC Packet Filter register contains the filter controls for receiving packets. Some of the controls from this register go to the address check block of the MAC which performs the first level of address filtering. The second level of filtering is performed on the incoming packet based on other controls such as Pass Bad Packets and Pass Control Packets.

31302928272625242322212019181716
RARes.Res.Res.Res.Res.Res.Res.Res.Res.DNTUIPFERes.Res.Res.VTFE
rwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.HPFSAFSAIFPCF[1:0]DBFPMDAIFHMCHUCPR
rwrwrwrwrwrwrwrwrwrw
Bit 31 RA : Receive All

When this bit is set, the MAC Receiver module passes all received packets to the application, irrespective of whether they pass the address filter or not. The result of the SA or DA filtering is updated (pass or fail) in the corresponding bit in the Rx Status Word.

When this bit is reset, the Receiver module passes only those packets to the application that pass the SA or DA address filter.

Bits 30:22 Reserved, must be kept at reset value.

Bit 21 DNTU : Drop Non-TCP/UDP over IP Packets

When this bit is set, the MAC drops the non-TCP or UDP over IP packets. The MAC forwards only those packets that are processed by the Layer 4 filter. When this bit is reset, the MAC forwards all non-TCP or UDP over IP packets.

Bit 20 IPFE: Layer 3 and Layer 4 Filter Enable

When this bit is set, the MAC drops packets that do not match the enabled Layer 3 and Layer 4 filters. If Layer 3 or Layer 4 filters are not enabled for matching, this bit does not have any effect.

When this bit is reset, the MAC forwards all packets irrespective of the match status of the Layer 3 and Layer 4 fields.

Bits 19:17 Reserved, must be kept at reset value.

Bit 16 VTFF: VLAN Tag Filter Enable

When this bit is set, the MAC drops the VLAN tagged packets that do not match the VLAN Tag. When this bit is reset, the MAC forwards all packets irrespective of the match status of the VLAN Tag.

Bits 15:11 Reserved, must be kept at reset value.

Bit 10 HPF: Hash or Perfect Filter

When this bit is set, the address filter passes a packet if it matches either the perfect filtering or Hash filtering as set by the HMC or HUC bit.

When this bit is reset and the HUC or HMC bit is set, the packet is passed only if it matches the Hash filter.

Bit 9 SAF: Source Address Filter Enable

When this bit is set, the MAC compares the SA field of the received packets with the values programmed in the enabled SA registers. If the comparison fails, the MAC drops the packet. When this bit is reset, the MAC forwards the received packet to the application with updated SAF bit of the Rx Status depending on the SA address comparison.

Note: According to the IEEE specification, Bit 47 of the SA is reserved. However, the MAC compares all 48 bits. The software driver should take this into consideration while programming the MAC address registers for SA.

Bit 8 SAIF: SA Inverse Filtering

When this bit is set, the Address Check block operates in the inverse filtering mode for SA address comparison. If the SA of a packet matches the values programmed in the SA registers, it is marked as failing the SAAddress filter.

When this bit is reset, if the SA of a packet does not match the values programmed in the SA registers, it is marked as failing the SAAddress filter.

Bits 7:6 PCF[1:0]: Pass Control Packets

These bits control the forwarding of all control packets (including unicast and multicast Pause packets).

00: The MAC filters all control packets from reaching the application.

01: The MAC forwards all control packets except Pause packets to the application even if they fail the Address filter.

10: The MAC forwards all control packets to the application even if they fail the Address filter.

11: The MAC forwards the control packets that pass the Address filter.

Bit 5 DBF: Disable Broadcast Packets

When this bit is set, the AFM module blocks all incoming broadcast packets. In addition, it overrides all other filter settings.

When this bit is reset, the AFM module passes all received broadcast packets.

Bit 4 PM: Pass All Multicast

When this bit is set, it indicates that all received packets with a multicast destination address (first bit in the destination address field is '1') are passed. When this bit is reset, filtering of multicast packet depends on HMC bit.

Bit 3 DAIF : DA Inverse Filtering

When this bit is set, the Address Check block operates in inverse filtering mode for the DA address comparison for both unicast and multicast packets. When this bit is reset, normal filtering of packets is performed.

Bit 2 HMC : Hash Multicast

When this bit is set, the MAC performs the destination address filtering of received multicast packets according to the Hash table.

When this bit is reset, the MAC performs the perfect destination address filtering for multicast packets, that is, it compares the DA field with the values programmed in DA registers.

Bit 1 HUC : Hash Unicast

When this bit is set, the MAC performs the destination address filtering of unicast packets according to the Hash table.

When this bit is reset, the MAC performs a perfect destination address filtering for unicast packets, that is, it compares the DA field with the values programmed in DA registers.

Bit 0 PR : Promiscuous Mode

When this bit is set, the Address Filtering module passes all incoming packets irrespective of the destination or source address. The SA or DA Filter Fails status bits of the Rx Status Word are always cleared when PR is set.

Watchdog timeout register (ETH_MACWTR)

Address offset: 0x000C

Reset value: 0x0000 0000

The Watchdog Timeout register controls the watchdog timeout for received packets.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.PWERes.Res.Res.Res.WTO[3:0]
rwrwrwrwrw

Bits 31:9 Reserved, must be kept at reset value.

Bit 8 PWE : Programmable Watchdog Enable

When this bit is set and the WD bit of the Operating mode configuration register (ETH_MACCR) register is reset, the WTO field is used as watchdog timeout for a received packet. When this bit is cleared, the watchdog timeout for a received packet is controlled by setting of WD and JE bits in Operating mode configuration register (ETH_MACCR) register.

Bits 7:4 Reserved, must be kept at reset value.

Bits 3:0 WTO[3:0] : Watchdog Timeout

When the PWE bit is set and the WD bit of the Operating mode configuration register (ETH_MACCR) register is reset, this field is used as watchdog timeout for a received packet. If the length of a received packet exceeds the value of this field, such packet is terminated and declared as an error packet.

Encoding is as follows:

0x0: 2 Kbytes

0x1: 3 Kbytes

0x2: 4 Kbytes

0x3: 5 Kbytes

..

0xC: 14 Kbytes

0xD: 15 Kbytes

0xE: 16383 Bytes

0xF: Reserved, must not be used

Note: When the PWE bit is set, the value in this field should be more than 1,522 (0x05F2). Otherwise, the IEEE 802.3-specified valid tagged packets are declared as error packets and then dropped.

Hash Table 0 register (ETH_MACHT0R)

Address offset: 0x0010

Reset value: 0x0000 0000

The Hash Table Register 0 contains the first lower 32 bits of the Hash table (64 bits).

The Hash table is used for group address filtering.

For Hash filtering, the content of the destination address in the incoming packet is passed through the CRC logic and the upper six bits of the CRC register are used to index the content of the Hash table. The most significant bits determines the register to be used (Hash Table Register 0 or 1) and the least significant five bits determine the bit within the register. For example, a hash value of 0b100000 selects Bit 0 of the Hash Table Register 1.

The Hash value of the destination address is calculated in the following way:

  1. 1. Calculate the 32-bit CRC for the DA (See IEEE 802.3, Section 3.2.8 for the steps to calculate CRC32).
  2. 2. Perform bitwise reversal for the value obtained in Step 1.
  3. 3. Take the upper 7 or 8 bits from the value obtained in Step 2.

If the corresponding bit value of the register is 1, the packet is accepted. Otherwise, it is rejected. If the PM bit is set in ETH_MACPFR, all multicast packets are accepted regardless of the multicast Hash values.

31302928272625242322212019181716
HT31T0[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
HT31T0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 HT31T0[31:0] : MAC Hash Table First 32 Bits

This field contains the first 32 Bits [31:0] of the Hash table.

Hash Table 1 register (ETH_MACHT1R)

Address offset: 0x0014

Reset value: 0x0000 0000

The Hash Table 1 register contains the upper 32 bits of the Hash table (64 bits).

The Hash table is used for group address filtering.

For Hash filtering, the content of the destination address in the incoming packet is passed through the CRC logic and the upper six bits of the CRC register are used to index the content of the Hash table. The most significant bits determines the register to be used (Hash Table Register 0 or 1) and the least significant five bits determine the bit within the register. For example, a hash value of 6'b100000 selects Bit 0 of the Hash Table Register 1.

The Hash value of the destination address is calculated in the following way:

  1. 1. Calculate the 32-bit CRC for the DA (See IEEE 802.3, Section 3.2.8 for the steps to calculate CRC32).
  2. 2. Perform bitwise reversal for the value obtained in Step 1.
  3. 3. Take the upper 7 or 8 bits from the value obtained in Step 2.

If the corresponding bit value of the register is 1, the packet is accepted. Otherwise, it is rejected. If the PM bit is set in ETH_MACPFR, all multicast packets are accepted regardless of the multicast Hash values.

31302928272625242322212019181716
HT63T32[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
HT63T32[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 HT63T32[31:0] : MAC Hash Table Second 32 Bits

This field contains the second 32 Bits [63:32] of the Hash table.

VLAN tag register (ETH_MACVTR)

Address offset: 0x0050

Reset value: 0x0000 0000

The VLAN Tag register identifies the IEEE 802.1Q VLAN type packets.

31302928272625242322212019181716
EIVLRXSRes.EIVLS[1:0]ERIVLTEDVLPVTHMEVLRXSRes.EVLS[1:0]DOVLTERSVLMESVLVTIMETV
r/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w
1514131211109876543210
VL[15:0]
r/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w

Bit 31 EIVLRXS: Enable Inner VLAN Tag in Rx Status

When this bit is set, the MAC provides the inner VLAN Tag in the Rx status. When this bit is reset, the MAC does not provide the inner VLAN Tag in Rx status.

Bit 30 Reserved, must be kept at reset value.

Bits 29:28 EIVLS[1:0]: Enable Inner VLAN Tag Stripping on Receive

This field indicates the stripping operation on inner VLAN Tag in received packet:

00: Do not strip

01: Strip if VLAN filter passes

10: Strip if VLAN filter fails

11: Always strip

Bit 27 ERIVLT: Enable Inner VLAN Tag

When this bit and the EDVLP field are set, the MAC receiver enables operation on the inner VLAN Tag (if present). When this bit is reset, the MAC receiver enables operation on the outer VLAN Tag (if present). The ERSVLM bit determines which VLAN type is enabled for filtering or matching. The ERSVLM bit and DOVLT bit determines which VLAN type is enabled for filtering.

Bit 26 EDVLP: Enable Double VLAN Processing

When this bit is set, the MAC enables processing of up to two VLAN Tags on Tx and Rx (if present). When this bit is reset, the MAC enables processing of up to one VLAN Tag on Tx and Rx (if present).

Bit 25 VTHM: VLAN Tag Hash Table Match Enable

When this bit is set, the most significant four bits of CRC of VLAN Tag are used to index the content of the ETH_MACVLANHTR register. A value of 1 in the VLAN Hash Table register, corresponding to the index, indicates that the packet matched the VLAN Hash table.

When the ETV bit is set, the CRC of the 12-bit VLAN Identifier (VID) is used for comparison.

When the ETV bit is reset, the CRC of the 16-bit VLAN tag is used for comparison.

When this bit is reset, the VLAN Hash Match operation is not performed.

Bit 24 EVLRXS: Enable VLAN Tag in Rx status

When this bit is set, MAC provides the outer VLAN Tag in the Rx status. When this bit is reset, the MAC does not provide the outer VLAN Tag in Rx status.

Bit 23 Reserved, must be kept at reset value.

Bits 22:21 EVLS[1:0] : Enable VLAN Tag Stripping on Receive

This field indicates the stripping operation on the outer VLAN Tag in received packet:

00: Do not strip

01: Strip if VLAN filter passes

10: Strip if VLAN filter fails

11: Always strip

Bit 20 DOVLT : Disable VLAN Type Check

When this bit is set, the MAC does not check whether the VLAN Tag specified by the ERIVLT bit is of type S-VLAN or C-VLAN.

When this bit is reset, the MAC filters or matches the VLAN Tag specified by the ERIVLT bit only when VLAN Tag type is similar to the one specified by the ERSVLM bit.

Bit 19 ERSVLM : Enable Receive S-VLAN Match

When this bit is set, the MAC receiver enables filtering or matching for S-VLAN (Type = 0x88A8) packets. When this bit is reset, the MAC receiver enables filtering or matching for C-VLAN (Type = 0x8100) packets.

The ERIVLT bit determines the VLAN tag position considered for filtering or matching.

Bit 18 ESVL : Enable S-VLAN

When this bit is set, the MAC transmitter and receiver consider the S-VLAN packets (Type = 0x88A8) as valid VLAN tagged packets.

Bit 17 VTIM : VLAN Tag Inverse Match Enable

When this bit is set, this bit enables the VLAN Tag inverse matching. The packets without matching VLAN Tag are marked as matched. When reset, this bit enables the VLAN Tag perfect matching. The packets with matched VLAN Tag are marked as matched.

Bit 16 ETV : Enable 12-Bit VLAN Tag Comparison

When this bit is set, a 12-bit VLAN identifier is used for comparing and filtering instead of the complete 16-bit VLAN tag. Bits[11:0] of VLAN tag are compared with the corresponding field in the received VLAN-tagged packet. Similarly, when enabled, only 12 bits of the VLAN tag in the received packet are used for Hash-based VLAN filtering.

When this bit is reset, all 16 bits of the 15th and 16th bytes of the received VLAN packet are used for comparison and VLAN Hash filtering.

Bits 15:0 VL[15:0] : VLAN Tag Identifier for Receive Packets

This field contains the 802.1Q VLAN tag to identify the VLAN packets. This VLAN tag identifier is compared to the 15th and 16th bytes of the packets being received for VLAN packets. The following list describes the bits of this field:

Bits[15:13]: User Priority

Bit 12: Canonical Format Indicator (CFI) or Drop Eligible Indicator (DEI)

Bits[11:0]: VLAN Identifier (VID) field of VLAN tag

When the ETV bit is set, only the VID is used for comparison.

If this field ([11:0] if ETV is set) is all zeros, the MAC does not check the 15th and 16th bytes for VLAN tag comparison and declares all packets with Type field value of 0x8100 or 0x88a8 as VLAN packets.

VLAN Hash table register (ETH_MACVHTR)

Address offset: 0x0058

Reset value: 0x0000 0000

When the VTHM bit of VLAN tag register (ETH_MACVTR) register is set, the 16-bit VLAN Hash Table register is used for group address filtering based on the VLAN tag. For Hash filtering, the content of the 16-bit VLAN tag or 12-bit VLAN ID (based on the ETV bit of VLAN tag register (ETH_MACVTR) register) in the incoming packet is passed through the CRC logic. The upper four bits of the calculated CRC are used to index the contents of the VLAN Hash table. For example, a Hash value of 1000 selects Bit 8 of the VLAN Hash table.

The Hash value of the destination address is calculated in the following way:

  1. 1. Calculate the 32-bit CRC for the VLAN tag or ID (For steps to calculate CRC32, see Section 3.2.8 of IEEE 802.3).
  2. 2. Perform bitwise reversal for the value obtained in step 1.
  3. 3. Take the upper four bits from the value obtained in step 2.
31302928272625242322212019181716
ResResResResResResResResResResResResResResResRes
1514131211109876543210
VLHT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 VLHT[15:0] : VLAN Hash Table

This field contains the 16-bit VLAN Hash Table.

VLAN inclusion register (ETH_MACVIR)

Address offset: 0x0060

Reset value: 0x0000 0000

The VLAN Tag Inclusion or Replacement register contains the VLAN tag for insertion or replacement in the Transmit packets. It also contains the VLAN tag insertion controls.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.VLTICSVLVLPVLC[1:0]
rwrwrwrwrw
1514131211109876543210
VLT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:21 Reserved, must be kept at reset value.

Bit 20 VLTI: VLAN Tag Input

When this bit is set, it indicates that the VLAN tag to be inserted or replaced in Tx packet should be taken from the Tx descriptor.

Bit 19 CSVL: C-VLAN or S-VLAN

When this bit is set, S-VLAN type (0x88A8) is inserted or replaced in the 13th and 14th bytes of transmitted packets. When this bit is reset, C-VLAN type (0x8100) is inserted or replaced in the 13th and 14th bytes of transmitted packets.

0: C-LAN

1: S-LAN

Bit 18 VLP: VLAN Priority Control

When this bit is set, the control bits[17:16] are used for VLAN deletion, insertion, or replacement. When this bit is reset, bits[17:16] are ignored.

Bits 17:16 VLC[1:0]: VLAN Tag Control in Transmit Packets

00: No VLAN tag deletion, insertion, or replacement

01: VLAN tag deletion. The MAC removes the VLAN type (bytes 13 and 14) and VLAN tag (bytes 15 and 16) of all transmitted packets with VLAN tags.

10: VLAN tag insertion. The MAC inserts VLT in bytes 15 and 16 of the packet after inserting the Type value (0x8100 or 0x88a8) in bytes 13 and 14. This operation is performed on all transmitted packets, irrespective of whether they already have a VLAN tag.

11: VLAN tag replacement. The MAC replaces VLT in bytes 15 and 16 of all VLAN-type transmitted packets (Bytes 13 and 14 are 0x8100 or 0x88a8).

Note: Changes to this field take effect only on the start of a packet. If you write this register field when a packet is being transmitted, only the subsequent packet can use the updated value, that is, the current packet does not use the updated value.

Bits 15:0 VLT[15:0]: VLAN Tag for Transmit Packets

This field contains the value of the VLAN tag to be inserted or replaced. The value must only be changed when the transmit lines are inactive or during the initialization phase.

The following list describes the bits of this field:

Bits[15:13]: User Priority

Bit 12: Canonical Format Indicator (CFI) or Drop Eligible Indicator (DEI)

Bits[11:0]: VLAN Identifier (VID) field of VLAN tag

Inner VLAN inclusion register (ETH_MACIVIR)

Address offset: 0x0064

Reset value: 0x0000 0000

The Inner VLAN Tag Inclusion or Replacement register contains the inner VLAN tag to be inserted or replaced in the Transmit packet. It also contains the inner VLAN tag insertion controls.

31302928272625242322212019181716
ResResResResResResResResResResResVLTICSVLVLPVLC[1:0]
rwrwrwrwrw
1514131211109876543210
VLT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:21 Reserved, must be kept at reset value.

Bit 20 VLTI : VLAN Tag Input

When this bit is set, it indicates that the VLAN tag to be inserted or replaced in Tx packet should be taken from the Tx descriptor

Bit 19 CSVL : C-VLAN or S-VLAN

When this bit is set, S-VLAN type (0x88A8) is inserted or replaced in the 13th and 14th bytes of transmitted packets. When this bit is reset, C-VLAN type (0x8100) is inserted or replaced in the 13th and 14th bytes of transmitted packets.

0: C-LAN

1: S-LAN

Bit 18 VLP : VLAN Priority Control

When this bit is set, the VLC field is used for VLAN deletion, insertion, or replacement. When this bit is reset, the VLC field is ignored.

Bits 17:16 VLC[1:0] : VLAN Tag Control in Transmit Packets

00: No VLAN tag deletion, insertion, or replacement

01: VLAN tag deletion

The MAC removes the VLAN type (bytes 17 and 18) and VLAN tag (bytes 19 and 20) of all transmitted packets with VLAN tags.

10: VLAN tag insertion

The MAC inserts VLT in bytes 19 and 20 of the packet after inserting the Type value (0x8100 or 0x88a8) in bytes 17 and 18. This operation is performed on all transmitted packets, irrespective of whether they already have a VLAN tag.

11: VLAN tag replacement

The MAC replaces VLT in bytes 19 and 20 of all VLAN-type transmitted packets (Bytes 17 and 18 are 0x8100 or 0x88a8).

Note: Changes to this field take effect only on the start of a packet. If you write to this register field when a packet is being transmitted, only the subsequent packet can use the updated value, that is, the current packet does not use the updated value.

Bits 15:0 VLT[15:0] : VLAN Tag for Transmit Packets

This field contains the value of the VLAN tag to be inserted or replaced. The value must only be changed when the transmit lines are inactive or during the initialization phase.

The following list describes the bits of this field:

Bits[15:13]: User Priority

Bit 12: Canonical Format Indicator (CFI) or Drop Eligible Indicator (DEI)

Bits[11:0]: VLAN Identifier (VID) field of VLAN tag

Tx Queue flow control register (ETH_MACQTXFCR)

Address offset: 0x0070

Reset value: 0x0000 0000

The Flow Control register controls the generation and reception of the Control (Pause Command) packets by the Flow control module of the MAC. A Write to a register with the Busy bit set to 1 triggers the Flow Control block to generate a Pause packet. The fields of the control packet are selected as specified in the 802.3x specification, and the Pause Time value from this register is used in the Pause Time field of the control packet. The Busy bit remains set until the control packet is transferred onto the cable. The application must make sure that the Busy bit is cleared before writing to the register.

31302928272625242322212019181716
PT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
ResResResResResResResResDZPQPLT[2:0]ResResTFEFCB_BPA
rwrwrwrwrwrw

Bits 31:16 PT[15:0] : Pause Time

This field holds the value to be used in the Pause Time field in the Tx control packet. I

Bits 15:8 Reserved, must be kept at reset value.

Bit 7 DZPQ : Disable Zero-Quanta Pause

When this bit is set, it disables the automatic generation of the zero-quanta Pause packets.

When this bit is reset, normal operation with automatic zero-quanta Pause packet generation is enabled.

Bits 6:4 PLT[2:0] : Pause Low Threshold

This field configures the threshold of the Pause timer at which the input flow is checked for automatic retransmission of the Pause packet.

The threshold values should be always less than the Pause Time configured in Bits[31:16]. For example, if PT = 100H (256 slot times), and PLT = 001, a second Pause packet is automatically transmitted at 228 (256-28) slot times after the first Pause packet is transmitted.

The following list provides the threshold values for different values:

000: Pause Time minus 4 Slot Times (PT -4 slot times)

001: Pause Time minus 28 Slot Times (PT -28 slot times)

010: Pause Time minus 36 Slot Times (PT -36 slot times)

011: Pause Time minus 144 Slot Times (PT -144 slot times)

100: Pause Time minus 256 Slot Times (PT -256 slot times)

101: Pause Time minus 512 Slot Times (PT -512 slot times)

110 to 111: Reserved, must not be used

The slot time is defined as the time taken to transmit 512 bits (64 bytes) on the MII interface. This (approximate) computation is based on the packet size (64, 1518, 2000, 9018, 16384, or 32768) + 2 Pause Packet Size + IPG in Slot Times.

Bits 3:2 Reserved, must be kept at reset value.

Bit 1 TFE : Transmit Flow Control Enable

Full-duplex mode: when this bit is set, the MAC enables the flow control operation to Tx Pause packets. When this bit is reset, the flow control operation in the MAC is disabled, and the MAC does not transmit any Pause packets.

Half-duplex mode: when this bit is set, the MAC enables the backpressure operation. When this bit is reset, the backpressure feature is disabled.

Bit 0 FCB_BPA : Flow Control Busy or Backpressure Activate

This bit initiates a Pause packet in the Full-duplex mode and activates the backpressure function in the Half-duplex mode if the TFE bit is set.

Full-Duplex mode: this bit should be read as 0 before writing to this register. To initiate a Pause packet, the application must set this bit to 1. During Control packet transfer, this bit continues to be set to indicate that a packet transmission is in progress. When Pause packet transmission is complete, the MAC resets this bit to 0. You should not write to this register until this bit is cleared.

Half-duplex mode: When this bit is set (and TFE bit is set) in the Half-duplex mode, the MAC asserts the backpressure. During backpressure, when the MAC receives a new packet, the transmitter starts sending a JAM pattern resulting in a collision. When the MAC is configured for the Full-duplex mode, the BPA is automatically disabled.

Rx flow control register (ETH_MACRXFCR)

Address offset: 0x0090

Reset value: 0x0000 0000

The Receive Flow Control register controls the pausing of MAC Transmit based on the received Pause packet.

31302928272625242322212019181716
ResResResResResResResResResResResResResResResRes
1514131211109876543210
ResResResResResResResResResResResResResResUPRFE
rwrw

Bits 31:2 Reserved, must be kept at reset value.

Bit 1 UP: Unicast Pause Packet Detect

A pause packet is processed when it has the unique multicast address specified in the IEEE 802.3. When this bit is set, the MAC can also detect Pause packets with unicast address of the station. This unicast address should be as specified in MAC Address 0 high register (ETH_MACA0HR) and MAC Address 0 low register MAC Address x low register (ETH_MACAxLR) .

When this bit is reset, the MAC only detects Pause packets with unique multicast address.

Note: The MAC does not process a Pause packet if the multicast address is different from the unique multicast address. This is also applicable to the received PFC packet when the Priority Flow Control (PFC) is enabled. The unique multicast address (0x01_80_C2_00_00_01) is as specified in IEEE 802.1 Qbb-2011.

Bit 0 RFE: Receive Flow Control Enable

When this bit is set and the MAC is operating in Full-duplex mode, the MAC decodes the received Pause packet and disables its transmitter for a specified (Pause) time. When this bit is reset or the MAC is operating in Half-duplex mode, the decode function of the Pause packet is disabled.

When PFC is enabled, flow control is enabled for PFC packets. The MAC decodes the received PFC packet and disables the Transmit queue, with matching priorities, for a duration of received Pause time.

Interrupt status register (ETH_MACISR)

Address offset: 0x00B0

Reset value: 0x0000 0000

The Interrupt Status register contains the status of interrupts.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.RXSTSISTXSTSISTSISRes.MMCTXISMMCRXISMMCISRes.Res.LPIISPMTISPHYISRes.Res.Res.
rc_rrc_rrc_rrrrrrr

Bits 31:15 Reserved, must be kept at reset value.

Bit 14 RXSTSIS: Receive Status Interrupt

This bit indicates the status of received packets. This bit is set when the RWT bit is set in the Rx Tx status register (ETH_MACRXTXSR) . This bit is cleared when the corresponding interrupt source bit is read (or corresponding interrupt source bit is written to 1 when RCWE bit of CSR software control register (ETH_MACCSRSWCR) is set) in the ETH_MACISR register.

Bit 13 TXSTSIS: Transmit Status Interrupt

This bit indicates the status of transmitted packets. This bit is set when any of the following bits is set in the Rx Tx status register (ETH_MACRXTXSR) :

This bit is cleared when the corresponding interrupt source bit is read (or corresponding interrupt source bit is written to 1 when RCWE bit of CSR software control register (ETH_MACCSRSWCR) is set) in the ETH_MACISR register.

Bit 12 TSIS: Timestamp Interrupt Status

If the Timestamp feature is enabled, this bit is set when any of the following conditions is true:

If the Auxiliary Snapshot feature is enabled, this bit is set when the auxiliary snapshot trigger is asserted.

When drop transmit status is enabled in MTL, this bit is set when the captured transmit timestamp is updated in the Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) and Tx timestamp status seconds register (ETH_MACTXTSSSR) registers.

When PTP offload feature is enabled, this bit is set when the captured transmit timestamp is updated in the Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) and Tx timestamp status seconds register (ETH_MACTXTSSSR) registers, for PTO generated Delay Request and Pdelay request packets.

This bit is cleared when the corresponding interrupt source bit is read (or corresponding interrupt source bit is written to 1 when RCWE bit of CSR software control register (ETH_MACCSRSWCR) is set) in the Timestamp status register (ETH_MACTSSR) .

Bit 11 Reserved, must be kept at reset value. Bit 10 MMCTXIS: MMC Transmit Interrupt Status

This bit is set high when an interrupt is generated in the MMC Tx interrupt register (ETH_MMC_TX_INTERRUPT) . This bit is cleared when all bits in this interrupt register are cleared.

Bit 9 MMCRXIS: MMC Receive Interrupt Status

This bit is set high when an interrupt is generated in the MMC Rx interrupt register (ETH_MMC_RX_INTERRUPT) . This bit is cleared when all bits in this interrupt register are cleared.

Bit 8 MMCIS: MMC Interrupt Status

This bit is set high when MMCTXIS or MMCRXIS is set high. This bit is cleared only when all these bits are low.

Bits 7:6 Reserved, must be kept at reset value. Bit 5 LPIIS: LPI Interrupt Status

This bit is set for any LPI state entry or exit in the MAC Transmitter or Receiver. This bit is cleared when the TLPIEN bit of LPI control and status register (ETH_MACLCSR) is read.

Bit 4 PMTIS: PMT Interrupt Status

This bit is set when a Magic packet or Wake-on-LAN packet is received in the power-down mode (RWKPRCVD and MGKPRCVD bits in ETH_MACPCSR register). This bit is cleared when Bits[6:5] are cleared because of a Read operation to the PMT control status register (ETH_MACPCSR) .

Bit 3 PHYIS: PHY Interrupt

This bit is set when rising edge is detected on the ETH_PHY_INTN input. This bit is cleared when this register is read.

Bits 2:0 Reserved, must be kept at reset value. Interrupt enable register (ETH_MACIER)

Address offset: 0x00B4

Reset value: 0x0000 0000

The Interrupt Enable register contains the masks for generating the interrupts.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.RXSTSIETXSTSIETSIERes.Res.Res.Res.Res.Res.LPIIEPMTIEPHYIERes.Res.Res.
rwrwrwrwrwrw

Bits 31:15 Reserved, must be kept at reset value.

Bit 14 RXSTSIE : Receive Status Interrupt EnableWhen this bit is set, it enables the assertion of the interrupt signal because of the setting of RXSTSIS bit in the Interrupt status register (ETH_MACISR) .Bit 13 TXSTSIE : Transmit Status Interrupt EnableWhen this bit is set, it enables the assertion of the interrupt signal because of the setting of TXSTSIS bit in the Interrupt status register (ETH_MACISR) .Bit 12 TSIE : Timestamp Interrupt EnableWhen this bit is set, it enables the assertion of the interrupt signal because of the setting of TSIS bit in Interrupt status register (ETH_MACISR) .

Bits 11:6 Reserved, must be kept at reset value.

Bit 5 LPIIE : LPI Interrupt EnableWhen this bit is set, it enables the assertion of the interrupt signal because of the setting of LPIIS bit in Interrupt status register (ETH_MACISR) .Bit 4 PMTIE : PMT Interrupt EnableWhen this bit is set, it enables the assertion of the interrupt signal because of the setting of PMTIS bit in Interrupt status register (ETH_MACISR) .Bit 3 PHYIE : PHY Interrupt EnableWhen this bit is set, it enables the assertion of the interrupt signal because of the setting of PHYIS bit in Interrupt status register (ETH_MACISR) .

Bits 2:0 Reserved, must be kept at reset value.

Rx Tx status register (ETH_MACRXTXSR)

Address offset: 0x00B8

Reset value: 0x0000 0000

The Receive Transmit Status register contains the Receive and Transmit Error status.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.RWTRes.Res.EXCOLLCOLEXDEFLCARRNCARRTJT
rc_rrc_rrc_rrc_rrc_rrc_rrc_r

Bits 31:9 Reserved, must be kept at reset value.

Bit 8 RWT: Receive Watchdog Timeout

This bit is set when a packet with length greater than 2,048 bytes is received (10,240 bytes when Jumbo Packet mode is enabled) and the WD bit is reset in the Operating mode configuration register (ETH_MACCR) . This bit is set when a packet with length greater than 16,383 bytes is received and the WD bit is set in the Operating mode configuration register (ETH_MACCR) .

Cleared on read (or write of 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bits 7:6 Reserved, must be kept at reset value.

Bit 5 EXCOL: Excessive Collisions

When the DTXSTS bit is set in the Operating mode Register (ETH_MTLOMR) , this bit indicates that the transmission aborted after 16 successive collisions while attempting to transmit the current packet. If the DR bit is set in the Operating mode configuration register (ETH_MACCR) , this bit is set after the first collision and the packet transmission is aborted.

Cleared on read (or write of 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bit 4 LCOL: Late Collision

When the DTXSTS bit is set in the Operating mode Register (ETH_MTLOMR) , this bit indicates that the packet transmission aborted because a collision occurred after the collision window (64 bytes including Preamble in MII mode).

This bit is not valid if the Underflow error occurs.

Cleared on read (or write of 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bit 3 EXDEF: Excessive Deferral

When the DTXSTS bit is set in the Operating mode Register (ETH_MTLOMR) and the DC bit is set in the Operating mode configuration register (ETH_MACCR) , this bit indicates that the transmission ended because of excessive deferral of over 24,288 bit times (155,680 when Jumbo packet is enabled).

Cleared on read (or write of 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bit 2 LCARR : Loss of Carrier

When the DTXSTS bit is set in the Operating mode Register (ETH_MTLOMR) , this bit indicates that the loss of carrier occurred during packet transmission, that is, the ETH_CRS signal was inactive for one or more transmission clock periods during packet transmission. This bit is valid only for packets transmitted without collision.

Cleared on read (or write of 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bit 1 NCARR : No Carrier

When the DTXSTS bit is set in the Operating mode Register (ETH_MTLOMR) , this bit indicates that the carrier signal from the PHY is not present at the end of preamble transmission.

Cleared on read (or write of 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bit 0 TJT : Transmit Jabber Timeout

This bit indicates that the Transmit Jabber Timer expired which happens when the packet size exceeds 2,048 bytes (10,240 bytes when the Jumbo packet is enabled) and JD bit is reset in the Operating mode configuration register (ETH_MACCR) . This bit is set when the packet size exceeds 16,383 bytes and the JD bit is set in the Operating mode configuration register (ETH_MACCR) .

Cleared on read (or write of 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

PMT control status register (ETH_MACPCSR)

Address offset: 0x00C0

Reset value: 0x0000 0000

31302928272625242322212019181716
RWKFILTRSTRes.Res.RWKPTR[4:0]Res.Res.Res.Res.Res.Res.Res.Res.
rwrrrrr
1514131211109876543210
Res.Res.Res.Res.Res.RWKPFGLBLUCASRes.Res.RWKPRCVDMGKPRCVDRes.Res.RWKPTENMGKPTENPWRDWN
rwrwrrc_rrwrwrw
Bit 31 RWKFILTRST : Remote wake-up Packet Filter Register Pointer Reset

When this bit is set, the remote wake-up packet filter register pointer is reset to 0. It is automatically cleared after 1 clock cycle.

Bits 30:29 Reserved, must be kept at reset value.

Bits 28:24 RWKPTR[4:0] : Remote wake-up FIFO Pointer

This field gives the current value (0 to 7) of the Remote wake-up Packet Filter register pointer. When the value of this pointer is equal to 7, the contents of the Remote wake-up Packet Filter Register are transferred to the eth_mii_rx_clk domain when a Write occurs to that register.

Bits 23:11 Reserved, must be kept at reset value.

Bit 10 RWKPF E : Remote wake-up Packet Forwarding Enable

When this bit is set along with RWKPKTEN, the MAC receiver drops all received frames until it receives the expected wake-up frame. All frames after that event including the received wake-up frame are forwarded to application. This bit is then self-cleared on receiving the wake-up packet.

The application can also clear this bit before the expected wake-up frame is received. In such cases, the MAC reverts to the default behavior where packets received are forwarded to the application. This bit must only be set when RWKPKTEN is set high and PWRDOWN is set low. The setting of this bit has no effect when PWRDOWN is set high.

Note: If Magic Packet Enable and wake-up Frame Enable are both set along with setting of this bit and Magic Packet is received prior to wake-up frame, this bit is self-cleared on receiving Magic Packet, the received Magic packet is dropped, and all frames after received Magic Packet are forwarded to application.

Bit 9 GLBLUCAS T : Global Unicast

When this bit set, any unicast packet filtered by the MAC (DAF) address recognition is detected as a remote wake-up packet.

Bits 8:7 Reserved, must be kept at reset value.

Bit 6 RWKPRC V D: Remote wake-up Packet Received

When this bit is set, it indicates that the power management event is generated because of the reception of a remote wake-up packet. This bit is cleared when this register is read.

Bit 5 MGKPRC V D: Magic Packet Received

When this bit is set, it indicates that the power management event is generated because of the reception of a magic packet. This bit is cleared when this register is read (or written to 1 when RCWE bit in CSR software control register (ETH_MACCSR S WGR) is set).

Bits 4:3 Reserved, must be kept at reset value.

Bit 2 RWKPKTEN: Remote wake-up Packet Enable

When this bit is set, a power management event is generated when the MAC receives a remote wake-up packet.

Bit 1 MGKPKTEN: Magic Packet Enable

When this bit is set, a power management event is generated when the MAC receives a magic packet.

Bit 0 PWRDOWN: Power Down

When this bit is set, the MAC receiver drops all received packets until it receives the expected magic packet or remote wake-up packet. This bit is then self-cleared and the power-down mode is disabled. The software can clear this bit before the expected magic packet or remote wake-up packet is received. The packets received by the MAC after this bit is cleared are forwarded to the application. This bit must only be set when the Magic Packet Enable, Global Unicast, or Remote wake-up Packet Enable bit is set high.

Note: You can gate-off the CSR clock during the power-down mode. However, when the CSR clock is gated-off, you cannot perform any read or write operations on this register. Therefore, the Software cannot clear this bit.

Remote wake-up packet filter register (ETH_MACRWKPFR)

Address offset: 0x00C4

Reset value: 0x0000 0000

31302928272625242322212019181716
MACRWKPFR[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
MACRWKPFR[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 MACRWKPFR[31:0] : Remote wake-up packet filter

Refer to Table 554 , Table 555 and Table 556 for details on register content and programming sequence.

The ETH_MACRWKPFR register at address 0x00C4 loads the wake-up Packet Filter register.

To load values in a wake-up Packet Filter register, the entire register (ETH_MACRWKPFR) must be written. The ETH_MACRWKPFR register is loaded by sequentially loading the eight, sixteen or thirty two register values in address (0x00C4) for ETH_MACRWKPFR value 0 to 7, respectively. The ETH_MACRWKPFR register is read in a similar way. The Ethernet peripheral updates the ETH_MACRWKPFR register current pointer value in Bits[26:24] of ETH_MACPCSR register.

LPI control and status register (ETH_MACLCSR)

Address offset: 0x00D0

Reset value: 0x0000 0000

The LPI Control and Status Register controls the LPI functions and provides the LPI interrupt status. The status bits are cleared when this register is read.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LPTCSELPITELPITXARes.PLSLPIEN
rwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.RLP1STTLPISTRes.Res.Res.Res.RLPIEXRLPIENTLPIEXTLPIEN
rrrrrr

Bits 31:22 Reserved, must be kept at reset value.

Bit 21 LPITCSE : LPI Tx Clock Stop Enable

When this bit is set, the MAC asserts sbd_tx_clk_gating_ctrl_o signal high after it enters Tx LPI mode to indicate that the Tx clock to MAC can be stopped. When this bit is reset, the MAC does not assert sbd_tx_clk_gating_ctrl_o signal high after it enters Tx LPI mode.

If RGMII Interface is selected, the Tx clock is required for transmitting the LPI pattern. The Tx Clock cannot be gated and so the LPITCSE bit cannot be programmed.

Bit 20 LPITE : LPI Timer Enable

This bit controls the automatic entry of the MAC Transmitter into and exit out of the LPI state. When LPITE, LPITXA and LPIEN bits are set, the MAC Transmitter enters LPI state only when the complete MAC TX data path is IDLE for a period indicated by the ETH_MACLETR register.

After entering LPI state, if the data path becomes non-IDLE (due to a new packet being accepted for transmission), the Transmitter exits LPI state but does not clear LPIEN bit. This enables the re-entry into LPI state when it is IDLE again.

When LPITE is 0, the LPI Auto timer is disabled and MAC Transmitter enters LPI state based on the settings of LPITXA and LPIEN bit descriptions.

Bit 19 LPITXA : LPI Tx Automate

This bit controls the behavior of the MAC when it is entering or coming out of the LPI mode on the Transmit side.

If the LPITXA and LPIEN bits are set to 1, the MAC enters the LPI mode only after all outstanding packets (in the core) and pending packets (in the application interface) have been transmitted. The MAC comes out of the LPI mode when the application sends any packet for transmission or the application issues a Tx FIFO Flush command. In addition, the MAC automatically clears the LPIEN bit when it exits the LPI state. If Tx FIFO Flush is set in the FTQ bit of ETH_MTLTxQOMR, when the MAC is in the LPI mode, it exits the LPI mode. When this bit is 0, the LPIEN bit directly controls behavior of the MAC when it is entering or coming out of the LPI mode.

Bit 18 Reserved, must be kept at reset value.

Bit 17 PLS : PHY Link Status

This bit indicates the link status of the PHY. The MAC Transmitter asserts the LPI pattern only when the link status is up (OKAY) at least for the time indicated by the LPI LS TIMER.

When this bit is set, the link is considered to be okay (UP) and when this bit is reset, the link is considered to be down.

Bit 16 LPIEN : LPI Enable

When this bit is set, it instructs the MAC Transmitter to enter the LPI state. When this bit is reset, it instructs the MAC to exit the LPI state and resume normal transmission.

This bit is cleared when the LPITXA bit is set and the MAC exits the LPI state because of the arrival of a new packet for transmission.

Bits 15:10 Reserved, must be kept at reset value.

Bit 9 RLPIST : Receive LPI State

When this bit is set, it indicates that the MAC is receiving the LPI pattern on the MII interface.

Bit 8 TLPIST : Transmit LPI State

When this bit is set, it indicates that the MAC is transmitting the LPI pattern on the MII interface.

Bits 7:4 Reserved, must be kept at reset value.

Bit 3 RLPIEX : Receive LPI Exit

When this bit is set, it indicates that the MAC Receiver has stopped receiving the LPI pattern on the MII interface, exited the LPI state, and resumed the normal reception. This bit is cleared by a read into this register (or by writing it to 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Note: This bit may not be set if the MAC stops receiving the LPI pattern for a very short duration, such as, less than three clock cycles of CSR clock.

Bit 2 RLPIEN : Receive LPI Entry

When this bit is set, it indicates that the MAC Receiver has received an LPI pattern and entered the LPI state. This bit is cleared by a read into this register (or by writing it to 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Note: This bit may not be set if the MAC stops receiving the LPI pattern for a very short duration, such as, less than three clock cycles of CSR clock.

Bit 1 TLPIEX : Transmit LPI Exit

When this bit is set, it indicates that the MAC transmitter exited the LPI state after the application cleared the LPIEN bit and the LPI TW Timer has expired. This bit is cleared by a read into this register (or by writing it to 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bit 0 TLPIEN : Transmit LPI Entry

When this bit is set, it indicates that the MAC Transmitter has entered the LPI state because of the setting of the LPIEN bit. This bit is cleared by a read into this register (or by writing it to 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

LPI timers control register (ETH_MACLTCR)

Address offset: 0x00D4

Reset value: 0x03E8 0000

The LPI Timers Control register controls the timeout values in the LPI states. It specifies the time for which the MAC transmits the LPI pattern and also the time for which the MAC waits before resuming the normal transmission.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.LST[9:0]
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TWT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:26 Reserved, must be kept at reset value.

Bits 25:16 LST[9:0] : LPI LS Timer

This field specifies the minimum time (in milliseconds) for which the link status from the PHY should be up (OKAY) before the LPI pattern can be transmitted to the PHY. The MAC does not transmit the LPI pattern even when the LPIEN bit is set unless the LPI LS Timer reaches the programmed terminal count. The default value of the LPI LS Timer is 1000 (1 sec) as defined in the IEEE standard.

Bits 15:0 TWT[15:0] : LPI TW Timer

This field specifies the minimum time (in microseconds) for which the MAC waits after it stops transmitting the LPI pattern to the PHY and before it resumes the normal transmission. The TLPIEX status bit is set after the expiry of this timer.

LPI entry timer register (ETH_MACLETR)

Address offset: 0x00D8

Reset value: 0x0000 0000

This register controls the Tx LPI entry timer. This counter is enabled only when LPITE bit of LPI control and status register (ETH_MACLCSR) register is set to 1.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LPIET[19:16]
rwrwrwrw
1514131211109876543210
LPIET[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrrr

Bits 31:20 Reserved, must be kept at reset value.

Bits 19:0 LPIET[19:0] : LPI Entry Timer

This field specifies the time in microseconds the MAC waits to enter LPI mode, after it has transmitted all the frames. This field is valid and used only when LPITE and LPITXA are set to 1.

Bits [2:0] are read-only so that the granularity of this timer is in steps of 8 micro-seconds.

One-microsecond-tick counter register (ETH_MAC1USTCR)

Address offset: 0x00DC

Reset value: 0x0000 0000

This register controls the generation of the Reference time (one-microsecond tick) for all the LPI timers. This timer has to be programmed by the software initially.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.TIC_1US_CNTR[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:12 Reserved , must be kept at reset value.

Bits 11:0 TIC_1US_CNTR[11:0] : 1 µs tick Counter

The application must program this counter so that the number of clock cycles of CSR clock is 1 µs (subtract 1 from the value before programming).
For example if the CSR clock is 100 MHz then this field needs to be programmed to 100 - 1 = 99 (which is 0x63).
This is required to generate the 1 µs events that are used to update some of the EEE related counters.

Version register (ETH_MACVR)

Address offset: 0x0110
Reset value: 0x0000 3142

The version register identifies the version of the Ethernet peripheral.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
USERVER[7:0]SNPSVER[7:0]
rrrrrrrrrrrrrrrr

Bits 31:16 Reserved , must be kept at reset value.

Bits 15:8 USERVER[7:0] : ST-defined version

Bits 7:0 SNPSVER[7:0] : IP version

Debug register (ETH_MACDR)

Address offset: 0x0114
Reset value: 0x0000 0000

The Debug register provides the debug status of various MAC blocks.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TFCSTS[1:0]TPESTS
rrr
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RFCFCSTS[1:0]RPESTS
rrr

Bits 31:19 Reserved, must be kept at reset value.

Bits 18:17 TFCSTS[1:0] : MAC Transmit Packet Controller Status

This field indicates the state of the MAC Transmit Packet Controller module:

00: Idle state

01: Waiting for one of the following:

10: Generating and transmitting a Pause control packet (in Full-duplex mode)

11: Transferring input packet for transmission

Bit 16 TPESTS : MAC MII Transmit Protocol Engine Status

When this bit is set, it indicates that the MAC MII transmit protocol engine is actively transmitting data, and it is not in the Idle state.

Bits 15:3 Reserved, must be kept at reset value.

Bits 2:1 RFCFCSTS[1:0] : MAC Receive Packet Controller FIFO Status

When this bit is set, this field indicates the active state of the small FIFO Read and Write controllers of the MAC Receive Packet Controller module.

Bit 0 RPESTS : MAC MII Receive Protocol Engine Status

When this bit is set, it indicates that the MAC MII receive protocol engine is actively receiving data, and it is not in the Idle state.

HW feature 0 register (ETH_MACHWF0R)

Address offset: 0x011C

Reset value: 0x0A0D 73F7

This register indicates the presence of first set of the optional features or functions of the Ethernet peripheral. The software driver can use this register to dynamically enable or disable the programs related to the optional blocks.

31302928272625242322212019181716
Res.ACTPHYSEL[2:0]SAVLANINSTSSTSSSEL[1:0]MACADR64SELMACADR32SELADDMACADRSEL[4:0]Res.RXCOESEL
rrrrrrrrrrrrrr
1514131211109876543210
Res.TXCOESELEEESELTSSELRes.Res.ARPOFFSELMMCSELMGKSELRWKSELSMASELVLHASHPCSSELHDSELGMIISELMIISEL
rrrrrrrrrrrrr

Bit 31 Reserved, must be kept at reset value.

Bits 30:28 ACTPHYSEL[2:0] : Active PHY Selected

When you have multiple PHY interfaces in your configuration, this field indicates the sampled value of phy_intf_sel_i during reset de-assertion:

000: GMII or MII

001: RGMII

010: SGMII

011: TBI

100: RMII

101: RTBI

110: SMII

Others: Reserved, must not be used

Bit 27 SAVLANINS : Source Address or VLAN Insertion Enable

This bit is set to 1 when the Enable SA and VLAN Insertion on Tx option is selected

Bits 26:25 TSSTSSEL[1:0] : Timestamp System Time Source

This bit indicates the source of the Timestamp system time:

01: Internal

10: External

11: Both

00: Reserved, must not be used

This bit is set to 1 when the Enable IEEE 1588 Timestamp Support option is selected

Bit 24 MACADR64SEL : MAC Addresses 64-127 Selected

This bit is set to 1 when the Enable Additional 64 MAC Address Registers (64-127) option is selected

Bit 23 MACADR32SEL : MAC Addresses 32-63 Selected

This bit is set to 1 when the Enable Additional 32 MAC Address Registers (32-63) option is selected

Bits 22:18 ADDMACADRSEL[4:0] : MAC Addresses 1-31 Selected

This bit is set to 1 when the Enable Additional 1-31 MAC Address Registers option is selected

Bit 17 Reserved, must be kept at reset value.

Bit 16 RXCOESEL : Receive Checksum Offload Enabled

This bit is set to 1 when the Enable Receive TCP/IP Checksum Check option is selected

Bit 15 Reserved, must be kept at reset value.

Bit 14 TXCOESEL : Transmit Checksum Offload Enabled

This bit is set to 1 when the Enable Transmit TCP/IP Checksum Insertion option is selected

Bit 13 EEESEL : Energy Efficient Ethernet Enabled

This bit is set to 1 when the Enable Energy Efficient Ethernet (EEE) option is selected

Bit 12 TSSEL : IEEE 1588-2008 Timestamp Enabled

This bit is set to 1 when the Enable IEEE 1588 Timestamp Support option is selected

Bits 11:10 Reserved, must be kept at reset value.

Bit 9 ARPOFFSEL : ARP Offload Enabled

This bit is set to 1 when the Enable IPv4 ARP Offload option is selected

Bit 8 MMCSEL : RMON Module Enable

This bit is set to 1 when the Enable MAC management counters (MMC) option is selected

Bit 7 MGKSEL : PMT Magic Packet Enable

This bit is set to 1 when the Enable Magic Packet Detection option is selected

Bit 6 RWKSEL : PMT Remote wake-up Packet Enable

This bit is set to 1 when the Enable Remote wake-up Packet Detection option is selected

Bit 5 SMASEL : SMA (MDIO) Interface

This bit is set to 1 when the Enable Station Management (MDIO Interface) option is selected

Bit 4 VLHASH : VLAN Hash Filter Selected

This bit is set to 1 when the Enable VLAN Hash Table Based Filtering option is selected

Bit 3 PCSSEL : PCS Registers (TBI, SGMII, or RTBI PHY interface)

This bit is set to 1 when the TBI, SGMII, or RTBI PHY interface option is selected

Bit 2 HDSEL : Half-duplex Support

This bit is set to 1 when the Half-duplex mode is selected

Bit 1 GMISEL : 1000 Mbps Support

This bit is set to 1 when 1000 Mbps is selected as operating mode.

Bit 0 MIISEL : 10 or 100 Mbps Support

This bit is set to 1 when 10/100 Mbps is selected as operating mode.

HW feature 1 register (ETH_MACHWF1R)

Address offset: 0x0120

Reset value: 0x1104 1904

This register indicates the presence of second set of the optional features or functions of the Ethernet peripheral. The software driver can use this register to dynamically enable or disable the programs related to the optional blocks.

31302928272625242322212019181716
Res.L3L4FNUM[3:0]Res.HASHTBLSZ[1:0]POUOSTRes.RAVSELAVSELDBGMEMATSOENSPHENDCBEN
rrrrrrrrrrrrr

1514131211109876543210
ADDR64[1:0]ADVTHWORDPTOENOSTENTXFIFOSIZE[4:0]Res.RXFIFOSIZE[4:0]
rrrrrrrrrrrrrrr
  1. Bit 31 Reserved, must be kept at reset value.
  2. Bits 30:27 L3L4FNUM[3:0] : Total number of L3 or L4 Filters
    This field indicates the total number of L3 or L4 filters:
    0000: No L3 or L4 Filter
    0001: 1 L3 or L4 Filter
    0010: 2 L3 or L4 Filters
    ..
    1000: 8 L3 or L4
  3. Bit 26 Reserved, must be kept at reset value.
  4. Bits 25:24 HASHTBLSZ[1:0] : Hash Table Size
    This field indicates the size of the Hash table:
    00: No Hash table
    01: 64
    10: 128
    11: 256
  5. Bit 23 POUOST : One Step for PTP over UDP/IP Feature Enable
    This bit is set to 1 when the Enable one step timestamp for PTP over UDP/IP feature is selected.
  6. Bit 22 Reserved, must be kept at reset value.
  7. Bit 21 RAVSEL : Rx Side Only AV Feature Enable
    This bit is set to 1 when the Enable Audio video bridging option on Rx Side Only is selected.
  8. Bit 20 AVSEL : AV Feature Enable
    This bit is set to 1 when the Enable Audio video bridging option is selected.
  9. Bit 19 DBGMEMA : DMA Debug Registers Enable
    This bit is set to 1 when the Debug Mode Enable option is selected
  10. Bit 18 TSOEN : TCP Segmentation Offload Enable
    This bit is set to 1 when the Enable TCP Segmentation Offloading for TCP/IP Packets option is selected
  11. Bit 17 SPHEN : Split Header Feature Enable
    This bit is set to 1 when the Enable Split Header Structure option is selected
  12. Bit 16 DCBEN : DCB Feature Enable
    This bit is set to 1 when the Enable Data Center Bridging option is selected
  13. Bits 15:14 ADDR64[1:0] : Address width
    This field indicates the configured address width.
    00: 32 bits
    Others: Reserved, must not be used
  14. Bit 13 ADVTHWORD : IEEE 1588 High Word Register Enable
    This bit is set to 1 when the Add IEEE 1588 Higher Word Register option is selected
  15. Bit 12 PTOEN : PTP Offload Enable
    This bit is set to 1 when the Enable PTP Timestamp Offload Feature is selected.
  16. Bit 11 OSTEN : One-Step Timestamping Enable
    This bit is set to 1 when the Enable One-Step Timestamp Feature is selected.
Bits 10:6 TXFIFOSIZE[4:0] : MTL Transmit FIFO Size

This field contains the configured value of MTL Tx FIFO in bytes expressed as Log to base 2 minus 7, that is, \( \text{Log2}(\text{TXFIFO\_SIZE}) - 7 \) :

00000: 128 bytes

00001: 256 bytes

00010: 512 bytes

00011: 1,024 bytes

00100: 2,048 bytes

00101: 4,096 bytes

00110: 8,192 bytes

00111: 16,384 bytes

01000: 32 Kbytes

01001: 64 Kbytes

01010: 128 Kbytes

01011 to 11111: Reserved, must not be used

Bit 5 Reserved, must be kept at reset value.

Bits 4:0 RXFIFOSIZE[4:0] : MTL Receive FIFO Size

This field contains the configured value of MTL Rx FIFO in bytes expressed as Log to base 2 minus 7, that is, \( \text{Log2}(\text{RXFIFO\_SIZE}) - 7 \) :

00000: 128 bytes

00001: 256 bytes

00010: 512 bytes

00011: 1,024 bytes

00100: 2,048 bytes

00101: 4,096 bytes

00110: 8,192 bytes

00111: 16,384 bytes

01000: 32 Kbytes

01001: 64 Kbytes

01010: 128 Kbytes

01011: 256 Kbytes

01100 to 11111: Reserved, must not be used

HW feature 2 register (ETH_MACHWF2R)

Address offset: 0x0124

Reset value: 0x4100 0000

This register indicates the presence of third set of the optional features or functions of the Ethernet peripheral. The software driver can use this register to dynamically enable or disable the programs related to the optional blocks.

31302928272625242322212019181716
ResAUXSNAPNUM[2:0]ResPPSOUTNUM[2:0]TDCSZ[1:0]TXHCNT[3:0]RDCSZ[1:0]
rrrrrrrrrrrrrr
1514131211109876543210
RXHCNT[3:0]ResResTXQCNT[3:0]ResResRXQCNT[3:0]
rrrrrrrrrrrr

Bit 31 Reserved, must be kept at reset value.

Bits 30:28 AUXSNAPNUM[2:0] : Number of Auxiliary Snapshot Inputs

This field indicates the number of auxiliary snapshot inputs:

000: No auxiliary input

001: 1 auxiliary input

010: 2 auxiliary inputs

011: 3 auxiliary inputs

100: 4 auxiliary inputs

101 to 111: Reserved, must not be used

Bit 27 Reserved, must be kept at reset value.

Bits 26:24 PPSOUTNUM[2:0] : Number of PPS Outputs

This field indicates the number of PPS outputs:

000: No PPS output

001: 1 PPS output

010: 2 PPS outputs

011: 3 PPS outputs

100: 4 PPS outputs

101 to 111: Reserved, must not be used

Bits 23:22 TDCSZ[1:0] : Tx DMA Descriptor Cache Size in terms of 16-byte descriptors

00: Cache not configured

01: Four 16-byte descriptors

10: Eight 16-byte descriptors

11: Sixteen 16-byte descriptors

Bits 21:18 TXHCNT[3:0] : Number of DMA Transmit Channels

This field indicates the number of DMA Transmit channels:

0000: 1 DMA Tx Channel

0001: 2 DMA Tx Channels

..

0111: 8 DMA Tx

Bits 17:16 RDCSZ[1:0] : Rx DMA Descriptor Cache Size in terms of 16-byte descriptors

Bits 15:12 RXHCNT[3:0] : Number of DMA Receive Channels

This field indicates the number of DMA Receive channels:

Bits 11:10 Reserved, must be kept at reset value.

Bits 9:6 TXQCNT[3:0] : Number of MTL Transmit Queues

This field indicates the number of MTL Transmit queues:

Bits 5:4 Reserved, must be kept at reset value.

Bits 3:0 RXQCNT[3:0] : Number of MTL Receive Queues

This field indicates the number of MTL Receive queues:

HW feature 3 register (ETH_MACHWF3R)

Address offset: 0x0128

Reset value: 0x0000 0020

This register indicates the presence of fourth set the optional features or functions of the Ethernet peripheral. The software driver can use this register to dynamically enable or disable the programs related to the optional blocks.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DVLANCBTISELRes.NRVF[2:0]
rrrrr

Bits 31:6 Reserved, must be kept at reset value.

Bit 5 DVLAN : Double VLAN processing enable

This bit is set to 1 when Double VLAN processing is enabled.

Bit 4 CBTISEL : Queue/Channel based VLAN tag insertion on Tx enable

This bit is set to 1 when the Enable Queue/Channel based VLAN tag insertion on Tx feature is selected.

Bit 3 Reserved, must be kept at reset value.

Bits 2:0 NRVF[2:0] : Number of Extended VLAN Tag Filters Enabled

This field indicates the Number of Extended VLAN Tag Filters selected:

000: No Extended Rx VLAN Filters

001: 4 Extended Rx VLAN Filters

010: 8 Extended Rx VLAN Filters

011: 16 Extended Rx VLAN Filters

100: 24 Extended Rx VLAN Filters

101: 32 Extended Rx VLAN Filters

110 to 111: Reserved, must not be used

MDIO address register (ETH_MACMDIOAR)

Address offset: 0x0200

Reset value: 0x0000 0000

The MDIO Address register controls the management cycles to external PHY through a management interface.

31302928272625242322212019181716
ResResResResPSEBTBPA[4:0]RDA[4:0]
rwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210

1514131211109876543210
ResNTC[2:0]CR[3:0]ResResResSKAPGOC[1:0]C45EMB
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:28 Reserved, must be kept at reset value.

Bit 27 PSE : Preamble Suppression Enable

When this bit is set, the SMA suppresses the 32-bit preamble and transmit MDIO frames with only 1 preamble bit.

When this bit is 0, the MDIO frame always has 32 bits of preamble as defined in the IEEE specifications.

Bit 26 BTB : Back to Back transactions

When this bit is set and the NTC has value greater than 0, then the MAC informs the completion of a read or write command at the end of frame transfer (before the trailing clocks are transmitted). The software can thus initiate the next command which is executed immediately irrespective of the number trailing clocks generated for the previous frame.

When this bit is reset, then the read/write command completion (MII busy is cleared) only after the trailing clocks are generated. In this mode, it is ensured that the NTC is always generated after each frame.

This bit must not be set when NTC=0.

Bits 25:21 PA[4:0] : Physical Layer Address

This field indicates which Clause 22 PHY devices (out of 32 devices) the MAC is accessing.

This field indicates which Clause 45 capable PHYs (out of 32 PHYs) the MAC is accessing.

Bits 20:16 RDA[4:0] : Register/Device Address

These bits select the PHY register in selected Clause 22 PHY device. These bits select the Device (MMD) in selected Clause 45 capable PHY.

Bit 15 Reserved, must be kept at reset value.

Bits 14:12 NTC[2:0] : Number of Training Clocks

This field controls the number of trailing clock cycles generated on ETH_MDC after the end of transmission of MDIO frame. The valid values can be from 0 to 7. Programming the value to 011 indicates that there are additional three clock cycles on the MDC line after the end of MDIO frame transfer.

Bits 11:8 CR[3:0] : CSR Clock Range

The CSR Clock Range selection determines the frequency of the MDC clock according to the CSR clock frequency used in your design:

0000: CSR clock = 60-100 MHz; MDC clock = CSR clock/42

0001: CSR clock = 100-150 MHz; MDC clock = CSR clock/62

0010: CSR clock = 20-35 MHz; MDC clock = CSR clock/16

0011: CSR clock = 35-60 MHz; MDC clock = CSR clock/26

0100: CSR clock = 150-250 MHz; MDC clock = CSR clock/102

0101: CSR clock = 250-300 MHz; MDC clock = CSR clock/124

0110 to 0111: Reserved, must not be used

The suggested range of CSR clock frequency applicable for each value (when Bit 11 = 0) ensures that the MDC clock is approximately between 1.0 MHz to 2.5 MHz frequency range. When Bit 11 is set, you can achieve a higher frequency of the MDC clock than the frequency limit of 2.5 MHz (specified in the IEEE 802.3) and program a clock divider of lower value. For example, when CSR clock is of 100 MHz frequency and you program these bits to 1010, the resultant MDC clock is of 12.5 MHz which is above the range specified in IEEE 802.3.

Program the following values only if the interfacing chips support faster MDC clocks:

1000: CSR clock/4

1001: CSR clock/6

1010: CSR clock/8

1011: CSR clock/10

1100: CSR clock/12

1101: CSR clock/14

1110: CSR clock/16

1111: CSR clock/18

Bits 7:5 Reserved, must be kept at reset value.

Bit 4 SKAP : Skip Address Packet

When this bit is set, the SMA does not send the address packets before read, write, or post-read increment address packets. This bit is valid only when C45E is set.

Bits 3:2 GOC[1:0] : MII Operation Command

This bit indicates the operation command to the PHY.

00: Reserved, must not be used

01: Write

10: Post Read Increment Address for Clause 45 PHY

11: Read

When Clause 22 PHY is enabled, only Write and Read commands are valid.

Bit 1 C45E : Clause 45 PHY Enable

When this bit is set, Clause 45 capable PHY is connected to MDIO. When this bit is reset, Clause 22 capable PHY is connected to MDIO.

Bit 0 MB : MII Busy

The application sets this bit to instruct the SMA to initiate a Read or Write access to the MDIOS. The MAC clears this bit after the MDIO frame transfer is completed. Hence the software must not write or change any of the fields in MDIO address register (ETH_MACMDIOAR) and MDIO data register (ETH_MACMDIODR) as long as this bit is set.

For write transfers, the application must first write 16-bit data in the MD field (and also RA field when C45E is set) in MDIO data register (ETH_MACMDIODR) register before setting this bit. When C45E is set, it should also write into the RA field of MDIO data register (ETH_MACMDIODR) before initiating a read transfer. When a read transfer is completed (MII busy=0), the data read from the PHY register is valid in the MD field of the MDIO data register (ETH_MACMDIODR) .

Note: Even if the addressed PHY is not present, there is no change in the functionality of this bit.

MDIO data register (ETH_MACMDIODR)

Address offset: 0x0204

Reset value: 0x0000 0000

The MDIO Data register stores the Write data to be written to the PHY register located at the address specified in MDIO address register (ETH_MACMDIOAR) . This register also stores the Read data from the PHY register located at the address specified by MDIO Address register.

31302928272625242322212019181716
RA[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
MD[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:16 RA[15:0] : Register Address

This field is valid only when C45E is set. It contains the Register Address in the PHY to which the MDIO frame is intended for.

Bits 15:0 MD[15:0] : MII Data

This field contains the 16-bit data value read from the PHY after a Management Read operation or the 16-bit data value to be written to the PHY before a Management Write operation.

ARP address register (ETH_MACARPAR)

Address offset: 0x0210

Reset value: 0x0000 0000

The ARP Address register contains the IPv4 Destination Address of the MAC.

31302928272625242322212019181716
ARPPA[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
ARPPA[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 ARPPA[31:0] : ARP Protocol Address

This field contains the IPv4 Destination Address of the MAC. This address is used for perfect match with the Protocol Address of Target field in the received ARP packet.

CSR software control register (ETH_MACCSRSWCR)

Address offset: 0x0230

Reset value: 0x0000 0000

This register contains software-programmable controls for changing the CSR access response and status bits clearing.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.SEENRes.Res.Res.Res.Res.Res.Res.RCWE
rwrw

Bits 31:9 Reserved, must be kept at reset value.

Bit 8 SEEN : Slave Error Response Enable

When this bit is set, the MAC responds with a Slave Error for accesses to reserved registers in CSR space.

When this bit is reset, the MAC responds with an Okay response to any register accessed from CSR space.

Bits 7:1 Reserved, must be kept at reset value.

Bit 0 RCWE : Register Clear on Write 1 Enable

When this bit is set, the access mode to some register fields changes to rc_w1 (clear on write) meaning that the application needs to set that respective bit to 1 to clear it.

When this bit is reset, the access mode to these register fields remains rc_r (clear on read).

MAC Address 0 high register (ETH_MACA0HR)

Address offset: 0x0300

Reset value: 0x8000 FFFF

The MAC Address0 High register holds the upper 16 bits of the first 6-byte MAC address of the station. The first DA byte that is received on the MII interface corresponds to the LS byte (Bits [7:0]) of the MAC Address Low register. For example, if 0x112233445566 is received (0x11 in lane 0 of the first column) on the MII as the destination address, then the MacAddress0 Register [47:0] is compared with 0x665544332211.

If the MAC address registers are configured to be double-synchronized to the MII clock domains, then the synchronization is triggered only when Bits[31:24] (in little-endian mode) or Bits[7:0] (in big-endian mode) of the MAC Address0 Low Register are written. For proper synchronization updates, the consecutive writes to this Address Low Register should be performed after at least four clock cycles in the destination clock domain.

31302928272625242322212019181716
AEResResResResResResResResResResResResResResRes
r
1514131211109876543210
ADDRHI[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 AE : Address Enable

This bit is always set to 1.

Bits 30:16 Reserved, must be kept at reset value.

Bits 15:0 ADDRHI[15:0] : MAC Address0[47:32]

This field contains the upper 16 bits [47:32] of the first 6-byte MAC address. The MAC uses this field for filtering the received packets and inserting the MAC address in the Transmit Flow Control (Pause) Packets.

MAC Address x low register (ETH_MACAxLR)

Address offset: 0x0304 + 0x8 * x, (x = 0 to 3)

Reset value: 0xFFFF FFFF

The MAC Address x Low register holds the lower 32 bits of the 6-byte first MAC address of the station.

31302928272625242322212019181716
ADDRLO[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
ADDRLO[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 ADDRLO[31:0] : MAC Address x [31:0] (x = 0 to 3)

This field contains the lower 32 bits of the first 6-byte MAC address. The MAC uses this field for filtering the received packets and inserting the MAC address in the Transmit Flow Control (Pause) Packets.

MAC Address x high register (ETH_MACAxHR)

Address offset: 0x0308 + 0x8 * (x-1), (x = 1 to 3)

Reset value: 0x0000 FFFF

The MAC Address x High register holds the upper 16 bits of the second 6-byte MAC address of the station.

31302928272625242322212019181716
AESAMBC[5:0]ResResResResResResResRes
rwrwrwrwrwrwrwrw
1514131211109876543210
ADDRHI[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 AE : Address Enable

When this bit is set, the address filter module uses the second MAC address for perfect filtering. When this bit is reset, the address filter module ignores the address for filtering.

Bit 30 SA : Source Address

When this bit is set, the MAC Addressx[47:0] is used to compare with the SA fields of the received packet. When this bit is reset, the MAC Address x[47:0] is used to compare with the DA fields of the received packet.

0: DA

1: SA

Bits 29:24 MBC[5:0] : Mask Byte Control

These bits are mask control bits for comparing each of the MAC Address bytes. When set high, the MAC does not compare the corresponding byte of received DA or SA with the contents of MAC Address1 registers. Each bit controls the masking of the bytes as follows:

Bit 29: ETH_MACAxHR[15:8]

Bit 28: ETH_MACAxHR[7:0]

Bit 27: ETH_MACAxLR[31:24]

Bit 26: ETH_MACAxLR[23:16]

Bit 25: ETH_MACAxLR[15:8]

Bit 24: ETH_MACAxLR[7:0]

You can filter a group of addresses (known as group address filtering) by masking one or more bytes of the address.

Bits 23:16 Reserved, must be kept at reset value.

Bits 15:0 ADDRHI[15:0] : MAC Address1 [47:32]

This field contains the upper 16 bits[47:32] of the second 6-byte MAC address.

MMC control register (ETH_MMC_CONTROL)

Address offset: 0x0700

Reset value: 0x0000 0000

This register configures the MMC operating mode.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.UCDBCRes.Res.CNTPRSTLVLCNTPRSTCNTFREEZRSTONRDCNTSTOPROCNTRST
rwrwrwrwrwrwrw

Bits 31:9 Reserved, must be kept at reset value.

Bit 8 UCDBC : Update MMC Counters for Dropped Broadcast Packets

The CNTRST bit has a higher priority than the CNTPRST bit. Therefore, when the software tries to set both bits in the same write cycle, all counters are cleared and the CNTPRST bit is not set.

When set, the MAC updates all related MMC Counters for Broadcast packets that are dropped because of the setting of the DBF bit of Packet filtering control register (ETH_MACPFR) .

When reset, the MMC Counters are not updated for dropped Broadcast packets.

Bits 7:6 Reserved, must be kept at reset value.

Bit 5 CNTPRSTLVL : Full-Half Preset

When this bit is low and the CNTPRST bit is set, all MMC counters get preset to almost-half value. All octet counters get preset to 0x7FFF_F800 (Half 2Kbytes) and all packet-counters get preset to 0x7FFF_FFF0 (Half 16).

When this bit is high and the CNTPRST bit is set, all MMC counters get preset to almost-full value. All octet counters get preset to 0xFFFF_F800 (Full 2Kbytes) and all packet-counters get preset to 0xFFFF_FFF0 (Full 16).

For 16-bit counters, the almost-half preset values are 0x7800 and 0x7FF0 for the respective octet and packet counters. Similarly, the almost-full preset values for the 16-bit counters are 0xF800 and 0xFFF0.

Bit 4 CNTPRST : Counters Preset

When this bit is set, all counters are initialized or preset to almost full or almost half according to the CNTPRSTLVL bit. This bit is cleared automatically after 1 clock cycle.

This bit, along with the CNTPRSTLVL bit, is useful for debugging and testing the assertion of interrupts because of MMC counter becoming half-full or full.

Bit 3 CNTFREEZ : MMC Counter Freeze

When this bit is set, it freezes all MMC counters to their current value.

Until this bit is reset to 0, no MMC counter is updated because of any transmitted or received packet. If any MMC counter is read with the Reset on Read bit set, then that counter is also cleared in this mode.

Bit 2 RSTONRD : Reset on Read

When this bit is set, the MMC counters are reset to zero after Read (self-clearing after reset). The counters are cleared when the least significant byte lane (Bits[7:0]) is read.

Bit 1 CNTSTOPRO : Counter Stop Rollover

When this bit is set, the counter does not roll over to zero after reaching the maximum value.

Bit 0 CNTRST : Counters Reset

When this bit is set, all counters are reset. This bit is cleared automatically after 1 clock cycle.

MMC Rx interrupt register (ETH_MMC_RX_INTERRUPT)

Address offset: 0x0704

Reset value: 0x0000 0000

This register maintains the interrupts generated from all Receive statistics counters.

The MMC Receive Interrupt register maintains the interrupts that are generated when the following occur:

When the CNTSTOPRO is set in MMC control register (ETH_MMC_CONTROL) , interrupts are set but the counter remains at all-ones. The MMC Receive Interrupt register is a 32 bit register. An interrupt bit is cleared when the respective MMC counter that caused the interrupt is read. The least significant byte lane (Bits[7:0]) of the respective counter must be read to clear the interrupt bit.

31302928272625242322212019181716
Res.Res.Res.Res.RXLPITRCISRXLPPIUSCISRes.Res.Res.Res.Res.Res.Res.Res.RXUCCGPISRes.
rc_rrc_rrc_r
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.RXALGNERPISRXCRERPISRes.Res.Res.Res.Res.
rc_rrc_r

Bits 31:28 Reserved, must be kept at reset value.

Bit 27 RXLPITRCIS : MMC Receive LPI transition counter interrupt status

This bit is set when the Rx LPI transition counter register (ETH_RX_LPI_TRAN_CNTR) counter reaches half of the maximum value or the maximum value.

Bit 26 RXLPPIUSCIS : MMC Receive LPI microsecond counter interrupt status

This bit is set when the Rx LPI microsecond counter register (ETH_RX_LPI_USEC_CNTR) counter reaches half of the maximum value or the maximum value.

Bits 25:18 Reserved, must be kept at reset value.

Bit 17 RXUCGPIS : MMC Receive Unicast Good Packet Counter Interrupt Status

This bit is set when the Rx unicast packets good register (ETH_RX_UNICAST_PACKETS_GOOD) counter reaches half of the maximum value or the maximum value.

Bits 16:7 Reserved, must be kept at reset value.

Bit 6 RXALGNERPIS : MMC Receive Alignment Error Packet Counter Interrupt Status

This bit is set when the Rx alignment error packets register (ETH_RX_ALIGNMENT_ERROR_PACKETS) counter reaches half of the maximum value or the maximum value.

Bit 5 RXRCERPIS : MMC Receive CRC Error Packet Counter Interrupt Status

This bit is set when the Rx CRC error packets register (ETH_RX_CRC_ERROR_PACKETS) counter reaches half of the maximum value or the maximum value.

Bits 4:0 Reserved, must be kept at reset value.

MMC Tx interrupt register (ETH_MMC_TX_INTERRUPT)

Address offset: 0x0708

Reset value: 0x0000 0000

This register maintains the interrupts generated from all Transmit statistics counters.

The MMC Transmit Interrupt register maintains the interrupts generated when transmit statistic counters reach half their maximum values (0x8000_0000 for 32 bit counter and 0x8000 for 16 bit counter), and when they cross their maximum values (0xFFFF_FFFF for 32-bit counter and 0xFFFF for 16-bit counter).

When CNTSTOPRO is set in MMC control register (ETH_MMC_CONTROL) , the interrupts are set but the counter remains at all-ones.

The MMC Transmit Interrupt register is a 32 bit register. An interrupt bit is cleared when the respective MMC counter that caused the interrupt is read.

The least significant byte lane (Bits[7:0]) of the respective counter must be read to clear the interrupt bit.

31302928272625242322212019181716
Res.Res.Res.Res.TXLPITRCISTXLPIUSCISRes.Res.Res.Res.TXGPKTISRes.Res.Res.Res.Res.
rc_rrc_rrc_r
1514131211109876543210
TXMCOLGPISTXSCOLGPISRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rc_rrc_r

Bits 31:28 Reserved, must be kept at reset value.

Bit 27 TXLPITRCIS : MMC Transmit LPI transition counter interrupt status

This bit is set when the Tx LPI transition counter register (ETH_TX_LPI_TRAN_CNTR) counter reaches half of the maximum value or the maximum value.

Bit 26 TXLPIUSCIS : MMC Transmit LPI microsecond counter interrupt status

This bit is set when the Tx LPI microsecond timer register (ETH_TX_LPI_USEC_CNTR) counter reaches half of the maximum value or the maximum value.

Bits 25:22 Reserved, must be kept at reset value.

Bit 21 TXGPKTIS : MMC Transmit Good Packet Counter Interrupt Status

This bit is set when the Tx packet count good register (ETH_TX_PACKET_COUNT_GOOD) counter reaches half of the maximum value or the maximum value.

Bits 20:16 Reserved, must be kept at reset value.

Bit 15 TXMCOLGPIS : MMC Transmit Multiple Collision Good Packet Counter Interrupt Status

This bit is set when the Tx multiple collision good packets register (ETH_TX_MULTIPLE_COLLISION_GOOD_PACKETS) counter reaches half of the maximum value or the maximum value.

Bit 14 TXSCOLGPIS : MMC Transmit Single Collision Good Packet Counter Interrupt Status

This bit is set when the Tx single collision good packets register (ETH_TX_SINGLE_COLLISION_GOOD_PACKETS) counter reaches half of the maximum value or the maximum value.

Bits 13:0 Reserved, must be kept at reset value.

MMC Rx interrupt mask register (ETH_MMC_RX_INTERRUPT_MASK)

Address offset: 0x070C

Reset value: 0x0000 0000

The MMC Receive Interrupt Mask register maintains the masks for the interrupts generated when receive statistic counters reach half of their maximum value or the maximum values.

31302928272625242322212019181716
Res.Res.Res.Res.RXLPITRCIMRXLPIUSCIMRes.Res.Res.Res.Res.Res.Res.Res.RXUCGPIMRes.
rwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.RXALGNERPIMRXRCERPIMRes.Res.Res.Res.Res.
rwrw

Bits 31:28 Reserved, must be kept at reset value.

Bit 27 RXLPITRCIM : MMC Receive LPI transition counter interrupt Mask

Setting this bit masks the interrupt when the Rx LPI transition counter register (ETH_RX_LPI_TRAN_CNTR) counter reaches half of the maximum value or the maximum value.

Bit 26 RXLPIUSCIM : MMC Receive LPI microsecond counter interrupt Mask

Setting this bit masks the interrupt when the Rx LPI microsecond counter register (ETH_RX_LPI_USEC_CNTR) counter reaches half of the maximum value or the maximum value.

Bits 25:18 Reserved, must be kept at reset value.

Bit 17 RXUCGPIM : MMC Receive Unicast Good Packet Counter Interrupt Mask

Setting this bit masks the interrupt when the Rx unicast packets good register (ETH_RX_UNICAST_PACKETS_GOOD) counter reaches half of the maximum value or the maximum value.

Bits 16:7 Reserved, must be kept at reset value.

Bit 6 RXALGNERPIM : MMC Receive Alignment Error Packet Counter Interrupt Mask

Setting this bit masks the interrupt when the Rx alignment error packets register (ETH_RX_ALIGNMENT_ERROR_PACKETS) counter reaches half of the maximum value or the maximum value.

Bit 5 RXRCERPIM : MMC Receive CRC Error Packet Counter Interrupt Mask

Setting this bit masks the interrupt when the Rx CRC error packets register (ETH_RX_CRC_ERROR_PACKETS) counter reaches half of the maximum value or the maximum value.

Bits 4:0 Reserved, must be kept at reset value.

MMC Tx interrupt mask register (ETH_MMC_TX_INTERRUPT_MASK)

Address offset: 0x0710

Reset value: 0x0000 0000

The MMC Transmit Interrupt Mask register maintains the masks for the interrupts generated when the transmit statistic counters reach half of their maximum value or the maximum values. This register is 32 bit wide.

31302928272625242322212019181716
Res.Res.Res.Res.TXLPITRCIMTXLPIUSCIMRes.Res.Res.Res.TXGPKTIMRes.Res.Res.Res.Res.
r/wr/wr/w

1514131211109876543210
TXMCOLGPIMTXSCOLGPIMRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
r/wr/w

Bits 31:28 Reserved, must be kept at reset value.

Bit 27 TXLPITRCIM : MMC Transmit LPI transition counter interrupt Mask

Setting this bit masks the interrupt when the Tx LPI transition counter register (ETH_TX_LPI_TRAN_CNTR) counter reaches half of the maximum value or the maximum value.

Bit 26 TXLPIUSCIM : MMC Transmit LPI microsecond counter interrupt Mask

Setting this bit masks the interrupt when the Tx LPI microsecond timer register (ETH_TX_LPI_USEC_CNTR) counter reaches half of the maximum value or the maximum value.

Bits 25:22 Reserved, must be kept at reset value.

Bit 21 TXGPKTIM : MMC Transmit Good Packet Counter Interrupt Mask

Setting this bit masks the interrupt when the Tx packet count good register (ETH_TX_PACKET_COUNT_GOOD) counter reaches half of the maximum value or the maximum value.

Bits 20:16 Reserved, must be kept at reset value.

Bit 15 TXMCOLGPIM : MMC Transmit Multiple Collision Good Packet Counter Interrupt Mask

Setting this bit masks the interrupt when the Tx multiple collision good packets register (ETH_TX_MULTIPLE_COLLISION_GOOD_PACKETS) counter reaches half of the maximum value or the maximum value.

Bit 14 TXSCOLGPIM : MMC Transmit Single Collision Good Packet Counter Interrupt Mask

Setting this bit masks the interrupt when the Tx single collision good packets register (ETH_TX_SINGLE_COLLISION_GOOD_PACKETS) counter reaches half of the maximum value or the maximum value.

Bits 13:0 Reserved, must be kept at reset value.

Tx single collision good packets register
(ETH_TX_SINGLE_COLLISION_GOOD_PACKETS)

Address offset: 0x074C

Reset value: 0x0000 0000

This register provides the number of successfully transmitted packets by Ethernet peripheral after a single collision in the Half-duplex mode.

31302928272625242322212019181716
TXSNGLCOLG[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
TXSNGLCOLG[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 TXSNGLCOLG[31:0] : Tx Single Collision Good Packets

This field indicates the number of successfully transmitted packets after a single collision in the Half-duplex mode.

Tx multiple collision good packets register
(ETH_TX_MULTIPLE_COLLISION_GOOD_PACKETS)

Address offset: 0x0750

Reset value: 0x0000 0000

This register provides the number of successfully transmitted packets by Ethernet peripheral after multiple collisions in the Half-duplex mode.

31302928272625242322212019181716
TXMULTCOLG[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
TXMULTCOLG[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 TXMULTCOLG[31:0] : Tx Multiple Collision Good Packets

This field indicates the number of successfully transmitted packets after multiple collisions in the Half-duplex mode.

Tx packet count good register (ETH_TX_PACKET_COUNT_GOOD)

Address offset: 0x0768

Reset value: 0x0000 0000

This register provides the number of good packets transmitted by Ethernet peripheral.

31302928272625242322212019181716
TXPKTG[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
TXPKTG[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 TXPKTG[31:0] : Tx Packet Count Good

This field indicates the number of good packets transmitted.

Rx CRC error packets register (ETH_RX_CRC_ERROR_PACKETS)

Address offset: 0x0794

Reset value: 0x0000 0000

This register provides the number of packets received by Ethernet peripheral with CRC error.

31302928272625242322212019181716
RXCRCERR[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
RXCRCERR[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 RXCRCERR[31:0] : Rx CRC Error Packets

This field indicates the number of packets received with CRC error.

Rx alignment error packets register
(ETH_RX_ALIGNMENT_ERROR_PACKETS)

Address offset: 0x0798

Reset value: 0x0000 0000

This register provides the number of packets received by Ethernet peripheral with alignment (dribble) error. It is valid only in 10/100 mode.

31302928272625242322212019181716
RXALGNERR[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
RXALGNERR[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 RXALGNERR[31:0] : Rx Alignment Error Packets

This field indicates the number of packets received with alignment (dribble) error. It is valid only in 10/100 mode.

Rx unicast packets good register (ETH_RX_UNICAST_PACKETS_GOOD)

Address offset: 0x07C4

Reset value: 0x0000 0000

This register provides the number of good unicast packets received by Ethernet peripheral.

31302928272625242322212019181716
RXUNICASTG[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
RXUNICASTG[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 RXUNICASTG[31:0] : Rx Unicast Packets Good

This field indicates the number of good unicast packets received.

Tx LPI microsecond timer register (ETH_TX_LPI_USEC_CNTR)

Address offset: 0x07EC

Reset value: 0x0000 0000

This register provides the number of microseconds Tx LPI is asserted by Ethernet peripheral.

31302928272625242322212019181716
TXLPIUSC[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
TXLPIUSC[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 TXLPIUSC[31:0] : Tx LPI Microseconds Counter

This field indicates the number of microseconds Tx LPI is asserted. For every Tx LPI Entry and Exit, the Timer value can have an error of +/- 1 microsecond.

Tx LPI transition counter register (ETH_TX_LPI_TRAN_CNTR)

Address offset: 0x07F0

Reset value: 0x0000 0000

This register provides the number of times Ethernet peripheral has entered Tx LPI.

31302928272625242322212019181716
TXLPITRC[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
TXLPITRC[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 TXLPITRC[31:0] : Tx LPI Transition counter

This field indicates the number of times Tx LPI Entry has occurred. Even if Tx LPI Entry occurs in Automate mode (because of LPITXA bit set in the LPI control and status register (ETH_MACLCSR) ), the counter is incremented.

Rx LPI microsecond counter register (ETH_RX_LPI_USEC_CNTR)

Address offset: 0x07F4

Reset value: 0x0000 0000

This register provides the number of microseconds Rx LPI is sampled by Ethernet peripheral.

31302928272625242322212019181716
RXLPIUSC[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
RXLPIUSC[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 RXLPIUSC[31:0] : Rx LPI Microseconds Counter

This field indicates the number of microseconds Rx LPI is asserted. For every Rx LPI Entry and Exit, the Timer value can have an error of +/- 1 microsecond.

Rx LPI transition counter register (ETH_RX_LPI_TRAN_CNTR)

Address offset: 0x07F8

Reset value: 0x0000 0000

This register provides the number of times Ethernet peripheral has entered Rx LPI.

31302928272625242322212019181716
RXLPITRC[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
RXLPITRC[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 RXLPITRC[31:0] : Rx LPI Transition counter

This field indicates the number of times Rx LPI Entry has occurred.

L3 and L4 control 0 register (ETH_MACL3L4C0R)

Address offset: 0x0900

Reset value: 0x0000 0000

The Layer 3 and Layer 4 Control register controls the operations of filter 0 of Layer 3 and Layer 4.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.L4DPM0L4DPM0L4SPM0L4SPM0Res.L4PEN0
rwrwrwrwrw
1514131211109876543210
L3HDBM0[4:0]L3HSBM0[4:0]L3DAM0L3DAM0L3SAM0L3SAM0Res.L3PEN0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:22 Reserved, must be kept at reset value.

Bit 21 L4DPM0 : Layer 4 Destination Port Inverse Match Enable

When this bit is set, the Layer 4 Destination Port number field is enabled for inverse matching. When this bit is reset, the Layer 4 Destination Port number field is enabled for perfect matching.

This bit is valid and applicable only when the L4DPM0 bit is set high.

Bit 20 L4DPM0 : Layer 4 Destination Port Match Enable

When this bit is set, the Layer 4 Destination Port number field is enabled for matching. When this bit is reset, the MAC ignores the Layer 4 Destination Port number field for matching.

Bit 19 L4SPM0 : Layer 4 Source Port Inverse Match Enable

When this bit is set, the Layer 4 Source Port number field is enabled for inverse matching. When this bit is reset, the Layer 4 Source Port number field is enabled for perfect matching. This bit is valid and applicable only when the L4SPM0 bit is set high.

Bit 18 L4SPM0 : Layer 4 Source Port Match Enable

When this bit is set, the Layer 4 Source Port number field is enabled for matching. When this bit is reset, the MAC ignores the Layer 4 Source Port number field for matching.

Bit 17 Reserved, must be kept at reset value.

Bit 16 L4PEN0 : Layer 4 Protocol Enable

When this bit is set, the Source and Destination Port number fields of UDP packets are used for matching. When this bit is reset, the Source and Destination Port number fields of TCP packets are used for matching.

The Layer 4 matching is done only when the L4SPM0 or L4DPM0 bit is set.

Bits 15:11 L3HDBM0[4:0] : Layer 3 IP DA higher bits match

Condition: IPv4 packets

This field contains the number of higher bits of IP Destination Address that are masked in the IPv4 packets:

0: No bits are masked.

1: LSb[0] is masked

2: Two LSbs [1:0] are masked

..

31: All bits except MSb are masked.

Condition: IPv6 packets

Bits[12:11] of this field correspond to Bits[6:5] of L3HSBM0 which indicate the number of lower bits of IP Source or Destination Address that are masked in the IPv6 packets. Number of bits masked is given by concatenated values of the L3HDBM0[1:0] and L3HSBM0 bits:

0: No bits are masked.

1: LSb[0] is masked

2: Two LSbs [1:0] are masked

..

31: All bits except MSb are masked.

This field is valid and applicable only when the L3DAM0 or L3SAM0 bit is set.

Bits 10:6 L3HSBM0[4:0] : Layer 3 IP SA higher bits match

Condition: IPv4 packets

This field contains the number of lower bits of IP source address that are masked for matching in the IPv4 packets. The following list describes the values of this field:

0: No bits are masked.

1: LSb[0] is masked

2: Two LSbs [1:0] are masked

..

31: All bits except MSb are masked.

Condition: IPv6 packets:

This field contains Bits[4:0] of L3HSBM0. These bits indicate the number of higher bits of IP source or destination address matched in the IPv6 packets. This field is valid and applicable only when the L3DAM0 or L3SAM0 bit is set high.

Bit 5 L3DAIM0 : Layer 3 IP DA Inverse Match Enable

When this bit is set, the Layer 3 IP Destination Address field is enabled for inverse matching.

When this bit is reset, the Layer 3 IP Destination Address field is enabled for perfect matching.

This bit is valid and applicable only when the L3DAM0 bit is set high.

Bit 4 L3DAM0 : Layer 3 IP DA Match Enable

When this bit is set, the Layer 3 IP Destination Address field is enabled for matching. When this bit is reset, the MAC ignores the Layer 3 IP Destination Address field for matching.

Note: When the L3PEN0 bit is set, you should set either this bit or the L3SAM0 bit because either IPv6 DA or SA can be checked for filtering.

Bit 3 L3SAIM0 : Layer 3 IP SA Inverse Match Enable

When this bit is set, the Layer 3 IP Source Address field is enabled for inverse matching.

When this bit reset, the Layer 3 IP Source Address field is enabled for perfect matching.

This bit is valid and applicable only when the L3SAM0 bit is set.

Bit 2 L3SAM0 : Layer 3 IP SA Match Enable

When this bit is set, the Layer 3 IP Source Address field is enabled for matching. When this bit is reset, the MAC ignores the Layer 3 IP Source Address field for matching.

Note: When the L3PEN0 bit is set, you should set either this bit or the L3DAM0 bit because either IPv6 SA or DA can be checked for filtering.

Bit 1 Reserved, must be kept at reset value.

Bit 0 L3PEN0 : Layer 3 Protocol Enable

When this bit is set, the Layer 3 IP Source or Destination Address matching is enabled for IPv6 packets. When this bit is reset, the Layer 3 IP Source or Destination Address matching is enabled for IPv4 packets.

The Layer 3 matching is done only when the L3SAM0 or L3DAM0 bit is set.

Layer4 Address filter 0 register (ETH_MACL4A0R)

Address offset: 0x0904

Reset value: 0x0000 0000

31302928272625242322212019181716
L4DP0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L4SP0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 L4DP0[15:0] : Layer 4 Destination Port Number Field

When the L4PEN0 bit is reset and the L4DPM0 bit is set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with the TCP Destination Port Number field in the IPv4 or IPv6 packets.

When the L4PEN0 and L4DPM0 bits are set in L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with the UDP Destination Port Number field in the IPv4 or IPv6 packets.

Bits 15:0 L4SP0[15:0] : Layer 4 Source Port Number Field

When the L4PEN0 bit is reset and the L4DPM0 bit is set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with the TCP Source Port Number field in the IPv4 or IPv6 packets.

When the L4PEN0 and L4DPM0 bits are set in L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with the UDP Source Port Number field in the IPv4 or IPv6 packets.

Layer3 Address 0 filter 0 register (ETH_MACL3A00R)

Address offset: 0x0910

Reset value: 0x0000 0000

For IPv4 packets, the Layer 3 Address 0 filter 0 register contains the 32-bit IP Source Address field. For IPv6 packets, it contains Bits[31:0] of the 128-bit IP Source Address or Destination Address field.

31302928272625242322212019181716
L3A00[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L3A00[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:0 L3A00[31:0] : Layer 3 Address 0 Field

When the L3PEN0 and L3SAM0 bits are set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with Bits[31:0] of the IP Source Address field in the IPv6 packets.

When the L3PEN0 and L3DAM0 bits are set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with Bits[31:0] of the IP Destination Address field in the IPv6 packets.

When the L3PEN0 bit is reset and the L3SAM0 bit is set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with the IP Source Address field in the IPv4 packets.

Layer3 Address 1 filter 0 register (ETH_MACL3A10R)

Address offset: 0x0914

Reset value: 0x0000 0000

For IPv4 packets, the Layer 3 Address 1 filter 0 register contains the 32-bit IP Destination Address field. For IPv6 packets, it contains Bits[63:32] of the 128-bit IP Source Address or Destination Address field.

31302928272625242322212019181716
L3A10[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L3A10[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 L3A10[31:0] : Layer 3 Address 1 Field

When the L3PEN0 and L3SAM0 bits are set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with Bits[63:32] of the IP Source Address field in the IPv6 packets.

When the L3PEN0 and L3DAM0 bits are set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with Bits[63:32] of the IP Destination Address field in the IPv6 packets.

When the L3PEN0 bit is reset and the L3SAM0 bit is set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with the IP Destination Address field in the IPv4 packets.

Layer3 Address 2 filter 0 register (ETH_MACL3A20R)

Address offset: 0x0918

Reset value: 0x0000 0000

The Layer 3 Address 2 filter 0 register is reserved for IPv4 packets. For IPv6 packets, it contains Bits[95:64] of 128-bit IP Source Address or Destination Address field.

31302928272625242322212019181716
L3A20[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L3A20[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 L3A20[31:0] : Layer 3 Address 2 Field

When the L3PEN0 and L3SAM0 bits are set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with Bits[95:64] of the IP Source Address field in the IPv6 packets.

When the L3PEN0 and L3DAM0 bits are set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with Bits[95:64] of the IP Destination Address field in the IPv6 packets.

When the L3PEN0 bit is reset in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field is not used.

Layer3 Address 3 filter 0 register (ETH_MACL3A30R)

Address offset: 0x091C

Reset value: 0x0000 0000

The Layer 3 Address 3 filter 0 register is reserved for IPv4 packets. For IPv6 packets, it contains Bits[127:96] of 128-bit IP Source Address or Destination Address field.

31302928272625242322212019181716
L3A30[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L3A30[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:0 L3A30[31:0] : Layer 3 Address 3 Field

When the L3PEN0 and L3SAM0 bits are set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with Bits[127:96] of the IP Source Address field in the IPv6 packets.

When the L3PEN0 and L3DAM0 bits are set in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field contains the value to be matched with Bits[127:96] of the IP Destination Address field in the IPv6 packets.

When the L3PEN0 bit is reset in the L3 and L4 control 0 register (ETH_MACL3L4C0R) , this field is not used.

L3 and L4 control 1 register (ETH_MACL3L4C1R)

Address offset: 0x0930

Reset value: 0x0000 0000

The Layer 3 and Layer 4 Control register controls the operations of filter 1 of Layer 3 and Layer 4.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.L4DPM1L4DPM1L4SPIM1L4SPM1Res.L4PEN1
rwrwrwrwrw
1514131211109876543210
L3HDBM1[4:0]L3HSBM1[4:0]L3DAM1L3DAM1L3SAM1L3SPM1Res.L3PEN1
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:22 Reserved, must be kept at reset value.

Bit 21 L4DPM1 : Layer 4 Destination Port Inverse Match Enable

When this bit is set, the Layer 4 Destination Port number field is enabled for inverse matching. When this bit is reset, the Layer 4 Destination Port number field is enabled for perfect matching.

This bit is valid and applicable only when the L4DPM1 bit is set high.

Bit 20 L4DPM1 : Layer 4 Destination Port Match Enable

When this bit is set, the Layer 4 Destination Port number field is enabled for matching. When this bit is reset, the MAC ignores the Layer 4 Destination Port number field for matching.

Bit 19 L4SPIM1 : Layer 4 Source Port Inverse Match Enable

When this bit is set, the Layer 4 Source Port number field is enabled for inverse matching. When this bit is reset, the Layer 4 Source Port number field is enabled for perfect matching. This bit is valid and applicable only when the L4SPM1 bit is set high.

Bit 18 L4SPM1 : Layer 4 Source Port Match Enable

When this bit is set, the Layer 4 Source Port number field is enabled for matching. When this bit is reset, the MAC ignores the Layer 4 Source Port number field for matching.

Bit 17 Reserved, must be kept at reset value.

Bit 16 L4PEN1 : Layer 4 Protocol Enable

When this bit is set, the Source and Destination Port number fields of UDP packets are used for matching. When this bit is reset, the Source and Destination Port number fields of TCP packets are used for matching.

The Layer 4 matching is done only when the L4SPM1 or L4DPM1 bit is set.

Bits 15:11 L3HDBM1[4:0] : Layer 3 IP DA higher bits match

Condition: IPv4 packets

This field contains the number of lower bits of IP Destination Address that are masked for matching in the IPv4 packets. The following list describes the values of this field:

0: No bits are masked.

1: LSb[0] is masked

2: Two LSbs [1:0] are masked

..

31: All bits except MSb are masked.

Condition: IPv6 packets

Bits[12:11] of this field correspond to Bits[6:5] of L3HSBM1, which indicate the number of lower bits of IP Source or Destination Address that are masked in the IPv6 packets. The following list describes the concatenated values of the L3HDBM1[1:0] and L3HSBM1 bits:

0: No bits are masked

1: LSb[0] is masked

2: Two LSbs [1:0] are masked

..

127: All bits except MSb are masked

This field is valid and applicable only when the L3DAM1 or L3SAM1 bit is set.

Bits 10:6 L3HSBM1[4:0] : Layer 3 IP SA Higher Bits Match

Condition: IPv4 packets

This field contains the number of lower bits of IP Source Address that are masked for matching in the IPv4 packets. The following list describes the values of this field:

0: No bits are masked.

1: LSb[0] is masked

2: Two LSbs [1:0] are masked

..

31: All bits except MSb are masked.

Condition: IPv6 packets

This field contains Bits[4:0] of L3HSBM1. These bits indicate the number of higher bits of IP Source or Destination Address matched in the IPv6 packets. This field is valid and applicable only when the L3DAM1 or L3SAM1 bit is set high.

Bit 5 L3DAIM1 : Layer 3 IP DA Inverse Match Enable

When this bit is set, the Layer 3 IP Destination Address field is enabled for inverse matching. When this bit is reset, the Layer 3 IP Destination Address field is enabled for perfect matching.

This bit is valid and applicable only when the L3DAM1 bit is set high.

Bit 4 L3DAM1 : Layer 3 IP DA Match Enable

When this bit is set, the Layer 3 IP Destination Address field is enabled for matching. When this bit is reset, the MAC ignores the Layer 3 IP Destination Address field for matching.

Note: When the L3PEN1 bit is set, you should set either this bit or the L3SAM1 bit because either IPv6 DA or SA can be checked for filtering.

Bit 3 L3SAIM1 : Layer 3 IP SA Inverse Match Enable

When this bit is set, the Layer 3 IP Source Address field is enabled for inverse matching.

When this bit reset, the Layer 3 IP Source Address field is enabled for perfect matching.

This bit is valid and applicable only when the L3SAM1 bit is set.

Bit 2 L3SAM1 : Layer 3 IP SA Match Enable

When this bit is set, the Layer 3 IP Source Address field is enabled for matching. When this bit is reset, the MAC ignores the Layer 3 IP Source Address field for matching.

Note: When the L3PEN1 bit is set, you should set either this bit or the L3DAM1 bit because either IPv6 SA or DA can be checked for filtering.

Bit 1 Reserved, must be kept at reset value.

Bit 0 L3PEN1 : Layer 3 Protocol Enable

When this bit is set, the Layer 3 IP Source or Destination Address matching is enabled for IPv6 packets. When this bit is reset, the Layer 3 IP Source or Destination Address matching is enabled for IPv4 packets.

The Layer 3 matching is done only when the L3SAM1 or L3DAM1 bit is set.

Layer 4 address filter 1 register (ETH_MACL4A1R)

Address offset: 0x0934

Reset value: 0x0000 0000

31302928272625242322212019181716
L4DP1[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L4SP1[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:16 L4DP1[15:0] : Layer 4 Destination Port Number Field

When the L4PEN1 bit is reset and the L4DPM1 bit is set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with the TCP Destination Port Number field in the IPv4 or IPv6 packets.

When the L4PEN1 and L4DPM1 bits are set in L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with the UDP Destination Port Number field in the IPv4 or IPv6 packets.

Bits 15:0 L4SP1[15:0] : Layer 4 Source Port Number Field

When the L4PEN1 bit is reset and the L4DPM1 bit is set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with the TCP Source Port Number field in the IPv4 or IPv6 packets.

When the L4PEN1 and L4DPM1 bits are set in L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with the UDP Source Port Number field in the IPv4 or IPv6 packets.

Layer3 address 0 filter 1 Register (ETH_MACL3A01R)

Address offset: 0x0940

Reset value: 0x0000 0000

For IPv4 packets, the Layer 3 Address 0 filter 1 register contains the 32-bit IP Source Address field. For IPv6 packets, it contains Bits[31:0] of the 128-bit IP Source Address or Destination Address field.

31302928272625242322212019181716
L3A01[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L3A01[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:0 L3A01[31:0] : Layer 3 Address 0 Field

When the L3PEN1 and L3SAM1 bits are set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with Bits[31:0] of the IP Source Address field in the IPv6 packets.

When the L3PEN1 and L3DAM1 bits are set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with Bits[31:0] of the IP Destination Address field in the IPv6 packets.

When the L3PEN1 bit is reset and the L3SAM1 bit is set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with the IP Source Address field in the IPv4 packets.

Layer3 address 1 filter 1 register (ETH_MACL3A11R)

Address offset: 0x0944

Reset value: 0x0000 0000

For IPv4 packets, the Layer 3 Address 1 filter 1 register contains the 32-bit IP Destination Address field. For IPv6 packets, it contains Bits[63:32] of the 128-bit IP Source Address or Destination Address field.

31302928272625242322212019181716
L3A11[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L3A11[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 L3A11[31:0] : Layer 3 Address 1 Field

When the L3PEN1 and L3SAM1 bits are set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with Bits[63:32] of the IP Source Address field in the IPv6 packets.

When the L3PEN1 and L3DAM1 bits are set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with Bits[63:32] of the IP Destination Address field in the IPv6 packets.

When the L3PEN1 bit is reset and the L3SAM1 bit is set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with the IP Destination Address field in the IPv4 packets.

Layer3 address 2 filter 1 Register (ETH_MACL3A21R)

Address offset: 0x0948

Reset value: 0x0000 0000

The Layer 3 Address 2 filter 1 register is reserved for IPv4 packets. For IPv6 packets, it contains Bits[95:64] of 128-bit IP Source Address or Destination Address field.

31302928272625242322212019181716
L3A21[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L3A21[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 L3A21[31:0] : Layer 3 Address 2 Field

When the L3PEN1 and L3SAM1 bits are set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with Bits[95:64] of the IP Source Address field in the IPv6 packets.

When the L3PEN1 and L3DAM1 bits are set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with Bits[95:64] of the IP Destination Address field in the IPv6 packets.

When the L3PEN1 bit is reset in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field is not used.

Layer3 address 3 filter 1 register (ETH_MACL3A31R)

Address offset: 0x94C

Reset value: 0x0000 0000

The Layer 3 Address 3 filter 1 register is reserved for IPv4 packets. For IPv6 packets, it contains Bits[127:96] of 128-bit IP Source Address or Destination Address field.

31302928272625242322212019181716
L3A31[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
L3A31[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 L3A31[31:0] : Layer 3 Address 3 Field

When the L3PEN1 and L3SAM1 bits are set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with Bits[127:96] of the IP Source Address field in the IPv6 packets.

When the L3PEN1 and L3DAM1 bits are set in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field contains the value to be matched with Bits[127:96] of the IP Destination Address field in the IPv6 packets.

When the L3PEN1 bit is reset in the L3 and L4 control 1 register (ETH_MACL3L4C1R) , this field is not used.

Timestamp control Register (ETH_MACTSCR)

Address offset: 0x0B00

Reset value: 0x0000 2000

This register controls the operation of the System Time generator and processing of PTP packets for timestamping in the Receiver.

31302928272625242322212019181716
Res.Res.Res.AV8021ASMENRes.Res.Res.TXTSSSTMRes.Res.Res.Res.Res.TSENMADDRSNAPTYPESEL[1:0]
r/wr/wr/wr/wr/w
1514131211109876543210
TSMSTRENATSEVNTENATSIPV4ENATSIPV6ENATSIPENATSVER2ENATSCTRLSSRTSENARes.Res.TSADDRRes.TSUPDTTSINITTSCFUPDTTSENA
r/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w

Bits 31:29 Reserved, must be kept at reset value.

Bit 28 AV8021ASMEN : AV 802.1AS Mode Enable

When this bit is set, the MAC processes only untagged PTP over Ethernet packets for providing PTP status and capturing timestamp snapshots, that is, IEEE 802.1AS operating mode.

When PTP offload feature is enabled, for the purpose of PTP offload, the transport specific field in the PTP header is generated and checked based on the value of this bit.

Bits 27:25 Reserved, must be kept at reset value.

Bit 24 TXTSSSTM : Transmit Timestamp Status Mode

When this bit is set, the MAC overwrites the earlier transmit timestamp status even if it is not read by the software. The MAC indicates this by setting the TXTSSMIS bit of the Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) register.

When this bit is reset, the MAC ignores the timestamp status of current packet if the timestamp status of previous packet is not read by the software. The MAC indicates this by setting the TXTSSMIS bit of the Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) .

Bits 23:19 Reserved, must be kept at reset value.

  1. Bit 18 TSENMACADDR : Enable MAC Address for PTP Packet Filtering
    When this bit is set, the DA MAC address (that matches any MAC Address register) is used to filter the PTP packets when PTP is directly sent over Ethernet.
    When this bit is set, received PTP packets with DA containing a special multicast or unicast address that matches the one programmed in MAC address registers are considered for processing as indicated below, when PTP is directly sent over Ethernet.
    For normal timestamping operation, MAC address registers 0 to 31 is considered for unicast destination address matching.
    For PTP offload, only MAC address register 0 is considered for unicast destination address matching.
  2. Bits 17:16 SNAPTYPSEL[1:0] : Select PTP packets for Taking Snapshots
    These bits, along with Bits 15 and 14, define the set of PTP packet types for which snapshot needs to be taken. The encoding is given in Table 540: Timestamp Snapshot Dependency on ETH_MACTSCR bits .
  3. Bit 15 TSMSTRENA : Enable Snapshot for Messages Relevant to Master
    When this bit is set, the snapshot is taken only for the messages that are relevant to the master node. Otherwise, the snapshot is taken for the messages relevant to the slave node.
  4. Bit 14 TSEVNTENA : Enable Timestamp Snapshot for Event Messages
    When this bit is set, the timestamp snapshot is taken only for event messages (SYNC, Delay_Req, Pdelay_Req, or Pdelay_Resp). When this bit is reset, the snapshot is taken for all messages except Announce, Management, and Signaling. For more information about the timestamp snapshots, see Table 540: Timestamp Snapshot Dependency on ETH_MACTSCR bits .
  5. Bit 13 TSIPV4ENA : Enable Processing of PTP Packets Sent over IPv4-UDP
    When this bit is set, the MAC receiver processes the PTP packets encapsulated in IPv4-UDP packets. When this bit is reset, the MAC ignores the PTP transported over IPv4-UDP packets. This bit is set by default.
  6. Bit 12 TSIPV6ENA : Enable Processing of PTP Packets Sent over IPv6-UDP
    When this bit is set, the MAC receiver processes the PTP packets encapsulated in IPv6-UDP packets. When this bit is clear, the MAC ignores the PTP transported over IPv6-UDP packets.
  7. Bit 11 TSIPENA : Enable Processing of PTP over Ethernet Packets
    When this bit is set, the MAC receiver processes the PTP packets encapsulated directly in the Ethernet packets. When this bit is reset, the MAC ignores the PTP over Ethernet packets.
  8. Bit 10 TSVER2ENA : Enable PTP Packet Processing for Version 2 Format
    When this bit is set, the IEEE 1588 version 2 format is used to process the PTP packets. When this bit is reset, the IEEE 1588 version 1 format is used to process the PTP packets. The IEEE 1588 formats are described in 'PTP Processing and Control'.
  9. Bit 9 TSCTRLSSR : Timestamp Digital or Binary Rollover Control
    When this bit is set, the Timestamp Low register rolls over after 0x3B9A_C9FF value (that is, 1 nanosecond accuracy) and increments the timestamp (High) seconds. When this bit is reset, the rollover value of subsecond register is 0x7FFF_FFFF. The subsecond increment must be programmed correctly depending on the PTP reference clock frequency and the value of this bit.
  10. Bit 8 TSENALL : Enable Timestamp for All Packets
    When this bit is set, the timestamp snapshot is enabled for all packets received by the MAC.
  11. Bits 7:6 Reserved, must be kept at reset value.
Bit 5 TSADDREG : Update Addend Register

When this bit is set, the content of the Timestamp Addend register is updated in the PTP block for fine correction. This bit is cleared when the update is complete. This bit should be zero before it is set.

Bit 4 Reserved, must be kept at reset value.

Bit 3 TSUPDT : Update Timestamp

When this bit is set, the system time is updated (added or subtracted) with the value specified in System time seconds update register (ETH_MACSTSUR) and System time nanoseconds update register (ETH_MACSTNUR) .

This bit should be zero before updating it. This bit is reset when the update is complete in hardware.

Bit 2 TSINIT : Initialize Timestamp

When this bit is set, the system time is initialized (overwritten) with the value specified in the System time seconds update register (ETH_MACSTSUR) and System time nanoseconds update register (ETH_MACSTNUR) .

This bit should be zero before it is updated. This bit is reset when the initialization is complete.

Bit 1 TSCFUPDT : Fine or Coarse Timestamp Update

When this bit is set, the Fine method is used to update system timestamp. When this bit is reset, Coarse method is used to update the system timestamp.

Bit 0 TSSENA : Enable Timestamp

When this bit is set, the timestamp is added for Transmit and Receive packets. When disabled, timestamp is not added for transmit and receive packets and the Timestamp Generator is also suspended. You need to initialize the Timestamp (system time) after enabling this mode.

On the Receive side, the MAC processes the 1588 packets only if this bit is set.

Subsecond increment register (ETH_MACSSIR)

Address offset: 0x0B04

Reset value: 0x0000 0000

In Coarse Update mode (bit TSCFUPDT in Timestamp control Register (ETH_MACTSCR) ), the value in this register is added to the system time every clock cycle of clk_ptp_ref_i. In Fine Update mode, the value in this register is added to the system time whenever the Accumulator gets an overflow.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.SSINC[7:0]
rwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.

Bits 31:24 Reserved, must be kept at reset value.

Bits 23:16 SSINC[7:0] : Subsecond Increment Value

The value programmed in this field is accumulated every clock cycle (of clk_ptp_i) with the contents of the subsecond register. For example, when the PTP clock is 50 MHz (period is 20 ns), you should program 20 (0x14) when the System Time Nanoseconds register has an accuracy of 1 ns [TSCTRLSSR bit is set in Timestamp control Register (ETH_MACTSCR) ]. When TSCTRLSSR is cleared, the Nanoseconds register has a resolution of ~0.465 ns. In this case, you should program a value of 43 (0x2B) which is derived by 20 ns/0.465.

Bits 15:0 Reserved, must be kept at reset value.

System time seconds register (ETH_MACSTSR)

Address offset: 0x0B08

Reset value: 0x0000 0000

The System Time Seconds register, along with System Time Nanoseconds register, indicates the current value of the system time maintained by the MAC. Though it is updated on a continuous basis, there is some delay from the actual time because of clock domain transfer latencies (from clk_ptp_ref_i to CSR clock).

31302928272625242322212019181716
TSS[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
TSS[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 TSS[31:0] : Timestamp Second

The value in this field indicates the current value in seconds of the System Time maintained by the MAC.

System time nanoseconds register (ETH_MACSTNR)

Address offset: 0x0B0C

Reset value: 0x0000 0000

The System Time Nanoseconds register, along with System Time Seconds register, indicates the current value of the system time maintained by the MAC.

31302928272625242322212019181716
Res.TSSS[30:16]
rrrrrrrrrrrrrrr
1514131211109876543210
TSSS[15:0]
rrrrrrrrrrrrrrrr

Bit 31 Reserved, must be kept at reset value.

Bits 30:0 TSSS[30:0] : Timestamp subseconds

The value in this field has the subsecond representation of time, with an accuracy of 0.46 ns. When TSCTRLSSR is set in Timestamp control Register (ETH_MACTSCR) , each bit represents 1 ns. The maximum value is 0x3B9A_C9FF after which it rolls-over to zero.

System time seconds update register (ETH_MACSTSUR)

Address offset: 0x0B10

Reset value: 0x0000 0000

The System Time Seconds Update register, along with the System Time Nanoseconds update register, initializes or updates the system time maintained by the MAC. You must write both registers before setting the TSINIT or TSUPDT bits in Timestamp control Register (ETH_MACTSCR) .

31302928272625242322212019181716
TSS[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TSS[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 TSS[31:0] : Timestamp Seconds

The value in this field is the seconds part of the update.

When ADDSUB is reset, this field must be programmed with the seconds part of the update value.

When ADDSUB is set, this field must be programmed with the complement of the seconds part of the update value.

For example, to subtract 2.000000001 seconds from the system time, the TSS field in the ETH_MACSTSUR register must be 0xFFFF_FFFE (that is, \( 2^{32} - 2 \) ).

Caution: When the ADDSUB bit is set, TSSS[30:0] field cannot be set to 0 in System time nanoseconds update register (ETH_MACSTNUR) . The TSSS bitfield must be programmed to 0x7FFF_FFFF (resulting in –0.46 ns) even if 0 ns must be subtracted.

For example, to subtract 2.000000000 seconds from the system time, the TSS field in the System time seconds update register (ETH_MACSTSUR) must be 0xFFFF_FFFE (that is, \( 2^{32} - 1 \) ) and the System time nanoseconds update register (ETH_MACSTNUR) must be 0xFFFF_FFFF (ADDSUB = 1 and TSSS[30:0] field = 0x7FFF_FFFF)

System time nanoseconds update register (ETH_MACSTNUR)

Address offset: 0x0B14

Reset value: 0x0000 0000

31302928272625242322212019181716
ADD
SUB
TSSS[30:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TSSS[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 ADDSUB : Add or Subtract Time

When this bit is set, the time value is subtracted with the contents of the update register.
When this bit is reset, the time value is added with the contents of the update register.

Bits 30:0 TSSS[30:0] : Timestamp subseconds

The value in this field is the subseconds part of the update.

For example, to subtract 2.000000001 seconds from the system time, then the TSSS field in the ETH_MACSTNUR register must be 0x7FFF_FFFF (that is, \( 2^{31} - 1 \) ), when TSCTRLSSR bit in Timestamp control Register (ETH_MACTSCR) is reset and 0x3B9A_C9FF (that is, \( 10^9 - 1 \) ), when TSCTRLSSR bit in Timestamp control Register (ETH_MACTSCR) is set.

Caution: When the ADDSUB bit is set, TSSS[30:0] field cannot be set to 0. The TSSS bitfield must be programmed to 0x7FFF_FFFF (resulting in -0.46 ns) even if 0 ns must be subtracted.

For example, to subtract 2.000000000 seconds from the system time, System time nanoseconds update register (ETH_MACSTNUR) must be 0xFFFF_FFFF (ADDSUB = 1 and TSSS[30:0] = 0) and the TSS field in the System time seconds update register (ETH_MACSTSUR) must be 0xFFFF_FFFE (that is, \( 2^{32} - 1 \) ).

Timestamp addend register (ETH_MACTSAR)

Address offset: 0x0B18

Reset value: 0x0000_0000

This register value is used only when the system time is configured for Fine Update mode (TSCFUPDT bit in the Timestamp control Register (ETH_MACTSCR) ). The content of this register is added to a 32-bit accumulator in every clock cycle of clk_ptp_ref_i and the system time is updated whenever the accumulator overflows.

31302928272625242322212019181716
TSAR[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TSAR[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 TSAR[31:0] : Timestamp Addend Register

This field indicates the 32-bit time value to be added to the Accumulator register to achieve time synchronization.

Timestamp status register (ETH_MACTSSR)

Address offset: 0x0B20

Reset value: 0x0000 0000

All bits except Bits[27:25] gets cleared when the application reads this register.

31302928272625242322212019181716
Res.Res.ATSNS[4:0]ATSS
TM
Res.Res.Res.Res.ATSSTN[3:0]
rrrrrrc_rrc_rrc_rrc_rrc_r

1514131211109876543210
TXT
SSIS
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TSTRG
TERR0
AUXTS
TRIG
TSTAR
GT0
TSSOV
F
rc_rrc_rrc_rrc_rrc_r

Bits 31:30 Reserved, must be kept at reset value.

Bits 29:25 ATSNS[4:0] : Number of Auxiliary Timestamp Snapshots

This field indicates the number of Snapshots available in the FIFO. A value equal to the depth of FIFO (4) indicates that the Auxiliary Snapshot FIFO is full. These bits are cleared (to 00000) when the Auxiliary snapshot FIFO clear bit is set.

Bit 24 ATSSM : Auxiliary Timestamp Snapshot Trigger Missed

This bit is set when the Auxiliary timestamp snapshot FIFO is full and external trigger was set. This indicates that the latest snapshot is not stored in the FIFO.

Bits 23:20 Reserved, must be kept at reset value.

Bits 19:16 ATSSTN[3:0] : Auxiliary Timestamp Snapshot Trigger Identifier

These bits identify the Auxiliary trigger inputs for which the timestamp available in the Auxiliary Snapshot Register is applicable. When more than one bit is set at the same time, it means that corresponding auxiliary triggers were sampled at the same clock. These bits are applicable only if the number of Auxiliary snapshots is more than one. One bit is assigned for each trigger as shown in the following list:

Bit 16: Auxiliary trigger 0

Bit 17: Auxiliary trigger 1

Bit 18: Auxiliary trigger 2

Bit 19: Auxiliary trigger 3

The software can read this register to find the triggers that are set when the timestamp is taken.

Bit 15 TXTSSIS : Tx Timestamp Status Interrupt Status

When drop transmit status is enabled in MTL, this bit is set when the captured transmit timestamp is updated in the Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) and Tx timestamp status seconds register (ETH_MACTXTSSSR) .

When PTP offload feature is enabled, this bit is set when the captured transmit timestamp is updated in the Tx timestamp status nanoseconds register (ETH_MACTXTSSNR) and Tx timestamp status seconds register (ETH_MACTXTSSSR) , for PTO generated Delay Request and Pdelay request packets.

This bit is cleared when the Tx timestamp status seconds register (ETH_MACTXTSSSR) is read (or written to 1 when RCWE bit in CSR software control register (ETH_MACCSRWSWCR) is set).

Bits 14:4 Reserved, must be kept at reset value.

Bit 3 TSTRGTERRO : Timestamp Target Time Error

This bit is set when the latest target time programmed in the ETH_MACPPSTTSR and ETH_MACPPSTTSNR elapses (see PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) ). This bit is cleared when the application reads this bit (or writes it to 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bit 2 AUXTSTRIG : Auxiliary Timestamp Trigger Snapshot

This bit is set high when the auxiliary snapshot is written to the FIFO. This bit is cleared when the application reads this bit (or writes it to 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set).

Bit 1 TSTARTGT0 : Timestamp Target Time Reached

When set, this bit indicates that the value of system time is greater than or equal to the value specified in the ETH_MACPPSTTSR and ETH_MACPPSTTSNR registers (see PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) ).

This bit is cleared when the application reads this bit (or writes of 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set)

Bit 0 TSISOVF : Timestamp Seconds Overflow

When this bit is set, it indicates that the seconds value of the timestamp (when supporting version 2 format) has overflowed beyond 32'hFFFF_FFFF.

This bit is cleared when the application reads this bit (or writes it to 1 when RCWE bit in CSR software control register (ETH_MACCSRSWCR) is set)

Tx timestamp status nanoseconds register (ETH_MACTXTSSNR)

Address offset: 0x0B30

Reset value: 0x0000 0000

This register contains the nanosecond part of timestamp captured for Transmit packets when Tx status is disabled.

31302928272625242322212019181716
TXTSS
MIS
TXTSSLO[30:16]
rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_r
1514131211109876543210
TXTSSLO[15:0]
rc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_rrc_r
Bit 31 TXTSSMIS : Transmit Timestamp Status Missed

When this bit is set, it indicates one of the following:

Bits 30:0 TXTSSLO[30:0] : Transmit Timestamp Status Low

This field contains the 31 bits of the Nanoseconds field of the Transmit packet's captured timestamp.

Tx timestamp status seconds register (ETH_MACTXTSSSR)

Address offset: 0x0B34

Reset value: 0x0000 0000

The register contains the higher 32 bits of the timestamp (in seconds) captured when a PTP packet is transmitted.

31302928272625242322212019181716
TXTSSHI[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
TXTSSHI[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 TXTSSHI[31:0] : Transmit Timestamp Status High

This field contains the lower 32 bits of the Seconds field of Transmit packet's captured timestamp.

Auxiliary control register (ETH_MACACR)

Address offset: 0x0B40

Reset value: 0x0000 0000

The Auxiliary Timestamp Control register controls the Auxiliary Timestamp snapshot.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.ATSEN3ATSEN2ATSEN1ATSEN0Res.Res.Res.ATSFC
nwnwnwnwnw

Bits 31:8 Reserved, must be kept at reset value.

Bit 7 ATSEN3 : Auxiliary Snapshot 3 Enable

Bit 6 ATSEN2 : Auxiliary Snapshot 2 Enable

Bit 5 ATSEN1 : Auxiliary Snapshot 1 Enable

Bit 4 ATSEN0 : Auxiliary Snapshot 0 Enable

This bit controls the capturing of Auxiliary Snapshot Trigger 0. When this bit is set, the auxiliary snapshot of the event on eth_ptp_trg0 input is enabled. When this bit is reset, the events on this input are ignored.

Bits 3:1 Reserved, must be kept at reset value.

Bit 0 ATSFC : Auxiliary Snapshot FIFO Clear

When set, this bit resets the pointers of the Auxiliary Snapshot FIFO. This bit is cleared when the pointers are reset and the FIFO is empty. When this bit is high, the auxiliary snapshots are stored in the FIFO.

Auxiliary timestamp nanoseconds register (ETH_MACATSNR)

Address offset: 0x0B48

Reset value: 0x0000 0000

The Auxiliary timestamp nanoseconds register (ETH_MACATSNR) , along with Auxiliary timestamp seconds register (ETH_MACATSSR) , gives the 64-bit timestamp stored as auxiliary snapshot. These two registers form the read port of a 64-bit wide FIFO with a depth of 4 words.

You can store multiple snapshots in this FIFO. Bits[29:25] in Timestamp status register (ETH_MACTSSR) indicate the fill-level of the FIFO. The top of the FIFO is removed only when Auxiliary timestamp seconds register (ETH_MACATSSR) is read.

31302928272625242322212019181716
Res.AUXTSLO[30:16]
rrrrrrrrrrrrrrr
1514131211109876543210
AUXTSLO[15:0]
rrrrrrrrrrrrrrrr

Bit 31 Reserved, must be kept at reset value.

Bits 30:0 AUXTSLO[30:0] : Auxiliary Timestamp

Contains the lower 31 bits (nanoseconds field) of the auxiliary timestamp.

Auxiliary timestamp seconds register (ETH_MACATSSR)

Address offset: 0x0B4C

Reset value: 0x0000 0000

The Auxiliary Timestamp Seconds register contains the lower 32 bits of the Seconds field of the auxiliary timestamp register.

31302928272625242322212019181716
AUXTSHI[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
AUXTSHI[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 AUXTSHI[31:0] : Auxiliary Timestamp

Contains the lower 32 bits of the Seconds field of the auxiliary timestamp.

Timestamp Ingress asymmetric correction register (ETH_MACTSIACR)

Address offset: 0x0B50

Reset value: 0x0000 0000

The MAC Timestamp Ingress Asymmetry Correction register contains the Ingress Asymmetry Correction value to be used while updating correction field in PDelay_Resp PTP messages.

31302928272625242322212019181716
OSTIAC[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
OSTIAC[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 OSTIAC[31:0] : One-Step Timestamp Ingress Asymmetry Correction

This field contains the ingress path asymmetry value to be added to correctionField of Pdelay_Resp PTP packet. The programmed value should be in units of nanoseconds and multiplied by \( 2^{16} \) . For example, 2.5 ns is represented as 0x00028000.

The value can also be negative, which is represented in 2's complement form with bit 31 representing the sign bit.

Timestamp Egress asymmetric correction register (ETH_MACTSEACR)

Address offset: 0x0B54

Reset value: 0x0000 0000

The MAC Timestamp Egress Asymmetry Correction register contains the Egress Asymmetry Correction value to be used while updating the correction field in PDelay_Req PTP messages.

31302928272625242322212019181716
OSTEAC[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
OSTEAC[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 OSTEAC[31:0] : One-Step Timestamp Egress Asymmetry Correction

This field contains the egress path asymmetry value to be subtracted from correctionField of Pdelay_Resp PTP packet. The programmed value must be the negated value in units of nanoseconds multiplied by \( 2^{16} \) .

For example, if the required correction is +2.5 ns, the programmed value must be 0xFFFD_8000, which is the 2's complement of 0x0002_8000 ( \( 2.5 \cdot 2^{16} \) ). Similarly, if the required correction is -3.3 ns, the programmed value is 0x0003_4CCC ( \( 3.3 \cdot 2^{16} \) ).

Timestamp Ingress correction nanosecond register (ETH_MACTSICNR)

Address offset: 0x0B58

Reset value: 0x0000 0000

This register contains the correction value in nanoseconds to be used with the captured timestamp value in the ingress path.

31302928272625242322212019181716
TSIC[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TSIC[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:0 TSIC[31:0] : Timestamp Ingress Correction

This field contains the ingress path correction value as defined by the Ingress Correction expression.

Timestamp Egress correction nanosecond register (ETH_MACTSECNR)

Address offset: 0x0B5C

Reset value: 0x0000 0000

This register contains the correction value in nanoseconds to be used with the captured timestamp value in the egress path.

31302928272625242322212019181716
TSEC[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TSEC[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:0 TSEC[31:0] : Timestamp Egress Correction

This field contains the nanoseconds part of the egress path correction value as defined by the Egress Correction expression.

PPS control register (ETH_MACPPSCR)

Address offset: 0x0B70

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.TRGTMODSEL0
[1:0]
PPSEN
0
PPSCTRL[3:0]
rwrwrwrwrwrwrw

Bits 31:7 Reserved, must be kept at reset value.

Bits 6:5 TRGTMODSEL0[1:0] : Target Time Register Mode for PPS Output

This field indicates the Target Time registers ( PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) ) mode for PPS output signal:

00: Target Time registers are programmed only for generating the interrupt event.

01: Reserved, must not be used

10: Target Time registers are programmed for generating the interrupt event and starting or stopping the PPS output signal generation.

11: Target Time registers are programmed only for starting or stopping the PPS output signal generation. No interrupt is asserted.

Bit 4 PPSENO : Flexible PPS Output Mode Enable

When this bit is set, PPSCTRL[3:0] function as PPSCMD[3:0]. When this bit is reset, PPSCTRL[3:0] function as PPSCTRL (Fixed PPS mode).

Bits 3:0 PPSCTRL[3:0] : PPS Output Frequency Control

This field controls the frequency of the PPS output ( eth_ptp_pps_out ) signal. The default value of PPSCTRL is 0000, and the PPS output is 1 pulse (of width clk_ptp_i ) every second. For other values of PPSCTRL, the PPS output becomes a generated clock of following frequencies:

0001: The binary rollover is 2 Hz, and the digital rollover is 1 Hz.

0010: The binary rollover is 4 Hz, and the digital rollover is 2 Hz.

0011: The binary rollover is 8 Hz, and the digital rollover is 4 Hz.

0100: The binary rollover is 16 Hz, and the digital rollover is 8 Hz.

..

1111: The binary rollover is 32.768 KHz and the digital rollover is 16.384 KHz.

Note: In the binary rollover mode, the PPS output (eth_ptp_pps_out) has a duty cycle of 50 percent with these frequencies. In the digital rollover mode, the PPS output frequency is an average number. The actual clock is of different frequency that gets synchronized every second. For example:

This behavior is because of the non-linear toggling of bits in the digital rollover mode in the ETH_MACSTNR register.

PPS control register [alternate] (ETH_MACPPSCR)

Address offset: 0x0B70

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.TRGTMODSEL0
[1:0]
PPSEN
0
PPSCMD[3:0]
rwrwrwrwrwrwrw

Bits 31:7 Reserved, must be kept at reset value.

Bits 6:5 TRGTMODSEL0[1:0] : Target Time Register Mode for PPS Output

This field indicates the Target Time registers ( PPS target time seconds register (ETH_MACPPSTTSR) and PPS target time nanoseconds register (ETH_MACPPSTTNR) ) mode for PPS output signal:

00: Target Time registers are programmed only for generating the interrupt event.

01: Reserved, must not be used

10: Target Time registers are programmed for generating the interrupt event and starting or stopping the PPS output signal generation.

11: Target Time registers are programmed only for starting or stopping the PPS output signal generation. No interrupt is asserted.

Bit 4 PPSEN0 : Flexible PPS Output Mode Enable

When this bit is set, Bits[3:0] function as PPSCMD[3:0]. When this bit is reset, Bits[3:0] function as PPSCTRL(Fixed PPS mode).

Bits 3:0 PPSCMD[3:0] : Flexible PPS Output (eth_ptp_pps_out) Control

Programming these bits with a non-zero value instructs the MAC to initiate an event. When the command is transferred or synchronized to the PTP clock domain, these bits get cleared automatically. The software should ensure that these bits are programmed only when they are 'all zero'. The following list describes the values of PPSCMD0:

0000: No Command

0001: START Single Pulse.

This command generates single pulse rising at the start point defined in Target Time Registers (register 455 and 456) and of a duration defined in the PPS Width Register.

0010: START Pulse Train.

This command generates the train of pulses rising at the start point defined in the Target Time Registers and of a duration defined in the PPS Width Register and repeated at interval defined in the PPS Interval Register. By default, the PPS pulse train is free-running unless stopped by the 'Stop Pulse train at time' or 'Stop Pulse Train immediately' commands.

0011: Cancel START.

This command cancels the START Single Pulse and START Pulse Train commands if the system time has not crossed the programmed start time.

0100: STOP Pulse Train at time.

This command stops the train of pulses initiated by the START Pulse Train command (PPSCMD[3:0] = 0010) after the time programmed in the Target Time registers elapses.

0101: STOP Pulse Train immediately.

This command immediately stops the train of pulses initiated by the START Pulse Train command (PPSCMD[3:0] = 0010).

0110: Cancel STOP Pulse train.

This command cancels the STOP pulse train at time command if the programmed stop time has not elapsed. The PPS pulse train becomes free-running on the successful execution of this command.

0111 to 1111: Reserved, must not be used

PPS target time seconds register (ETH_MACPPSTTSR)

Address offset: 0x0B80

Reset value: 0x0000 0000

The PPS output Target Time Seconds register, along with PPS target time nanoseconds register (ETH_MACPPSTTNR) , is used to schedule an interrupt event (Bit TSSOVF of Timestamp status register (ETH_MACTSSR) ) when the system time exceeds the value programmed in these registers.

31302928272625242322212019181716
TSTRH0[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TSTRH0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:0 TSTRH0[31:0] : PPS Target Time Seconds Register

This field stores the time in seconds. When the timestamp value matches or exceeds both Target Timestamp registers, the MAC starts or stops the PPS signal output and generates an interrupt (if enabled) based on Target Time mode selected for the corresponding PPS output in the PPS control register (ETH_MACPPSCR) .

PPS target time nanoseconds register (ETH_MACPPSTTNR)

Address offset: 0x0B84

Reset value: 0x0000 0000

The PPS Target Time Nanoseconds register is present only when more than one Flexible PPS output is selected.

31302928272625242322212019181716
TRGTB
USY0
TTSL0[30:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TTSL0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bit 31 TRGTBUSY0 : PPS Target Time Register Busy

The MAC sets this bit when the PPSCMD0 field in the PPS control register (ETH_MACPPSCR) is programmed to 010 or 011. Programming the PPSCMD0 field to 010 or 011 instructs the MAC to synchronize the Target Time Registers to the PTP clock domain. The MAC clears this bit after synchronizing the Target Time Registers with the PTP clock domain. The application must not update the Target Time Registers when this bit is read as 1. Otherwise, the synchronization of the previous programmed time gets corrupted.

Bits 30:0 TTSL0[30:0] : Target Time Low for PPS Register

This register stores the time in (signed) nanoseconds. When the value of the timestamp matches the value in both Target Timestamp registers, the MAC starts or stops the PPS signal output and generates an interrupt (if enabled) based on the TRGTMODSEL0 field (Bits [6:5]) in PPS control register (ETH_MACPPSCR) .

When the TSCTRLSSR bit is set in the Timestamp control Register (ETH_MACCTSCR) , this value should not exceed 0x3B9A_C9FF. The actual start or stop time of the PPS signal output may have an error margin up to one unit of subsecond increment value.

PPS interval register (ETH_MACPPSIR)

Address offset: 0x0B88

Reset value: 0x0000 0000

The PPS Interval register contains the number of units of subsecond increment value between the rising edges of PPS output.

31302928272625242322212019181716
PPSINT0[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
PPSINT0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 PPSINT0[31:0] : PPS Output Signal Interval

These bits store the interval between the rising edges of PPS signal output. The interval is stored in terms of number of units of subsecond increment value.

You need to program one value less than the required interval. For example, if the PTP reference clock is 50 MHz (period of 20 ns), and desired interval between the rising edges of PPS signal output is 100 ns (that is, 5 units of subsecond increment value), you should program value 4 (5-1) in this register.

PPS width register (ETH_MACPPSWR)

Address offset: 0x0B8C

Reset value: 0x0000 0000

The PPS Width register contains the number of units of subsecond increment value between the rising and corresponding falling edges of PPS output.

31302928272625242322212019181716
PPSWIDTH0[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
PPSWIDTH0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 PPSWIDTH0[31:0] : PPS Output Signal Width

These bits store the width between the rising edge and corresponding falling edge of PPS signal output. The width is stored in terms of number of units of subsecond increment value.

You need to program one value less than the required interval. For example, if PTP reference clock is 50 MHz (period of 20 ns), and width between the rising and corresponding falling edges of PPS signal output is 80 ns (that is, four units of subsecond increment value), you should program value 3 (4-1) in this register.

Note: The value programmed in this register must be lesser than the value programmed in PPS interval register (ETH_MACPPSIR).

PTP Offload control register (ETH_MACPOCR)

Address offset: 0x0BC0

Reset value: 0x0000 0000

This register controls the PTP Offload Engine operation.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
DN[7:0]Res.DRRDISAPDRE QTRIGASYNC TRIGRes.APDRE QENASYNC ENPTOEN
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:8 DN[7:0] : Domain Number

This field indicates the domain Number in which the PTP node is operating.

Bit 7 Reserved, must be kept at reset value.

Bit 6 DRRDIS : Disable PTO Delay Request/Response response generation

When this bit is set, the Delay Request and Delay response are not generated for received SYNC and Delay request packet respectively, as required by the programmed mode.

Bit 5 APDREQTRIG : Automatic PTP Pdelay_Req message Trigger

When this bit is set, one PTP Pdelay_Req message is transmitted. This bit is automatically cleared after the PTP Pdelay_Req message is transmitted. The application should set the APDREQEN bit for this operation.

Bit 4 ASYNCTRIG : Automatic PTP SYNC message Trigger

When this bit is set, one PTP SYNC message is transmitted. This bit is automatically cleared after the PTP SYNC message is transmitted. The application should set the ASYNCEN bit for this operation.

Bit 3 Reserved, must be kept at reset value.

Bit 2 APDREQEN : Automatic PTP Pdelay_Req message Enable

When this bit is set, PTP Pdelay_Req message is generated periodically based on interval programmed or trigger from application, when the MAC is programmed to be in Peer-to-Peer Transparent mode.

Bit 1 ASYNCEN : Automatic PTP SYNC message Enable

When this bit is set, PTP SYNC message is generated periodically based on interval programmed or trigger from application, when the MAC is programmed to be in Clock Master mode.

Bit 0 PTOEN : PTP Offload Enable

When this bit is set, the PTP Offload feature is enabled.

PTP Source Port Identity 0 Register (ETH_MACSPI0R)

Address offset: 0x0BC4

Reset value: 0x0000 0000

This register contains Bits[31:0] of the 80-bit Source Port Identity of the PTP node.

31302928272625242322212019181716
SPI0[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SPI0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 SPI0[31:0] : Source Port Identity 0

This field indicates bits [31:0] of sourcePortIdentity of PTP node.

PTP Source port identity 1 register (ETH_MACSPI1R)

Address offset: 0x0BC8

Reset value: 0x0000 0000

This register contains Bits[63:32] of the 80-bit Source Port Identity of the PTP node.

31302928272625242322212019181716
SPI1[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SPI1[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 SPI1[31:0] : Source Port Identity 1

This field indicates bits [63:32] of sourcePortIdentity of PTP node.

PTP Source port identity 2 register (ETH_MACSPI2R)

Address offset: 0x0BCC

Reset value: 0x0000 0000

This register contains Bits[79:64] of the 80-bit Source Port Identity of the PTP node.

31302928272625242322212019181716
ResResResResResResResResResResResResResResResRes
1514131211109876543210
SPI2[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 SPI2[15:0] : Source Port Identity 2

This field indicates bits [79:64] of sourcePortIdentity of PTP node.

Log message interval register (ETH_MACLMIR)

Address offset: 0x0BD0

Reset value: 0x0000 0000

This register contains the periodic intervals for automatic PTP packet generation.

31302928272625242322212019181716
LMPDRI[7:0]ResResResResResResResRes
rwrwrwrwrwrwrwrw
1514131211109876543210
ResResResResResDRSYNCR[2:0]LSI[7:0]
rwrwrwrwrwrwrwrwrwrwrw

Bits 31:24 LMPDRI[7:0]: Log Min Pdelay_Req Interval

This field indicates logMinPdelayReqInterval of PTP node. This is used to schedule the periodic Pdelay request packet transmission. Allowed values are -15 to 15. Negative value must be represented in 2's-complement form. For example, if the required value is -1, the value programmed must be 0xFF.

Bits 23:11 Reserved, must be kept at reset value.

Bits 10:8 DRSYNCR[2:0]:

Delay_Req to SYNC Ratio

In Slave mode, it is used for controlling frequency of Delay_Req messages transmitted.

0: DelayReq generated for every received SYNC

1: DelayReq generated every alternate reception of SYNC

2: for every 4 SYNC messages

3: for every 8 SYNC messages

4: for every 16 SYNC messages

5: for every 32 SYNC messages

Others: Reserved, must not be used

The master sends this information (logMinDelayReqInterval) in the DelayResp PTP messages to the slave. The reception processes this value from the received DelayResp messages and updates this field accordingly. In the Slave mode, the host must not write/update this register unless it has to override the received value. In Master mode, the sum of this field and logSyncInterval (LSI) field is provided in the logMinDelayReqInterval field of the generated multicast Delay_Resp PTP message.

Bits 7:0 LSI[7:0]:

Log Sync Interval

This field indicates the periodicity of the automatically generated SYNC message when the PTP node is Master. Allowed values are -15 to 15. Negative value must be represented in 2's-complement form. For example, if the required value is -1, the value programmed must be 0xFF.

Ethernet MAC register map and reset values

Table 587. Ethernet MAC register map and reset values

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0000ETH_MACCRARPENSARC[2:0]IPCIPG[2:0]GPSLCES2KPCSTACSWDRes.JDJERes.FESDMLMECRSFDDODCRSDRRes.BL[1:0]Res.DCPRELEN[1:0]TERE
Reset value00000000000000000000000000000000
0x0004ETH_MACECRRes.Res.EIPG[4:0]EIPGENRes.Res.Res.Res.USPSPENDCRCCRes.Res.GPSL[13:0]
Reset value000000000000000000000000
0x0008ETH_MACPFRRARes.Res.Res.Res.Res.Res.Res.Res.DNTUIPFERes.Res.Res.VTFERes.Res.Res.Res.Res.HPFSAFSAIFPCF[1:0]Res.DBFPMDAIFHMCHUCPR
Reset value000000000000000
0x000CETH_MACWTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PWERes.Res.Res.Res.Res.WTO[3:0]
Reset value00000
0x0010ETH_MACHT0RHT31T0[31:0]
Reset value00000000000000000000000000000000
0x0014ETH_MACHT1RHT63T32[31:0]
Reset value00000000000000000000000000000000
0x0018 - 0x004CReserved
0x0050ETH_MACVTREIVLRXSRes.EIVLS[1:0]ERIVLTEDVLPVTHMEVLRXSRes.EVLS[1:0]DOVLTCERSVLMESVLVTIMETVVL[15:0]
Reset value000000000000000000000000000000
0x0054Reserved
0x0058ETH_MACVHTRRes.VLHT[15:0]
Reset value0000000000000000
0x005CReserved
0x0060ETH_MACVIRRes.VLTICSVLVLPVLC[1:0]VLT[15:0]
Reset value000000000000000000000

Table 587. Ethernet MAC register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0064ETH_MACVIRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.VLT[15:0]
Reset value000000000000000000000
0x0068 -
0x006C
Reserved
0x0070ETH_MACQTXFCRPT[15:0]Res.Res.Res.Res.Res.Res.Res.Res.DZPQPLT[2:0]Res.Res.TFEFCBBPA
Reset value0000000000000000000000
0x0074 -
0x008C
Reserved
0x0090ETH_MACRXFCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.UPRFE
Reset value00
0x0094-
0x00AC
Reserved
0x00B0ETH_MACISRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value
0x00B4ETH_MACIERRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value
0x00B8ETH_MACRTXSRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value
0x00BCReserved
0x00C0ETH_MACPCSRRWKFILTRSTRes.Res.RWKPTR[4:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value000000
0x00C4ETH_MACRWKPFRMACRWKPFR[31:0]
Reset value00000000000000000000000000000000
0x00C8 -
0x00CC
Reserved

Table 587. Ethernet MAC register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x00D0ETH_MACLCSRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.LPITCSELPITELPITXARes.PLSLPIENRes.Res.Res.Res.Res.Res.RLPISTTLPISTRes.Res.Res.Res.Res.RLPIEXRLPIENTLPIEXTLPIEN
Reset value00000000000
0x00D4ETH_MACLTCRRes.LST[9:0]TWT[15:0]
Reset value11111010000000000000000000
0x00D8ETH_MACLETRRes.LPIET[19:0]
Reset value00000000000000000000
0x00DCETH_MAC1USTCRRes.TIC_1US_CNTR[11:0]
Reset value000000000000
0x00E0 -
0x010C
Reserved
0x0110ETH_MACVRRes.USERVER[7:0]SNPSVER[7:0]
Reset value0011000101000010
0x0114ETH_MACDRRes.TFCSTS[1:0]TPESTSRes.RFCFCSTS[1:0]RPESTS
Reset value000000
0x0118Reserved
0x011CETH_MACHWF0RRes.ACTPHYSEL[2:0]SAVLININSTSSTSEL[1:0]MACADR64SELMACADR32SELADDMAADRSEL[4:0]Res.RXCOESELRes.TXCOESELEEESELTSSELRes.Res.ARPOFFSELMMCSSELMGKSELRWKSELSMASELVLHASHPCSELHDSELGMISELMISEL
Reset value00010100000111111111111011
0x0120ETH_MACHWF1RRes.L3L4FNUM[3:0]Res.HASHTBLSZ[1:0]POUOSTRes.RAVSELAVSELDBGMEMATSOENSPHENDCBENADDR64[1:0]ADVTHWORDPTOENOSTENTXFIFOSIZE[4:0]Res.RXFIFOSIZE[4:0]
Reset value0010010000100000110010000100
Table 587. Ethernet MAC register map and reset values (continued)
OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0124ETH_MACHWF2RRes.AUXSNAPNUM[2:0]Res.Res.PPSOUTNUM[2:0]Res.TDCSZ[1:0]TXHCNT[3:0]Res.RDCSZ[1:0]Res.RXHCNT[3:0]Res.Res.Res.TXQCNT[3:0]Res.Res.Res.RXQCNT[3:0]
Reset value1000010000000000000000000000
0x0128ETH_MACHWF3RRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DVLANCBTISELRes.NRVF[2:0]
Reset value10000
0x012C -
0x01FC
Reserved
0x0200ETH_MACMDIOARRes.Res.Res.Res.PSEBTBPA[4:0]RDA[4:0]Res.NTC[2:0]CR[3:0]Res.Res.Res.SKAPGOC[1:0]C45EMB
Reset value000000000000000000000000
0x0204ETH_MACMDIODRRA[15:0]MD[15:0]
Reset value00000000000000000000000000000000
0x0208 -
0x020C
Reserved
0x0210ETH_MACARPARARPPA[31:0]
Reset value00000000000000000000000000000000
0x0214 -
0x022C
Reserved
0x0230ETH_MACCCSRSWCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SEENRes.Res.Res.Res.Res.Res.Res.RCWE
Reset value00
0x0234 -
0x02FC
Reserved
0x0300ETH_MACA0HRAERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ADDRHI[15:0]
Reset value11111111111111111
0x0304ETH_MACA0LRADDRLO[31:0]
Reset value11111111111111111111111111111111
Table 587. Ethernet MAC register map and reset values (continued)
OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0308ETH_MACA1HRAESAMBC[5:0]Res.Res.Res.Res.Res.Res.Res.Res.ADDRHI[15:0]
Reset value000000001111111111111111
0x30CETH_MACA1LRADDRLO[31:0]
Reset value11111111111111111111111111111111
0x0310ETH_MACA2HRAESAMBC[5:0]Res.Res.Res.Res.Res.Res.Res.Res.ADDRHI[15:0]
Reset value00000000111111111111111
0x0314ETH_MACA2LRADDRLO[31:0]
Reset value11111111111111111111111111111111
0x0318ETH_MACA3HRAESAMBC[5:0]Res.Res.Res.Res.Res.Res.Res.Res.ADDRHI[15:0]
Reset value00000000111111111111111
0x031CETH_MACA3LRADDRLO[31:0]
Reset value11111111111111111111111111111111
0x0320 -
0x06FC
Reserved
0x0700ETH_MMC_
CONTROL
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.UCCDBCRes.Res.CNTPRSTLVLCNTPRSTCNTFREEZRSTONRDCNTSTOPROCNTRST
Reset value0000000
0x0704ETH_MMC_RX_
INTERRUPT
Res.Res.Res.Res.RXLPITRCISRXLPUIUSCISRes.Res.Res.Res.Res.Res.Res.Res.RXUCGPISRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RXALGNERPISRXRCERPIPISRes.Res.Res.Res.
Reset value00000
0x0708ETH_MMC_TX_
INTERRUPT
Res.Res.Res.Res.TXLPITRCISTXLPUIUSCISRes.Res.Res.Res.TXGPKTISRes.Res.Res.Res.Res.TXMCOLGPISTXSCOLGPISRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value00000

Table 587. Ethernet MAC register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x070CETH_MMC_RX_
INTERRUPT_
MASK
Res.Res.Res.Res.RXLPITRCIMRXLPIUSCIMRes.Res.Res.Res.Res.Res.Res.Res.RXUCGPIMRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RXALGNERPIMRXRCERPIMRes.Res.Res.Res.Res.
Reset value00000
0x0710ETH_MMC_TX_
INTERRUPT_
MASK
Res.Res.Res.Res.TXLPITRCIMTXLPIUSCIMRes.Res.Res.Res.TXGPKTIMRes.Res.Res.Res.Res.TXMCOLGPIMTXSCOLGPIMRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value00000
0x0714 -
0x0748
Reserved
0x074CETH_TX_SINGLE_
COLLISION_
GOOD_PACKETS
TXSNGLCOLG[31:0]
Reset value00000000000000000000000000000000
0x0750ETH_TX_MULTIPL
E_COLLISION_
GOOD_PACKETS
TXMULTCOLG[31:0]
Reset value00000000000000000000000000000000
0x0754 -
0x0764
Reserved
0x0768ETH_TX_PACKET_
COUNT_GOOD
TXPKTG[31:0]
Reset value00000000000000000000000000000000
0x076C -
0x0790
Reserved
0x0794ETH_RX_CRC_ER
ROR_PACKETS
RXCRCERR[31:0]
Reset value00000000000000000000000000000000
0x0798ETH_RX_
ALIGNMENT_
ERROR_
PACKETS
RXALGNERR[31:0]
Reset value00000000000000000000000000000000
0x079C -
0x07C0
Reserved
0x07C4ETH_RX_
UNICAST_
PACKETS_GOOD
RXUCASTG[31:0]
Reset value00000000000000000000000000000000

Table 587. Ethernet MAC register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x07C8 -
0x07E8
Reserved
0x07ECETH_TX_LPI_
USEC_CNTR
TXLPIUSC[31:0]
Reset value00000000000000000000000000000000
0x07F0ETH_TX_LPI_
TRAN_CNTR
TXLPITRC[31:0]
Reset value00000000000000000000000000000000
0x07F4ETH_RX_LPI_
USEC_CNTR
RXLPPIUSC[31:0]
Reset value00000000000000000000000000000000
0x07F8ETH_RX_LPI_
TRAN_CNTR
RXLPITRC[31:0]
Reset value00000000000000000000000000000000
0x07FC -
0x08FC
Reserved
0x0900ETH_
MACL3L4COR
ResResResResResResResResResResL4DPM0L4DPM0L4SPM0L4SPM0ResL4PEN0L3HDBM0[4:0]L3HSBM0[4:0]L3DAIM0L3DAM0L3SAIM0L3SAM0ResL3PEN0
Reset value000000000000000000000
0x0904ETH_MACL4A0RL4DP0[15:0]L4SP0[15:0]
Reset value00000000000000000000000000000000
0x0908 -
0x090C
Reserved
0x0910ETH_MACL3A00RL3A00[31:0]
Reset value00000000000000000000000000000000
0x0914ETH_MACL3A10RL3A10[31:0]
Reset value00000000000000000000000000000000
0x0918ETH_MACL3A20RL3A20[31:0]
Reset value00000000000000000000000000000000
0x091CETH_MACL3A30RL3A30[31:0]
Reset value00000000000000000000000000000000
0x0920 -
0x092C
Reserved

Table 587. Ethernet MAC register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0930ETH_
MACL3L4C1R
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.L4DPIM1L4DPM1L4SPIM1L4SPM1Res.L4PEN1L3HDBM1[4:0]L3HSBM1[4:0]L3DAIM1L3DAM1L3SAIM1L3SAM1Res.L3PEN1
Reset value00000000000000000000
0x0934ETH_MACL4A1RL4DP1[15:0]L4SP1[15:0]
Reset value00000000000000000000000000000000
0x0938 - 0x093CReserved
0x0940ETH_MACL3A01RL3A01[31:0]
Reset value00000000000000000000000000000000
0x0944ETH_MACL3A11RL3A11[31:0]
Reset value00000000000000000000000000000000
0x0948ETH_MACL3A21RL3A21[31:0]
Reset value00000000000000000000000000000000
0x094CETH_MACL3A31RL3A31[31:0]
Reset value00000000000000000000000000000000
0x0950 - 0x0AFCReserved
0x0B00ETH_MACTSCRRes.Res.Res.AV8021ASMENRes.Res.Res.TXTSTSTMRes.Res.Res.Res.Res.TSENMACADDRSNAPTYPSEL[1:0]TSMSTRENATSEVNTENATSIPV4ENATSIPV6ENATSIPENATSVER2ENATSCTRLSSRTSENALLRes.Res.TSADDREGRes.TSUPDTTSINITTSCFUPDTTSENA
Reset value00000010000000000
0x0B04ETH_MACSSIRRes.Res.Res.Res.Res.Res.Res.Res.SSINC[7:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value00000000
0x0B08ETH_MACSTSRTSS[31:0]
Reset value00000000000000000000000000000000
0x0B0CETH_MACSTNRRes.TSSS[30:0]
Reset value0000000000000000000000000000000
0x0B10ETH_MACSTSURTSS[31:0]
Reset value00000000000000000000000000000000
0x0B14ETH_MACSTNURADDSUBTSSS[30:0]
Reset value00000000000000000000000000000000
Table 587. Ethernet MAC register map and reset values (continued)
OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0B18ETH_MACTSARTSAR[31:0]
Reset value00000000000000000000000000000000
0x0B1CReserved
0x0B20ETH_MACTSSRRes.Res.ATSNS[4:0]ATSSTMRes.Res.Res.Res.ATSSTN[3:0]TXTSSISRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TSTRGTERROAUXTSTRIGTSTARGT0TSSOVF
Reset value00000000000000
0x0B24 -
0x0B2C
Reserved
0x0B30ETH_MACTXTSSNRTXTSSMISTXTSSLO[30:0]
Reset value00000000000000000000000000000000
0x0B34ETH_MACTXTSSSRTXTSSH[31:0]
Reset value00000000000000000000000000000000
0x0B38 -
0x0B3C
Reserved
0x0B40ETH_MACACRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ATSEN3ATSEN2ATSEN1ATSEN0Res.Res.Res.ATSFC
Reset value00000
0x0B44Reserved
0x0B48ETH_MACATSNRRes.AUXTSLO[30:0]
Reset value0000000000000000000000000000000
0x0B4CETH_MACATSSRAUXTSHI[31:0]
Reset value00000000000000000000000000000000
0x0B50ETH_MACTSIACROSTIAC[31:0]
Reset value00000000000000000000000000000000
0x0B54ETH_MACTSEACROSTEAC[31:0]
Reset value00000000000000000000000000000000
0x0B58ETH_MACTSICNRTSIC[31:0]
Reset value00000000000000000000000000000000
0x0B5CETH_MACTSECNRTSEC[31:0]
Reset value00000000000000000000000000000000

Table 587. Ethernet MAC register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0B60 -
0x0B6C
Reserved
0x0B70ETH_MACPPSCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TRGTMODSEL0[1:0]PPSENORes.PPSCTRL[3:0]
Reset value0000000
0x0B70ETH_MACPPSCR
(alternate)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TRGTMODSEL0[1:0]PPSENORes.PPSCMD[3:0]
Reset value0000000
0x0B74 -
0x0B7C
Reserved
0x0B80ETH_MACPSTTSRTSTRH0[31:0]
Reset value00000000000000000000000000000000
0x0B84ETH_MACPSTTNRTRGTBUSY0TTSL0[30:0]
Reset value00000000000000000000000000000000
0x0B88ETH_MACPPSIRPPSINT0[31:0]
Reset value00000000000000000000000000000000
0x0B8CETH_MACPPSWRPPSWIDTH0[31:0]
Reset value00000000000000000000000000000000
0x0B90 -
0x0BBC
Reserved
0x0BC0ETH_MACPOCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DN[7:0]Res.DRRDISAPDREQTRIGASYNCTRIGRes.APDREQENASYNCENPTOEN
Reset value00000000000000
0x0BC4ETH_MACSPI0RSPI0[31:0]
Reset value00000000000000000000000000000000

Table 587. Ethernet MAC register map and reset values (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x0BC8ETH_MACSPI1RSPI1[31:0]
Reset value00000000000000000000000000000000
0x0BCCETH_MACSPI2RResResResResResResResResResResResResResResResResSPI2[15:0]
Reset value000000000000000
0x0BD0ETH_MACLMIRLMPDRI[7:0]ResResResResResResResResResResResResResDRSYNCR[2:0]LSI[7:0]
Reset value000000000000000000

Refer to Section 2.3 on page 129 for the register boundary addresses.