From: Michal Simek Date: Tue, 26 Oct 2021 13:51:39 +0000 (+0200) Subject: net: zynq: Add support for mdio bus address decoding X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a251cdd07405ca2675f3a1381436626bc7923415;p=thirdparty%2Fu-boot.git net: zynq: Add support for mdio bus address decoding There are flying two configurations around. The first (already supported) has phy as subnode of gem node. The second has mdio subnode (with mdio name) which has phy subnode. This patch adds support for the second case where mdio subnode is found driver will look at its parent to find out which gem is handling MDIO bus. Signed-off-by: Michal Simek --- diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 57a0f2551fe..56f668c2496 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -828,6 +828,9 @@ static int zynq_gem_of_to_plat(struct udevice *dev) SPEED_1000); parent = ofnode_get_parent(phandle_args.node); + if (ofnode_name_eq(parent, "mdio")) + parent = ofnode_get_parent(parent); + addr = ofnode_get_addr(parent); if (addr != FDT_ADDR_T_NONE) { debug("MDIO bus not found %s\n", dev->name);