summaryrefslogtreecommitdiffstats
path: root/drivers/net/pcnet.c
diff options
context:
space:
mode:
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2020-05-03 19:43:32 +0200
committerTom Rini <trini@konsulko.com>2020-05-04 08:57:50 -0400
commit8510580f2e85a8687b40fe5fc3d8c060e5278505 (patch)
tree47e5ad275b59e6d71afed646332e1f2f8925201e /drivers/net/pcnet.c
parent04da42770b0cc3bea8841972bfc9568299ece826 (diff)
downloadu-boot-8510580f2e85a8687b40fe5fc3d8c060e5278505.tar.gz
u-boot-8510580f2e85a8687b40fe5fc3d8c060e5278505.tar.xz
u-boot-8510580f2e85a8687b40fe5fc3d8c060e5278505.zip
net: pcnet: fix I/O primitives for memory access
Commit 69529c912059 ("net: pcnet: Switch to PCI memory access") switched from PCI IO access to PCI memory access without updating the I/O primitives. Contrary to SH, the primitives for memory access and IO access are implemented differently. Thus doing memory access with IO port primitives breaks the driver on MIPS Malta board. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'drivers/net/pcnet.c')
-rw-r--r--drivers/net/pcnet.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index 34a5a16cfe..f97e7f8c6a 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -91,37 +91,49 @@ static pcnet_priv_t *lp;
static u16 pcnet_read_csr(struct eth_device *dev, int index)
{
- outw(index, dev->iobase + PCNET_RAP);
- return inw(dev->iobase + PCNET_RDP);
+ void __iomem *base = (void __iomem *)dev->iobase;
+
+ writew(index, base + PCNET_RAP);
+ return readw(base + PCNET_RDP);
}
static void pcnet_write_csr(struct eth_device *dev, int index, u16 val)
{
- outw(index, dev->iobase + PCNET_RAP);
- outw(val, dev->iobase + PCNET_RDP);
+ void __iomem *base = (void __iomem *)dev->iobase;
+
+ writew(index, base + PCNET_RAP);
+ writew(val, base + PCNET_RDP);
}
static u16 pcnet_read_bcr(struct eth_device *dev, int index)
{
- outw(index, dev->iobase + PCNET_RAP);
- return inw(dev->iobase + PCNET_BDP);
+ void __iomem *base = (void __iomem *)dev->iobase;
+
+ writew(index, base + PCNET_RAP);
+ return readw(base + PCNET_BDP);
}
static void pcnet_write_bcr(struct eth_device *dev, int index, u16 val)
{
- outw(index, dev->iobase + PCNET_RAP);
- outw(val, dev->iobase + PCNET_BDP);
+ void __iomem *base = (void __iomem *)dev->iobase;
+
+ writew(index, base + PCNET_RAP);
+ writew(val, base + PCNET_BDP);
}
static void pcnet_reset(struct eth_device *dev)
{
- inw(dev->iobase + PCNET_RESET);
+ void __iomem *base = (void __iomem *)dev->iobase;
+
+ readw(base + PCNET_RESET);
}
static int pcnet_check(struct eth_device *dev)
{
- outw(88, dev->iobase + PCNET_RAP);
- return inw(dev->iobase + PCNET_RAP) == 88;
+ void __iomem *base = (void __iomem *)dev->iobase;
+
+ writew(88, base + PCNET_RAP);
+ return readw(base + PCNET_RAP) == 88;
}
static int pcnet_init (struct eth_device *dev, bd_t * bis);