RZ/T2H Networking

RZ/T2H Networking

See also General Linux Hints and Communications.

Assigning IP Addresses to Host

In default HW and SW configuration according to Linux Start-up Guide, the available ethernet ports are as follows:

Ethernet Port
(EVK Name)

Hardware

Linux ethernet device

Ethernet Port
(EVK Name)

Hardware

Linux ethernet device

ETH0

GMAC0 via switch

lan0

ETH1

GMAC0 via switch

lan1

ETH2

GMAC2

eth1

ETH3

GMAC1

eth0



The IP address is needed by the host for communication. When adding an IP address with 'ip addr add' (or 'ifconfig') the ethernet interface must be specified as argument. The interface is is used to configure the routing table. When receiving an ethernet packet the destination IP address must match to a configured IP address, but the port from where the packet was received is not relevant. When transmitting an ethernet packet (e.g. for the response) the routing table is used to decide to which interface the packet shall be sent.

In this context the following items need to be considered:

  • To avoid ambiguousness in the routing table, IP addresses for different ethernet ports must belong to different subnets.
    (e.g. 192.168.10.100/24 and 192.168.20.100/24, but not 192.168.10.101/24 and 192.168.10.102/24)
    Otherwise packets (e.g. ARP response) might be routed to the wrong ethernet port, use 'ip route show' to check routing entries.

  • eth2 shall not be configured. Use lan0 and lan1 instead.

  • To configure one IP for multiple ethernet ports configure a bridge.
    E.g. configure ETH1 (lan1) and ETH2 (eth1) for the same IP address:

    ip link set lan1 up
    ip link add name br0 type bridge
    ip link set lan1 master br0
    ip link set eth1 master br0
    ip link set br0 up
    ip addr add 192.168.10.100/24 dev br0

TSN Package

  • Download the TSN package from here (Renesas Website, RZ/T2H Linux Software Pakage).

  • Install the gPTP support according to included Application Note

IEEE802.1as Mode (gPTP)

To operate linuxptp in IEEE802.1as mode, add/adapt the configuration given in the Application Note as follows:

logSyncInterval         -3
ptp_dst_mac             01:80:C2:00:00:0E

intel i226 NIC for PTP Testing

The intel PCIe NICs like i210 or i226 can be used as opposite system to test PTP or gPTP with the Renesas RZ/T2H RSK board.
The following description shows how to configure the i226 NIC for output of the 1PPS (one pulse per second) signal.
Installation related commands are given for Ubuntu Linux.

Prepare NIC for 1PPS signal

The intel NIC i226-T1 can be equipped with a pin header to access the Software Defined Pins.
The picture shows the location of these pins SDP0, 1, 2 and GND.

Install testptp Tool

The tool testptp is needed to configure the output pin for the 1PPS signal.
testptp is part of the linux kernel sources and is available here: https://github.com/torvalds/linux/tree/master/tools/testing/selftests/ptp

To get the right version fitting to the kernel, it can be be downloaded and build with:

$ sudo apt update
$ sudo apt install linux-source
$ cd /usr/src> tar xvjf linux-sources-5.15.0.tar.bz2
$ cd linux-source-5.15.0/tools/testing/selftests/ptp
$ gcc -lrt testptp.c -o testptp

Install linuxptp

$ sudo apt install linuxptp

Configure 1PPS signal and start linuxptp

Assign the 1PPS signal to SDP0 pin and set the frequency to 1 Hz. Start linuxptp with master parameters (see TSN application note for RZ/T2H).
Adapt the ethernet interface (here "enp2s0") accordingly to your PC.

$ testptp -d /dev/ptp0 -L0,2
set pin function ok
$ testptp -d /dev/ptp0 -p 1000000000
periodic output request okay
$ ptp4l -i enp2s0 -f gPTP_ms.cfg --step_threshold=1 -m -p /dev/ptp0

Miscellaneous

Changing PTP interface

In the RZ/T2H RSK environment the PTP interface can vary from run to run (ptp0, ptp1, or ptp2). Use a variable derived from ethtool output to run ptp4l independenly of this:

$ ptp_dev=`ethtool -T eth0 |awk'/PTP Hardware Clock:/ {print $4}'`
$ ptp4l -i eth0 -f /home/root/gPTP_sl.conf --step_threshold=1 -m -p /dev/ptp$ptp_dev