From: Jia Wang <wangjia@ultrarisc.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Jose Abreu <joabreu@synopsys.com>,
Chen Wang <chen.wang@linux.dev>,
Inochi Amaoto <inochiama@gmail.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
Jia Wang <wangjia@ultrarisc.com>,
sophgo@lists.linux.dev
Subject: [PATCH net-next v2 5/5] net: stmmac: Add UltraRISC DP1000 GMAC support
Date: Mon, 07 Sep 2026 15:46:54 +0800 [thread overview]
Message-ID: <20260907-dwmac-ultrarisc-v2-5-9a39bf8db313@ultrarisc.com> (raw)
In-Reply-To: <20260907-dwmac-ultrarisc-v2-0-9a39bf8db313@ultrarisc.com>
The UltraRISC DP1000 GMAC provides fixed internal delays on both TX and RX
RGMII clock paths.
Add a platform glue driver and describe both delay capabilities through
the common stmmac platform data. This lets the common RGMII delay handling
adjust the interface mode passed to the PHY and reject incompatible RGMII
modes.
Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
MAINTAINERS | 1 +
drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 +++++
drivers/net/ethernet/stmicro/stmmac/Makefile | 1 +
.../net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c | 52 ++++++++++++++++++++++
4 files changed, 65 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 01597d1df270..d6fb876227e9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -27999,6 +27999,7 @@ ULTRARISC DP1000 DWMAC GLUE LAYER
M: Jia Wang <wangjia@ultrarisc.com>
S: Maintained
F: Documentation/devicetree/bindings/net/ultrarisc,dp1000-gmac.yaml
+F: drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c
ULTRARISC DP1000 PINCTRL DRIVER
M: Jia Wang <wangjia@ultrarisc.com>
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index e3dd5adda5ac..ab3c4cf96423 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -319,6 +319,17 @@ config DWMAC_THEAD
the stmmac device driver. This driver is used for T-HEAD TH1520
ethernet controller.
+config DWMAC_ULTRARISC
+ tristate "UltraRISC DWMAC support"
+ default ARCH_ULTRARISC
+ depends on OF && (ARCH_ULTRARISC || COMPILE_TEST)
+ help
+ Support for the Ethernet controller on the UltraRISC DP1000 SoC.
+
+ This selects the UltraRISC platform specific glue layer support
+ for the stmmac device driver. This driver is used for the DP1000
+ GMAC Ethernet controller.
+
config DWMAC_IMX8
tristate "NXP IMX8 DWMAC support"
default ARCH_MXC
diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
index a1cea2f57252..b16a456b730e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Makefile
+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o
obj-$(CONFIG_DWMAC_SUN8I) += dwmac-sun8i.o
obj-$(CONFIG_DWMAC_SUN55I) += dwmac-sun55i.o
obj-$(CONFIG_DWMAC_THEAD) += dwmac-thead.o
+obj-$(CONFIG_DWMAC_ULTRARISC) += dwmac-ultrarisc.o
obj-$(CONFIG_DWMAC_DWC_QOS_ETH) += dwmac-dwc-qos-eth.o
obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o
obj-$(CONFIG_DWMAC_LOONGSON1) += dwmac-loongson1.o
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c
new file mode 100644
index 000000000000..0b62a75b782a
--- /dev/null
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * UltraRISC DWMAC platform driver
+ *
+ * Copyright (C) 2026 UltraRISC Technology (Shanghai) Co., Ltd.
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include "stmmac_platform.h"
+
+static int ultrarisc_dwmac_probe(struct platform_device *pdev)
+{
+ struct plat_stmmacenet_data *plat_dat;
+ struct stmmac_resources stmmac_res;
+ struct device *dev = &pdev->dev;
+ int ret;
+
+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to get resources\n");
+
+ plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ if (IS_ERR(plat_dat))
+ return dev_err_probe(dev, PTR_ERR(plat_dat),
+ "failed to parse DT parameters\n");
+
+ plat_dat->has_internal_tx_delay = true;
+ plat_dat->has_internal_rx_delay = true;
+
+ return devm_stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
+}
+
+static const struct of_device_id ultrarisc_dwmac_match[] = {
+ { .compatible = "ultrarisc,dp1000-gmac" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ultrarisc_dwmac_match);
+
+static struct platform_driver ultrarisc_dwmac_driver = {
+ .probe = ultrarisc_dwmac_probe,
+ .driver = {
+ .name = "ultrarisc-dwmac",
+ .pm = &stmmac_pltfr_pm_ops,
+ .of_match_table = ultrarisc_dwmac_match,
+ },
+};
+module_platform_driver(ultrarisc_dwmac_driver);
+
+MODULE_DESCRIPTION("UltraRISC DWMAC platform driver");
+MODULE_LICENSE("GPL");
--
2.34.1
next prev parent reply other threads:[~2026-09-07 7:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 7:46 [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support Jia Wang
2026-09-07 7:46 ` [PATCH net-next v2 1/5] net: stmmac: Add common internal RGMII delay handling Jia Wang
2026-09-07 11:44 ` Maxime Chevallier
2026-09-07 7:46 ` [PATCH net-next v2 2/5] net: stmmac: sophgo: Use common " Jia Wang
2026-09-07 11:45 ` Maxime Chevallier
2026-09-07 7:46 ` [PATCH net-next v2 3/5] net: stmmac: eic7700: " Jia Wang
2026-09-07 11:46 ` Maxime Chevallier
2026-09-07 7:46 ` [PATCH net-next v2 4/5] dt-bindings: net: Add UltraRISC DP1000 GMAC Jia Wang
2026-09-07 7:46 ` Jia Wang [this message]
2026-09-07 11:48 ` [PATCH net-next v2 5/5] net: stmmac: Add UltraRISC DP1000 GMAC support Maxime Chevallier
2026-09-10 8:50 ` [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support patchwork-bot+netdevbpf
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=20260907-dwmac-ultrarisc-v2-5-9a39bf8db313@ultrarisc.com \
--to=wangjia@ultrarisc.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=chen.wang@linux.dev \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=inochiama@gmail.com \
--cc=joabreu@synopsys.com \
--cc=krzk+dt@kernel.org \
--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=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=robh@kernel.org \
--cc=sophgo@lists.linux.dev \
/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).