mbox series

[v2,net-next,0/7] Hardware operations for the SJA1105 DSA PTP clock

Message ID 20190910013501.3262-1-olteanv@gmail.com
Headers show
Series Hardware operations for the SJA1105 DSA PTP clock | expand

Message

Vladimir Oltean Sept. 10, 2019, 1:34 a.m. UTC
This series performs the following changes to the PTP portion of the
driver:
- Deletes the timecounter/cyclecounter implementation of a free-running
  PHC and replaces it with actual hardware corrections of the PTP
  timestamping clock.
- Deletes the approximation of timecounter_init() with the argument of
  ktime_to_ns(ktime_get_real()) (aka system clock) that is currently
  done in sja1105_ptp_reset. Now that the PTP clock can keep the wall
  time in hardware, it makes sense to do so (and thus arises the need
  to restore the PTP time after resetting the switch).
- Profits from the fact that timecounter/cyclecounter code has been
  removed from sja1105_main.c, and goes a step further by doing some
  more cleanup and making the PTP Kconfig more self-contained. The
  cleanup also covers preparing the driver for the gettimex API
  (PTP_SYS_OFFSET_EXTENDED ioctl) - an API which at the moment does
  not have the best implementation available in the kernel for this
  switch, but for which the addition of a better API is trivial after
  the cleanup.

 drivers/net/dsa/sja1105/sja1105.h      |  18 +-
 drivers/net/dsa/sja1105/sja1105_main.c |  66 ++++--
 drivers/net/dsa/sja1105/sja1105_ptp.c  | 283 +++++++++++++------------
 drivers/net/dsa/sja1105/sja1105_ptp.h  |  78 +++++++
 drivers/net/dsa/sja1105/sja1105_spi.c  |  42 ++--
 5 files changed, 310 insertions(+), 177 deletions(-)