]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: macb: fix mapping of registers
authorRamon Fried <ramon.fried@gmail.com>
Thu, 27 Dec 2018 17:58:42 +0000 (19:58 +0200)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 24 Jan 2019 17:35:29 +0000 (11:35 -0600)
Some architectures (MIPS) needs mapping to access IOMEM.
Fix that.

Fixes: f1dcc19b213d ("net: macb: Convert to driver model")
Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/macb.c

index 94c89c762b6ffe47c210946235c567f00f59ed7c..c9ee22279ae121b9347659930bb1eb34d28b4604 100644 (file)
@@ -1151,7 +1151,9 @@ static int macb_eth_ofdata_to_platdata(struct udevice *dev)
 {
        struct eth_pdata *pdata = dev_get_platdata(dev);
 
-       pdata->iobase = devfdt_get_addr(dev);
+       pdata->iobase = (phys_addr_t)dev_remap_addr(dev);
+       if (!pdata->iobase)
+               return -EINVAL;
 
        return macb_late_eth_ofdata_to_platdata(dev);
 }