linux_dsm_epyc7002/drivers/net/dsa/sja1105
Vladimir Oltean 664277781c net: dsa: sja1105: Change the PTP command access pattern
The PTP command register contains enable bits for:
- Putting the 64-bit PTPCLKVAL register in add/subtract or write mode
- Taking timestamps off of the corrected vs free-running clock
- Starting/stopping the TTEthernet scheduling
- Starting/stopping PPS output
- Resetting the switch

When a command needs to be issued (e.g. "change the PTPCLKVAL from write
mode to add/subtract mode"), one cannot simply write to the command
register setting the PTPCLKADD bit to 1, because that would zeroize the
other settings. One also cannot do a read-modify-write (that would be
too easy for this hardware) because not all bits of the command register
are readable over SPI.

So this leaves us with the only option of keeping the value of the PTP
command register in the driver, and operating on that.

Actually there are 2 types of PTP operations now:
- Operations that modify the cached PTP command. These operate on
  ptp_data->cmd as a pointer.
- Operations that apply all previously cached PTP settings, but don't
  otherwise cache what they did themselves. The sja1105_ptp_reset
  function is such an example. It copies the ptp_data->cmd on stack
  before modifying and writing it to SPI.

This practically means that struct sja1105_ptp_cmd is no longer an
implementation detail, since it needs to be stored in full into struct
sja1105_ptp_data, and hence in struct sja1105_private. So the (*ptp_cmd)
function prototype can change and take struct sja1105_ptp_cmd as second
argument now.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-10-14 16:45:40 -07:00
..
Kconfig net: dsa: sja1105: Add dependency for NET_DSA_SJA1105_TAS 2019-09-21 19:41:19 -07:00
Makefile net: dsa: sja1105: Configure the Time-Aware Scheduler via tc-taprio offload 2019-09-16 21:32:58 +02:00
sja1105_clocking.c net: dsa: sja1105: Rename sja1105_spi_send_packed_buf to sja1105_xfer_buf 2019-10-02 12:25:11 -04:00
sja1105_dynamic_config.c net: dsa: sja1105: Rename sja1105_spi_send_packed_buf to sja1105_xfer_buf 2019-10-02 12:25:11 -04:00
sja1105_dynamic_config.h net: dsa: sja1105: Plug in support for TCAM searches via the dynamic interface 2019-06-04 11:49:19 -07:00
sja1105_ethtool.c net: dsa: sja1105: Rename sja1105_spi_send_packed_buf to sja1105_xfer_buf 2019-10-02 12:25:11 -04:00
sja1105_main.c net: dsa: sja1105: Move PTP data to its own private structure 2019-10-14 16:45:40 -07:00
sja1105_ptp.c net: dsa: sja1105: Change the PTP command access pattern 2019-10-14 16:45:40 -07:00
sja1105_ptp.h net: dsa: sja1105: Change the PTP command access pattern 2019-10-14 16:45:40 -07:00
sja1105_spi.c net: dsa: sja1105: Make all public PTP functions take dsa_switch as argument 2019-10-14 16:45:40 -07:00
sja1105_static_config.c net: dsa: sja1105: Add static config tables for scheduling 2019-09-16 21:32:57 +02:00
sja1105_static_config.h net: dsa: sja1105: Add static config tables for scheduling 2019-09-16 21:32:57 +02:00
sja1105_tas.c net: dsa: sja1105: Configure the Time-Aware Scheduler via tc-taprio offload 2019-09-16 21:32:58 +02:00
sja1105_tas.h net: dsa: sja1105: Configure the Time-Aware Scheduler via tc-taprio offload 2019-09-16 21:32:58 +02:00
sja1105.h net: dsa: sja1105: Change the PTP command access pattern 2019-10-14 16:45:40 -07:00