]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: zynq: Add support for mdio bus address decoding
authorMichal Simek <michal.simek@xilinx.com>
Tue, 26 Oct 2021 13:51:39 +0000 (15:51 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 6 Dec 2021 12:32:48 +0000 (13:32 +0100)
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 <michal.simek@xilinx.com>
drivers/net/zynq_gem.c

index 57a0f2551fe0d3e3c10bfacd15e85285a5a6b11d..56f668c24964432876adbbae51a1dfdd7f81c9c3 100644 (file)
@@ -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);