U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Heiko Thiery" <heiko.thiery@gmail.com>, <u-boot@lists.denx.de>
Cc: "Joe Hershberger" <joe.hershberger@ni.com>,
	"Ramon Fried" <rfried.dev@gmail.com>,
	"Tom Rini" <trini@konsulko.com>, "Marek Vasut" <marex@denx.de>,
	"Alice Guo" <alice.guo@nxp.com>, "Ye Li" <ye.li@nxp.com>,
	"Tim Harvey" <tharvey@gateworks.com>,
	"Thomas Schaefer" <thomas.schaefer@kontron.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>
Subject: Re: [PATCH] net: fsl_enetc: fix imdio register calculation
Date: Mon, 28 Apr 2025 12:06:28 +0200	[thread overview]
Message-ID: <D9I6S5PD32TJ.3AGU7UM3EUOF6@kernel.org> (raw)
In-Reply-To: <20250428095945.1432389-1-heiko.thiery@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]

[+ Vladimir]

Hi,

nice catch!

> With commit cc4e8af2c552, fsl_enetc register accessors have been split to

With 'commit cc4e8af2c552 ("net: fsl_enetc: Split register accessors")'

> handle different register offsets on different SoCs. However, for
> internal MDIO register calculation, only ENETC_PM_IMDIO_BASE was fixed
> without adding the SoC specific MAC register offset.
>
> As a result, the network support for the Kontron SMARC-sAL28 and
> probably other boards based on the LS1028A CPU is broken.
>
> Add the SoC specific MAC register offset to calculation of imdio.priv to
> fix this.
>
> Fixes: cc4e8af2c552 ("net: fsl_enetc: Split register accessors")
> Signed-off-by: Thomas Schaefer <thomas.schaefer@kontron.com>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

With the nitpick above:

Reviewed-by: Michael Walle <mwalle@kernel.org>

> ---
>
> But the question that now arises is, does this code path work on the imx
> SoCs as well. Now the imx specific offset 0x5000 is added here and was not
> used before.

Maybe the imx9 doesn't use the internal MDIO controller or the board
which was this tested on doesn't use the PCS?

-michael

> Can someone please test this on an imx9 and confirm?
>
>  drivers/net/fsl_enetc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
> index 52fa820f51..97cccda451 100644
> --- a/drivers/net/fsl_enetc.c
> +++ b/drivers/net/fsl_enetc.c
> @@ -473,13 +473,15 @@ static int enetc_init_sxgmii(struct udevice *dev)
>  /* Apply protocol specific configuration to MAC, serdes as needed */
>  static void enetc_start_pcs(struct udevice *dev)
>  {
> +	struct enetc_data *data = (struct enetc_data *)dev_get_driver_data(dev);
>  	struct enetc_priv *priv = dev_get_priv(dev);
>  
>  	/* register internal MDIO for debug purposes */
>  	if (enetc_read_pcapr_mdio(dev)) {
>  		priv->imdio.read = enetc_mdio_read;
>  		priv->imdio.write = enetc_mdio_write;
> -		priv->imdio.priv = priv->port_regs + ENETC_PM_IMDIO_BASE;
> +		priv->imdio.priv = priv->port_regs + data->reg_offset_mac +
> +		                   ENETC_PM_IMDIO_BASE;
>  		strlcpy(priv->imdio.name, dev->name, MDIO_NAME_LEN);
>  		if (!miiphy_get_dev_by_name(priv->imdio.name))
>  			mdio_register(&priv->imdio);


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

  reply	other threads:[~2025-04-28 10:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28  9:59 [PATCH] net: fsl_enetc: fix imdio register calculation Heiko Thiery
2025-04-28 10:06 ` Michael Walle [this message]
2025-04-28 14:23   ` Vladimir Oltean
2025-04-29  1:19     ` Wei Fang
2025-05-06  9:32       ` Heiko Thiery
2025-05-06 15:31         ` Tim Harvey
2025-05-07  5:12           ` Heiko Thiery
2025-05-11 20:55 ` Marek Vasut
2025-05-12  1:27 ` 回复: " Alice Guo (OSS)
2025-05-12 21:50 ` Fabio Estevam

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=D9I6S5PD32TJ.3AGU7UM3EUOF6@kernel.org \
    --to=mwalle@kernel.org \
    --cc=alice.guo@nxp.com \
    --cc=heiko.thiery@gmail.com \
    --cc=joe.hershberger@ni.com \
    --cc=marex@denx.de \
    --cc=rfried.dev@gmail.com \
    --cc=tharvey@gateworks.com \
    --cc=thomas.schaefer@kontron.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vladimir.oltean@nxp.com \
    --cc=ye.li@nxp.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