[PATCH net-next v2 0/8] Add Xilinx TSN Endpoint Ethernet MAC driver
From: Srinivas Neeli <srinivas.neeli@amd.com>
Date: 2026-09-08 19:20:30
Also in:
linux-arm-kernel, linux-rt-devel, lkml, netdev
Introduce a new network driver for the AMD LogiCORE 100M/1G TSN
Subsystem IP, also known as the TSN Endpoint Ethernet MAC IP, which
implements IEEE 802.1 Time-Sensitive Networking (TSN) features for
deterministic and low-latency Ethernet communication in real-time and
industrial automation use cases.
The v1 posting sent all 20 patches (wrapper, endpoint and the DSA switch)
as one series. Following the review feedback to split it, this v2 sends
only the wrapper and endpoint side (patches 1-8). The DSA switch driver,
tag protocol, MDIO, phylink, PTP and bridge offloads will follow as a
separate series once this base lands.
IP Core Overview:
The AMD LogiCORE 100M/1G TSN Subsystem IP solution (named as TSN Endpoint
Ethernet MAC IP in the IP catalog) implements IEEE 802.1 Time Sensitive
Networking (TSN) Standards and provides a low latency Bridged Endpoint or
Endpoint only solutions. The bridged endpoint solution consists of a 3-port
switch that connects to an endpoint including Linux software drivers. For
Bridged Endpoint (Switch Endpoint), two ports connects to the network and
one port connects to an internal Endpoint. It supports the use of
GMII/RGMII interfaces connecting to a physical-side interface (PHY) chip
with full duplex 100 Mb/s and 1 Gb/s operations.
Features:
- IP Customizable to generate TSN Endpoint or Bridged Endpoint solution
- Supports interface to network software stack
- Designed to comply with the following IEEE standards
- 802.1AS : Precision Time Protocol (PTP) synchronization
- 802.1Qav : Credit-Based Shaper for traffic shaping
- 802.1Qbv : Time-Aware Shaper for scheduled traffic
- 802.1Qbu : Frame Preemption for ultra-low latency
- 802.1CB : Frame Replication and Elimination for redundancy
- 802.1Qcc : Stream Reservation Protocol (SRP)
- IP is customizable to enable various TSN feature-sets
- Supports 2 to 8 priority queues for scheduled, reserved (IEEE 802.1 Qav
Credit Based Shaper) and best effort traffic classes
- Provides feature rich Ethernet Switch that caters to various network
needs
* 3-port Switch (2-external, 1-internal)
* Programmable cut-through and store-forward operations
* 4-port Switch (2-external, 2-internal) extension through
'Endpoint Extension' and 'Endpoint Packet Switching' features
- Solution validated on ZCU102 & ZC702 AMD Evaluation boards.
Sample hardware architecture diagram for Bidge End Point like below:
+------------------+
| MCDMA |
+---------+--------+
Q0---Q7
|
+------------------------------------------------------------ +
| | TSN sub system(Bridge End Point) |
| | |
| +------+----+ Port 0 +-----------------------+ |
| | EndPoint |<--------->| TSN Switch | |
| | (EP) | +----+-------------+----+ |
| +-----------+ | | |
| | | |
| Port 1 Port 2 |
| | | |
| +-----------+ +-----------+ |
| | MAC-1 | | MAC-2 | |
| | (ETH1) | | (ETH2) | |
| +-----+-----+ +-----+-----+ |
| | | |
| | | |
+-------------------------------------------------------------+
| |
RGMII RGMII
| |
+-----------+ +-----------+
| PHY1 | | PHY2 |
| (Port 0) | | (Port 2) |
+-----------+ +-----------+
Software Driver Overview:
This series adds the wrapper and endpoint side of the IP. The switch-facing
part is exposed through the Distributed Switch Architecture (DSA) framework
in a follow-up series, so that MAC1 and MAC2 show up to Linux as switch
ports with the endpoint acting as the CPU/conduit port. The endpoint frames
are already classified by source-port id and tagged with DSA port metadata
here, so the switch series can consume them without further endpoint
change.
Wrapper driver:
- Binds the top-level IP node, acquires and enables the IP-block clocks.
- Spawns the endpoint (and, later, switch) blocks as child platform
devices via devm_of_platform_populate() and carries no netdev or
register access of its own.
Endpoint driver:
- Implements the conduit net_device that Linux DMA traffic flows through
on its way to and from the switch fabric.
- Manages multi-queue TX and RX descriptor rings using the dmaengine
framework for high-performance packet transfer.
- Classifies each received frame by the source-port id carried in the RX
descriptor sideband metadata and attaches DSA port metadata so the DSA
core can demux it to the right user port netdev.
Changes in v2:
- Split the original 20-patch series. This v2 carries only the wrapper and
endpoint (patches 1-8). The DSA switch driver, tag protocol and offloads
will be posted as a separate follow-up series.
- binding: describe only the Bridged Endpoint configuration, drop reg from
the wrapper node (it has none of its own, ranges covers the child
windows), rename ep-mac@ to ethernet@ and mdio-mac1/2 to mdio-1/2, cap
the DMA channels at 8 (dma-names maxItems 16, tx_chan/rx_chan [0-7],
dma-channel-num max 7), use a ports/ethernet-ports container and require
port@0, port@1 and port@2, add reg (enum [1, 2]) and require reg,
phy-mode and phy-handle on the external ports (gmii/rgmii/rgmii-id), and
add minItems on the switch interrupts.
- Kconfig: depend on OF_ADDRESS instead of OF && HAS_IOMEM, point the help
text at the companion DSA driver rather than a symbol that does not exist
yet, and drop the mod_devicetable.h include (platform_device.h pulls it
in).
- endpoint: name the netdev ep%d instead of a fixed "ep", drop the mapped
but unused register window, use dev_kfree_skb_any() on the drop path, and
drop the mod_devicetable.h include.
- endpoint DMA: check xlnx,dma-channel-num against the channels dma-names
lists, require one queue per tx_chan and num-priorities equal to the TX
channel count, cap TX/RX at 8, error out on an unknown dma-names entry,
and drop the unreachable count guards.
- endpoint MCDMA bring-up: request a channel at probe time so -EPROBE_DEFER
stays in the probe path and never reaches ndo_open, and request channels
by their real dma-names index instead of a dense 0..N-1 sequence.
- endpoint RX: serialise the refill against teardown under a per-channel
lock, recover a drained ring with a refill timer instead of stalling,
fail ndo_open if a channel cannot arm any descriptor, take the ring size
from the channel, shut the refill timer down with timer_shutdown_sync()
at teardown, and return true from the refill helper when it arms a
descriptor.
- endpoint TX: take the scatterlist count from skb_to_sgvec(), check
dmaengine_submit() before advancing the ring and charging BQL, publish
the ring head and tail with WRITE_ONCE(), move tx_lock into the
per-channel struct so independent TX queues do not share one lock, use
the spinlock_bh guard class in the completion callback, and use
dmaengine_prep_slave_sg().
- endpoint RX to DSA: attach the port metadata only when the netdev is a
DSA conduit, take a counted dst reference (dst_hold() + skb_dst_set()) so
the dst survives the __netif_rx() backlog handoff without skb_dst_force()
in softirq, and release it with dst_release() at teardown.
Previous versions:
v1 (full 20-patch series, now split):
https://lore.kernel.org/lkml/20260807104431.157230-1-nagadheeraj.rottela@amd.com/ (local)
Test information:
- Validated these changes on the net-next branch with the MCDMA metadata
patches cherry-picked from linux-next, along with the series listed below
https://lore.kernel.org/all/20260713072146.45269-1-srinivas.neeli@amd.com/ (local)
- The endpoint RX path depends on AXI MCDMA metadata support in the
dmaengine driver. On plain net-next, xilinx_mcdma_prep_slave_sg() does
not attach metadata_ops and desc_metadata_modes stays 0 for
XDMA_TYPE_AXIMCDMA, so dmaengine_desc_get_metadata_ptr() returns
-ENOTSUPP and ep_dma_rx_cb() would drop every received frame. The series
therefore depends on the MCDMA metadata support that extends metadata_ops
to XDMA_TYPE_AXIMCDMA and returns the descriptor status word (index 0 is
status, index 1 is the sideband word carrying TID/TDEST/TUSER, index 2
onward is the app words). That dmaengine work is a prerequisite for RX to
function and the TSN patches touch no dmaengine code. It will be posted
to the dmaengine tree and this series carries a Depends-on note plus a
lore link once it is on-list.
- Performed ping, iperf3 and multi-queue TX/RX tests on the ZynqMP ZCU102
platform, with the endpoint conduit up and both external MACs cabled to
peer NICs. Also ran teardown and probe-defer stress under KASAN and
lockdep with no use-after-free or locking splats.
Signed-off-by: Srinivas Neeli <srinivas.neeli@amd.com>
---
Nagadheeraj Rottela (1):
net: xilinx: tsn: deliver endpoint RX frames to DSA user ports
Srinivas Neeli (7):
dt-bindings: net: add Xilinx TSN Endpoint Ethernet MAC
net: xilinx: tsn: add TSN endpoint wrapper driver
net: xilinx: tsn: add endpoint MAC driver skeleton
net: xilinx: tsn: parse endpoint DMA channel configuration
net: xilinx: tsn: bring up the endpoint MCDMA channels
net: xilinx: tsn: add the endpoint RX data path
net: xilinx: tsn: add the endpoint TX data path
.../net/xlnx,tsn-endpoint-ethernet-mac.yaml | 364 +++++++
MAINTAINERS | 8 +
drivers/net/ethernet/xilinx/Kconfig | 1 +
drivers/net/ethernet/xilinx/Makefile | 1 +
drivers/net/ethernet/xilinx/tsn/Kconfig | 16 +
drivers/net/ethernet/xilinx/tsn/Makefile | 2 +
drivers/net/ethernet/xilinx/tsn/xilinx_tsn.h | 15 +
drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c | 1034 ++++++++++++++++++++
drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c | 107 ++
9 files changed, 1548 insertions(+)
---
base-commit: bc6fe9d301d59fe5cb236d646abe792bffae5fa6
change-id: 20260831-patches_v2_external-36421e557430
prerequisite-message-id: 20260818174151.1608971-1-srinivas.neeli@amd.com
prerequisite-patch-id: abfd1f0259ea7524a5b6a4a7c98b116a213910d0
prerequisite-patch-id: 64bc1fc9008bff333d8cab78d018d93db31c2ee7
prerequisite-patch-id: 3e7fee96146b9a89dbd70f83942e4acf61cfd730
prerequisite-patch-id: 87d626e07a12df2d50163e12e34879868c750253
Best regards,
--
Srinivas Neeli [off-list ref]