Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Jia Wang <wangjia@ultrarisc.com>,
	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 Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Jose Abreu <joabreu@synopsys.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
Subject: Re: [PATCH net-next 3/3] net: stmmac: Add UltraRISC DP1000 GMAC support
Date: Tue, 1 Sep 2026 09:29:51 +0200	[thread overview]
Message-ID: <49620860-9bd5-48fb-bbaf-55da377e9018@bootlin.com> (raw)
In-Reply-To: <20260901-dwmac-ultrarisc-v1-3-f19454814bcf@ultrarisc.com>

Hello,

On 9/1/26 03:27, Jia Wang wrote:
> The DP1000 GMAC integration provides fixed TX and RX RGMII clock delays
> that cannot be disabled. For boards without PCB delays, "rgmii-id"
> describes the link, but passing that mode unchanged to the PHY would enable
> a second set of delays.
> 
> Use phy_fix_phy_mode_for_mac_delays() to translate "rgmii-id" to "rgmii"
> before attaching the PHY. Reject other RGMII modes because the fixed MAC
> delays cannot be combined with them without duplicating or omitting a
> delay.
> 
> Signed-off-by: Jia Wang <wangjia@ultrarisc.com>

Simple enough, this is nice :)

One thing, I'm going to start requiring this for new glue drivers, can you give
the output of "ethtool -t eth0" on your device with this new glue driver ?

You'll have to enable CONFIG_STMMAC_SELFTESTS

As this is is a 5.20, I'm expecting you'll get something like :

 1. MAC Loopback                 0
 2. MMC Counters                 0
 3. EEE                          -95
 4. Hash Filter MC               0
 5. Perfect Filter UC            0
 6. MC Filter                    0
 7. UC Filter                    0
 8. Flow Control                 -95
 9. RSS                          -95
10. VLAN Filtering               -110
11. VLAN Filtering (perf)        -110
12. Double VLAN Filter           -110
13. Double VLAN Filter (perf)    -110
14. Flexible RX Parser           -95
15. SA Insertion (desc)          0
16. SA Replacement (desc)        0
17. SA Insertion (reg)           0
18. SA Replacement (reg)         0
19. VLAN TX Insertion            -110
20. SVLAN TX Insertion           -95
21. L3 DA Filtering              -95
22. L3 SA Filtering              -95
23. L4 DA TCP Filtering          -95
24. L4 SA TCP Filtering          -95
25. L4 DA UDP Filtering          -95
26. L4 SA UDP Filtering          -95
27. ARP Offload                  -110
28. Jumbo Frame                  0
29. Multichannel Jumbo           -95
30. Split Header                 -95
31. TBS (ETF Scheduler)          -95

-95 (-EOPNOTSUP) and 0 are OK, watch for any other values.

If ARP Offload and any VLAN selftest (insertion and filtering), this is a known
issue and you can ignore :)

Maxime


> ---
>  MAINTAINERS                                        |  1 +
>  drivers/net/ethernet/stmicro/stmmac/Kconfig        | 11 +++++
>  drivers/net/ethernet/stmicro/stmmac/Makefile       |  1 +
>  .../net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c  | 54 ++++++++++++++++++++++
>  4 files changed, 67 insertions(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 3b96ff0734e6..aacbab369b51 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -28008,6 +28008,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..4bdda2665338
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c
> @@ -0,0 +1,54 @@
> +// 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/phy.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->phy_interface =
> +		phy_fix_phy_mode_for_mac_delays(plat_dat->phy_interface, true, true);
> +	if (plat_dat->phy_interface == PHY_INTERFACE_MODE_NA)
> +		return dev_err_probe(dev, -EINVAL, "unsupported phy interface mode\n");
> +
> +	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");
> 



  reply	other threads:[~2026-09-01  7:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  1:27 [PATCH net-next 0/3] net: stmmac: Add UltraRISC DP1000 GMAC support Jia Wang
2026-09-01  1:27 ` [PATCH net-next 1/3] dt-bindings: net: snps,dwmac: Add UltraRISC DP1000 compatible Jia Wang
2026-09-01 17:46   ` Conor Dooley
2026-09-02  9:35     ` Jia Wang
2026-09-01  1:27 ` [PATCH net-next 2/3] dt-bindings: net: Add UltraRISC DP1000 GMAC Jia Wang
2026-09-01 17:47   ` Conor Dooley
2026-09-01  1:27 ` [PATCH net-next 3/3] net: stmmac: Add UltraRISC DP1000 GMAC support Jia Wang
2026-09-01  7:29   ` Maxime Chevallier [this message]
2026-09-01  8:32     ` Jia Wang
2026-09-01  9:05       ` Maxime Chevallier
2026-09-01 13:48   ` Andrew Lunn

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=49620860-9bd5-48fb-bbaf-55da377e9018@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.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=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=robh@kernel.org \
    --cc=wangjia@ultrarisc.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