diff --git a/configs/AM335X/AM335X_linux_toc.txt b/configs/AM335X/AM335X_linux_toc.txt index 27be52250..50aa51765 100644 --- a/configs/AM335X/AM335X_linux_toc.txt +++ b/configs/AM335X/AM335X_linux_toc.txt @@ -57,6 +57,9 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/I2C linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRUSS +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_PRP_Non_Offload +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload linux/Foundational_Components/Kernel/Kernel_Drivers/PWM linux/Foundational_Components/Kernel/Kernel_Drivers/SPI linux/Foundational_Components/Kernel/Kernel_Drivers/Storage/NAND @@ -86,6 +89,7 @@ linux/Foundational_Components/PRU-ICSS-Linux-Drivers linux/Foundational_Components/PRU-ICSS/Linux_Drivers/RemoteProc linux/Foundational_Components/PRU-ICSS/Linux_Drivers/RPMsg linux/Foundational_Components/PRU-ICSS/RPMsg_Quick_Start_Guide +linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU-ICSS_Ethernet linux/Foundational_Components/PRU-ICSS/Linux_Drivers/pru-sw-uart linux/Foundational_Components/PRU-ICSS/Linux_Drivers/pruss-uart linux/Foundational_Components/PRU-ICSS-Hardware diff --git a/configs/AM437X/AM437X_linux_toc.txt b/configs/AM437X/AM437X_linux_toc.txt index fd3f6097e..2c28029a2 100644 --- a/configs/AM437X/AM437X_linux_toc.txt +++ b/configs/AM437X/AM437X_linux_toc.txt @@ -57,6 +57,9 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO linux/Foundational_Components/Kernel/Kernel_Drivers/I2C linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRUSS +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_PRP_Non_Offload +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload linux/Foundational_Components/Kernel/Kernel_Drivers/PWM linux/Foundational_Components/Kernel/Kernel_Drivers/QSPI linux/Foundational_Components/Kernel/Kernel_Drivers/SPI @@ -87,6 +90,7 @@ linux/Foundational_Components/PRU-ICSS-Linux-Drivers linux/Foundational_Components/PRU-ICSS/Linux_Drivers/RemoteProc linux/Foundational_Components/PRU-ICSS/Linux_Drivers/RPMsg linux/Foundational_Components/PRU-ICSS/RPMsg_Quick_Start_Guide +linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU-ICSS_Ethernet linux/Foundational_Components/PRU-ICSS/Linux_Drivers/pru-sw-uart linux/Foundational_Components/PRU-ICSS-Hardware linux/Foundational_Components/PRU-ICSS/PRU-EVMs diff --git a/configs/AM57X/AM57X_linux_toc.txt b/configs/AM57X/AM57X_linux_toc.txt index ad56b4cfd..c5a933b76 100644 --- a/configs/AM57X/AM57X_linux_toc.txt +++ b/configs/AM57X/AM57X_linux_toc.txt @@ -60,6 +60,9 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/I2C linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW linux/Foundational_Components/Kernel/Kernel_Drivers/Network/NetCP linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRUSS +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_PRP_Non_Offload +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_End_Point linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Root_Complex linux/Foundational_Components_Power_Management diff --git a/configs/AM65X/AM65X_linux_toc.txt b/configs/AM65X/AM65X_linux_toc.txt index 97941c2aa..159584123 100644 --- a/configs/AM65X/AM65X_linux_toc.txt +++ b/configs/AM65X/AM65X_linux_toc.txt @@ -56,6 +56,9 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/I2C linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW2g linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-EST linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-IET +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_PRP_Non_Offload +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload +linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_End_Point linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Root_Complex linux/Foundational_Components/Kernel/Kernel_Drivers/PWM diff --git a/source/images/Am335x_ice.jpg b/source/images/Am335x_ice.jpg deleted file mode 100644 index 8e0e5ce76..000000000 Binary files a/source/images/Am335x_ice.jpg and /dev/null differ diff --git a/source/images/Am437x_idk_500x300.jpg b/source/images/Am437x_idk_500x300.jpg deleted file mode 100644 index 7c9398261..000000000 Binary files a/source/images/Am437x_idk_500x300.jpg and /dev/null differ diff --git a/source/images/Am571x_idk.JPG b/source/images/Am571x_idk.JPG deleted file mode 100644 index cf1122344..000000000 Binary files a/source/images/Am571x_idk.JPG and /dev/null differ diff --git a/source/images/Am572x_idk.PNG b/source/images/Am572x_idk.PNG deleted file mode 100644 index d72187a24..000000000 Binary files a/source/images/Am572x_idk.PNG and /dev/null differ diff --git a/source/images/K2g_ice.PNG b/source/images/K2g_ice.PNG deleted file mode 100644 index 654207086..000000000 Binary files a/source/images/K2g_ice.PNG and /dev/null differ diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload.rst index 0480ddb9a..60251a75b 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload.rst @@ -4,15 +4,16 @@ HSR Offload .. rubric:: **Introduction** -HSR framework in linux allows offloading below functionalities to the +HSR (High-availability Seamless Redundancy) framework in Linux allows offloading following functionalities to the device hsr-fwd-offload: For forwarding HSR frames one port to another i.e port-to-port forwarding hsr-dup-offload: Duplicate the outgoing HSR frame -The ICSSG HSR firmware supports port-to-port forwarding, Tx packet duplication -and this allows to offload these capabilities from HSR driver in software to the PRU-ICSSG. +The (Programmable Real-time Unit and Industrial Communication Subsystem) PRU-ICSS HSR firmware supports +port-to-port forwarding, Tx packet duplication and this allows to offload these capabilities from HSR driver +in software to the PRU subsystem. To enable offloading using below commands To enable port-to-port offload @@ -29,10 +30,11 @@ To enable Tx packet duplication ethtool -K hsr-dup-offload on .. note:: - The ICSSG HSR firmware is designed to always carry out port-to-port - forwarding. So whenever any of the HSR features are to be offloaded, the - port-to-port forwarding must also be offloaded. It is not possible to offload - only Tx packet duplication functionality. + + The ICSS HSR firmware always run with port-to-port forwarding. + So whenever any of the HSR features are to be offloaded, the port-to-port + forwarding must also be offloaded. It is not possible to offload + only transmission (Tx) packet duplication functionality. The below script sets up an HSR interface with the port-to-port forwarding and Tx packet duplication offloaded @@ -70,8 +72,12 @@ forwarding and Tx packet duplication offloaded echo "slave-a=$ifa" echo "slave-b=$ifb" - ip link set hsr0 down - ip link delete hsr0 2> /dev/null + ip link set $if down + ip link delete $if 2> /dev/null + + ip link set $ifa down + ip link set $ifb down + sleep 1 if [ "$1" = "hsr_hw" ] then @@ -99,6 +105,9 @@ forwarding and Tx packet duplication offloaded ip addr add "$ip"/24 dev $if ip link set $if up + ip link set $ifa up + ip link set $ifb up + sleep 1 To create HSR interface with IP address 192.168.2.20 using eth1 and eth2, run the script by passing the arguments as below @@ -400,12 +409,15 @@ CPU usage at Node B found to be negligible 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 -.. rubric:: Througput at Node A +.. ifconfig:: CONFIG_part_variant in ('AM64X', 'AM65X') + + .. rubric:: Througput at Node A + + .. list-table:: Throughput performance + :widths: 25 25 -.. list-table:: Throughput performance - :widths: 25 25 + * - Sender + - Receiver + * - 505 Mbits/sec + - 504 Mbits/sec - * - Sender - - Receiver - * - 505 Mbits/sec - - 504 Mbits/sec diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_PRP_Non_Offload.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_PRP_Non_Offload.rst index bf2d0808f..93f2e6999 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_PRP_Non_Offload.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_PRP_Non_Offload.rst @@ -39,84 +39,82 @@ and the ethernet ports are eth1/eth2): 2) The below script automates the steps to create a HSR/PRP interface using ethernet interfaces and IP address for HSR/PRP provided as arguments -:: - - #!/bin/sh - - if [ "$#" != "4" ] - then - echo "$0 " - exit - fi - - if [ "$1" != "hsr" ] && [ "$1" != "prp" ] - then - echo "$0 " - exit - fi - - if [ "$1" == "hsr" ] - then - if=hsr0 - else - if=prp0 - fi - - ifa=$2 - ifb=$3 - - ip=$4 - mac=`ifconfig $ifa | grep ether | cut -d " " -f 10` - - echo "ip=$ip" - echo "if=$if" - echo "mac=$mac" - echo "slave-a=$ifa" - echo "slave-b=$ifb" - if [ "$1" == "hsr" ] - then - ip link delete prp0 2> /dev/null - else - ip link delete hsr0 2> /dev/null - fi - - ip link set $ifa down - ip link set $ifb down - sleep 1 - - ip link set dev $ifa address $mac - ip link set dev $ifb address $mac - - ip link set $ifa up - sleep 1 - - ip link set $ifb up - sleep 1 - - if [ "$1" == "hsr" ] - then - ip link add name $if type hsr slave1 $ifa slave2 $ifb supervision 45 version 1 - else - ip link add name $if type hsr slave1 $ifa slave2 $ifb supervision 45 proto 1 - fi - sleep 3 - - ip addr add $ip/24 dev $if - ip link set $if up +.. code-block:: bash + + #!/bin/sh + + if [ "$#" != "4" ] + then + echo "$0 " + exit + fi + + if [ "$1" != "hsr" ] && [ "$1" != "prp" ] + then + echo "$0 " + exit + fi + + if [ "$1" == "hsr" ] + then + if=hsr0 + else + if=prp0 + fi + + ifa=$2 + ifb=$3 + + ip=$4 + mac=`ifconfig $ifa | grep ether | cut -d " " -f 10` + + echo "ip=$ip" + echo "if=$if" + echo "mac=$mac" + echo "slave-a=$ifa" + echo "slave-b=$ifb" + if [ "$1" == "hsr" ] + then + ip link delete prp0 2> /dev/null + else + ip link delete hsr0 2> /dev/null + fi + + ip link set $ifa down + ip link set $ifb down + sleep 1 + + ip link set dev $ifa address $mac + ip link set dev $ifb address $mac + + if [ "$1" == "hsr" ] + then + ip link add name $if type hsr slave1 $ifa slave2 $ifb supervision 45 version 1 + else + ip link add name $if type hsr slave1 $ifa slave2 $ifb supervision 45 proto 1 + fi + sleep 3 + + ip addr add $ip/24 dev $if + ip link set $if up + + ip link set $ifa up + ip link set $ifb up + sleep 1 To create HSR interface with IP address 192.168.2.20 using eth1 and eth2, run the script by passing the arguments as below -:: +.. code-block:: console - sh ./ hsr eth1 eth2 192.168.2.20 + sh ./ hsr eth1 eth2 192.168.2.20 To create a PRP interface with IP address 192.168.2.20 using eth1 and eth2, run the script by passing the arguments as below -:: +.. code-block:: console - sh ./ prp eth1 eth2 192.168.2.20 + sh ./ prp eth1 eth2 192.168.2.20 Please make sure that the IP address on both the platforms are unique @@ -125,23 +123,23 @@ HSR/PRP interface, the ping will continue even if one of the connections is remo .. rubric:: *VLAN* -:: +.. code-block:: console - ifconfig hsr0 0.0.0.0 - ip link add link hsr0 name hsr0.2 type vlan id 2 - ip link add link hsr0 name hsr0.3 type vlan id 3 + ifconfig hsr0 0.0.0.0 + ip link add link hsr0 name hsr0.2 type vlan id 2 + ip link add link hsr0 name hsr0.3 type vlan id 3 - ip addr add 192.168.2.3 dev hsr0.2 - ip addr add 192.168.3.3 dev hsr0.3 + ip addr add 192.168.2.3 dev hsr0.2 + ip addr add 192.168.3.3 dev hsr0.3 With the above configuration, tracing using tcpdump -i -xxx on the remote side will show VLAN header with id information. .. rubric:: *VLAN Filtering* -:: +.. code-block:: console - ip link add link hsr0 name hsr0.4 type vlan id 4 + ip link add link hsr0 name hsr0.4 type vlan id 4 Suppose on the remote side a new VLAN ID '4' is created and attempt to ping a system with only VLAN ID '2' and '3', the packet will be filtered and dropped. @@ -157,201 +155,202 @@ Multicast MAC address can be added/deleted using ip maddr commands or Linux sock .. rubric:: Show muliticast address -:: +.. code-block:: console - # ip maddr show dev - 2: eth0 - link 01:00:5e:00:00:01 - link 01:80:c2:00:00:00 - link 01:80:c2:00:00:03 - link 01:80:c2:00:00:0e - link 01:00:5e:00:00:fc - inet 224.0.0.252 - inet 224.0.0.1 + # ip maddr show dev + 2: hsr0 + link 01:00:5e:00:00:01 + link 01:80:c2:00:00:00 + link 01:80:c2:00:00:03 + link 01:80:c2:00:00:0e + link 01:00:5e:00:00:fc + inet 224.0.0.252 + inet 224.0.0.1 .. rubric:: Add muliticast address -:: +.. code-block:: console - # ip maddr add 01:00:5e:00:00:05 dev eth0 - # ip maddr show dev eth0 - 2: eth0 - link 01:00:5e:00:00:01 - link 01:80:c2:00:00:00 - link 01:80:c2:00:00:03 - link 01:80:c2:00:00:0e - link 01:00:5e:00:00:fc - link 01:00:5e:00:00:05 static - inet 224.0.0.252 - inet 224.0.0.1 + # ip maddr add 01:00:5e:00:00:05 dev hsr0 + # ip maddr show dev hsr0 + 2: hsr0 + link 01:00:5e:00:00:01 + link 01:80:c2:00:00:00 + link 01:80:c2:00:00:03 + link 01:80:c2:00:00:0e + link 01:00:5e:00:00:fc + link 01:00:5e:00:00:05 static + inet 224.0.0.252 + inet 224.0.0.1 .. rubric:: Delete muliticast address -:: +.. code-block:: console - # ip maddr del 01:00:5e:00:00:05 dev eth0 + # ip maddr del 01:00:5e:00:00:05 dev hsr0 -.. rubric:: PTP Ordinary Clock +.. ifconfig:: CONFIG_part_variant in ('AM64X', 'AM65X') -PTP Master Clock + .. rubric:: PTP Ordinary Clock -The PTP Ordinary Clock (OC) implementation is provided by the linuxptp application. -The following command should be executed for master mode clock. + PTP Master Clock -:: + The PTP Ordinary Clock (OC) implementation is provided by the linuxptp application. + The following command should be executed for master mode clock. - ptp4l -f gm_hsr0.cfg -m + .. code-block:: console + ptp4l -f gm_hsr0.cfg -m -The gm_hsr0.cfg is given below + The gm_hsr0.cfg is given below -:: + .. code-block:: console - root@am65xx-evm:~# cat gm_hsr0.cfg - [global] - sanity_freq_limit 0 - step_threshold 0.00002 - tx_timestamp_timeout 20 + root@am65xx-evm:~# cat gm_hsr0.cfg + [global] + sanity_freq_limit 0 + step_threshold 0.00002 + tx_timestamp_timeout 20 - domainNumber 0 - priority1 127 - priority2 128 - slaveOnly 0 + domainNumber 0 + priority1 127 + priority2 128 + slaveOnly 0 - twoStepFlag 1 - summary_interval 0 - doubly_attached_clock 1 + twoStepFlag 1 + summary_interval 0 + doubly_attached_clock 1 - [hsr0] - redundancy 1 - delay_mechanism P2P - network_transport L2 + [hsr0] + redundancy 1 + delay_mechanism P2P + network_transport L2 - [eth1] - redundancy 1 - redundancy_master_interface hsr0 - redundancy_slave_number 1 + [eth1] + redundancy 1 + redundancy_master_interface hsr0 + redundancy_slave_number 1 - logAnnounceInterval 0 - logSyncInterval 0 - logMinPdelayReqInterval 0 - announceReceiptTimeout 3 - syncReceiptTimeout 2 + logAnnounceInterval 0 + logSyncInterval 0 + logMinPdelayReqInterval 0 + announceReceiptTimeout 3 + syncReceiptTimeout 2 - delay_mechanism P2P - network_transport L2 - egressLatency 726 - ingressLatency 186 - fault_reset_interval 0 + delay_mechanism P2P + network_transport L2 + egressLatency 726 + ingressLatency 186 + fault_reset_interval 0 - [eth2] - redundancy 1 - redundancy_master_interface hsr0 - redundancy_slave_number 2 + [eth2] + redundancy 1 + redundancy_master_interface hsr0 + redundancy_slave_number 2 - logAnnounceInterval 0 - logSyncInterval 0 - logMinPdelayReqInterval 0 - announceReceiptTimeout 3 - syncReceiptTimeout 2 + logAnnounceInterval 0 + logSyncInterval 0 + logMinPdelayReqInterval 0 + announceReceiptTimeout 3 + syncReceiptTimeout 2 - delay_mechanism P2P - network_transport L2 - egressLatency 726 - ingressLatency 186 - fault_reset_interval 0 + delay_mechanism P2P + network_transport L2 + egressLatency 726 + ingressLatency 186 + fault_reset_interval 0 -PTP Slave Clock + .. rubric:: PTP Slave Clock -The following command should be executed for slave mode clock. + The following command should be executed for slave mode clock. -:: + .. code-block:: console - ptp4l -f oc_hsr0.cfg -m -s + ptp4l -f oc_hsr0.cfg -m -s -The oc_hsr0.cfg is given below + The oc_hsr0.cfg is given below -:: + .. code-block:: console - [global] - sanity_freq_limit 0 - step_threshold 0.00002 - tx_timestamp_timeout 20 + [global] + sanity_freq_limit 0 + step_threshold 0.00002 + tx_timestamp_timeout 20 - domainNumber 0 - priority1 128 - priority2 128 - slaveOnly 0 + domainNumber 0 + priority1 128 + priority2 128 + slaveOnly 0 - twoStepFlag 1 - summary_interval 0 - doubly_attached_clock 1 + twoStepFlag 1 + summary_interval 0 + doubly_attached_clock 1 - [hsr0] - redundancy 1 - delay_mechanism P2P - network_transport L2 + [hsr0] + redundancy 1 + delay_mechanism P2P + network_transport L2 - [eth1] - redundancy 1 - redundancy_master_interface hsr0 - redundancy_slave_number 1 + [eth1] + redundancy 1 + redundancy_master_interface hsr0 + redundancy_slave_number 1 - logAnnounceInterval 0 - logSyncInterval 1 - logMinPdelayReqInterval 0 - announceReceiptTimeout 3 - syncReceiptTimeout 2 + logAnnounceInterval 0 + logSyncInterval 1 + logMinPdelayReqInterval 0 + announceReceiptTimeout 3 + syncReceiptTimeout 2 - delay_mechanism P2P - network_transport L2 - egressLatency 726 - ingressLatency 186 - fault_reset_interval 0 + delay_mechanism P2P + network_transport L2 + egressLatency 726 + ingressLatency 186 + fault_reset_interval 0 - [eth2] - redundancy 1 - redundancy_master_interface hsr0 - redundancy_slave_number 2 + [eth2] + redundancy 1 + redundancy_master_interface hsr0 + redundancy_slave_number 2 - logAnnounceInterval 0 - logSyncInterval 1 - logMinPdelayReqInterval 0 - announceReceiptTimeout 3 - syncReceiptTimeout 2 + logAnnounceInterval 0 + logSyncInterval 1 + logMinPdelayReqInterval 0 + announceReceiptTimeout 3 + syncReceiptTimeout 2 - delay_mechanism P2P - network_transport L2 - egressLatency 726 - ingressLatency 186 - fault_reset_interval 0 + delay_mechanism P2P + network_transport L2 + egressLatency 726 + ingressLatency 186 + fault_reset_interval 0 -PPS + .. rubric:: PPS - PPS can be tested using testptp.c tool. + PPS can be tested using the testptp.c tool. - To find out the PTP device number i.e. PTP Hardware Clock, use + To find which PTP Hardware Clock is associated with the netdevice, use -:: + .. code-block:: console - ethtool -T DEVNAME + ethtool -T DEVNAME -To turn on PPS, + To turn on PPS, -:: + .. code-block:: console - # ip link set dev eth1 up - # ./testptp -d /dev/ptp2 -P 1 - pps for system time request okay + # ip link set dev eth1 up + # ./testptp -d /dev/ptp2 -P 1 + pps for system time request okay -To turn off PPS, + To turn off PPS, -:: + .. code-block:: console - # ./testptp -d /dev/ptp2 -P 0 - pps for system time request okay + # ./testptp -d /dev/ptp2 -P 0 + pps for system time request okay -PTP Over VLAN + .. rubric:: PTP Over VLAN -For PTP Over VLAN, the PTP oc_hsr0.cfg and gm_hsr0.cfg should use VLAN -interface instead of hsr0. + For PTP Over VLAN, the PTP oc_hsr0.cfg and gm_hsr0.cfg should use VLAN + interface instead of hsr0. diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload.rst index d9eea4642..cf3337c24 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload.rst @@ -11,7 +11,7 @@ It also allows to offload the below functionalities of PRP mode to the underlyin - hsr-dup-offload: Duplicate the outgoing PRP frame - hsr-tag-rm-offload: Remove PRP trailer from the frame -The ICSSG PRP firmware supports offloading of all above functionalities saving overhead from the driver. +The Programmable Real-time Unit and Industrial Communication Subsystem (PRU-ICSS) PRP firmware supports offloading of all above functionalities saving overhead from the driver. .. note:: @@ -347,12 +347,14 @@ A sample test setup is as shown below iperf3 -c -t60 -.. rubric:: Throughput at Node A +.. ifconfig:: CONFIG_part_variant in ('AM64X') -.. list-table:: Throughput performance - :widths: 25 25 + .. rubric:: Througput at Node A - * - Sender - - Receiver - * - 610 Mbits/sec - - 605 Mbits/sec + .. list-table:: Throughput performance + :widths: 25 25 + + * - Sender + - Receiver + * - 610 Mbits/sec + - 605 Mbits/sec diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRUSS.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRUSS.rst index 336553197..c0df9d859 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRUSS.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRUSS.rst @@ -65,7 +65,7 @@ space. +--------+-------------------------------------------+-------------------------+ | S.No | Location | Description | +========+===========================================+=========================+ -| 1 | drivers/net/ethernet/ti/prueth_core.c | PRU Ethernet driver | +| 1 | drivers/net/ethernet/ti/icssm | PRU Ethernet driver | +--------+-------------------------------------------+-------------------------+ | 2 | drivers/remoteproc/pruss.c | PRUSS core driver | +--------+-------------------------------------------+-------------------------+ @@ -81,52 +81,46 @@ space. .. rubric:: **Board specific Setup Details** :name: board-specific-setup-details -.. rubric:: AM335x-ICE-v2 - :name: am335x-ice-v2 +.. ifconfig:: CONFIG_part_variant in ('AM335X') -This board has only 2 Ethernet ports that can be used either as CPSW -Ethernet or PRUSS Ethernet. For PRUSS Ethernet configration place -jumpers J18 and J19 at MII position before powering up the board. + This board has only 2 Ethernet ports that can be used either as CPSW + Ethernet or PRUSS Ethernet. For PRUSS Ethernet configration place + jumpers J18 and J19 at MII position before powering up the board. -.. rubric:: AM437x-IDK - :name: am437x-idk +.. ifconfig:: CONFIG_part_variant in ('AM437X') -This board as one Gigabit (CPSW) Ethernert port and 2 PRUSS Ethernet -ports. No special board configuration is needed to use all ports. + This board as one Gigabit (CPSW) Ethernert port and 2 PRUSS Ethernet + ports. No special board configuration is needed to use all ports. -.. rubric:: K2G-ICE EVM - :name: k2g-ice-evm +.. ifconfig:: CONFIG_part_variant in ('AM57X') -This board has one Gigabit (netCP) Ethernet port and 4 PRUSS Ethernet -ports. No special board configuration is needed to use all ports. + .. rubric:: AM571x-IDK + :name: am571x-idk -.. rubric:: AM571x-IDK - :name: am571x-idk + This board has 2 Gigabit (CPSW) Ethernet ports and 4 PRUSS Ethernet + ports. Due to pinmux limitations it can support either of the following + configurations -This board has 2 Gigabit (CPSW) Ethernet ports and 4 PRUSS Ethernet -ports. Due to pinmux limitations it can support either of the following -configurations + - Jumper J51 placed. LCD + 2 Gigabit (CPSW) + 2 PRUSS Ethernet ports + (PRU2\_ETH0 and PRU2\_ETH1) -- Jumper J51 placed. LCD + 2 Gigabit (CPSW) + 2 PRUSS Ethernet ports - (PRU2\_ETH0 and PRU2\_ETH1) + **OR** -**OR** + - Jumper J51 removed. No LCD, 2 Gigabit (CPSW) + 4 PRUSS Ethernet + ports. -- Jumper J51 removed. No LCD, 2 Gigabit (CPSW) + 4 PRUSS Ethernet - ports. + NOTE: Jumper must be configured before powering up the board. -NOTE: Jumper must be configured before powering up the board. + .. rubric:: AM572x-IDK + :name: am572x-idk -.. rubric:: AM572x-IDK - :name: am572x-idk + This board has 2 Gigabit (CPSW) Ethernet ports and 4 PRUSS Ethernet + ports. However, only 2 Gigabit + 2 PRUSS Ethernet ports (PRU2\_ETH0 and + PRU2\_ETH1) are supported due to pinmux limitations. -This board has 2 Gigabit (CPSW) Ethernet ports and 4 PRUSS Ethernet -ports. However, only 2 Gigabit + 2 PRUSS Ethernet ports (PRU2\_ETH0 and -PRU2\_ETH1) are supported due to pinmux limitations. - -NOTE: Only ES2.0 silicon (Board Rev1.3 or later) is supported as older -Silicon uses a older version of PRUSS core that is not compatible with -the supplied firmware. + NOTE: Only ES2.0 silicon (Board Rev1.3 or later) is supported as older + Silicon uses a older version of PRUSS core that is not compatible with + the supplied firmware. .. rubric:: Kernel configuration :name: kernel-configuration diff --git a/source/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU-ICSS_Ethernet.rst b/source/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU-ICSS_Ethernet.rst index c260e1d4e..14895232c 100644 --- a/source/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU-ICSS_Ethernet.rst +++ b/source/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU-ICSS_Ethernet.rst @@ -1,12 +1,18 @@ .. _pru_icss_ethernet: -PRU-ICSS Ethernet ------------------ +################## +PRU_ICSSM Ethernet +################## -.. rubric:: Introduction - :name: introduction-pru-icss-ethernet-linux +.. contents:: + :local: + :depth: 3 -As of version 3.1.0.6 of the Linux Processor SDK, the evaluation modules +************ +Introduction +************ + +As of version 11.0 of the Linux Processor SDK, the evaluation modules listed below support additional 100 Mbps Ethernet ports through the PRU-ICSS while running Linux as your host operating system. @@ -14,152 +20,69 @@ This page **DOES NOT** cover any of the industrial protocols that are supported by the PRU-ICSS while running other host operating systems (bare metal, StarterWare, TI RTOS, third party, etc). -For previous versions of the Linux Processor SDK, please see the -Archives section at the bottom of this page. - -.. rubric:: Boards Supported - :name: boards-supported - -.. Image:: /images/Am335x_ice.jpg - -.. rubric:: `AM3359 Industrial Communications Engine - (ICE) `__ - :name: am3359-industrial-communications-engine-ice - -The AM3359 Industrial Communications Engine (ICE) is a development -platform targeted for systems that specifically focus on the industrial -communications capabilities of the Sitara AM335x ARM® Cortex™-A8 -Processors - -The AM335x ARM Cortex-A8 Processors integrate the Programmable Real-time -Unit (PRU) that has been architected to implement the real-time -communication technologies used in a broad range of industrial -automation equipment. It enables low foot print designs with minimal -external components and with best in class low power performance. - -.. Image:: /images/Am437x_idk_500x300.jpg - -.. rubric:: `AM437x Industrial Development Kit - (IDK) `__ - :name: am437x-industrial-development-kit-idk - -The AM437x Industrial Development Kit (IDK) is an application -development platform for evaluating the industrial communication and -control capabilities of Sitara™ AM4379 and AM4377 processors for -industrial applications. - -The AM4379 and AM4377 processors are ideal for industrial -communications, industrial control, and industrial drives applications. -The AM437x processors integrate a quad-core Programmable Real-time Unit -(PRU) that has been architected to implement the real-time communication -technologies used in a broad range of industrial automation equipment. -It enables low foot print designs with minimal external components and -with best in class low power performance. - -.. Image:: /images/Am571x_idk.JPG - -.. rubric:: `AM571x Industrial Development Kit - (IDK) `__ - :name: am571x-industrial-development-kit-idk - -The AM571x IDK is a standalone test, development, and evaluation module -that enables developers to write software and develop hardware for -industrial control and industrial communications applications. It has -been equipped with a TI AM5718 processor and a defined set of features -to allow you to experience industrial communication solutions using -various serial or Ethernet based interfaces. Using standard interfaces, -the AM571x IDK may interface to other processors or systems and act as a -communication gateway or controller. In addition, it can directly -operate as a standard remote I/O system or a sensor connected to an -industrial communication network. - .. note:: - Due to pin muxing between the optional LCD and the PRUSS1 Ethernet - ports, the AM571x IDK supports two configurations. The first - configuration is 4-port Ethernet + LCD. In this configuration, two - Ethernet ports are provided by the CPSW, two Ethernet ports are provided - by PRUSS2, and the LCD is enabled. To use this configuration, place a - jumper across **J51** on the board. The second configuration is 6-port - Ethernet. In this configuration, two Ethernet ports are provided by the - CPSW, two Ethernet ports are provided by PRUSS1, two Ethernet ports are - provided by PRUSS2, and the LCD is disabled. To use this configuration, - leave **J51** open. - -| - -.. Image:: /images/Am572x_idk.PNG - -.. rubric:: `AM572x Industrial Development Kit - (IDK) `__ - :name: am572x-industrial-development-kit-idk - -The AM572x Industrial Development Kit (IDK) is a development platform -for evaluating the industrial communication and control capabilities of -Sitara AM572x processors for applications in factory automation, drives, -robotics, grid infrastructure, and more. AM572x processors include dual -PRU-ICSS (Programmable Real-time Unit for Industrial Communications) -sub-systems which can be used for industrial Ethernet protocols such as -Profinet, EtherCAT, Ethernet/IP, and others. The TMDXIDK5728 breaks out -six ports of Ethernet, four of which can be used concurrently: 2x Gb -Ethernet ports and 2x 10/100 Ethernet ports from the PRU-ICSS -subsystems. -.. note:: - Due to changes in the PRU-ICSS between silicon revisions, the PRU - Ethernet firmwares provided for the AM5728 device are only meant to be - used on silicon revision SR 2.0. + Starting with the SDK 11.1 release, the Linux driver is not compatible with earlier versions + of the PRU Ethernet firmware from previous SDK releases. The Linux driver provided + with this release should be used with the PRU firmware from this release. + Similarly, the PRU Ethernet firmware from this release is not compatible with earlier versions + of Linux drivers from before the SDK 11.1 release. -| +****************** +Features supported +****************** -.. Image:: /images/K2g_ice.PNG +- Rx and Tx over PRU Ethernet ports in Dual EMAC mode +- Full duplex with 100 Mbps link speed +- VLAN filtering +- Enhanced multicast filtering +- Promiscuous mode +- Storm prevention +- Interrupt coalescing +- Linux PTP (ptp4l) Ordinary clock +- ethtool support for link status and statistics -.. rubric:: `K2G Industrial Communication Engine - (ICE) `__ - :name: k2g-industrial-communication-engine-ice +******************** +Driver Configuration +******************** -The K2G Industrial Communications Engine (ICE) enables 66AK2Gx processor -developers to immediately start development, demonstration and test of -industrial communication protocols for products such as PLC, bus -controllers, motion control and other real-time industrial networked -applications. The evaluation module is supported by Processor SDK for RT -Linux and TI-RTOS operating systems and is supplied with an SD micro -card for easy boot up and out of box experience. The two PRU-ICSS -subystems can be used for industrial Ethernet protocols such as -Profinet, EtherCAT, Ethernet/IP, and others. +The TI Processor SDK has ICSSM driver enabled by default on supported platforms. +In case of custom builds, please ensure following configs are enabled. -| +.. code-block:: text -| + CONFIG_TI_PRUSS + CONFIG_REMOTEPROC + CONFIG_PRU_REMOTEPROC + CONFIG_TI_PRUSS_INTC + CONFIG_TI_DAVINCI_MDIO + CONFIG_TI_ICSS_IEP + CONFIG_TI_PRUETH_ECAP -.. rubric:: What You Get - :name: what-you-get +.. rubric:: **Module Build** -With the PRU-ICSS Ethernet support, you get two (or four, on the AM571x -IDK and K2G ICE) additional 100 Mbps Ethernet interfaces that show up -just like any other Ethernet interface in Linux. These interfaces are -there 'out-of-the-box' in the latest Linux Processor SDK when ran on any -of the boards shown above. All you need to do is plug in an Ethernet -cable and bring the interface up from the console (discussed below). +Module build for the ICSSM driver is supported. To do this, use option 'm' for above configs, where applicable. -The current implementation does **not** support Ethernet switching -within the PRU-ICSS. The provided PRU firmwares only support 'dual emac' -mode in this release of the Linux Processor SDK. +******************** +Device tree bindings +******************** -| +The DT bindings description can be found at: +| `Documentation/devicetree/bindings/net/ti,icssm-prueth.yaml `__ +| `Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml `__ | -.. rubric:: How It Works - :name: how-it-works +************ +How It Works +************ Texas Instruments provides all of the necessary software and firmware in the Linux Processor SDK to enable the PRU-ICSS Ethernet ports. The PRU -firmware binaries can be found in the **/lib/firmware/ti-pruss/** folder +firmware binaries can be found in the :file:`/lib/firmware/ti-pruss/` folder in the filesystem. A Linux kernel networking driver is provided that can be found at -**<%LINUX\_PROC\_SDK\_X\_X\_X\_X%>/board-support/linux-x.y.z..../drivers/net/ethernet/ti/prueth.c**. -The required device tree modifications are also given in the dts files -of the supported boards from above. +:file:`<%LINUX\_PROC\_SDK\_X\_X\_X\_X%>/board-support/linux-x.y.z..../drivers/net/ethernet/ti/icssm/**`. As the boards boot, the prussN\_eth device tree node causes the ti-prueth driver to be probed. This probe function does several things @@ -169,82 +92,28 @@ to prepare the PRU-ICSS Ethernet ports: - Requests ownership of the PRUSS memory regions from the pruss driver - Allocates a pool of memory in OCMC SRAM for the Ethernet buffers to be passed from the PRU to Linux -- Initializes a netdev devices +- Initializes a netdev device - Registers the network device with Linux At this point the Linux driver is ready for the new Ethernet interface -to be started. Once the user issues the interface up command ('ifup -eth2' for example), the **emac\_ndo\_open** function is called in the +to be started. Once the user issues the interface up command (``ifconfig +eth2 up`` for example), the **emac\_ndo\_open** function is called in the ti-prueth driver which uses the remoteproc interface to boot the PRU -cores with the firmware provided in the **/lib/firmware/ti-pruss/** +cores with the firmware provided in the :file:`/lib/firmware/ti-pruss/` folder of the EVM filesystem. The PRUs running this firmware, coupled -with the ti-prueth Linux driver, allows up to 2 (or 4, on the AM571x -IDK) additional 100 Mbps Ethernet interfaces to be exposed to the user. - -| +with the ti-prueth Linux driver, allows up to 2 additional 100 Mbps +Ethernet interfaces to be exposed to the user. -.. rubric:: Block Diagram +Block Diagram +============= -| This is a high level block diagram to show how everything fits - together. For more information see the schematics for the boards as - well as the Linux driver source code. +This is a high level block diagram to show how everything fits +together. For more information see the schematics for the boards as +well as the Linux driver source code. .. Image:: /images/Pru_eth_block_diagram_3_0_0_4.PNG -| - -.. rubric:: Try It Out - :name: try-it-out - -Here are the steps needed to test out the new Ethernet interfaces: - -- Get your hands on one of the industrial boards - - - `AM3359 Industrial Communications Engine - (ICE) `__ - - `AM437x Industrial Development Kit - (IDK) `__ - - `AM571x Industrial Development Kit - (IDK) `__ - - `AM572x Industrial Development Kit - (IDK) `__ - - `K2G Industrial Communication Engine - (ICE) `__ - -- Download the Linux Processor SDK (v3.1.0.6 or higher) - - - `Linux Processor SDK for AM335x - devices `__ - - `Linux Processor SDK for AM437x - devices `__ - - `Linux Processor SDK for AM57x - devices `__ - - `Linux Processor SDK for K2G - devices `__ - -- Run the 'create SD card' script provided in the SDK to create a - bootable SD card - - - Plug your SD card into your Ubuntu development machine with a USB - card reader - - **cd <%LINUX\_PROC\_SDK\_X\_X\_X\_X%>/bin/** - - **sudo ./create-sdcard.sh** - - follow the script directions to format your SD card and then - install the pre-built binaries from the SDK - - for more information on creating an SD card: - :ref:`Processor\_SDK\_Linux\_create\_SD\_card\_script ` - -- Boot from the newly created SD card - - - Put the SD card into your board, power it on, and wait for the - login prompt then type **root** to log in. - - .. note:: - You'll need to clear the SPI flash on the AM3359 ICE board before - you can boot from an SD card: `AM3359 ICE clear SPI - flash `__ - -- Plug an Ethernet cable into the ports supported by the PRU-ICSS +.. ifconfig:: CONFIG_part_variant in ('AM335X') - On the AM3359 ICE there are only two Ethernet ports on the board @@ -261,80 +130,51 @@ Here are the steps needed to test out the new Ethernet interfaces: values. Both need to be MII (PRU-ICSS) or both need to be RMII (CPSW). +.. ifconfig:: CONFIG_part_variant in ('AM437X') + - On the AM437x IDK the silkscreen says **PRUETH0** and **PRUETH1** for the supported PRU ports + +.. ifconfig:: CONFIG_part_variant in ('AM57X') + - On the AM571x IDK the silkscreen says **PRU1 ETH0**, **PRU1 ETH1**, **PRU2 ETH0**, and **PRU2 ETH1** for the supported PRU ports .. note:: - On the AM571x IDK board, the pins used for PRU1 ETH0 and PRU1 ETH1 - are shared with pins used for the optional LCD touchscreen. U-Boot - uses jumper **J51** to determine if the LCD touchscreen should be - enabled or not. If **J51** is closed (jumper is present across the - two pins), then U-Boot will load a device tree that enables the - LCD touchscreen and disables PRUSS1 Ethernet ports. This means - that only **PRU2 ETH0** and **PRU2 ETH1** will be supported if - jumper **J51** is closed. If **J51** is open (jumper is not - present across the two pins), then U-Boot will load a device tree - that enables all four PRUSS Ethernet ports, two from PRUSS1 and - two from PRUSS2. In this mode, the LCD touchscreen is disabled. + + On the AM571x IDK board, the pins used for PRU1 ETH0 and PRU1 ETH1 + are shared with pins used for the optional LCD touchscreen. U-Boot + uses jumper **J51** to determine if the LCD touchscreen should be + enabled or not. If **J51** is closed (jumper is present across the + two pins), then U-Boot will load a device tree that enables the + LCD touchscreen and disables PRUSS1 Ethernet ports. This means + that only **PRU2 ETH0** and **PRU2 ETH1** will be supported if + jumper **J51** is closed. If **J51** is open (jumper is not + present across the two pins), then U-Boot will load a device tree + that enables all four PRUSS Ethernet ports, two from PRUSS1 and + two from PRUSS2. In this mode, the LCD touchscreen is disabled. - On the AM572x IDK the silkscreen says **PRU2 ETH0** and **PRU2 ETH1** for the supported PRU ports - - On the K2G ICE the supported PRU ports are the two stacked RJ45 - connectors - -- Bring up the PRU Ethernet interface in Linux - - - Depending on your board and the contents of your - **/etc/networking/interfaces** file, the PRU-ICSS Ethernet ports - may already be brought up. If not: - - On the AM3359 ICE type **ifup eth0** to bring up **Ethernet\_0** - and type **ifup eth1** to bring up **Ethernet\_1** - - On the AM437x IDK type **ifup eth1** to bring up **PRUETH0** and - type **ifup eth2** to bring up **PRUETH1** - - On the AM571x IDK type **ifup eth2** to bring up **PRU1 ETH0**, - type **ifup eth3** to bring up **PRU1 ETH1**, type **ifup eth4** - to bring up **PRU2 ETH0**, and type **ifup eth5** to bring up - **PRU2 ETH1** - - .. note:: - As mentioned in the note above, jumper **J51** on the board - determines if two or four PRUSS Ethernet ports are supported. If - **J51** is closed then only two of the four interfaces listed here - will be available for use. - - - On the AM572x IDK type **ifup eth2** to bring up **PRU2 ETH0** and - type **ifup eth3** to bring up **PRU2 ETH1** - - On the K2G ICE type **ifup eth1**, **ifup eth2**, **ifup eth3**, - and **ifup eth4** to bring up the PRU Ethernet interfaces -- If all goes well you should see the PRU-ICSS ports in the output of - the **ip/ifconfig** command - -| - -| - -.. rubric:: Network Topologies - :name: network-topologies +****************** +Network Topologies +****************** The following network topologies are possible with the PRU-ICSS Ethernet ports. -.. rubric:: Single Port Mode - :name: single-port-mode +Single Port Mode +================ -| In this mode only one of the PRU-ICSS Ethernet ports are used. This is - the simplest mode and works as you would expect it to. +In this mode only one of the PRU-ICSS Ethernet ports are used. This is +the simplest mode and works as you would expect it to. .. Image:: /images/Pru_eth_block_single_port_3_0_0_4.PNG --------------- - -.. rubric:: Dual MAC Mode (Gateway) - :name: dual-mac-mode-gateway +Dual MAC mode +============= One use case made possible with two ports on the same device is to allow your device to act as a gateway between two different subnets. In this @@ -342,48 +182,505 @@ use case you just need to bring up both ports and then plug them into the two subnets as shown below. .. note:: - It is not a normal use case to plug both PRU-ICSS Ethernet ports into - the same switch (same subnet) out-of-the-box. While it may appear to - work at first, it will lead to unexpected behavior including (but not - limited to) packets entering/exiting the device on the opposite port - that you would expect due to ARP broadcasts and other topics that are - outside the scope of this document. -| + It is not a normal use case to plug both PRU-ICSS Ethernet ports into + the same switch (same subnet) out-of-the-box. While it may appear to + work at first, it will lead to unexpected behavior including (but not + limited to) packets entering/exiting the device on the opposite port + that you would expect due to ARP broadcasts and other topics that are + outside the scope of this document. .. Image:: /images/Pru_eth_block_gateway_3_0_0_4.PNG +********** +User guide +********** + +Bringing Up interface +===================== + +The network interface can be configured automatically depending on root file system or configured manually. Manual configuration: --------------- +.. code-block:: console + + ip addr add 192.168.1.1/24 dev eth2 + ip link set dev eth2 up + + < or > + + ifconfig eth2 netmask up + +Get information (ethtool) +========================= + +Get driver information +---------------------- + +The interface can be identified by using ``ethtool -i DEVNAME`` command. +It also provides some information about supported features. + +.. code-block:: console + + ~# ethtool -i eth2 + driver: prueth + version: + firmware-version: + expansion-rom-version: + bus-info: pruss2-eth + supports-statistics: yes + supports-test: no + supports-eeprom-access: no + supports-register-dump: yes + supports-priv-flags: no + + +Display standard information about device/link +---------------------------------------------- + +Run ``ethtool DEVNAME`` command without parameters. + +.. code-block:: console + + ~# ethtool eth2 + Settings for eth2: + Supported ports: [ TP MII ] + Supported link modes: 100baseT/Full + Supported pause frame use: No + Supports auto-negotiation: Yes + Supported FEC modes: Not reported + Advertised link modes: 100baseT/Full + Advertised pause frame use: No + Advertised auto-negotiation: Yes + Advertised FEC modes: Not reported + Link partner advertised link modes: 10baseT/Half 10baseT/Full + 100baseT/Half 100baseT/Full + Link partner advertised pause frame use: Symmetric + Link partner advertised auto-negotiation: Yes + Link partner advertised FEC modes: Not reported + Speed: 100Mb/s + Duplex: Full + Auto-negotiation: on + Port: MII + PHYAD: 0 + Transceiver: external + Link detected: yes + +Display time stamping capabilities +---------------------------------- + +The interface time stamping capabilities can be retrieved by using ``ethtool -T DEVNAME`` command. + +.. code-block:: console + + ~# ethtool -T eth2 + Time stamping parameters for eth2: + Capabilities: + hardware-transmit + hardware-receive + software-receive + software-system-clock + hardware-raw-clock + PTP Hardware Clock: 1 + Hardware Transmit Timestamp Modes: + off + on + Hardware Receive Filter Modes: + none + ptpv2-event + +Show adapter statistics +----------------------- + +The interface statistics are divided into several parts. Different statistics can be retrieved using the commands as mentioned below. + +Standard netdev statistics +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can retrieve standard netdev statistics such as RX / TX bytes / packet counts by using the command ``ip -s -s link show dev DEVNAME``. +For more details, see `Standard interface statistics `__. + +.. code-block:: console + + ~# ip -s -s link show dev eth2 + 6: eth2: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 + link/ether 70:ff:76:1d:5c:64 brd ff:ff:ff:ff:ff:ff + RX: bytes packets errors dropped missed mcast + 2554 19 0 0 0 0 + RX errors: length crc frame fifo overrun + 0 0 0 0 0 + TX: bytes packets errors dropped carrier collsns + 22493 208 0 18 0 0 + TX errors: aborted fifo window heartbt transns + 0 0 0 0 3 + +Protocol-specific statistics +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can retrieve protocol specific statistics such as packet counts for different octet sizes by using the command ``ethtool -S DEVNAME --groups rmon``. For more details refer `Protocol specific statistics `__ + +.. code-block:: console + + ~# ethtool -S eth2 --groups rmon + Standard stats for eth2: + rmon-etherStatsUndersizePkts: 0 + rmon-etherStatsOversizePkts: 0 + rx-rmon-etherStatsPkts64Octets: 11 + rx-rmon-etherStatsPkts65to127Octets: 145 + rx-rmon-etherStatsPkts128to255Octets: 48 + rx-rmon-etherStatsPkts256to511Octets: 7 + rx-rmon-etherStatsPkts512to1023Octets: 0 + tx-rmon-etherStatsPkts64Octets: 12 + tx-rmon-etherStatsPkts65to127Octets: 2 + tx-rmon-etherStatsPkts128to255Octets: 1 + tx-rmon-etherStatsPkts256to511Octets: 5 + tx-rmon-etherStatsPkts512to1023Octets: 0 + +Driver-defined statistics +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Driver-defined ethtool statistics can be retrieved by using ``ethtool -S DEVNAME`` command. +It displays statistic for the ethernet port. + +.. code-block:: console + + ~# ethtool -S eth2 + NIC statistics: + tx_bcast: 5 + tx_mcast: 85 + tx_ucast: 123 + rx_bcast: 4 + rx_mcast: 1 + rx_ucast: 15 + rx_misalignment_frames: 0 + stormprev_counter_bc: 0 + stormprev_counter_mc: 0 + stormprev_counter_uc: 0 + mac_rxerror: 0 + sfd_error: 0 + mac_txerror: 0 + rx_oversized_frames: 0 + rx_undersized_frames: 0 + dropped_packets: 0 + tx_hwq_overflow: 0 + tx_hwq_underflow: 0 + + +VLAN Config +=========== + +VLAN can be added/deleted using ``ip`` utility. + +*VLAN Add* + +.. code-block:: console + + ip link add link eth2 name eth2.5 type vlan id 5 + +*VLAN del* + +.. code-block:: console + + ip link del eth2.5 + +*VLAN IP assigning* + +IP address can be assigned to the VLAN interface either via udhcpc +when a VLAN aware dhcp server is present or via static ip assigning +using ``ip`` or ``ifconfig``. + +Once VLAN is added, it will create a new entry in Ethernet interfaces +like eth2.5, below is an example how it check the vlan interface + +.. code-block:: console + + ip addr add 10.0.0.5/24 dev eth2.5 + + < or > + + ifconfig eth2.5 10.0.0.5 + .... + + ~# ifconfig eth2.5 + eth2.5: flags=4163 mtu 1500 + inet 10.0.0.5 netmask 255.255.255.0 broadcast 0.0.0.0 + inet6 fe80::887a:20ff:fedd:b4e1 prefixlen 64 scopeid 0x20 + ether 8a:7a:20:dd:b4:e1 txqueuelen 1000 (Ethernet) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 26 bytes 4904 (4.7 KiB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +*VLAN Packet Send/Receive* + +To Send or receive packets with the VLAN tag, bind the socket to the +proper Ethernet interface shown above and can send/receive via that +socket-fd. | -.. rubric:: Linux network device re-naming +Interrupt pacing +================ + +The Interrupt pacing (IRQ coalescing) based on hrtimers is supported for RX path +and can be enabled by ethtool commands: + +.. code-block:: console + + ethtool -C ethX rx-usecs N # Enable RX coalescing + +The Interrupt pacing (IRQ coalescing) configuration can be retrieved by commands: + +.. code-block:: console + + ethtool -c ethX # Show RX coalescing + +Multicast Add/Delete +==================== + +Multicast MAC address can be added/deleted using *ip maddr* commands or Linux +socket ioctl SIOCADDMULTI/SIOCDELMULTI. + +*Show muliticast address* + +.. code-block:: console + + ~# ip maddr show eth2 + 6: eth2 + link 01:80:c2:00:00:0e users 2 static + link 01:80:c2:00:00:03 users 2 static + link 01:80:c2:00:00:00 users 2 static + link 01:00:5e:00:00:01 + link 01:00:5e:00:00:fb + link 33:33:00:00:00:01 + link 33:33:ff:1d:5c:64 + link 33:33:00:00:00:fb + inet6 ff02::fb + inet6 ff02::1:ff1d:5c64 + inet6 ff02::1 users 2 + inet6 ff01::1 + +*Add muliticast address* + +.. code-block:: console + + ~# ip maddr add 01:00:5e:00:00:05 dev eth2 + ~# ip maddr show dev eth2 + 6: eth2 + link 01:80:c2:00:00:0e users 2 static + link 01:80:c2:00:00:03 users 2 static + link 01:80:c2:00:00:00 users 2 static + link 01:00:5e:00:00:01 + link 01:00:5e:00:00:fb + link 33:33:00:00:00:01 + link 33:33:ff:1d:5c:64 + link 33:33:00:00:00:fb + link 01:00:5e:00:00:05 static + inet6 ff02::fb + inet6 ff02::1:ff1d:5c64 + inet6 ff02::1 users 2 + inet6 ff01::1 + + +*Delete muliticast address* + +.. code-block:: console + + # ip maddr del 01:00:5e:00:00:05 dev eth2 + +.. rubric:: **Multicast + VLAN** + +Multicast MAC address can be added/deleted using *ip maddr* commands for vlan interfaces. + +*Show multicast address for vlan interface* + +.. code-block:: console -It's possible to perform Linux network devices renaming for devices created by -PRU Ethernet driver for consistency, as standard Linux Ethernet network devices -naming (ethX) depends in platform configuration and drivers initialization sequence. -The PRU Ethernet network devices renaming can be achieved by using udev rules, -like below, which can be added in /etc/udev/rules.d/autonet.rules, for example. + ~# ip maddr show eth1.5 -.. code-block:: bash +*Add multicast address for vlan interface* - SUBSYSTEM=="net", ACTION=="add", KERNELS=="pruss1_eth", ATTR{phys_port_name}=="p1", NAME="pru10" - SUBSYSTEM=="net", ACTION=="add", KERNELS=="pruss1_eth", ATTR{phys_port_name}=="p2", NAME="pru11" - SUBSYSTEM=="net", ACTION=="add", KERNELS=="pruss2_eth", ATTR{phys_port_name}=="p1", NAME="pru20" - SUBSYSTEM=="net", ACTION=="add", KERNELS=="pruss2_eth", ATTR{phys_port_name}=="p2", NAME="pru21" +.. code-block:: console + + ~# ip maddr add 01:00:5e:00:00:05 dev eth1.5 + +*Delete multicast address for vlan interface* + +.. code-block:: console + + ~# ip maddr del 01:00:5e:00:00:05 dev eth1.5 + +| + +Promiscous Mode +=============== +By default promiscous mode is disabled. It can be enabled by using +the below command. + +Please note running a tool like tcpdump will itself enable promiscous +mode. + +.. code-block:: console + + ip link set eth0 promisc on + +PTP Ordinary Clock +================== + +The PRU Ethernet & IEP drivers implement the Linux PTP hardware clock subsystem APIs. +See `PTP hardware clock infrastructure for Linux `__ for +more details. + +The PTP Ordinary Clock (OC) implementation is provided by the linuxptp application. + +.. code-block:: console + + ptp4l -f oc.cfg + +oc.cfg is a ptp4l configuration file. + +Example oc.cfg for OC, + +.. code-block:: text + + [global] + tx_timestamp_timeout 10 + logMinPdelayReqInterval -3 + logSyncInterval -3 + twoStepFlag 1 + summary_interval 0 + [eth2] + delay_mechanism P2P + network_transport L2 + +where **eth2** is the intended PRU-ICSSM Ethernet port over which the OC +functionality is provided. + +See `The Linux PTP Project `__ for +more details about linuxptp in general and `ptp4l(8) - Linux man +page `__ about ptp4l configurations in particular. + +Here is a sample screen display of ptp4l for PRU-ICSS Ethernet port as +PTP/OC in slave mode: + +.. code-block:: console + + # ptp4l -f oc.cfg -s -m + ptp4l[6753.465]: selected /dev/ptp1 as PTP clock + ptp4l[6753.520]: port 1 (eth2): INITIALIZING to LISTENING on INIT_COMPLETE + ptp4l[6753.520]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE + ptp4l[6753.521]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE + ptp4l[6757.507]: port 1 (eth2): new foreign master 70ff76.fffe.1f3c10-1 + ptp4l[6761.457]: selected local clock 70ff76.fffe.1d5c64 as best master + ptp4l[6761.509]: selected best master clock 70ff76.fffe.1f3c10 + ptp4l[6761.509]: port 1 (eth2): LISTENING to UNCALIBRATED on RS_SLAVE + ptp4l[6761.885]: port 1 (eth2): UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED + ptp4l[6762.511]: rms 634337579602795 max 1268675159205708 freq -2928 +/- 1269 delay 927 +/- 4 + ptp4l[6763.512]: rms 210 max 317 freq -2488 +/- 289 delay 933 +/- 1 + ptp4l[6764.513]: rms 350 max 375 freq -1844 +/- 93 delay 931 +/- 1 + ptp4l[6765.514]: rms 218 max 294 freq -1728 +/- 21 delay 925 +/- 2 + ptp4l[6766.515]: rms 72 max 119 freq -1794 +/- 32 delay 923 +/- 0 + ptp4l[6767.516]: rms 10 max 24 freq -1866 +/- 13 delay 926 +/- 1 + ptp4l[6768.517]: rms 27 max 37 freq -1912 +/- 10 delay 925 +/- 1 + ptp4l[6769.518]: rms 16 max 23 freq -1911 +/- 15 delay 927 +/- 1 + ptp4l[6770.519]: rms 12 max 20 freq -1912 +/- 15 delay 928 +/- 1 + ptp4l[6771.520]: rms 8 max 17 freq -1907 +/- 11 delay 932 +/- 1 + ptp4l[6772.521]: rms 16 max 28 freq -1890 +/- 19 delay 929 +/- 2 + ptp4l[6773.522]: rms 13 max 19 freq -1891 +/- 18 delay 926 +/- 0 + ptp4l[6774.523]: rms 14 max 24 freq -1900 +/- 18 delay 928 +/- 1 + ptp4l[6775.525]: rms 11 max 21 freq -1893 +/- 15 delay 924 +/- 2 + ptp4l[6776.526]: rms 15 max 22 freq -1898 +/- 21 delay 931 +/- 2 + ptp4l[6777.527]: rms 14 max 19 freq -1888 +/- 18 delay 930 +/- 1 + ptp4l[6778.528]: rms 11 max 19 freq -1887 +/- 14 delay 929 +/- 3 + ptp4l[6779.529]: rms 17 max 25 freq -1895 +/- 23 delay 925 +/- 1 + ptp4l[6780.530]: rms 12 max 20 freq -1894 +/- 16 delay 926 +/- 2 + ptp4l[6781.531]: rms 11 max 20 freq -1887 +/- 14 delay 928 +/- 2 + ptp4l[6782.532]: rms 13 max 19 freq -1892 +/- 17 delay 929 +/- 1 + ptp4l[6783.533]: rms 15 max 29 freq -1866 +/- 11 delay 924 +/- 2 + ptp4l[6784.534]: rms 11 max 15 freq -1877 +/- 16 delay 925 +/- 1 + + ... | -.. rubric:: Dual EMAC Network Storm Prevention Support - :name: dual-emac-storm-prevention +************************ +Two Port Ethernet Switch +************************ + +PRU_ICSSM can operate as VLAN aware Switch mode with two external physical ports +and one internal host port. By default, interfaces come up in Dual independent +EMAC mode and can be changed to operate in Switch mode at runtime. +Note that changing from Dual EMAC to Switch mode needs loading of +different firmwares to various PRU cores and thus have to follow +specific sequence as shown in below sections: + +Enabling Switch mode +==================== + +Example assuming ETH2 and ETH3 as ICSSM interfaces: + +.. code-block:: console + + ip link set dev eth2 down + ip link set dev eth3 down + ip link add name br0 type bridge + ip link set dev eth2 master br0 + ip link set dev eth3 master br0 + ip link set dev br0 up + bridge vlan add dev br0 vid 1 pvid untagged self + ip link set dev eth2 up + ip link set dev eth3 up + +Going back to Dual EMAC mode +---------------------------- + +.. code-block:: console + + ip link set dev eth2 down + ip link set dev eth3 down + ip link set dev br0 down + ip link set dev eth1 nomaster + ip link set dev eth2 nomaster + ip link del name br0 type bridge + ip link set dev eth2 up + ip link set dev eth3 up + +Forwarding Data Bases (FDBs) +============================ + +Forwarding entries for MAC addresses are automatically added on the +appropriate switch port upon detection as default operation as an +unmanaged bridge. For managed bridge operation manually add FDB entries +as required. + +Manually adding FDBs + +.. code-block:: console + + bridge fdb add aa:bb:cc:dd:ee:fe dev eth2 master + +Multicast Data Bases (MDBs) +=========================== + +Multicast entries are automatically added on the appropriate switch port +upon detection as default operation as an unmanaged bridge. For managed +bridge operation manually add MDB entries as required. + +Manually adding MDBs + +.. code-block:: console + + bridge mdb add dev br0 port eth2 grp 239.1.1.1 permanent + +Multicast flooding +------------------ + +CPU port mcast_flooding is always on -Dual EMAC mode supports credit based network storm prevention feature -for each port. +Turning flooding on/off on switch ports -Refer to `Network Storm Prevention section <../../../Industrial_Protocols_HSR_PRP.html#network-storm-prevention>`__ -of HSR/PRP documentation for more details. +.. code-block:: console + bridge link set dev eth2 mcast_flood on/off -------------- @@ -536,8 +833,8 @@ to get your PRU-ICSS interface up and running already): .. rubric:: Is flow control supported in the PRU-ICSS Ethernet ports? :name: is-flow-control-supported-in-the-pru-icss-ethernet-ports -| Flow control is not currently supported in this version of the - PRU-ICSS Ethernet firware that is provided by Texas Instruments. +Flow control is not currently supported in this version of the +PRU-ICSS Ethernet firware that is provided by Texas Instruments. .. rubric:: Are multicast and VLAN filtering as well as storm prevention supported in the PRU-ICSS Ethernet ports?