From: Mario Six Date: Fri, 27 Apr 2018 12:52:57 +0000 (+0200) Subject: tsec: Fix reading phy registers from DT X-Git-Tag: v2018.07-rc2~51^2~16 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5e9d9abe08745b54262fb26e2d6fcccbea61e409;p=u-boot tsec: Fix reading phy registers from DT Bus translations should be applied when reading the address of the sgmii phy registers from the DT. Use ofnode_get_addr_index instead of the plain ofnode_read_u32_default to fix this. Signed-off-by: Mario Six Acked-by: Joe Hershberger --- diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 37840420fa..03a46da2f8 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -796,8 +796,9 @@ int tsec_probe(struct udevice *dev) parent = ofnode_get_parent(phandle_args.node); if (ofnode_valid(parent)) { - int reg = ofnode_read_u32_default(parent, "reg", 0); - priv->phyregs_sgmii = (struct tsec_mii_mng *)(reg + 0x520); + int reg = ofnode_get_addr_index(parent, 0); + + priv->phyregs_sgmii = (struct tsec_mii_mng *)reg; } else { debug("No parent node for PHY?\n"); return -ENOENT;