How to configure Ethernet switch

Revision as of 09:38, 27 October 2023 by Registered User (→‎Ethernet switch interface)
Applicable for Unknown MPU

"STM32MP25" is not in the list (STM32MP13x, STM32MP15x, STM32MP25x) of allowed values for the "Has applicability specified for" property.

1. Purpose[edit source]

This article describes how to configure the Ethernet switch.

2. For GMAC standalone configuration[edit source]

100% same sequence than MP1

3. For Switch configuration[edit source]

ETH1  Stm32-deip glue  edge-lkml File describing the probe scheme are located on board in:


During edge-lkml probe, the interface on which the switch internal port is connected is given as parameter:

 Ex: edgx_pfm_lkm netif="end1:0"
 In: /etc/modprobe.d/edgx_sw_core.conf

3.1. Ethernet switch interface[edit source]

Alternate text
Ethernet Switch interfaces

Use ifconfig to list interfaces:

end0: standalone GMAC interface

end1: SW interface for ETH1 GMAC Connected to switch internal port Will not have IP address!

Sw0p1: Internal port interface Will not have IP address!

Sw0p2: External port interface connected to ETH3 port Will not have IP address!

Sw0p3: External port interface connected to ETH1 port Will not have IP address!

Sw0ep: « endpoint » interface Used to communicate to/from the MP25 through external ports

Those interfaces are set during boot thanks to this script: /usr/sbin/


Bridge setup (as described above)

Services startup:

 Start deptp:
   proprietary PTP stack provided by TTTech used for gPTP synchronization
 Start LLDP (Link Layer Discovery Protocol):
   Use to exchange informations (name, capabilities) with other connected devices
 Start SNMPD:
   Use to collect data from the switch
 Configure MSTP (through « mstpctl »)
   Used for spanning tree management (to avoid loop in a network)
 PHY configuration:
   Affect PHY to the well switch port:
     echo -n stmmac-1:05 > /sys/devices/platform/soc/$IP_REF_NAME/net/sw0p3/phy/mdiobus
     echo -n stmmac-1:04 > /sys/devices/platform/soc/$IP_REF_NAME/net/sw0p2/phy/mdiobus
     (ls –al /sys/bus/mdio_bus/devices/ to know which mdio bus refers to GMAC ETH1)
    This has to be updated for customer PHY
 Add phy delays:
   Used by the switch to compute his propagation delay (used for gPTP)
    echo 84 > /sys/class/net/sw0p2/phy/delay1000tx_min     
    echo 92 > /sys/class/net/sw0p2/phy/delay1000tx_max                     
    echo 84 > /sys/class/net/sw0p3/phy/delay1000tx_min                          
    echo 92 > /sys/class/net/sw0p3/phy/delay1000tx_max                                    
    echo 0 > /sys/class/net/sw0p2/phy/delay1000rx_min                                     
    echo 250 > /sys/class/net/sw0p2/phy/delay1000rx_max                                   
    echo 0 > /sys/class/net/sw0p3/phy/delay1000rx_min                                     
    echo 250 > /sys/class/net/sw0p3/phy/delay1000rx_max 
  ifconfig eth0
Warning white.png Warning
If there is some service such as systemd-networkd, NetworkManager, Connman , the configuration of Ethernet interface can change when the service see the change

To check if eth0 and the gateway are well configured, one can type:
In the console, a log similar to the one below should be displayed:
 eth0      Link encap:Ethernet  HWaddr 00:80:E1:01:39:61  
           inet addr:  Bcast:  Mask:
           RX packets:18 errors:0 dropped:0 overruns:0 frame:0
           TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000 
           RX bytes:3038 (2.9 KiB)  TX bytes:684 (684.0 B)
 STM32MP1 # route
 Kernel IP routing table
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 default         lme-gw-vl802.lm         UG    10     0        0 eth0       *        U     0      0        0 eth0

4. References[edit source]