-
Running ptp4l with hardware timestamping on RV2?
I got Orange PI RV2 many months earlier to experiment with RISCV. I installed initially Orange PI Ubuntu and recently Armbian, I was able to cross compile RV2 image using RPI5 which is great. To my big surprise the RV2 board ethernet show it is supporting hardware timestamping by looking at ethtool -T root@orangepirv2:/sys/class/net/eth0/queues# ethtool -T eth0 Time stamping parameters for eth0: Capabilities: hardware-transmit software-transmit hardware-receive software-receive software-system-clock hardware-raw-clock Hardware timestamp provider index: 0 Hardware timestamp provider qualifier: Precise (IEEE 1588 quality) Hardware Transmit Timestamp Modes: off on Hardware Receive Filter Modes: none all ptpv1-l4-event ptpv1-l4-sync ptpv1-l4-delay-req ptpv2-l4-event ptpv2-l4-sync ptpv2-l4-delay-req ptpv2-event ptpv2-sync ptpv2-delay-req However when trying to run ptp4l in either master or slave with "ptp4l -i eth0 -2 -m --tx_timestamp_timeout 100 -s" or "ptp4l -i eth0 -2 -m --tx_timestamp_timeout 100" ptp4l complained it cannot receive timestamp when in slave mode when SYNC is received, or in master when DELAY_REQ is received. ptp4l in master mode can send SYNC and receive timestamp for subsequent FOLLOWUP packet, so for tx RV2 ethernet can return the tx timestamp, but for receive it does not work. I check the datasheet of K1 ethernet and PTP section registers, nothing seem wrong. I just suspect maybe the filter for PTP packet to be timestamped maybe not working. root@orangepirv2:/sys/class/net/eth0/queues# /root/Downloads/linuxptp-code/ptp4l -i eth0 -2 -m --tx_timestamp_timeout 100 ptp4l[120447.510]: selected /dev/ptp0 as PTP clock ptp4l[120447.512]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[120447.513]: port 0 (/var/run/ptp/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[120447.513]: port 0 (/var/run/ptp/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[120453.808]: port 1 (eth0): LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[120453.808]: selected local clock c0742b.fffe.fcd1e0 as best master ptp4l[120453.808]: port 1 (eth0): assuming the grand master role ptp4l[120492.717]: port 1 (eth0): received DELAY_REQ without timestamp ptp4l[120493.027]: port 1 (eth0): received DELAY_REQ without timestamp ptp4l[120494.187]: port 1 (eth0): received DELAY_REQ without timestamp ptp4l[120494.332]: port 1 (eth0): received DELAY_REQ without timestamp ptp4l[120495.579]: port 1 (eth0): received DELAY_REQ without timestamp ptp4l[120496.234]: port 1 (eth0): received DELAY_REQ without timestamp ptp4l[120496.659]: port 1 (eth0): received DELAY_REQ without timestamp ptp4l[120498.583]: port 1 (eth0): received DELAY_REQ without timestamp root@orangepirv2:/sys/class/net/eth0/queues# /root/Downloads/linuxptp-code/ptp4l -i eth0 -2 -m --tx_timestamp_timeout 100 -s ptp4l[120550.932]: selected /dev/ptp0 as PTP clock ptp4l[120550.934]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[120550.935]: port 0 (/var/run/ptp/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[120550.935]: port 0 (/var/run/ptp/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[120550.996]: port 1 (eth0): received SYNC without timestamp ptp4l[120551.996]: port 1 (eth0): received SYNC without timestamp ptp4l[120551.997]: port 1 (eth0): new foreign master 2ccf67.fffe.1f909a-1 ptp4l[120552.996]: port 1 (eth0): received SYNC without timestamp ptp4l[120553.996]: port 1 (eth0): received SYNC without timestamp ptp4l[120554.996]: port 1 (eth0): received SYNC without timestamp ptp4l[120555.996]: port 1 (eth0): received SYNC without timestamp ptp4l[120555.997]: selected best master clock 2ccf67.fffe.1f909a ptp4l[120555.997]: port 1 (eth0): LISTENING to UNCALIBRATED on RS_SLAVE ptp4l[120556.996]: port 1 (eth0): received SYNC without timestamp ptp4l[120557.996]: port 1 (eth0): received SYNC without timestamp the driver is driver/net/ethernet/spacemit for Armbian, kernel 6.18 from Orangepi they use older kernel 6.6 and driver/net/ethernet/k1 the two drivers are identical with minor changes, the section for ptp handling looks identical. I hope to find kernel dev here who has tried ptp4l with the Spacemit ethernet with PTP support for help. I work a lot on PTP so anytime I see a board supporting hardware timestamping, I just want to try. So far only boards I know with hw timestamping is RPI5 and BeagleBoneBlack (even if only 100M). Have a good day! Chi-Thanh
-
Orange PI RV2 Jumbo Frame
The driver does not change max_mtu to a higher limit when it is registering to netdev , so default is 1500. You are right that the RV2 hw i.e. K1 ethernet can do up to 16K not 18K according to K1 user guide. But the driver limit the size internally to 4K, so this is a soft limit. First is if you can recompile the kernel/driver, you can change max_mtu to higher value as the first step, and remove the software limit from 4K to let say 9K which is more common for jumbo frame mtu.
Chi-Thanh Hoang
Members
-
Joined
-
Last visited