跳到主要内容

14.3 Ethernet GMAC

14.3.1 Overview

The K3 SoC integrates four GMAC interfaces for Ethernet communication.

Controller Architecture:

  • Based on Synopsys DesignWare Ethernet QoS controller
  • Complies with IEEE 802.3-2015 standard
  • Consists of three modules: MAC, MTL, and DMA

Interface Support:

  • Application side: AXI interface
  • PHY side: MII, RMII, and RGMII
  • Link speeds: 10/100/1000 Mbps

Key Capabilities:

  • Packet filtering
  • Hardware offload functions
  • Flow control
  • PTP time synchronization
  • Energy Efficient Ethernet (EEE)
  • Time-Sensitive Networking (TSN)

Applications:

  • AV bridges and nodes
  • Network switches
  • Network interface cards
  • Data center bridges and nodes

14.3.2 Features

14.3.2.1 MAC Features

  • Supports MII, RMII, and RGMII interface modes
  • Supports 10/100/1000 Mbps link speeds
  • Supports automatic CRC generation and stripping
  • Supports standard Ethernet frames
  • Supports jumbo frames
  • Supports source address insertion and replacement
  • Supports VLAN tag insertion, replacement, and removal
  • Supports VLAN filtering on received packets
  • Supports destination address filtering
  • Supports source address filtering
  • Supports perfect match filtering
  • Supports hash filtering
  • Supports promiscuous mode
  • Supports Layer 3 filtering
  • Supports Layer 4 filtering
  • Supports IPv4 packet filtering
  • Supports IPv6 packet filtering
  • Supports TCP packet filtering
  • Supports UDP packet filtering
  • Supports IEEE 802.3x Pause frame flow control
  • Supports Priority Flow Control (PFC)
  • Supports half-duplex backpressure flow control
  • Supports transmit and receive timestamping
  • Supports one-step timestamping
  • Supports two-step timestamping
  • Supports one PPS output
  • Supports Wake-on-LAN (WoL)
  • Supports MAC loopback mode

14.3.2.2 MTL Features

  • Supports programmable burst length
  • Supports up to four Tx/Rx queues
  • Supports Store-and-Forward mode
  • Supports Threshold mode
  • Supports Strict Priority (SP) scheduling
  • Supports Weighted Round Robin (WRR) scheduling
  • Supports Deficit Weighted Round Robin (DWRR) scheduling
  • Supports Weighted Fair Queuing (WFQ) scheduling
  • Supports Credit Based Shaper (CBS)
  • Supports Enhancements for Scheduled Traffic (EST)
  • Supports frame preemption
  • Supports Time Based Scheduling (TBS)

14.3.2.3 DMA Features

  • Supports up to four Tx/Rx DMA channels
  • Supports TCP Segmentation Offload (TSO)
  • Supports checksum insertion on transmit packets
  • Supports checksum checking on received packets
  • Supports IPv4 checksum offload
  • Supports TCP checksum offload
  • Supports UDP checksum offload
  • Supports ICMP checksum offload
  • Supports header/payload split storage
  • Supports ARP offload
  • Supports packet routing to different channels based on priority
  • Supports packet routing to different channels based on VLAN priority

14.3.3 Signal Descriptions

SignalDescription
RXDVReceive control signal. In MII mode, this pin is used as RXDV. In RMII mode, it is multiplexed as CRS_DV. In RGMII mode, it is multiplexed as RX_CTL.
RX_D0Receive data bit 0. Used in MII, RMII, and RGMII modes.
RX_D1Receive data bit 1. Used in MII, RMII, and RGMII modes.
RX_CLKReceive/reference clock signal. In MII mode, this pin is used as RX_CLK. In RMII mode, this pin is unused and should be left unconnected. In RGMII mode, it is used as RX_CLK.
RX_D2Receive data bit 2. Used in RGMII mode only.
RX_D3Receive data bit 3. Used in RGMII mode only.
TX_D0Transmit data bit 0. Used in MII, RMII, and RGMII modes.
TX_D1Transmit data bit 1. Used in MII, RMII, and RGMII modes.
TX_CLKTransmit/reference clock signal. In RGMII mode, this pin is used as TX_CLK and may operate as either an input or output depending on the clock configuration. In RMII mode, it is used as REF_CLK and receives the reference clock from the PHY.
TX_D2Transmit data bit 2. Used in RGMII mode only.
TX_D3Transmit data bit 3. Used in RGMII mode only.
TX_ENTransmit control signal. In MII and RMII modes, this pin is used as TX_EN. In RGMII mode, it is multiplexed as TX_CTL.
MDCManagement Data Clock for the MDIO interface. Used to drive PHY management transactions.
MDIOManagement Data Input/Output for the MDIO interface. Used to access PHY registers.
INT_NInterrupt input from the PHY, active low.
RXERReceive error indication signal. Used in MII mode only.
TXERTransmit error indication signal. Used in MII mode only.
CRSCarrier sense signal. Used in MII mode only.
COLCollision detect signal. Used in MII mode only.
PPSPulse Per Second output.
CLK_REFOptional reference clock output for the external PHY. It can be used as the PHY reference clock source in place of an external 25 MHz crystal.

14.3.4 Register Description

All four GMAC controllers each have two platform registers: a control register (CTRL) and a delay line register (DLINE). Their base addresses and offsets are as follows:

  • GMAC0
    • CTRL register: base = 0xd4282be4, offset = 0x3e4
    • DLINE register: base = 0xd4282be4, offset = 0x3e8
  • GMAC1
    • CTRL register: base = 0xd4282be4, offset = 0x3ec
    • DLINE register: base = 0xd4282be4, offset = 0x3f0
  • GMAC2
    • CTRL register: base = 0xd4282be4, offset = 0x248
    • DLINE register: base = 0xd4282be4, offset = 0x24c
  • GMAC3
    • CTRL register: base = 0xc0880000, offset = 0x0e4
    • DLINE register: base = 0xc0880000, offset = 0x0e8

Below, the descriptions of these two registers are provided for GMAC0 as an example; the bit definitions for the corresponding registers in the other GMAC controllers are identical.

14.3.4.1 GMAC0 CTRL Register

BitsField (Code)TypeResetDescription
31:16RSVDRO0Reserved for future use
15EMAC0_1588_CLK_MUXRW0x01 = PLL 125 MHz/25 MHz/2.5 MHz (matches the current speed mode: 1000M/100M/10M)
0 = 24M
14EMAC0_CLK_REF_GATERW0x01 = tx 25M refclk disable
0 = tx 25M refclk enable
13EMAC0_AXI_MST_IDRW0x01 = EMAC0 AXI MST interface uses a single ID to issue transfers
0 = EMAC0 AXI MST interface uses multiple IDs to issue transfers
12EMAC0_PHY_INTR_ENRW0x01 = EMAC0 PHY PMT Intr MASK enable
0 = EMAC0 PHY PMT Intr MASK disable
11:10RSVDRO0Reserved for future use
9EMAC0_LPI_INTR_ENRW0x01 = EMAC0 LPI Intr MASK enable
0 = EMAC0 LPI Intr MASK disable
8EMAC0_RGMII_TXC_SRC_SELRW0x0This bit is only valid in RGMII mode.
1 = tx clock source from SoC
0 = tx clock source from RX clock
7EMAC_RX_REFCLK_PHASE_SELRW0x0EMAC0 RX REFCLK PHASE SEL
1 = REFCLK inv
0 = REFCLK
6EMAC_RMII_TX_REFCLK_PHASE_SELRW0x0EMAC0 RMII TX REFCLK PHASE SEL
1 = RMII REFCLK inv
0 = RMII REFCLK
5RSVDRO0Reserved for future use
4:3EMAC0_PHY_SELECTRW0x0EMAC0 PHY SELECT
2'b11 = MII
2'b01 = RGMII
2'b00 = RMII
2RSVDRO0Reserved for future use
1EMAC0_BUS_RSTRW0x0EMAC0 AXI Bus Reset
1 = Reset Release (deasserted)
0 = Reset
0EMAC0_BUS_ENRW0x0EMAC0 AXI Bus Clock Enable
1 = AXI clock enabled
0 = AXI clock disabled

14.3.4.2 GMAC0 DLINE Register

BitsField (Code)TypeResetDescription
31:24EMAC0_RGMII_TXC_DLINE_ADJRW0x0Delay code
23:22RSVDRO0Reserved for future use
21:20EMAC0_RGMII_TXC_DLINE_STEPRW0x0Delay step:
2'b00: 15.6 ps,
2'b01: 24.4 ps,
2'b10: 29.7 ps,
2'b11: 35.1 ps
19:17RSVDRO0Reserved for future use
16EMAC0_RGMII_TXC_DLINE_PURW0x0Delay line enable
15:8EMAC0_RGMII_RXC_DLINE_ADJRW0x0Delay code
7:6RSVDRO0Reserved for future use
5:4EMAC0_RGMII_RXC_DLINE_STEPRW0x0Delay step:
2'b00: 15.6 ps,
2'b01: 24.4 ps,
2'b10: 29.7 ps,
2'b11: 35.1 ps
3:1RSVDRO0Reserved for future use
0EMAC0_RGMII_RXC_DLINE_PURW0x0Delay line enable