Skip to contentSkip to conversation

Add OpenCompute timecard driver

PATCH Applied Jonathan Lemon 3 participants 6 messages Dec 4, 2020 – Dec 5, 2020

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

v3 cover Add OpenCompute timecard driver

From: Jonathan Lemon <[email protected]>

v2->v3:
remove dev_info() informational lines
v1->v2:
make the driver dependent on CONFIG_PCI, for the test robot. move the config option under PTP_1588_CLOCK hierarcy
v1:
initial submission

Jonathan Lemon (1):
ptp: Add clock driver for the OpenCompute TimeCard.

 drivers/ptp/Kconfig   |  14 ++
 drivers/ptp/Makefile  |   1 +
 drivers/ptp/ptp_ocp.c | 400 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 415 insertions(+)
 create mode 100644 drivers/ptp/ptp_ocp.c
Signature · 1 line
2.24.1
#1 lore raw

PATCH v3 1/1 ptp: Add clock driver for the OpenCompute TimeCard.

The OpenCompute time card is an atomic clock along with a GPS receiver that provides a Grandmaster clock source for a PTP enabled network.

More information is available at http://www.timingcard.com/

---
 drivers/ptp/Kconfig   |  14 ++
 drivers/ptp/Makefile  |   1 +
 drivers/ptp/ptp_ocp.c | 398 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 413 insertions(+)
 create mode 100644 drivers/ptp/ptp_ocp.c
drivers/ptp/Kconfig +14 -0
index 942f72d8151d..476d7c7fe70a 100644
@@ -151,4 +151,18 @@ config PTP_1588_CLOCK_VMW
 	  To compile this driver as a module, choose M here: the module
 	  will be called ptp_vmw.
 
+config PTP_1588_CLOCK_OCP
+	tristate "OpenCompute TimeCard as PTP clock"
+	depends on PTP_1588_CLOCK
+	depends on HAS_IOMEM && PCI
+	default n
+	help
+	  This driver adds support for an OpenCompute time card.
+
+	  The OpenCompute time card is an atomic clock along with
+	  a GPS receiver that provides a Grandmaster clock source
+	  for a PTP enabled network.
+
+	  More information is available at http://www.timingcard.com/
+
 endmenu
drivers/ptp/Makefile +1 -0
index 7aff75f745dc..db5aef3bddc6 100644
@@ -15,3 +15,4 @@ ptp-qoriq-$(CONFIG_DEBUG_FS)		+= ptp_qoriq_debugfs.o
 obj-$(CONFIG_PTP_1588_CLOCK_IDTCM)	+= ptp_clockmatrix.o
 obj-$(CONFIG_PTP_1588_CLOCK_IDT82P33)	+= ptp_idt82p33.o
 obj-$(CONFIG_PTP_1588_CLOCK_VMW)	+= ptp_vmw.o
+obj-$(CONFIG_PTP_1588_CLOCK_OCP)	+= ptp_ocp.o
drivers/ptp/ptp_ocp.c new file +398 -0

398 lines not on this page · raw message

Signature · 1 line
2.24.1
maintainer Applied
#3 lore raw

Re: [PATCH 1/1 v3 net-next] ptp: Add clock driver for the OpenCompute TimeCard.

Quoted 10 lines · On Fri, 4 Dec 2020 05:40:11 -0800 Richard Cochran wrote:
Quoted 7 lines · Jonathan Lemon

The OpenCompute time card is an atomic clock along with a GPS receiver that provides a Grandmaster clock source for a PTP enabled network.

More information is available at http://www.timingcard.com/

Applied, thanks!

maintainer
#4 lore raw

Re: [PATCH 1/1 v3 net-next] ptp: Add clock driver for the OpenCompute TimeCard.

In reply to Jonathan Lemon
Quoted 7 lines · On Thu, 3 Dec 2020 19:51:28 -0800 Jonathan Lemon wrote:
drivers/ptp/ptp_ocp.c new file +7 -0
+static int __init
+ptp_ocp_init(void)
+{
+	int err;
+
+	err = pci_register_driver(&ptp_ocp_driver);
+	return err;

drivers/ptp/ptp_ocp.c line 395

Quoted 10 lines
drivers/ptp/ptp_ocp.c new file +10 -0
+}
+
+static void __exit
+ptp_ocp_fini(void)
+{
+	pci_unregister_driver(&ptp_ocp_driver);
+}
+
+module_init(ptp_ocp_init);
+module_exit(ptp_ocp_fini);

FWIW if you want to send a follow up you can replace all this with:

module_pci_driver(ptp_ocp_driver);

maintainer
#5 lore raw

Re: [PATCH 1/1 v3 net-next] ptp: Add clock driver for the OpenCompute TimeCard.

Quoted 21 lines · On Sat, 5 Dec 2020 13:57:18 -0800 Jakub Kicinski wrote:
Quoted 7 lines · On Thu, 3 Dec 2020 19:51:28 -0800 Jonathan Lemon wrote:
drivers/ptp/ptp_ocp.c new file +7 -0
+static int __init
+ptp_ocp_init(void)
+{
+	int err;
+
+	err = pci_register_driver(&ptp_ocp_driver);
+	return err;

drivers/ptp/ptp_ocp.c line 395

Quoted 10 lines
drivers/ptp/ptp_ocp.c new file +10 -0
+}
+
+static void __exit
+ptp_ocp_fini(void)
+{
+	pci_unregister_driver(&ptp_ocp_driver);
+}
+
+module_init(ptp_ocp_init);
+module_exit(ptp_ocp_fini);  

FWIW if you want to send a follow up you can replace all this with:

Quoted 1 line

module_pci_driver(ptp_ocp_driver);

Also consider adding yourself a MAINTAINERS entry.