diff options
author | Hoan Hoang <hnhoan@i-syst.com> | 2010-05-11 02:43:07 -0400 |
---|---|---|
committer | Ben Warren <biggerbadderben@gmail.com> | 2010-07-12 00:14:29 -0700 |
commit | 14f637f8f7e4d4d43ac717075aacd0681b3ff270 (patch) | |
tree | 43f5a9453f1a4221569e02b608904cb49a2656c9 /drivers | |
parent | 256670680b058105bb948c9f55e11db7ed949fa9 (diff) | |
download | u-boot-imx-14f637f8f7e4d4d43ac717075aacd0681b3ff270.zip u-boot-imx-14f637f8f7e4d4d43ac717075aacd0681b3ff270.tar.gz u-boot-imx-14f637f8f7e4d4d43ac717075aacd0681b3ff270.tar.bz2 |
AX88180: make OUTW handle 32bit/16bit defines too
The current OUTW function is always defined as a 16bit function, but this
doesn't work correctly when using the 32bit access mode. So define it as
a 32bit function when in 32bit mode so things work correctly on Blackfin
32bit LE systems.
Signed-off-by: Hoan Hoang <hnhoan@i-syst.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ax88180.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/ax88180.h b/drivers/net/ax88180.h index f26a91b..9a324bd 100644 --- a/drivers/net/ax88180.h +++ b/drivers/net/ax88180.h @@ -357,15 +357,15 @@ static inline unsigned short INW (struct eth_device *dev, unsigned long addr) return le16_to_cpu (*(volatile unsigned short *) (addr + dev->iobase)); } +/* + Access RXBUFFER_START/TXBUFFER_START to read RX buffer/write TX buffer +*/ +#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); } -/* - Access RXBUFFER_START/TXBUFFER_START to read RX buffer/write TX buffer -*/ -#if defined (CONFIG_DRIVER_AX88180_16BIT) static inline unsigned short READ_RXBUF (struct eth_device *dev) { return le16_to_cpu (*(volatile unsigned short *) (RXBUFFER_START + dev->iobase)); @@ -376,6 +376,11 @@ static inline void WRITE_TXBUF (struct eth_device *dev, unsigned short data) *(volatile unsigned short *) ((TXBUFFER_START + dev->iobase)) = cpu_to_le16 (data); } #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); +} + static inline unsigned long READ_RXBUF (struct eth_device *dev) { return le32_to_cpu (*(volatile unsigned long *) (RXBUFFER_START + dev->iobase)); |