From: Jakub Kicinski <kuba@kernel.org>
To: inochiama@gmail.com
Cc: Jakub Kicinski <kuba@kernel.org>,
davem@davemloft.net, dlan@kernel.org, palmer@dabbelt.com,
me@ziyao.cc, boon.khai.ng@altera.com,
linux-riscv@lists.infradead.org, edumazet@google.com,
joabreu@synopsys.com, pjw@kernel.org,
weishangjuan@eswincomputing.com, andrew+netdev@lunn.ch,
prabhakar.mahadev-lad.rj@bp.renesas.com,
siyanteng@cqsoftware.com.cn, richardcochran@gmail.com,
looong.bin@gmail.com, quentin.schulz@cherry.de, alex@ghiti.fr,
robh@kernel.org, krzk+dt@kernel.org, dlan@gentoo.org,
alexandre.torgue@foss.st.com, conor+dt@kernel.org,
netdev@vger.kernel.org, aou@eecs.berkeley.edu,
rmk+kernel@armlinux.org.uk, linux-arm-kernel@lists.infradead.org,
vladimir.oltean@nxp.com, mcoquelin.stm32@gmail.com,
spacemit@lists.linux.dev, linux-kernel@vger.kernel.org,
peppe.cavallaro@st.com, devicetree@vger.kernel.org,
pabeni@redhat.com, linux-stm32@st-md-mailman.stormreply.com,
wens@kernel.org, maxime.chevallier@bootlin.com
Subject: Re: [net-next,v7,3/3] net: stmmac: Add glue layer for Spacemit K3 SoC
Date: Thu, 5 Mar 2026 18:52:37 -0800 [thread overview]
Message-ID: <20260306025237.580075-1-kuba@kernel.org> (raw)
In-Reply-To: <20260304080721.1658224-4-inochiama@gmail.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: stmmac: Add glue layer for Spacemit K3 SoC
The ethernet controller on Spacemit K3 SoC is Synopsys DesignWare
MAC (version 5.40a), with the following special points:
1. The rate of the tx clock line is auto changed when the mac speed
rate is changed, and no need for changing the input tx clock.
2. This controller require a extra syscon device to configure the
interface type, enable wake up interrupt and delay configuration
if needed.
Add Spacemit dwmac driver support on the Spacemit K3 SoC.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-spacemit.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-spacemit.c
> new file mode 100644
> index 000000000000..22aa25a7417b
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-spacemit.c
> @@ -0,0 +1,228 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Spacemit DWMAC platform driver
> + *
> + * Copyright (C) 2026 Inochi Amaoto <inochiama@gmail.com>
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/math.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/property.h>
> +#include <linux/regmap.h>
> +
> +#include "stmmac_platform.h"
[ ... ]
> +struct spacmit_dwmac {
> + struct regmap *apmu;
> + unsigned int ctrl_offset;
> + unsigned int dline_offset;
> +};
This isn't a bug, but the struct name is 'spacmit_dwmac' (missing 'e'),
while the driver filename is 'dwmac-spacemit.c' and all function names use
'spacemit_*' (e.g., spacemit_dwmac_probe, spacemit_dwmac_set_delay). Should
the struct be named 'spacemit_dwmac' for consistency?
[ ... ]
> +static int spacemit_dwmac_fix_delay(struct spacmit_dwmac *dwmac,
> + struct plat_stmmacenet_data *plat_dat,
> + unsigned int tx_delay,
> + unsigned int rx_delay)
> +{
> + int rx_code;
> + int tx_code;
> +
> + rx_code = spacemit_dwmac_detected_delay_value(rx_delay);
> + if (rx_code < 0)
> + return rx_code;
> +
> + tx_code = spacemit_dwmac_detected_delay_value(tx_delay);
> + if (tx_code < 0)
> + return tx_code;
> +
> + return spacemit_dwmac_set_delay(dwmac, tx_code, rx_code);
> +}
The 'plat_dat' parameter appears to be unused in spacemit_dwmac_fix_delay().
The function only uses 'dwmac', 'tx_delay', and 'rx_delay'. Is this
parameter needed?
[ ... ]
prev parent reply other threads:[~2026-03-06 2:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 8:07 [PATCH net-next v7 0/3] riscv: spacemit: Add ethernet support for K3 Inochi Amaoto
2026-03-04 8:07 ` [PATCH net-next v7 1/3] dt-bindings: net: Add support for Spacemit K3 dwmac Inochi Amaoto
2026-03-04 8:07 ` [PATCH net-next v7 2/3] net: stmmac: platform: Add snps,dwmac-5.40a IP compatible string Inochi Amaoto
2026-03-04 8:07 ` [PATCH net-next v7 3/3] net: stmmac: Add glue layer for Spacemit K3 SoC Inochi Amaoto
2026-03-06 2:52 ` Jakub Kicinski [this message]
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=20260306025237.580075-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=alex@ghiti.fr \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=aou@eecs.berkeley.edu \
--cc=boon.khai.ng@altera.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=dlan@kernel.org \
--cc=edumazet@google.com \
--cc=inochiama@gmail.com \
--cc=joabreu@synopsys.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=looong.bin@gmail.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=me@ziyao.cc \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=palmer@dabbelt.com \
--cc=peppe.cavallaro@st.com \
--cc=pjw@kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=quentin.schulz@cherry.de \
--cc=richardcochran@gmail.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=robh@kernel.org \
--cc=siyanteng@cqsoftware.com.cn \
--cc=spacemit@lists.linux.dev \
--cc=vladimir.oltean@nxp.com \
--cc=weishangjuan@eswincomputing.com \
--cc=wens@kernel.org \
/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