public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Maxim Kiselev <bigunclemax@gmail.com>
Cc: u-boot@lists.denx.de, Joe Hershberger <joe.hershberger@ni.com>,
	Ramon Fried <rfried.dev@gmail.com>
Subject: Re: [PATCH v1] net: sun8i-emac: Add support for fixed-link phy
Date: Tue, 16 Jan 2024 00:17:35 +0000	[thread overview]
Message-ID: <20240116001735.7c48ea88@minigeek.lan> (raw)
In-Reply-To: <20230614214405.1038301-1-bigunclemax@gmail.com>

On Thu, 15 Jun 2023 00:44:06 +0300
Maxim Kiselev <bigunclemax@gmail.com> wrote:

Hi Maxim,

> From: Maksim Kiselev <bigunclemax@gmail.com>
> 
> Based on dt-specs fixed-link doesn't require phy-handle to be used.

Do you have such a board? And where is that written down? I don't see
it explicitly mentioned as optional in ethernet-controller.yaml or in
the DT spec PDF. The sun8i EMAC binding lists phy-handle as required,
so that would need to be relaxed there then.

> Fix driver to only read phy related setting when phy-handle is found.

The patch itself looks fine, we already specify -1 as the default when
the PHY DT node does not contain a reg property, so that looks like it
would work.

Cheers,
Andre

> Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
> ---
>  drivers/net/sun8i_emac.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
> index 04c3274fbe..0e339d69e0 100644
> --- a/drivers/net/sun8i_emac.c
> +++ b/drivers/net/sun8i_emac.c
> @@ -834,11 +834,8 @@ static int sun8i_emac_eth_of_to_plat(struct udevice *dev)
>  	priv->use_internal_phy = false;
>  
>  	offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "phy-handle");
> -	if (offset < 0) {
> -		debug("%s: Cannot find PHY address\n", __func__);
> -		return -EINVAL;
> -	}
> -	priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
> +	if (offset >= 0)
> +		priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
>  
>  	pdata->phy_interface = dev_read_phy_mode(dev);
>  	debug("phy interface %d\n", pdata->phy_interface);


  parent reply	other threads:[~2024-01-16  0:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 21:44 [PATCH v1] net: sun8i-emac: Add support for fixed-link phy Maxim Kiselev
2023-07-22  8:20 ` Ramon Fried
2024-01-16  0:17 ` Andre Przywara [this message]
2024-01-16 16:58   ` Maxim Kiselev
2024-01-17  0:13     ` Andre Przywara
2024-01-19 17:35     ` Andre Przywara
2024-01-19 18:11       ` Maxim Kiselev
2024-01-19 21:56         ` Andre Przywara

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=20240116001735.7c48ea88@minigeek.lan \
    --to=andre.przywara@arm.com \
    --cc=bigunclemax@gmail.com \
    --cc=joe.hershberger@ni.com \
    --cc=rfried.dev@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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