From: Vladimir Oltean <olteanv@gmail.com>
To: f.fainelli@gmail.com, vivien.didelot@gmail.com, andrew@lunn.ch,
davem@davemloft.net
Cc: vinicius.gomes@intel.com, richardcochran@gmail.com,
netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>
Subject: [PATCH net-next 0/2] PTP clock source for SJA1105 tc-taprio offload
Date: Tue, 12 Nov 2019 02:11:52 +0200 [thread overview]
Message-ID: <20191112001154.26650-1-olteanv@gmail.com> (raw)
This series makes the IEEE 802.1Qbv egress scheduler of the sja1105
switch use a time reference that is synchronized to the network. This
enables quite a few real Time Sensitive Networking use cases, since in
this mode the switch can offer its clients a TDMA sort of access to the
network, and guaranteed latency for frames that are properly scheduled
based on the common PTP time.
The driver needs to do a 2-part activity:
- Program the gate control list into the static config and upload it
over SPI to the switch (already supported)
- Write the activation time of the scheduler (base-time) into the
PTPSCHTM register, and set the PTPSTRTSCH bit.
- Monitor the activation of the scheduler at the planned time and its
health.
Ok, 3 parts.
The time-aware scheduler cannot be programmed to activate at a time in
the past, and there is some logic to avoid that.
PTPCLKCORP is one of those "black magic" registers that just need to be
written to the length of the cycle. There is a 40-line long comment in
the second patch which explains why.
Vladimir Oltean (2):
net: dsa: sja1105: Make the PTP command read-write
net: dsa: sja1105: Implement state machine for TAS with PTP clock
source
drivers/net/dsa/sja1105/Kconfig | 1 +
drivers/net/dsa/sja1105/sja1105.h | 16 +-
drivers/net/dsa/sja1105/sja1105_ptp.c | 77 +++--
drivers/net/dsa/sja1105/sja1105_ptp.h | 24 +-
drivers/net/dsa/sja1105/sja1105_spi.c | 16 +-
drivers/net/dsa/sja1105/sja1105_tas.c | 428 +++++++++++++++++++++++++-
drivers/net/dsa/sja1105/sja1105_tas.h | 27 ++
7 files changed, 534 insertions(+), 55 deletions(-)
--
2.17.1
next reply other threads:[~2019-11-12 0:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 0:11 Vladimir Oltean [this message]
2019-11-12 0:11 ` [PATCH net-next 1/2] net: dsa: sja1105: Make the PTP command read-write Vladimir Oltean
2019-11-12 0:11 ` [PATCH net-next 2/2] net: dsa: sja1105: Implement state machine for TAS with PTP clock source Vladimir Oltean
2019-11-14 23:09 ` [PATCH net-next 0/2] PTP clock source for SJA1105 tc-taprio offload David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191112001154.26650-1-olteanv@gmail.com \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=vinicius.gomes@intel.com \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).