mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] net: bcmgenet: fix OF node of MII bus controller
@ 2022-11-30 11:51 Ahmad Fatoum
  2022-12-02  8:56 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2022-11-30 11:51 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The bcmgenet device tree binding describes the MDIO controller as a
subnode of the Ethernet controller node. Linux handles this by having
a driver for each of the MAC and MDIO controller, but in barebox we
keep a single driver and largely ignore the subnode.

Since Commit 8abc2059298d ("net: add support for MDIO devices"), this
leads to following error message:

  ERROR: miibus0: /scb/ethernet@7d580000/mdio@e14 PHY address 3604 is too
  large

Give the MII bus the correct device tree node to fix this. We already do
it this way in the designware_eqos driver.

This was tested on a Raspberry Pi 4b, where Link up and reading PHY ID
of 600d 84a2 is sensible (matches PHY_ID_BCM54210E). DHCP though didn't
work for me with or without this patch.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/net/bcmgenet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
index 2098e73b5cea..03389db8749b 100644
--- a/drivers/net/bcmgenet.c
+++ b/drivers/net/bcmgenet.c
@@ -577,6 +577,8 @@ static int bcmgenet_probe(struct device_d *dev)
 
 	priv->miibus.priv = priv;
 	priv->miibus.parent = dev;
+	priv->miibus.dev.device_node
+		= of_get_compatible_child(dev->device_node, "brcm,genet-mdio-v5");
 
 	ret = mdiobus_register(&priv->miibus);
 	if (ret)
-- 
2.30.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH master] net: bcmgenet: fix OF node of MII bus controller
  2022-11-30 11:51 [PATCH master] net: bcmgenet: fix OF node of MII bus controller Ahmad Fatoum
@ 2022-12-02  8:56 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2022-12-02  8:56 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Wed, Nov 30, 2022 at 12:51:57PM +0100, Ahmad Fatoum wrote:
> The bcmgenet device tree binding describes the MDIO controller as a
> subnode of the Ethernet controller node. Linux handles this by having
> a driver for each of the MAC and MDIO controller, but in barebox we
> keep a single driver and largely ignore the subnode.
> 
> Since Commit 8abc2059298d ("net: add support for MDIO devices"), this
> leads to following error message:
> 
>   ERROR: miibus0: /scb/ethernet@7d580000/mdio@e14 PHY address 3604 is too
>   large
> 
> Give the MII bus the correct device tree node to fix this. We already do
> it this way in the designware_eqos driver.
> 
> This was tested on a Raspberry Pi 4b, where Link up and reading PHY ID
> of 600d 84a2 is sensible (matches PHY_ID_BCM54210E). DHCP though didn't
> work for me with or without this patch.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/net/bcmgenet.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
> index 2098e73b5cea..03389db8749b 100644
> --- a/drivers/net/bcmgenet.c
> +++ b/drivers/net/bcmgenet.c
> @@ -577,6 +577,8 @@ static int bcmgenet_probe(struct device_d *dev)
>  
>  	priv->miibus.priv = priv;
>  	priv->miibus.parent = dev;
> +	priv->miibus.dev.device_node
> +		= of_get_compatible_child(dev->device_node, "brcm,genet-mdio-v5");
>  
>  	ret = mdiobus_register(&priv->miibus);
>  	if (ret)
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-02  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 11:51 [PATCH master] net: bcmgenet: fix OF node of MII bus controller Ahmad Fatoum
2022-12-02  8:56 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox