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 <mario.six@gdsys.cc>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
Mario Six 2018-04-27 14:52:57 +02:00 committed by Joe Hershberger
parent 3ce4304205
commit 5e9d9abe08

View File

@ -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;