From: Jakub Kicinski <kuba@kernel.org>
To: rmk+kernel@armlinux.org.uk
Cc: Jakub Kicinski <kuba@kernel.org>,
linux-arm-kernel@lists.infradead.org, andrew@lunn.ch,
davem@davemloft.net, alexandre.torgue@foss.st.com,
netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
heiko@sntech.de, andrew+netdev@lunn.ch,
linux-rockchip@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [net-next,19/21] net: stmmac: rk: rk3528: gmac0 only supports RMII
Date: Sun, 25 Jan 2026 14:16:32 -0800 [thread overview]
Message-ID: <20260125221632.3396270-1-kuba@kernel.org> (raw)
In-Reply-To: <E1vjEvK-00000005ghP-3lCt@rmk-PC.armlinux.org.uk>
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: rk: rk3506, rk3528 and kk3588 have rmii_mode in clock register
This commit moves the rmii_mode configuration for rk3506, rk3528, and
rk3588 from the per-SoC set_to_rmii() functions into the centralized
rk_gmac_powerup() function, using a new clock.rmii_mode_mask field.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> index ebbc09ea572a..759deb66ef2a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
[ ... ]
> @@ -987,6 +966,7 @@ static int rk3588_init(struct rk_priv_data *bsp_priv)
> bsp_priv->clock.gmii_clk_sel_mask = GENMASK_U16(3, 2);
> bsp_priv->clock.rmii_clk_sel_mask = BIT_U16(2);
> bsp_priv->clock.rmii_gate_en_mask = BIT_U16(1);
> + bsp_priv->clock.rmii_mode_mask = BIT_U16(0);
> return 0;
[ ... ]
> @@ -1412,6 +1385,15 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
> return ret;
> }
>
> + if (bsp_priv->clock.rmii_mode_mask) {
> + val = rk_encode_wm16(ret == PHY_INTF_SEL_RMII,
> + bsp_priv->clock.rmii_mode_mask);
For rk3588, the variable ret has been overwritten by the preceding
regmap_write() in the gmac_phy_intf_sel_mask block. At this point ret
contains 0 (success) rather than PHY_INTF_SEL_RMII (4).
Looking at rk_gmac_powerup(), the flow for rk3588 is:
ret = rk_get_phy_intf_sel(bsp_priv->phy_iface); // ret = 4 for RMII
...
if (bsp_priv->gmac_phy_intf_sel_mask || ...) // true for rk3588
...
ret = regmap_write(...); // ret = 0 on success
...
if (bsp_priv->clock.rmii_mode_mask) // true for rk3588
val = rk_encode_wm16(ret == PHY_INTF_SEL_RMII, ...); // 0 == 4 is false
Since rk3588_init() sets both gmac_phy_intf_sel_mask and
clock.rmii_mode_mask, does this mean RMII mode can never be correctly
configured for rk3588?
> +
> + ret = rk_write_clock_grf_reg(bsp_priv, val);
> + if (ret < 0)
> + return ret;
> + }
[ ... ]
next prev parent reply other threads:[~2026-01-25 22:16 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 10:59 [PATCH net-next 00/21] net: stmmac: rk: simplify per-SoC configuration Russell King (Oracle)
2026-01-23 11:00 ` [PATCH net-next 01/21] net: stmmac: rk: avoid phy_power_on() Russell King (Oracle)
2026-01-23 11:00 ` [PATCH net-next 02/21] net: stmmac: rk: get rid of rk_phy_power_ctl() Russell King (Oracle)
2026-01-23 11:00 ` [PATCH net-next 03/21] net: stmmac: rk: convert rk3328 to use bsp_priv->id Russell King (Oracle)
2026-01-25 22:16 ` [net-next,03/21] " Jakub Kicinski
2026-01-23 11:00 ` [PATCH net-next 04/21] net: stmmac: rk: group MACPHY register offset and fields together Russell King (Oracle)
2026-01-23 11:00 ` [PATCH net-next 05/21] net: stmmac: rk: add GMAC_CLK_xx constants, simplify RGMII definitions Russell King (Oracle)
2026-01-23 11:00 ` [PATCH net-next 06/21] net: stmmac: rk: add SoC specific ->init() method Russell King (Oracle)
2026-01-23 11:00 ` [PATCH net-next 07/21] net: stmmac: rk: convert to mask-based interface mode configuration Russell King (Oracle)
2026-01-25 22:16 ` [net-next,07/21] " Jakub Kicinski
2026-01-23 11:00 ` [PATCH net-next 08/21] net: stmmac: rk: move speed GRF register offset to private data Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 09/21] net: stmmac: rk: convert rk3588 to rk_set_reg_speed() Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 10/21] net: stmmac: rk: remove rk3528 RMII clock initialisation Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 11/21] net: stmmac: rk: use rk_encode_wm16() for RGMII clocks Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 12/21] net: stmmac: rk: use rk_encode_wm16() for RMII speed Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 13/21] net: stmmac: rk: use rk_encode_wm16() for RMII clock Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 14/21] net: stmmac: rk: remove need for ->set_speed() method Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 15/21] net: stmmac: rk: convert px30 Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 16/21] net: stmmac: rk: introduce flags indicating support for RGMII/RMII Russell King (Oracle)
2026-01-23 11:01 ` [PATCH net-next 17/21] net: stmmac: rk: replace empty set_to_rmii() with supports_rmii Russell King (Oracle)
2026-01-25 22:16 ` [net-next,17/21] " Jakub Kicinski
2026-01-23 11:01 ` [PATCH net-next 18/21] net: stmmac: rk: rk3328: gmac2phy only supports RMII Russell King (Oracle)
2026-01-25 22:16 ` [net-next,18/21] " Jakub Kicinski
2026-01-25 22:27 ` Russell King (Oracle)
2026-01-25 23:04 ` Jakub Kicinski
2026-01-23 11:01 ` [PATCH net-next 19/21] net: stmmac: rk: rk3528: gmac0 " Russell King (Oracle)
2026-01-25 22:16 ` Jakub Kicinski [this message]
2026-01-23 11:02 ` [PATCH net-next 20/21] net: stmmac: rk: use rk_encode_wm16() for clock selection Russell King (Oracle)
2026-01-25 22:16 ` [net-next,20/21] " Jakub Kicinski
2026-01-23 11:02 ` [PATCH net-next 21/21] net: stmmac: rk: rk3506, rk3528 and kk3588 have rmii_mode in clock register Russell King (Oracle)
2026-01-25 22:16 ` [net-next,21/21] " Jakub Kicinski
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=20260125221632.3396270-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
/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