ptp: ocp: Expose various resources on the timecard.
PATCH v3 1/1 ptp: ocp: Expose various resources on the timecard.
The OpenCompute timecard driver has additional functionality besides a clock. Make the following resources available:
- The external timestamp channels (ts0/ts1)
- devlink support for flashing and health reporting
- GPS and MAC serial ports
- board serial number (obtained from i2c device)
Also add watchdog functionality for when GNSS goes into holdover.
The resources are collected under a driver procfs directory:
[jlemon@timecard ~]$ ls -g /proc/driver/ocp1
total 0
-rw-r--r--. 1 root 0 Jul 30 12:37 clock_source -r--r--r--. 1 root 0 Jul 30 12:37 gps_state
lrwxrwxrwx. 1 root 26 Jul 30 12:37 i2c -> /sys/bus/i2c/devices/i2c-2/
lrwxrwxrwx. 1 root 9 Jul 30 12:37 pps -> /dev/pps1 lrwxrwxrwx. 1 root 9 Jul 30 12:37 ptp -> /dev/ptp2 -r--r--r--. 1 root 0 Jul 30 12:37 serial
lrwxrwxrwx. 1 root 10 Jul 30 12:37 ttyGPS -> /dev/ttyS7 lrwxrwxrwx. 1 root 10 Jul 30 12:37 ttyMAC -> /dev/ttyS8
---
v3: fix missed warning: 0 -> NULL. Checked w/KCFLAGS=-W again.
v2: fix warnings.
drivers/ptp/Kconfig | 7 + drivers/ptp/ptp_ocp.c | 1312 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 1272 insertions(+), 47 deletions(-)
drivers/ptp/Kconfig +7 -0
@@ -157,6 +157,13 @@ config PTP_1588_CLOCK_OCP tristate "OpenCompute TimeCard as PTP clock" depends on PTP_1588_CLOCK depends on HAS_IOMEM && PCI + depends on SPI && I2C && MTD + imply SPI_MEM + imply SPI_XILINX + imply MTD_SPI_NOR + imply I2C_XILINX + select SERIAL_8250 + default n help This driver adds support for an OpenCompute time card.
drivers/ptp/ptp_ocp.c +1265 -47
1,463 lines not on this page · raw message
Signature · 1 line
2.30.2
Richard Cochran
maintainerQuoted 3 lines · Jonathan Lemon
The resources are collected under a driver procfs directory:
[jlemon@timecard ~]$ ls -g
/proc/driver/ocp1
I thought that adding new stuff under /proc was stopped years ago?
Thanks,
Richard
Quoted 7 lines · Richard Cochran
Quoted 3 lines · Jonathan Lemon
The resources are collected under a driver procfs directory:
[jlemon@timecard ~]$ ls -g
/proc/driver/ocp1I thought that adding new stuff under /proc was stopped years ago?
The Documentation seems to indicate that driver specific entries should be under /proc/driver, and there are several existing examples in the tree. No idea whether this is current best practice.
Signature · 1 line
Jonathan