Skip to contentSkip to conversation

net: fec: Add support for periodic output signal of PPS

PATCH In review [email protected] 2 participants 3 messages Oct 19, 2022 – Oct 20, 2022

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 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
index 33f84a30e167..476e3863a310 100644
@@ -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
maintainer
#1 lore raw
Quoted 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.

author maintainer
#2 lore raw
Quoted 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 PPS

Quoted 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!