Skip to contentSkip to conversation

ptp: add FemtoClock3 Wireless as ptp hardware clock

PATCH In review Min Li 2 participants 2 messages Jan 15, 2024 – Feb 6, 2024 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Min Li

author
#1 lore raw

PATCH v8 2/2 ptp: add FemtoClock3 Wireless as ptp hardware clock

From: Min Li <[email protected]>

The RENESAS FemtoClock3 Wireless is a high-performance jitter attenuator, frequency translator, and clock synthesizer. The device is comprised of 3 digital PLLs (DPLL) to track CLKIN inputs and three independent low phase noise fractional output dividers (FOD) that output low phase noise clocks.

FemtoClock3 supports one Time Synchronization (Time Sync) channel to enable an external processor to control the phase and frequency of the Time Sync channel and to take phase measurements using the TDC. Intended applications are synchronization using the precision time protocol (PTP) and synchronization with 0.5 Hz and 1 Hz signals from GNSS.

---
 drivers/ptp/Kconfig                |   12 +
 drivers/ptp/Makefile               |    1 +
 drivers/ptp/ptp_fc3.c              | 1016 ++++++++++++++++++++++++++++
 drivers/ptp/ptp_fc3.h              |   45 ++
 include/linux/mfd/idtRC38xxx_reg.h |  273 ++++++++
 5 files changed, 1347 insertions(+)
 create mode 100644 drivers/ptp/ptp_fc3.c
 create mode 100644 drivers/ptp/ptp_fc3.h
 create mode 100644 include/linux/mfd/idtRC38xxx_reg.h
drivers/ptp/Kconfig +12 -0
index 5dd5f188e..604541dcb 100644
@@ -155,6 +155,18 @@ config PTP_1588_CLOCK_IDTCM
 	  To compile this driver as a module, choose M here: the module
 	  will be called ptp_clockmatrix.
 
+config PTP_1588_CLOCK_FC3W
+	tristate "RENESAS FemtoClock3 Wireless as PTP clock"
+	depends on PTP_1588_CLOCK && I2C
+	default n
+	help
+	  This driver adds support for using Renesas FemtoClock3 Wireless
+	  as a PTP clock. This clock is only useful if your time stamping
+	  MAC is connected to the RENESAS chip.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called ptp_fc3.
+
 config PTP_1588_CLOCK_MOCK
 	tristate "Mock-up PTP clock"
 	depends on PTP_1588_CLOCK
drivers/ptp/Makefile +1 -0
index dea0cebd2..68bf02078 100644
@@ -15,6 +15,7 @@ obj-$(CONFIG_PTP_1588_CLOCK_QORIQ)	+= ptp-qoriq.o
 ptp-qoriq-y				+= ptp_qoriq.o
 ptp-qoriq-$(CONFIG_DEBUG_FS)		+= ptp_qoriq_debugfs.o
 obj-$(CONFIG_PTP_1588_CLOCK_IDTCM)	+= ptp_clockmatrix.o
+obj-$(CONFIG_PTP_1588_CLOCK_FC3W)	+= ptp_fc3.o
 obj-$(CONFIG_PTP_1588_CLOCK_IDT82P33)	+= ptp_idt82p33.o
 obj-$(CONFIG_PTP_1588_CLOCK_MOCK)	+= ptp_mock.o
 obj-$(CONFIG_PTP_1588_CLOCK_VMW)	+= ptp_vmw.o
drivers/ptp/ptp_fc3.c new file +1016 -0

1,016 lines not on this page · raw message

drivers/ptp/ptp_fc3.h new file +45 -0

45 lines not on this page · raw message

include/linux/mfd/idtRC38xxx_reg.h new file +273 -0

273 lines not on this page · raw message

Signature · 1 line
2.39.2
#2 lore raw

Hi Min,

Quoted 7 lines · Min Li

From: Min Li <[email protected]>

The RENESAS FemtoClock3 Wireless is a high-performance jitter attenuator, frequency translator, and clock synthesizer. The device is comprised of 3 digital PLLs (DPLL) to track CLKIN inputs and three independent low phase noise fractional output dividers (FOD) that output low phase noise clocks.

Quoted 7 lines

FemtoClock3 supports one Time Synchronization (Time Sync) channel to enable an external processor to control the phase and frequency of the Time Sync channel and to take phase measurements using the TDC. Intended applications are synchronization using the precision time protocol (PTP) and synchronization with 0.5 Hz and 1 Hz signals from GNSS.

Thanks for your patch, which is now commit 1ddfecafabf71e0e ("ptp:
add FemtoClock3 Wireless as ptp hardware clock") in net-next/main.

drivers/ptp/Kconfig config PTP_1588_CLOCK_IDTCM · line 160

Quoted 9 lines
drivers/ptp/Kconfig +3 -0
@@ -155,6 +155,18 @@ config PTP_1588_CLOCK_IDTCM
          To compile this driver as a module, choose M here: the module
          will be called ptp_clockmatrix.
 
+config PTP_1588_CLOCK_FC3W
+       tristate "RENESAS FemtoClock3 Wireless as PTP clock"
+       depends on PTP_1588_CLOCK && I2C

This driver does not seem to use any direct i2c functionality (it does use regmap), so presumably it should depend on something else (see below) instead?

drivers/ptp/Kconfig config PTP_1588_CLOCK_IDTCM · line 161

Quoted 1 line
drivers/ptp/Kconfig +1 -0
+       default n

"default n" is the default.

Quoted 14 lines
drivers/ptp/Kconfig +8 -0
+       help
+         This driver adds support for using Renesas FemtoClock3 Wireless
+         as a PTP clock. This clock is only useful if your time stamping
+         MAC is connected to the RENESAS chip.
+
+         To compile this driver as a module, choose M here: the module
+         will be called ptp_fc3.
+
 config PTP_1588_CLOCK_MOCK
        tristate "Mock-up PTP clock"
        depends on PTP_1588_CLOCK

drivers/ptp/ptp_fc3.c line 1014

Quoted 8 lines
drivers/ptp/ptp_fc3.c new file +7 -0
 
+static struct platform_driver idtfc3_driver = {
+       .driver = {
+               .name = "rc38xxx-phc",
+       },
+       .probe = idtfc3_probe,
+       .remove = idtfc3_remove,
+};

Who is supposed to instantiate this platform device? I couldn't find anything in-tree or on lore.kernel.org. Presumably that driver should be a dependency for the PTP_1588_CLOCK_FC3W config symbol.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds