diff options
author | Michal Simek <michal.simek@xilinx.com> | 2016-05-30 10:43:11 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2020-09-23 10:31:40 +0200 |
commit | 8c40e07aab8763d9a61d98bcce4bdf4a69566fe4 (patch) | |
tree | debdc8404f681f2813d0c0a1bbf5ffe82267c0a9 /drivers/net | |
parent | 6c0e59fcd9bfc258c2ec4cad4971352a17a58411 (diff) | |
download | u-boot-8c40e07aab8763d9a61d98bcce4bdf4a69566fe4.tar.gz |
net: gem: Add support for more PHYs on MDIO bus
Find out MDIO bus and enable MDIO access to it if this is done via
different GEM controller. Only works across GEM instances.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/zynq_gem.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index da4b6fba9f..8afec8bbfc 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -758,6 +758,9 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev) if (!dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, &phandle_args)) { + fdt_addr_t addr; + ofnode parent; + debug("phy-handle does exist %s\n", dev->name); priv->phyaddr = ofnode_read_u32_default(phandle_args.node, "reg", -1); @@ -765,6 +768,13 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev) priv->max_speed = ofnode_read_u32_default(phandle_args.node, "max-speed", SPEED_1000); + + parent = ofnode_get_parent(phandle_args.node); + addr = ofnode_get_addr(parent); + if (addr != FDT_ADDR_T_NONE) { + debug("MDIO bus not found %s\n", dev->name); + priv->mdiobase = (struct zynq_gem_regs *)addr; + } } phy_mode = dev_read_prop(dev, "phy-mode", NULL); |