关于fec_ptp驱动的一个疑问

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

关于fec_ptp驱动的一个疑问

543 Views
mahongfei
Contributor I

fec_ptp_start_cyclecounter函数中,会调用timercounter_init将系统时间同步到ptp时间。但是fec_ptp_start_cyclecounter函数在多个场景下都会调用到,ptp时间可能会多次从系统时间同步,这样ptp时间就可能出现跳变。

根据对gptp协议栈的理解,ptp时间在gptp协议栈启动后就不应该再出现跳变,应该只是在初始时间基础上随着硬件时钟递增。而且这个初始时间其实不太重要,因为gptp是相对时间协议。所以我理解,fec_ptp_start_cyclecounter中的timercounter_init是不是单板上电之后只调用一次即可,多次调用反而有时间跳变的风险?这样修改是否可行,会不会有什么影响?

Tags (1)
0 Kudos
3 Replies

515 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @mahongfei 

I hope you are doing well.

fec_ptp_start_cyclecounter() is called once when the board is powered on or FEC restart happens. and it will not be called every-time when time synchronization happens.

Thanks & Regards

Sanket Parekh

0 Kudos

503 Views
mahongfei
Contributor I

@Sanket_Parekh ,是的,我们看到在link change,eth open和ethtool/ioctl set feature等场景下,都会有fec restart,然后重新同步时间。
这里重新同步就会导致时间跳变,进而影响到我们gptp协议栈正常工作。
我们想要把fec_ptp_start_cyclecounter()修改为上电之后只调用一次?请问会有什么影响吗?

0 Kudos

479 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @mahongfei ,

you can modify by fec_ptp_start_cyclecounter() to be called only once after power up by commenting call to fec_ptp_start_cyclecounter() in fec_restart() in fec_main.c
In this way, it will only call it at start-up and after that time synchronization should be handled by your gPTP stack.
 
Thanks & Regards
Sanket Parekh
0 Kudos