linux/drivers/net/dsa
Vladimir Oltean bb77f36ac2 net: dsa: sja1105: Add support for the PTP clock
The design of this PHC driver is influenced by the switch's behavior
w.r.t. timestamping.  It exposes two PTP counters, one free-running
(PTPTSCLK) and the other offset- and frequency-corrected in hardware
through PTPCLKVAL, PTPCLKADD and PTPCLKRATE.  The MACs can sample either
of these for frame timestamps.

However, the user manual warns that taking timestamps based on the
corrected clock is less than useful, as the switch can deliver corrupted
timestamps in a variety of circumstances.

Therefore, this PHC uses the free-running PTPTSCLK together with a
timecounter/cyclecounter structure that translates it into a software
time domain.  Thus, the settime/adjtime and adjfine callbacks are
hardware no-ops.

The timestamps (introduced in a further patch) will also be translated
to the correct time domain before being handed over to the userspace PTP
stack.

The introduction of a second set of PHC operations that operate on the
hardware PTPCLKVAL/PTPCLKADD/PTPCLKRATE in the future is somewhat
unavoidable, as the TTEthernet core uses the corrected PTP time domain.
However, the free-running counter + timecounter structure combination
will suffice for now, as the resulting timestamps yield a sub-50 ns
synchronization offset in steady state using linuxptp.

For this patch, in absence of frame timestamping, the operations of the
switch PHC were tested by syncing it to the system time as a local slave
clock with:

phc2sys -s CLOCK_REALTIME -c swp2 -O 0 -m -S 0.01

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-06-08 15:20:40 -07:00
..
b53 treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
microchip treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mv88e6xxx Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-07 11:00:14 -07:00
sja1105 net: dsa: sja1105: Add support for the PTP clock 2019-06-08 15:20:40 -07:00
bcm_sf2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
bcm_sf2.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
bcm_sf2_cfp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
bcm_sf2_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
dsa_loop.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
dsa_loop.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dsa_loop_bdinfo.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
lan9303-core.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
lan9303.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
lan9303_i2c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
lan9303_mdio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
lantiq_gswip.c net: dsa: lantiq: fix spelling mistake "brigde" -> "bridge" 2019-05-08 09:43:56 -07:00
lantiq_pce.h net: dsa: Add Lantiq / Intel DSA driver for vrx200 2018-09-13 08:14:33 -07:00
Makefile net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch 2019-05-03 10:49:17 -04:00
mt7530.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mt7530.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mv88e6060.c net: dsa: mv88e6060: Remove support for legacy probing 2019-04-30 23:13:33 -04:00
mv88e6060.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
qca8k.c net: dsa: qca8k: extend slave-bus implementations 2019-03-26 10:47:10 -07:00
qca8k.h net: dsa: qca8k: extend slave-bus implementations 2019-03-26 10:47:10 -07:00
realtek-smi.c net: dsa: realtek-smi: fix OF child-node lookup 2019-01-17 14:04:49 -08:00
realtek-smi.h net: dsa: realtek-smi: Add Realtek SMI driver 2018-07-18 13:43:38 +09:00
rtl8366.c dsa: rtl8366: Remove unused variable. 2018-07-18 14:42:18 +09:00
rtl8366rb.c dsa: Remove phydev parameter from disable_port call 2019-02-24 22:30:34 -08:00
vitesse-vsc73xx.c dsa: Remove phydev parameter from disable_port call 2019-02-24 22:30:34 -08:00