1. Purpose[edit source]
This article describes how to configure the Ethernet switch.
2. Switch configuration[edit source]
Boot sequence is: ETH1 -> Stm32-deip glue -> edge-lkml (-> ACM)
File describing the probe scheme are located on board in:
/etc/modprobe.d/edgx_sw_modprobe.cnf /etc/modprobe.d/acm_modprobe.cnf
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
2.1. Ethernet switch interface[edit source]
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/ttt-ip-init-systemd.sh
2.1.1. more details about /usr/sbin/ttt-ip-init-systemd.sh[edit source]
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)
-> Here Phy adress 5 is affected to sw0p3 port
-> Here Phy adress 4 is affected to sw0p2 port
- 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
- Configure IP address of sw0ep interface by default
ip addr add 192.168.0.10 dev sw0ep
-> By default 192.168.0.10 is assigned to sw0ep interface
3. References[edit source]