2019-05-19 20:07:45 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2019-05-03 04:23:30 +08:00
|
|
|
config NET_DSA_SJA1105
|
|
|
|
tristate "NXP SJA1105 Ethernet switch family support"
|
|
|
|
depends on NET_DSA && SPI
|
2019-05-05 18:19:27 +08:00
|
|
|
select NET_DSA_TAG_SJA1105
|
2019-05-03 04:23:30 +08:00
|
|
|
select PACKING
|
|
|
|
select CRC32
|
|
|
|
help
|
|
|
|
This is the driver for the NXP SJA1105 automotive Ethernet switch
|
|
|
|
family. These are 5-port devices and are managed over an SPI
|
|
|
|
interface. Probing is handled based on OF bindings and so is the
|
2019-06-08 21:03:42 +08:00
|
|
|
linkage to PHYLINK. The driver supports the following revisions:
|
2019-05-03 04:23:30 +08:00
|
|
|
- SJA1105E (Gen. 1, No TT-Ethernet)
|
|
|
|
- SJA1105T (Gen. 1, TT-Ethernet)
|
|
|
|
- SJA1105P (Gen. 2, No SGMII, No TT-Ethernet)
|
|
|
|
- SJA1105Q (Gen. 2, No SGMII, TT-Ethernet)
|
|
|
|
- SJA1105R (Gen. 2, SGMII, No TT-Ethernet)
|
|
|
|
- SJA1105S (Gen. 2, SGMII, TT-Ethernet)
|
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 20:04:34 +08:00
|
|
|
|
|
|
|
config NET_DSA_SJA1105_PTP
|
2019-06-17 21:14:10 +08:00
|
|
|
bool "Support for the PTP clock on the NXP SJA1105 Ethernet switch"
|
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 20:04:34 +08:00
|
|
|
depends on NET_DSA_SJA1105
|
net: Make PTP-specific drivers depend on PTP_1588_CLOCK
Commit d1cbfd771ce8 ("ptp_clock: Allow for it to be optional") changed
all PTP-capable Ethernet drivers from `select PTP_1588_CLOCK` to `imply
PTP_1588_CLOCK`, "in order to break the hard dependency between the PTP
clock subsystem and ethernet drivers capable of being clock providers."
As a result it is possible to build PTP-capable Ethernet drivers without
the PTP subsystem by deselecting PTP_1588_CLOCK. Drivers are required to
handle the missing dependency gracefully.
Some PTP-capable Ethernet drivers (e.g., TI_CPSW) factor their PTP code
out into separate drivers (e.g., TI_CPTS_MOD). The above commit also
changed these PTP-specific drivers to `imply PTP_1588_CLOCK`, making it
possible to build them without the PTP subsystem. But as Grygorii
Strashko noted in [1]:
On Wed, Apr 22, 2020 at 02:16:11PM +0300, Grygorii Strashko wrote:
> Another question is that CPTS completely nonfunctional in this case and
> it was never expected that somebody will even try to use/run such
> configuration (except for random build purposes).
In my view, enabling a PTP-specific driver without the PTP subsystem is
a configuration error made possible by the above commit. Kconfig should
not allow users to create a configuration with missing dependencies that
results in "completely nonfunctional" drivers.
I audited all network drivers that call ptp_clock_register() but merely
`imply PTP_1588_CLOCK` and found five PTP-specific drivers that are
likely nonfunctional without PTP_1588_CLOCK:
NET_DSA_MV88E6XXX_PTP
NET_DSA_SJA1105_PTP
MACB_USE_HWSTAMP
CAVIUM_PTP
TI_CPTS_MOD
Note how these symbols all reference PTP or timestamping in their name;
this is a clue that they depend on PTP_1588_CLOCK.
Change them from `imply PTP_1588_CLOCK` [2] to `depends on PTP_1588_CLOCK`.
I'm not using `select PTP_1588_CLOCK` here because PTP_1588_CLOCK has
its own dependencies, which `select` would not transitively apply.
Additionally, remove the `select NET_PTP_CLASSIFY` from CPTS_TI_MOD;
PTP_1588_CLOCK already selects that.
[1]: https://lore.kernel.org/lkml/c04458ed-29ee-1797-3a11-7f3f560553e6@ti.com/
[2]: NET_DSA_SJA1105_PTP had never declared any type of dependency on
PTP_1588_CLOCK (`imply` or otherwise); adding a `depends on PTP_1588_CLOCK`
here seems appropriate.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Fixes: d1cbfd771ce8 ("ptp_clock: Allow for it to be optional")
Signed-off-by: Clay McClure <clay@daemons.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-04-29 15:59:00 +08:00
|
|
|
depends on PTP_1588_CLOCK
|
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 20:04:34 +08:00
|
|
|
help
|
|
|
|
This enables support for timestamping and PTP clock manipulations in
|
|
|
|
the SJA1105 DSA driver.
|
2019-09-15 10:00:02 +08:00
|
|
|
|
|
|
|
config NET_DSA_SJA1105_TAS
|
|
|
|
bool "Support for the Time-Aware Scheduler on NXP SJA1105"
|
2019-10-25 15:26:35 +08:00
|
|
|
depends on NET_DSA_SJA1105 && NET_SCH_TAPRIO
|
|
|
|
depends on NET_SCH_TAPRIO=y || NET_DSA_SJA1105=m
|
2019-11-12 08:11:54 +08:00
|
|
|
depends on NET_DSA_SJA1105_PTP
|
2019-09-15 10:00:02 +08:00
|
|
|
help
|
|
|
|
This enables support for the TTEthernet-based egress scheduling
|
|
|
|
engine in the SJA1105 DSA driver, which is controlled using a
|
|
|
|
hardware offload of the tc-tqprio qdisc.
|
2020-05-06 03:20:55 +08:00
|
|
|
|
|
|
|
config NET_DSA_SJA1105_VL
|
|
|
|
bool "Support for Virtual Links on NXP SJA1105"
|
|
|
|
depends on NET_DSA_SJA1105_TAS
|
|
|
|
help
|
|
|
|
This enables support for flow classification using capable devices
|
|
|
|
(SJA1105T, SJA1105Q, SJA1105S). The following actions are supported:
|
|
|
|
- redirect, trap, drop
|
|
|
|
- time-based ingress policing, via the tc-gate action
|