mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel@riscstar.com>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Alex Elder <elder@riscstar.com>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com,
	hkallweit1@gmail.com, linux@armlinux.org.uk,
	richardcochran@gmail.com, p.zabel@pengutronix.de,
	peppe.cavallaro@st.com, joabreu@synopsys.com,
	mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 5/5] net: stmmac: support the TC9564 SoC
Date: Thu, 5 Nov 2026 14:06:12 +0000	[thread overview]
Message-ID: <auyNVNo2I_Xunxi-@aspen.lan> (raw)
In-Reply-To: <3d0b17c6-3b94-4e36-b7bc-700211c83273@bootlin.com>

Hi Maxime

Actually, this might be more for Alex to find when he works through the
review feedback but...


On Mon, Oct 19, 2026 at 09:52:58AM +0200, Maxime Chevallier wrote:
> > +static struct tc9564_mac_speed mac_speed[] = {
> > +	{ PHY_INTERFACE_MODE_2500BASEX,	SPEED_2500,  SP_SEL_2500BASEX },
> > +	{ PHY_INTERFACE_MODE_SGMII,	SPEED_1000,  SP_SEL_SGMII_1000M },
> > +	{ PHY_INTERFACE_MODE_SGMII,	SPEED_100,   SP_SEL_SGMII_100M },
> > +	{ PHY_INTERFACE_MODE_SGMII,	SPEED_10,    SP_SEL_SGMII_10M },
> > +};
> <snip>
> > +static int tc9564_mac_speed_select(struct tc9564_data *td,
> > +				   phy_interface_t interface, int speed)
> > +{
> > +	int i;
> > +
> > +	for (i = 0; i < ARRAY_SIZE(mac_speed); i++) {
> > +		if (mac_speed[i].phy_interface != interface)
> > +			continue;
> > +
> > +		if (speed == mac_speed[i].speed || speed == SPEED_UNKNOWN)
> > +			return mac_speed[i].sp_sel;
> > +	}
> > +	dev_err(td->dev, "%s/%d unsupported\n", phy_modes(interface), speed);
>
> Is that "mac_speed" lookup table actually needed ? maybe a simpler switch/case
> based on the speed alone would be enough, or do we really need to validate
> the phy_interface_t each time ?

Once we add 10G PHY support I don't think it can be based on link speed
alone (for 10G PHY we have to write the same value to SP_SEL regardless
of link speed).

However even when that happens we could still code it up using switch/case
and ifs.


Daniel.

  reply	other threads:[~2026-11-05 14:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  3:01 [PATCH net-next 0/5] net: stmmac: enable Toshiba TC9564 Alex Elder
2026-10-19  3:01 ` [PATCH net-next 1/5] dt-bindings: net: add support for " Alex Elder
2026-10-19 12:41   ` Andrew Lunn
2026-10-20 15:12   ` Rob Herring (Arm)
2026-10-19  3:01 ` [PATCH net-next 2/5] net: pcs: pcs-xpcs-regmap: support XPCS memory-mapped MDIO bus via regmap Alex Elder
2026-10-19  3:01 ` [PATCH net-next 3/5] net: stmmac: dwxgmac2: Add XGMAC 3.01a support Alex Elder
2026-10-19  7:58   ` Maxime Chevallier
2026-10-19  3:01 ` [PATCH net-next 4/5] net: stmmac: dwxgmac2: export symbols for XGMAC 3.01a DMA Alex Elder
2026-10-19  3:01 ` [PATCH net-next 5/5] net: stmmac: support the TC9564 SoC Alex Elder
2026-10-19  7:52   ` Maxime Chevallier
2026-11-05 14:06     ` Daniel Thompson [this message]
2026-10-19  9:14   ` Mohd Ayaan Anwar

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=auyNVNo2I_Xunxi-@aspen.lan \
    --to=daniel@riscstar.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@kernel.org \
    --cc=elder@riscstar.com \
    --cc=hkallweit1@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=linux@armlinux.org.uk \
    --cc=lorenzo.bianconi@oss.qualcomm.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mohd.anwar@oss.qualcomm.com \
    --cc=netdev@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=richardcochran@gmail.com \
    --cc=robh@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

all inboxes | Powered by JetHome®