summaryrefslogtreecommitdiff
path: root/drivers/net/ax88180.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-06-02 21:03:50 -0400
committerBen Warren <biggerbadderben@gmail.com>2010-07-12 00:14:29 -0700
commitcafb14fecb2085299b1b06beb93d27d46efdfe52 (patch)
treeaf73a8e5c520dace411e94861e89a4a1310f3783 /drivers/net/ax88180.h
parent14f637f8f7e4d4d43ac717075aacd0681b3ff270 (diff)
downloadu-boot-imx-cafb14fecb2085299b1b06beb93d27d46efdfe52.zip
u-boot-imx-cafb14fecb2085299b1b06beb93d27d46efdfe52.tar.gz
u-boot-imx-cafb14fecb2085299b1b06beb93d27d46efdfe52.tar.bz2
AX88180: use standard I/O accessors
The current dm9000x driver accesses its memory mapped registers directly instead of using the standard I/O accessors. This can cause problems on Blackfin systems as the accesses can get out of order. So convert the direct volatile dereferences to use the normal in/out macros. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Tested-by: Hoan Hoang <hnhoan@i-syst.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net/ax88180.h')
-rw-r--r--drivers/net/ax88180.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/ax88180.h b/drivers/net/ax88180.h
index 9a324bd..daf18e0 100644
--- a/drivers/net/ax88180.h
+++ b/drivers/net/ax88180.h
@@ -19,6 +19,7 @@
#ifndef _AX88180_H_
#define _AX88180_H_
+#include <asm/io.h>
#include <asm/types.h>
#include <config.h>
@@ -354,7 +355,7 @@ struct ax88180_private {
static inline unsigned short INW (struct eth_device *dev, unsigned long addr)
{
- return le16_to_cpu (*(volatile unsigned short *) (addr + dev->iobase));
+ return le16_to_cpu(readw(addr + (void *)dev->iobase));
}
/*
@@ -363,32 +364,32 @@ static inline unsigned short INW (struct eth_device *dev, unsigned long addr)
#if defined (CONFIG_DRIVER_AX88180_16BIT)
static inline void OUTW (struct eth_device *dev, unsigned short command, unsigned long addr)
{
- *(volatile unsigned short *) ((addr + dev->iobase)) = cpu_to_le16 (command);
+ writew(cpu_to_le16(command), addr + (void *)dev->iobase);
}
static inline unsigned short READ_RXBUF (struct eth_device *dev)
{
- return le16_to_cpu (*(volatile unsigned short *) (RXBUFFER_START + dev->iobase));
+ return le16_to_cpu(readw(RXBUFFER_START + (void *)dev->iobase));
}
static inline void WRITE_TXBUF (struct eth_device *dev, unsigned short data)
{
- *(volatile unsigned short *) ((TXBUFFER_START + dev->iobase)) = cpu_to_le16 (data);
+ writew(cpu_to_le16(data), TXBUFFER_START + (void *)dev->iobase);
}
#else
static inline void OUTW (struct eth_device *dev, unsigned short command, unsigned long addr)
{
- *(volatile unsigned long *) ((addr + dev->iobase)) = cpu_to_le32 (command);
+ writel(cpu_to_le32(command), addr + (void *)dev->iobase);
}
static inline unsigned long READ_RXBUF (struct eth_device *dev)
{
- return le32_to_cpu (*(volatile unsigned long *) (RXBUFFER_START + dev->iobase));
+ return le32_to_cpu(readl(RXBUFFER_START + (void *)dev->iobase));
}
static inline void WRITE_TXBUF (struct eth_device *dev, unsigned long data)
{
- *(volatile unsigned long *) ((TXBUFFER_START + dev->iobase)) = cpu_to_le32 (data);
+ writel(cpu_to_le32(data), TXBUFFER_START + (void *)dev->iobase);
}
#endif