Skip to content

Commit bfec6d7

Browse files
dramforeverPaolo Abeni
authored andcommitted
net: spacemit: Add K1 Ethernet MAC
The Ethernet MACs found on SpacemiT K1 appears to be a custom design that only superficially resembles some other embedded MACs. SpacemiT refers to them as "EMAC", so let's just call the driver "k1_emac". Supports RGMII and RMII interfaces. Includes support for MAC hardware statistics counters. PTP support is not implemented. Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Tested-by: Junhui Liu <junhui.liu@pigmoral.tech> Tested-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Link: https://patch.msgid.link/20250914-net-k1-emac-v12-2-65b31b398f44@iscas.ac.cn Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 62a12a2 commit bfec6d7

File tree

6 files changed

+2612
-0
lines changed

6 files changed

+2612
-0
lines changed

drivers/net/ethernet/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ source "drivers/net/ethernet/sis/Kconfig"
188188
source "drivers/net/ethernet/sfc/Kconfig"
189189
source "drivers/net/ethernet/smsc/Kconfig"
190190
source "drivers/net/ethernet/socionext/Kconfig"
191+
source "drivers/net/ethernet/spacemit/Kconfig"
191192
source "drivers/net/ethernet/stmicro/Kconfig"
192193
source "drivers/net/ethernet/sun/Kconfig"
193194
source "drivers/net/ethernet/sunplus/Kconfig"

drivers/net/ethernet/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ obj-$(CONFIG_NET_VENDOR_SOLARFLARE) += sfc/
9191
obj-$(CONFIG_NET_VENDOR_SGI) += sgi/
9292
obj-$(CONFIG_NET_VENDOR_SMSC) += smsc/
9393
obj-$(CONFIG_NET_VENDOR_SOCIONEXT) += socionext/
94+
obj-$(CONFIG_NET_VENDOR_SPACEMIT) += spacemit/
9495
obj-$(CONFIG_NET_VENDOR_STMICRO) += stmicro/
9596
obj-$(CONFIG_NET_VENDOR_SUN) += sun/
9697
obj-$(CONFIG_NET_VENDOR_SUNPLUS) += sunplus/
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
config NET_VENDOR_SPACEMIT
2+
bool "SpacemiT devices"
3+
default y
4+
depends on ARCH_SPACEMIT || COMPILE_TEST
5+
help
6+
If you have a network (Ethernet) device belonging to this class,
7+
say Y.
8+
9+
Note that the answer to this question does not directly affect
10+
the kernel: saying N will just cause the configurator to skip all
11+
the questions regarding SpacemiT devices. If you say Y, you will
12+
be asked for your specific chipset/driver in the following questions.
13+
14+
if NET_VENDOR_SPACEMIT
15+
16+
config SPACEMIT_K1_EMAC
17+
tristate "SpacemiT K1 Ethernet MAC driver"
18+
depends on ARCH_SPACEMIT || COMPILE_TEST
19+
depends on MFD_SYSCON
20+
depends on OF
21+
default m if ARCH_SPACEMIT
22+
select PHYLIB
23+
help
24+
This driver supports the Ethernet MAC in the SpacemiT K1 SoC.
25+
26+
To compile this driver as a module, choose M here: the module
27+
will be called k1_emac.
28+
29+
endif # NET_VENDOR_SPACEMIT
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
#
3+
# Makefile for the SpacemiT network device drivers.
4+
#
5+
6+
obj-$(CONFIG_SPACEMIT_K1_EMAC) += k1_emac.o

0 commit comments

Comments
 (0)