[U-Boot] [PATCH v2] net: macb: fix mapping of registers

Ramon Fried ramon.fried at gmail.com
Tue Dec 18 20:49:03 UTC 2018


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 at gmail.com>
---
v2: switched to use dev_reamp_addr() to reduce boilerplate code.
    (as suggested by Daniel Schwierzeck)


 drivers/net/macb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 94c89c762b..ede1277901 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -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 = dev_remap_addr(dev);
+	if (!pdata->iobase)
+		return -EINVAL;
 
 	return macb_late_eth_ofdata_to_platdata(dev);
 }
-- 
2.19.2



More information about the U-Boot mailing list