91. Ethernet subsystem overview (ETHSS)
91.1 Introduction
This section describes the STM32MP23/25xx Ethernet subsystem.
The Ethernet subsystem includes two independent TSN Gigabit Ethernet controllers and a three-port TSN Gigabit switch. An acceleration module bridges the two external ports of the switch to support very low latency use-cases (such as motion control).
This section includes the subsystem overview, details the interconnections between the peripherals and provides the subsystem-related registers description.
For more information on:
- • the Ethernet controller, refer to Section 92: Ethernet (ETH): gigabit media access control (GMAC) with DMA controller
- • the Ethernet switch, refer to Section 93: Ethernet switch (ETHSW)
- • the acceleration module, refer to Section 94: Ethernet switch acceleration module (ETHSW_ACM)
91.2 ETHSS main features
- • Two fully independent instances of 10/100/1G Ethernet MAC controller, enabling transmission and reception of data over Ethernet, in compliance with IEEE 802.3-2008. Each Ethernet MAC controller is connected to an external Ethernet PHY via a standard media independent interface (MII/RMII/RGMII)
- • A three-port Ethernet switch (ETHSW) with TSN (time sensitive networking) functionalities for deterministic and low-latency traffic:
- – two RMII/RGMII external ports
- – a third port connected to the ETH1 Ethernet controller
- • An acceleration module (ETHSW_ACM) tightly coupled with the Ethernet switch, with ultra-low latency cut-through operation
- • Possibility to handle the PTP system time as follows:
- – Internal system time: each Ethernet controller handles it own system time.
- – External system time: the Ethernet controllers are synchronized with system time managed in the switch, for a global Ethernet subsystem synchronization.
- • Ethernet switch bypass for direct connection between the ETH1 Ethernet controller and ETH1 port
91.3 ETHSS functional description
91.3.1 ETHSS block diagram
Figure 1068 shows the main components of the Ethernet subsystem.
Figure 1068. Ethernet subsystem block diagram

The diagram illustrates the Ethernet subsystem (ETHSS) architecture. At the top, two 1G Ethernet controllers, ETH1 and ETH2, are shown, both supporting IEEE1588/AVB/TSN. ETH1 is connected to a multiplexer with inputs '1' and '0'. Input '1' is labeled 'Ethernet switch bypass (ETH1_DIRECT)'. The output of this multiplexer connects to the 'Time sensitive networking (TSN) Ethernet switch (ETHSW)'. ETH2 is connected directly to the ETHSW. The ETHSW has two output paths, each labeled 'RMII' and 'RGMII'. These paths lead to a block labeled 'Ultra-low latency cut-through (ETHSW_ACM)'. The output of the ETHSW_ACM block leads to another multiplexer with inputs '1' and '0'. Input '0' is labeled 'ETH1_DIRECT'. The output of this second multiplexer connects to the 'ETH1 Port', which supports 'MII/RMII/RGMII' interfaces. The ETHSW also has a direct connection to the 'ETH3 Port', which supports 'RMII/RGMII' interfaces. The ETH2 controller connects to the 'ETH2 Port', which supports 'MII/RMII/RGMII' interfaces. The reference ID 'MSv68366V2' is located in the bottom right corner of the diagram area.
91.3.2 ETHSS pins and internal signals
The ETHSS features two Ethernet controllers (ETH1 and ETH2), a three-port Gigabit Ethernet switch (ETHSW) and a cut-through accelerator (ETHSW_ACM). They share three external ports ETH1, ETH2 and ETH3:
- • ETH1 port can be connected directly the ETH1 Ethernet controller when the ETH1_DIRECT bit is set (in SYSCFG_ETHSWCR register), or to the port 2 of the Ethernet switch (ETH1_DIRECT = 0). In this case the RMII and RGMII interfaces are only supported (no MII support).
- • ETH2 port is connected to the ETH2 controller.
- • ETH3 port is connected to the port 1 of the Ethernet switch, and only support RMII and RGMII interfaces.
The port 0 of the switch is internally connected to the ETH1 controller and is used in RGMII MAC-to-MAC mode.
Figure 1069 shows a simplified view of ETHSS pins (the MII/RMII and RGMII signals are detailed in Section 93: Ethernet switch (ETHSW) and Section 92: Ethernet (ETH): gigabit media access control (GMAC) with DMA controller).
Figure 1069. ETHSS external signals (simplified view)

The diagram illustrates the Ethernet subsystem (ETHSS) architecture. It features two main Ethernet controllers, ETH1 and ETH2. ETH1 is connected to a switch (ETHSW) via Port 0, and ETH2 is connected via Port 1. The ETHSW also includes Port 2 and an Ethernet Switch Access Control Module (ETHSW_ACM). The system supports multiple interface types: MII/RMII/RGMII and RGMII. External signals for ETH1 and ETH2 include MDC, MDIO, PPS_OUT, and PTP_AUX_TS. A switch bypass mode is controlled by the ETH1_DIRECT signal, which can be set to 1 or 0. The ETH3 port is connected to the ETHSW via Port 2. The diagram also shows the connection of ETH1_DIRECT to the ETHSW_ACM and the ETHSW. The ETH3 port is connected to the ETHSW via Port 2. The ETH3 port is connected to the ETHSW via Port 2. The ETH3 port is connected to the ETHSW via Port 2.
The auxiliary timestamp inputs (ETHx_PTP_AUX_TS pins) and management inputs/outputs are connected to the ETH1 and ETH2 controllers only. The PHY connected to ETH3 port must therefore be configured using ETH1_MDC and ETH1_MDIO pins, or ETH2_MDC and ETH2_MDIO pins.
PHY interface selection
The interface selection is done in the system configuration controller (SYSCFG).
The ETH1 and ETH2 port PHY interface selection is done using ETH1_SEL[2:0] in SYSCFG_ETH1CR, and ETH2_SEL[2:0] in SYSCFG_ETH2CR. This is done on the Ethernet controller side, not on port side.
When ETH1_DIRECT = 1 (switch bypass mode), ETH1_SEL[2:0] defines the interface on ETH1 port.
When ETH1_DIRECT = 0 (switch enabled), ETH1_SEL[2:0] must be set to 0b001 (RGMII interface used for ETH1 to ETHSW port 0 connection). ETH1 and ETH3 ports are controlled by the ETHSW, and the interface type (RMII or RGMII) is defined using ETHSW_CFG_IF_SEL bit in SYSCFG_ETHSWCR.
Table 891. PHY interface selection
| ETH1_DIRECT | ETH1 port | ETH2 port | ETH3 port |
|---|---|---|---|
| 0 (ETHSW enabled) |
| ETH2 port connected to ETH2 controller and configured through ETH2_SEL2[2:0] |
|
| 1 (ETHSW bypassed) | ETH1 port connected to PHY and configured through ETH1_SEL2[2:0] | NA |
Internal connections
The figure below represents the internal connection within the Ethernet subsystem and with the other peripherals.
Figure 1070. Ethernet subsystem internal signals

The diagram illustrates the internal signal connections within the Ethernet subsystem. It features four main blocks: TIM2, TIM3, ETH1, and ETH2, all interfacing with a central ETHSW block.
- TIM2 (top left) receives inputs: eth1_ptp_pps_out, eth2_ptp_pps_out, eth1_ptp_pps_out, eth2_ptp_pps_out, PCIe ptm_local_clock[17], and PCIe ptm_local_clock[20]. It outputs tim2_trgo to ETH2 and tim2_trgo to ETH1.
- TIM3 (top right) receives inputs: eth1_ptp_pps_out, eth2_ptp_pps_out, eth1_ptp_pps_out, eth2_ptp_pps_out, PCIe ptm_local_clock[17], and PCIe ptm_local_clock[20]. It outputs tim3_trgo to ETH1 and tim3_trgo to ETH2.
- ETH1 (middle left) receives inputs: eth1_ptp_aux_ts_trig0, eth1_ptp_aux_ts_trig1, eth1_ptp_aux_ts_trig2, eth1_ptp_aux_ts_trig3, eth1_ptp_pps_out, and eth1_ptp_timestamp_i[63:0]. It outputs ETH1_PTP_AUX_TS and ETH1_PPS_OUT.
- ETH2 (middle right) receives inputs: eth2_ptp_aux_ts_trig0, eth2_ptp_aux_ts_trig1, eth2_ptp_aux_ts_trig2, eth2_ptp_aux_ts_trig3, eth2_ptp_timestamp_i[63:0], and eth2_ptp_pps_out. It outputs ETH2_PTP_AUX_TS and ETH2_PPS_OUT.
- ETHSW (bottom center) receives ethsw_time_data[79:16] and outputs to TIM2, TIM3, ETH1, and ETH2.
- External Signals at the bottom include ETH1_PTP_AUX_TS, ETH1_PPS_OUT, ETH3_PPS_OUT, ETH2_PPS_OUT, and ETH2_PTP_AUX_TS. A PCIe ptm_local_clock[20] signal is shown entering from the left and right sides.
MSv68797V2
Auxiliary timestamp inputs
ETH1 and ETH2 have four auxiliary timestamp inputs, which can be connected to:
- • TIM2 or TIM3 tim_trgo outputs, to simultaneously timestamp in the two Ethernet controllers when each one run in a different PTP clock domain.
- • ETHx_PTP_AUX_TS pins, to timestamp with an external signal (such as GPS)
- • bit 20 of the PCIE ptm_local_clock bus, to synchronize the PTM and the PTP clocks
PPS outputs
ethx_ptp_pps_out outputs are available off-chip as alternate functions, but can also be used internally. They are connected to the following inputs of TIM2 and TIM3 timers:
- • tim_etrx pins, to serve as timer counter clock source or as a trigger to start/reset the timer (for example for PTP synchronized PWM)
- • tim_tix_in pins, to measure PTP time intervals and trigger counter captures. In this case, they can also be used to synchronize the PTM and the PTP clocks, together with the bit 17 and 20 of the PCIE ptm_local_clock bus, connected to adjacent timer input.
The PPS outputs can be configured as regular pulse-per-second outputs or in Flexible PPS mode to provide a programmable train of pulses. They can also be used to synchronize software tasks on the PTP clock.
System time source selection
The IEEE 802.1AS-Rev draft defines a “system time” (also known as “gPTP clock”) that is shared among all Ethernet nodes, and one node in the system known as “grandmaster” reference. All other Ethernet nodes implement a “slave clock”, which is periodically synchronized with the “grandmaster” clock.
The Ethernet controller can be configured by software in one of the following two modes:
- • External system time mode
This mode assumes that the “system time” is already generated by the ETHSW switch, and that this “system time” is provided to the Ethernet controller through the eth_ptp_timestamp_i[63:0] input. - • Internal system time mode
This mode assumes that the “system clock” is generated internally by the Ethernet controller. If an external “grandmaster” is present on the Ethernet network, it periodically synchronizes itself with it. If no “grandmaster” is present on the network, ETH1 and/or ETH2 can play this role. In this mode the eth_ptp_timestamp_i[63:0] input is not used.
ETH1 and ETH2 controller can be disciplined to the PTP clock of the ETHSW Ethernet switch, when the gPTP protocol is running on the switch. This allows the synchronization of the TSN traffic with ETH and ETHSW, using a unique clock reference.
The only source for eth_ptp_timestamp_i is the ethsw_time_data bus from ETHSW. This can be selected using the ETH1_PTP_CLK_SEL or ETH2_PTP_CLK_SEL bit, and by configuring the ETH to operate in External system time mode.
The PTP system time buses have different widths, 64-bit for ETH and 96-bit for ETHSW, but can be interconnected. The eth_ptp_timestamp_i[63:0] bus is connected to the ethsw_time_data[79:16] bus as follows:
- • ethsw_time_data[15:0] bits (subnanoseconds) are not used.
- • ethsw_time_data[45:16] bits (nanoseconds) are connected to eth_ptp_timestamp_i[29:0].
- • ethsw_time_data[47:46] bits are not used.
- • ethsw_time_data[79:48] bits (seconds) are connected to eth_ptp_timestamp_i[63:32].
- • ethsw_time_data[96:80] bits (most significant 16-bit of the seconds part) are not used.
The maximum value of the lower 32 bits of the system time is 999,999,999 decimal (0x3B9A C9FF) and it wraps to 0 when reaching this value (representing a full second). The ETH peripheral must be in digital rollover mode (TSCTRLSSR bit = 1 in ETH_MACTSCR) to be compatible with the system time format provided by the ETHSW.
The external system time mode must be enabled in ETH1 when using the ETHSW so that the “system time” is provided to ETH1, to have synchronized TSN traffic. This also means ETH1 Flexible PPS output is available and synchronized. The synchronization can also be extended to the ETH2 controller.
ETHSW_ACM
The Ethernet switch acceleration module (ETHSW_ACM) is tightly coupled with the ETHSW switch. It inherits the ports setting defined by the ETHSW and does not have external pins.
91.3.3 ETHSS clocks
The clocking scheme of the Ethernet subsystem peripherals is detailed in the RCC section.
The control bits are located in the following registers:
- • RCC Ethernet 1 configuration register (RCC_ETH1CFGR)
- • RCC Ethernet 2 configuration register (RCC_ETH2CFGR)
- • RCC Ethernet switch configuration register (RCC_ETHSWCFGR)
- • RCC Ethernet switch ACM configuration register (RCC_ETHSWACMCFGR)
- • RCC Ethernet switch ACM message configuration register (RCC_ETHSWACMMMSGCFGR)
- • SYSCFG Ethernet1 control register (SYSCFG_ETH1CR)
- • SYSCFG Ethernet1 status register (SYSCFG_ETH1SR)
- • SYSCFG Ethernet2 configuration register (SYSCFG_ETH2CR)
- • SYSCFG Ethernet2 status register (SYSCFG_ETH2SR)
- • SYSCFG Ethernet switch configuration register (SYSCFG_ETHSWCR)