From: alexis.lothore@bootlin.com
To: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Richard Cochran <richardcochran@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Nicolas Carrier <nicolas.carrier@nav-timing.safrangroup.com>
Subject: [PATCH net-next 0/8] net: stmmac: enable timestamp snapshots for DWMAC1000
Date: Fri, 16 Jun 2023 12:04:01 +0200 [thread overview]
Message-ID: <20230616100409.164583-1-alexis.lothore@bootlin.com> (raw)
From: Alexis Lothoré <alexis.lothore@bootlin.com>
While trying to use the recently implemented auxiliary snapshot feature
([1]) on Cyclone V platform (embedding DWMAC1000 IP), I realized that some
parts are too tightly coupled to GMAC4 version of the IP. For example,
timestamp_interrupt function in stmmac_hwtstamp.c reads some timestamp
status (GMAC_TIMESTAMP_STATUS), which offset is relevant for GMAC4 (ptpaddr
+ 0x20), but not for GMAC3 (which should be ptpaddr + 0x28).
Another example is that auxiliary snapshot trigger configuration is done in
a dedicated register for GMAC4, while it is in the general Timestamp
control register for DWMAC1000.
This series proposes to split those too specific parts in each IP variant
file. DWMAC1000 mapping is based on Cyclone V HPS register map ([2]) while
GMAC4 mapping has been checked based on some Elkhart Lake range processors
mapping ([3])
One point I am not sure about is for all other variants: sun8i-dwmac,
dwxgmac2 and dwmac100. I have no clue about registers layout for those
platforms. I then had to possible approaches to enable feature on
DWMAC1000:
- ensure that current behaviour is preserved for dwxgmac2, sun8i-dwmac and
dwmac100; keep auxiliary snapshot feature in stmmac_ptp.c and add
dwmac1000 behaviour as an "exception"
- assume auxiliary snaspshots controls are different for each, then move the
controls in each IP version file (XXXX_core.c)
I felt like stmmac_ptp.c should remain independant from the IP version, so
I chose the second option, but since I do not know about other versions
layout (and do not have the hardware), I did not wire "blindly" the
feature on those platform.
Please let me know if I am wrong and/or if I should come with a more
conservative approach (ie first version)
Tested on Cyclone V with testptp
[1] https://lore.kernel.org/netdev/20210414001617.3490-1-vee.khee.wong@linux.intel.com/
[2] https://cdrdv2.intel.com/v1/dl/getContent/666962?fileName=cv_5v4-683126-666962.pdf
[3] https://cdrdv2.intel.com/v1/dl/getContent/636722?fileName=636722_EHL+Datasheet+V2+Book+2_rev003.pdf
Alexis Lothoré (8):
net: stmmac: add IP-specific callbacks for auxiliary snapshot
net: stmmac: populate dwmac4 callbacks for auxiliary snapshots
net: stmmac: move PTP interrupt handling to IP-specific DWMAC file
net: stmmac: move common defines in stmmac_ptp.h
net: stmmac: set number of snapshot external triggers for GMAC3
net: stmmac: introduce setter/getter for timestamp configuration
net: stmmac: do not overwrite other flags when writing timestamp
control
net: stmmac: enable timestamp external trigger for dwmac1000
.../ethernet/stmicro/stmmac/dwmac-socfpga.c | 2 +
.../net/ethernet/stmicro/stmmac/dwmac1000.h | 12 ++-
.../ethernet/stmicro/stmmac/dwmac1000_core.c | 83 ++++++++++++++++++
drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 29 +++++--
.../net/ethernet/stmicro/stmmac/dwmac4_core.c | 85 +++++++++++++++++++
drivers/net/ethernet/stmicro/stmmac/hwif.h | 17 +++-
.../ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 62 ++------------
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 14 +--
.../net/ethernet/stmicro/stmmac/stmmac_ptp.c | 29 ++-----
.../net/ethernet/stmicro/stmmac/stmmac_ptp.h | 26 +-----
10 files changed, 246 insertions(+), 113 deletions(-)
--
2.41.0
next reply other threads:[~2023-06-16 10:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 10:04 alexis.lothore [this message]
2023-06-16 10:04 ` [PATCH net-next 1/8] net: stmmac: add IP-specific callbacks for auxiliary snapshot alexis.lothore
2023-06-16 10:04 ` [PATCH net-next 2/8] net: stmmac: populate dwmac4 callbacks for auxiliary snapshots alexis.lothore
2023-06-16 10:04 ` [PATCH net-next 3/8] net: stmmac: move PTP interrupt handling to IP-specific DWMAC file alexis.lothore
2023-06-16 13:34 ` Simon Horman
2023-06-16 13:48 ` Alexis Lothoré
2023-06-17 3:09 ` kernel test robot
2023-06-16 10:04 ` [PATCH net-next 4/8] net: stmmac: move common defines in stmmac_ptp.h alexis.lothore
2023-06-16 10:04 ` [PATCH net-next 5/8] net: stmmac: set number of snapshot external triggers for GMAC3 alexis.lothore
2023-06-16 10:04 ` [PATCH net-next 6/8] net: stmmac: introduce setter/getter for timestamp configuration alexis.lothore
2023-06-16 10:04 ` [PATCH net-next 7/8] net: stmmac: do not overwrite other flags when writing timestamp control alexis.lothore
2023-06-16 10:04 ` [PATCH net-next 8/8] net: stmmac: enable timestamp external trigger for dwmac1000 alexis.lothore
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=20230616100409.164583-1-alexis.lothore@bootlin.com \
--to=alexis.lothore@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.carrier@nav-timing.safrangroup.com \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=richardcochran@gmail.com \
--cc=thomas.petazzoni@bootlin.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
all inboxes | Powered by JetHome®