Skip to content

Commit 4342d71

Browse files
WorldofJARcraftkartben
authored andcommitted
drivers: ethernet: Add Xilinx AXI Enet driver
The Xilinx AXI Ethernet subsystem is commonly found in FPGA designs. This patch adds a driver and device tree bindings for the Ethernet MAC core and its MDIO controller. The driver was tested on a RISC-V softcore in an FPGA design, with an RGMII phy and Ethernet subsystem version 7.2 Rev. 14. Device tree bindings match the device tree generated by Vitis hsi. Note that Vitis generates one of the two included compatible strings depending on version. Signed-off-by: Eric Ackermann <[email protected]>
1 parent c05cfbf commit 4342d71

File tree

11 files changed

+1067
-0
lines changed

11 files changed

+1067
-0
lines changed

drivers/ethernet/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ zephyr_library_sources_ifdef(CONFIG_ETH_RENESAS_RA eth_renesas_ra.c)
4444
zephyr_library_sources_ifdef(CONFIG_ETH_LAN9250 eth_lan9250.c)
4545
zephyr_library_sources_ifdef(CONFIG_ETH_SY1XX eth_sensry_sy1xx_mac.c)
4646
zephyr_library_sources_ifdef(CONFIG_ETH_NXP_ENET eth_nxp_enet.c)
47+
zephyr_library_sources_ifdef(CONFIG_ETH_XILINX_AXIENET eth_xilinx_axienet.c)
4748

4849
if(CONFIG_ETH_NXP_S32_NETC)
4950
zephyr_library_sources(eth_nxp_s32_netc.c)

drivers/ethernet/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ source "drivers/ethernet/Kconfig.xmc4xxx"
7676
source "drivers/ethernet/Kconfig.test"
7777
source "drivers/ethernet/Kconfig.lan9250"
7878
source "drivers/ethernet/Kconfig.sy1xx_mac"
79+
source "drivers/ethernet/Kconfig.xilinx_axienet"
7980

8081
source "drivers/ethernet/eth_nxp_enet_qos/Kconfig"
8182

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#
2+
#Xilinx AXI 1G / 2.5G Ethernet Subsystem
3+
#
4+
#Copyright(c) 2024, CISPA Helmholtz Center for Information Security
5+
#SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
config ETH_XILINX_AXIENET
9+
bool "Xilinx AXI Ethernet Driver"
10+
default y
11+
depends on DT_HAS_XLNX_AXI_ETHERNET_1_00_A_ENABLED
12+
depends on DMA_XILINX_AXI_DMA
13+
help
14+
Enable Xilinx 1G / 2.5G AXI Ethernet driver,
15+
commonly found on FPGAs.
16+
17+
config ETH_XILINX_AXIENET_BUFFER_NUM_TX
18+
int "Number of buffers for concurrent transmission (TX)."
19+
depends on ETH_XILINX_AXIENET
20+
default DMA_XILINX_AXI_DMA_SG_DESCRIPTOR_NUM_TX
21+
range 2 DMA_XILINX_AXI_DMA_SG_DESCRIPTOR_NUM_TX
22+
help
23+
Number of buffers for transmission allocated in the Xilinx AXI Ethernet driver.
24+
This limits how many transmissions can be in-flight at the same time.
25+
This cannot exceed the number of available TX buffers in the AXI DMA. However,
26+
in scenarios with multiple AXI DMAs for different purposes in the system, it
27+
may be desirable to reduce the number of concurrent transmissions to conserve
28+
resources.
29+
30+
config ETH_XILINX_AXIENET_BUFFER_NUM_RX
31+
int "Number of buffers for concurrent reception (RX)."
32+
depends on ETH_XILINX_AXIENET
33+
default DMA_XILINX_AXI_DMA_SG_DESCRIPTOR_NUM_RX
34+
range 2 DMA_XILINX_AXI_DMA_SG_DESCRIPTOR_NUM_RX
35+
help
36+
Number of buffers for reception allocated in the Xilinx AXI Ethernet driver.
37+
This limits how many transmissions can be in-flight at the same time.
38+
This cannot exceed the number of available RX buffers in the AXI DMA. However,
39+
in scenarios with multiple AXI DMAs for different purposes in the system, it
40+
may be desirable to reduce the number of concurrent transmissions to conserve
41+
resources.

0 commit comments

Comments
 (0)