net: fec: Add support for periodic output signal of PPS
Subsystems (3)
[email protected]
maintainerPATCH 1/1 net: fec: Add support for periodic output signal of PPS
From: Wei Fang <[email protected]>
This patch adds the support for configuring periodic output signal of PPS. So the PPS can be output at a specified time and period.
For developers or testers, they can use the command "echo <channel> <start.sec> <start.nsec> <period.sec> <period. nsec> > /sys/class/ptp/ptp0/period" to specify time and period to output PPS signal.
Notice that, the channel can only be set to 0. In addtion, the start time must larger than the current PTP clock time. So users can use the command "phc_ctl /dev/ptp0 -- get" to get the current PTP clock time before.
--- drivers/net/ethernet/freescale/fec.h | 2 + drivers/net/ethernet/freescale/fec_ptp.c | 164 ++++++++++++++++++++++- 2 files changed, 164 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/fec.h +2 -0
@@ -658,6 +658,8 @@ struct fec_enet_private {unsigned int reload_period;int pps_enable;unsigned int next_counter; +struct hrtimer perout_timer; +u64 perout_stime;struct imx_sc_ipc *ipc_handle;
drivers/net/ethernet/freescale/fec_ptp.c +162 -2
213 lines not on this page · raw message
Signature · 1 line
2.25.1
Jakub Kicinski
maintainerQuoted 13 lines · On Wed, 19 Oct 2022 13:08:08 +0800 [email protected] wrote:
From: Wei Fang <[email protected]>
This patch adds the support for configuring periodic output signal of PPS. So the PPS can be output at a specified time and period.
For developers or testers, they can use the command "echo <channel> <start.sec> <start.nsec> <period.sec> <period. nsec> >/sys/class/ptp/ptp0/period" to specify time and period to output PPS signal.
Notice that, the channel can only be set to 0. In addtion, the start time must larger than the current PTP clock time. So users can use the command "phc_ctl/dev/ptp0-- get" to get the current PTP clock time before.
You need to CC Richard C the PTP maintainer on PTP-related patches, please repost.
Wei Fang
maintainerQuoted 25 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: 2022年10月20日 10:13
To: Wei Fang <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Frank Li <[email protected]>
Subject: Re: [PATCH net-next] net: fec: Add support for periodic output signal of PPSQuoted 12 lines · On Wed, 19 Oct 2022 13:08:08 +0800 [email protected] wrote:
From: Wei Fang <[email protected]>
This patch adds the support for configuring periodic output signal of PPS. So the PPS can be output at a specified time and period. For developers or testers, they can use the command "echo <channel> <start.sec> <start.nsec> <period.sec> <period.
nsec> >/sys/class/ptp/ptp0/period" to specify time and period to output PPS signal.
Notice that, the channel can only be set to 0. In addtion, the start time must larger than the current PTP clock time.
So users can use the command "phc_ctl/dev/ptp0-- get" to get the current PTP clock time before.
Quoted 2 lines
You need to CC Richard C the PTP maintainer on PTP-related patches, please repost.
Okay, thanks!