DTS Needs for PTP on IMX?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DTS Needs for PTP on IMX?

971 Views
clementLollygag
Contributor I

Been trying to run ptp4l on my Linux build on an IMXMP with a grandmaster clock on the same network. I can never get the foreign clock to be detected even though I can see with tcpdump that I am receiving PTP multicast messages over ethernet from the expected grandmaster IP address.

Starting to expect a device tree thing and, per most device tree topics, there seems to be minimal information online for PTP-specific device tree needs. Also possible we are missing something in the kernel config file but, for any suggested config options I see online, we already have that option implemented. So wondering if anyone can suggest anything to try in the device tree or kernel config OR point me to a resource for ensuring PTP is able to work in our Linux build.

Thanks for any help in advance!

0 Kudos
Reply
9 Replies

689 Views
clementLollygag
Contributor I

Update on this - pretty sure this was not a device tree issue but a configuration issue with the IMX8 clock and the test PTP device we were using. On a Wireshark examination, saw that the domain number for PTP was not matching between the 2 devices, causing the IMX8 to never detect a foreign master clock.

0 Kudos
Reply

668 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

Can you please share the eqos device tree including pinctrl node and hardware design about eqos?

Best Regards
Zhiming

0 Kudos
Reply

919 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

For dts, you may need add iomux about XXX_XXX_1588_EVENT0_OUT, for example, add MX8MP_IOMUXC_SAI1_RXC__ENET1_1588_EVENT0_OUT in eth pinctrl node. This is decided by your hardware design using which gpio.

MX8MP_IOMUXC_SAI1_RXFS__ENET1_1588_EVENT0_IN	0x100
MX8MP_IOMUXC_SAI1_RXC__ENET1_1588_EVENT0_OUT	0x1c0

 

For drivers/net/ethernet/freescale/fec_ptp.c, need to use FEC_TMODE_TOGGLE for capturing signal with normal oscilloscope.

 

Zhiming_Liu_0-1725240683973.png



Best Regards
Zhiming

0 Kudos
Reply

850 Views
clementLollygag
Contributor I

Also another note here - I am using the ENET_QOS rather than ENET1. I'm unsure this uses the fec_ptp driver since, according to some example device trees online, the ENET_QOS does not use the fec drivers.

0 Kudos
Reply

837 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

Only FEC driver use ptp function.

Best Regards
Zhiming

0 Kudos
Reply

826 Views
clementLollygag
Contributor I

So the nxp,imx8mp-dwmac-eqos driver (driver we link in the device tree) doesn't support PTP/PTP4L? I am pretty confident the ENET EQOS supports IEEE 1588 so this is surprising.

0 Kudos
Reply

806 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

Sorry, just declear again, the EQOS use drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c, not fec_ptp.c. There is no need to modify stmmac_ptp.c. After setting the dts pinctl about IEEE1588 EVENT OUT, you can try below commands, then you may see pluse.

#  ptp4l -i ethX -p /dev/ptp0 -m -2 &
# T=$(($(date +%s) + 20))
# echo "0 $T 0 1 1" > /sys/class/ptp/ptp0/period

or

echo "0 $(date +%s) 100000000 1 0" > /sys/class/ptp/ptp0/period



Best Regards
Zhiming

0 Kudos
Reply

782 Views
clementLollygag
Contributor I

Alright good to know it supports it. From the bindings here, I might need to add a ptp route to my device tree...regardless my problem is still not with the GPIO out pin. It is with getting ptp4l to actually see a foreign master clock even though I can see foreign master on wireshark, tcpdump, etc. 

0 Kudos
Reply

897 Views
clementLollygag
Contributor I

Alright. I am aware of some of the needs to use that event in/out pin. It seems like some people issues with that AFTER ptp4l is able to detect a foreign clock and sync the system clock to a PTP time source. Does that fec_ptp driver need to be linked for ptp4l to see a foreign clock at all? That is my primary issue right now.

0 Kudos
Reply