linux-stable/drivers/net/dsa/mv88e6xxx
Kurt Kanzenbach 9627c981ac net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390
The switch receives management traffic such as STP and LLDP. However, PTP
messages are not received, only transmitted.

Ideally, the switch would trap all PTP messages to the management CPU. This
particular switch has a PTP block which identifies PTP messages and traps them
to a dedicated port. There is a register to program this destination. This is
not used at the moment.

Therefore, program it to the same port as the MGMT traffic is trapped to. This
allows to receive PTP messages as soon as timestamping is enabled.

In addition, the datasheet mentions that this register is not valid e.g., for
6190 variants. So, add a new PTP operation which is added for the 6390 and 6290
devices.

Tested simply like this on Marvell 88E6390, revision 1:

|/ # ptp4l -2 -i lan4 --tx_timestamp_timeout=40 -m
|[...]
|ptp4l[147.450]: master offset         56 s2 freq   +1262 path delay       413
|ptp4l[148.450]: master offset         22 s2 freq   +1244 path delay       434
|ptp4l[149.450]: master offset          5 s2 freq   +1234 path delay       446
|ptp4l[150.451]: master offset          3 s2 freq   +1233 path delay       451
|ptp4l[151.451]: master offset          1 s2 freq   +1232 path delay       451
|ptp4l[152.451]: master offset         -3 s2 freq   +1229 path delay       451
|ptp4l[153.451]: master offset          9 s2 freq   +1240 path delay       451

Link: https://lore.kernel.org/r/CAFSKS=PJBpvtRJxrR4sG1hyxpnUnQpiHg4SrUNzAhkWnyt9ivg@mail.gmail.com
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-01-16 13:36:57 +00:00
..
chip.c net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
chip.h net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
devlink.c net: devlink: let the core report the driver name instead of the drivers 2022-11-30 21:49:38 -08:00
devlink.h net: dsa: tear down devlink port regions when tearing down the devlink port on error 2021-09-19 13:05:44 +01:00
global1.c net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
global1.h net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
global1_atu.c net: dsa: mv88e6xxx: mac-auth/MAB implementation 2023-01-10 11:58:39 +01:00
global1_vtu.c net: dsa: mv88e6xxx: replace VTU violation prints with trace points 2022-12-12 15:01:18 -08:00
global2.c net: dsa: mv88e6xxx: Separate C22 and C45 transactions 2023-01-10 15:53:37 -08:00
global2.h net: dsa: mv88e6xxx: Separate C22 and C45 transactions 2023-01-10 15:53:37 -08:00
global2_avb.c
global2_scratch.c net: dsa: mv88e6xxx: add mv88e6352_g2_scratch_port_has_serdes() 2022-02-03 14:10:35 +00:00
hwtstamp.c net: dsa: Use netif_rx(). 2022-03-04 12:02:19 +00:00
hwtstamp.h net: dsa: no longer clone skb in core driver 2021-04-27 14:10:15 -07:00
Kconfig net: dsa: mv88e6xxx: depend on PTP conditionally 2022-12-26 09:03:44 +00:00
Makefile net: dsa: mv88e6xxx: mac-auth/MAB implementation 2023-01-10 11:58:39 +01:00
phy.c net: dsa: mv88e6xxx: Separate C22 and C45 transactions 2023-01-10 15:53:37 -08:00
phy.h net: dsa: mv88e6xxx: Separate C22 and C45 transactions 2023-01-10 15:53:37 -08:00
port.c net: dsa: mv88e6xxx: Add RGMII delay to 88E6320 2022-10-31 20:00:20 -07:00
port.h net: dsa: mv88e6xxx: Add RGMII delay to 88E6320 2022-10-31 20:00:20 -07:00
port_hidden.c net: dsa: mv88e6xxx: Fix port_hidden_wait to account for port_base_addr 2022-04-26 12:03:58 +02:00
ptp.c net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
ptp.h net: dsa: mv88e6xxx: Enable PTP receive for mv88e6390 2023-01-16 13:36:57 +00:00
serdes.c net: dsa: mv88e6xxx: Separate C22 and C45 transactions 2023-01-10 15:53:37 -08:00
serdes.h dsa: mv88e6xxx: make serdes SGMII/Fiber tx amplitude configurable 2022-02-11 11:21:34 +00:00
smi.c net: dsa: mv88e6xxx: Improve indirect addressing performance 2022-01-31 11:29:12 +00:00
smi.h
switchdev.c net: dsa: mv88e6xxx: mac-auth/MAB implementation 2023-01-10 11:58:39 +01:00
switchdev.h net: dsa: mv88e6xxx: mac-auth/MAB implementation 2023-01-10 11:58:39 +01:00
trace.c net: dsa: mv88e6xxx: replace ATU violation prints with trace points 2022-12-12 15:01:18 -08:00
trace.h net: dsa: mv88e6xxx: replace VTU violation prints with trace points 2022-12-12 15:01:18 -08:00