Skip to contentSkip to conversation

net: macb: fix mapping of registers

PATCH Superseded Ramon Fried 3 participants 4 messages Dec 18, 2018 – Dec 27, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: macb: fix mapping of registers

Some architectures (MIPS) needs mapping to access IOMEM. Fix that.

Fixes f1dcc19b213d ("net: macb: Convert to driver model")

---
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(-)
drivers/net/macb.c +3 -1
index 94c89c762b..ede1277901 100644
@@ -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);
 }
Signature · 1 line
2.19.2
#1 lore raw

PATCH v2 1/1 net: macb: fix mapping of registers

Am 18.12.18 um 21:49 schrieb Ramon Fried:

Quoted 5 lines

Some architectures (MIPS) needs mapping to access IOMEM. Fix that.

Fixes f1dcc19b213d ("net: macb: Convert to driver model")
Quoted 9 lines

---
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(-)
Signature · 1 line
- Daniel
#2 lore raw

PATCH v2 1/1 net: macb: fix mapping of registers

In reply to Ramon Fried
Quoted 10 lines · Ramon Fried

Some architectures (MIPS) needs mapping to access IOMEM. Fix that.

Fixes f1dcc19b213d ("net: macb: Convert to driver model")

---
v2: switched to use dev_reamp_addr() to reduce boilerplate code.
(as suggested by Daniel Schwierzeck)

On many platforms:
arm: w+ sama5d36ek_cmp_nandflash
+(sama5d36ek_cmp_nandflash) pdata->iobase = dev_remap_addr(dev);
+(sama5d36ek_cmp_nandflash) ^
w+(sama5d36ek_cmp_nandflash) drivers/net/macb.c: In function 'macb_eth_ofdata_to_platdata':
w+(sama5d36ek_cmp_nandflash) drivers/net/macb.c:1154:16: warning: assignment makes integer from pointer without a cast [-Wint-conversion]

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181226/2e76d08f/attachment.sig>
#3 lore raw

PATCH v2 1/1 net: macb: fix mapping of registers

Quoted 21 lines · Tom Rini
Quoted 10 lines · Ramon Fried

Some architectures (MIPS) needs mapping to access IOMEM. Fix that.

Fixes f1dcc19b213d ("net: macb: Convert to driver model")

---
v2: switched to use dev_reamp_addr() to reduce boilerplate code.
(as suggested by Daniel Schwierzeck)

On many platforms:
arm: w+ sama5d36ek_cmp_nandflash

(quoted diff) +2 -0
+(sama5d36ek_cmp_nandflash)   pdata->iobase = dev_remap_addr(dev);
+(sama5d36ek_cmp_nandflash)                 ^

w+(sama5d36ek_cmp_nandflash) drivers/net/macb.c: In function 'macb_eth_ofdata_to_platdata':
w+(sama5d36ek_cmp_nandflash) drivers/net/macb.c:1154:16: warning: assignment makes integer from pointer without a cast [-Wint-conversion]

Quoted 2 lines

--
Tom

Thanks Tom,
I'll look into it.