Skip to contentSkip to conversation

net: microchip: lan743x: add support for PTP pulse width (duty cycle)

PATCH New [email protected] 1 participant 1 message Oct 12, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: microchip: lan743x: add support for PTP pulse width (duty cycle)

From: Yuiko Oshino <[email protected]>

If the PTP_PEROUT_DUTY_CYCLE flag is set, then check if the request_on value in ptp_perout_request matches the pre-defined values or a toggle option.
Return a failure if the value is not supported.

Preserve the old behaviors if the PTP_PEROUT_DUTY_CYCLE flag is not set.

Tested with an oscilloscope on EVB-LAN7430:
e.g., to output PPS 1sec period 500mS on (high) to GPIO 2.
./testptp -L 2,2
./testptp -p 1000000000 -w 500000000

---
 drivers/net/ethernet/microchip/lan743x_main.h |  1 +
 drivers/net/ethernet/microchip/lan743x_ptp.c  | 91 ++++++++++++++++---
 2 files changed, 81 insertions(+), 11 deletions(-)
drivers/net/ethernet/microchip/lan743x_main.h +1 -0
index 6080028c1df2..34c22eea0124 100644
@@ -279,6 +279,7 @@
 #define PTP_GENERAL_CONFIG_CLOCK_EVENT_1MS_	(3)
 #define PTP_GENERAL_CONFIG_CLOCK_EVENT_10MS_	(4)
 #define PTP_GENERAL_CONFIG_CLOCK_EVENT_200MS_	(5)
+#define PTP_GENERAL_CONFIG_CLOCK_EVENT_TOGGLE_	(6)
 #define PTP_GENERAL_CONFIG_CLOCK_EVENT_X_SET_(channel, value) \
 	(((value) & 0x7) << (1 + ((channel) << 2)))
 #define PTP_GENERAL_CONFIG_RELOAD_ADD_X_(channel)	(BIT((channel) << 2))
drivers/net/ethernet/microchip/lan743x_ptp.c +80 -11

135 lines not on this page · raw message

Signature · 1 line
2.25.1