Hello everyone,
I am pretty new to this, so I'll try to provide as much info as possible. We are using an i.MX8M Mini based board (the Nitrogen8mm) and we are looking into time synchronization using a combination of NTP and PTP.
Essentially, we need to input a PPS signal to discipline the system time and get a PPS output signal so that we can use it to synchronize other components. These two signals must be highly synchronized, which is why we want to make use of the PTP ports. According to the Reference Manual, the I2C2_SCL and I2C2_SDA can be set for ENET1_1588_EVENT1_IN and ENET1_1588_EVENT1_OUT respectively.
We currently have managed to get the output PPS signal by adding the following lines in the FEC pinctrl of the device tree and disabling all other I2C2 declarations.
MX8MM_IOMUXC_I2C2_SDA_ENET1_1588_EVENT1_OUT 0x00000116
MX8MM_IOMUXC_I2C2_SCL_ENET1_1588_EVENT1_IN 0x00000136
Also, in the fec_ptp.c driver, we modified the FEC Channel to 1, since the hardcoded value only allowed output in the EVENT0_OUT pin.
#define FEC_CHANNLE_0 1
#define DEFAULT_PPS_CHANNEL FEC_CHANNLE_0
Now I'm attempting to get the input and output signal to be synchronized. I tried testing the input signal by using the testptp tool, however, when running the command below to set up PPS input, I get the error PTP_PIN_SETFUNC: Invalid argument.
testptp -d /dev/ptp0 -L 0,1
Likewise, when probing with the command below, I get the error PTP_EXTTS_REQUEST: Invalid argument.
testptp -d /dev/ptp0 -e 1000
Furthermore, using ethtool and testptp for getting the device capabilities I get the following results.
Time stamping parameters for end0:
Capabilities:
hardware-transmit
software-transmit
hardware-receive
software-receive
software-system-clock
hardware-raw-clock
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
off
on
Hardware Receive Filter Modes:
none
all
capabilities:
250000000 maximum frequency adjustment (ppb)
0 programmable alarms
0 external time stamp channels
1 programmable periodic signals
1 pulse per second
0 programmable pins
0 cross timestamping
0 adjust_phase
0 maximum phase adjustment (ns)
From what I've been able to gather, this is a reference to something in the kernel's ptp driver going wrong. Some more research pointed out that the culprit may be the fec_ptp.c driver. There seems to be no implementation of a PPS input event, only PPS out, and that may be causing a conflict between the PTP kernel driver and the Ethernet controller PTP driver.
So my question is, are there any missing pieces I have not considered? Is the driver not compatible with the tools and is doing synchronization of the signals under the hood?
Thank you in advance for any info and advice you can give!