X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsmc91x.h;h=5c2824be4ee6399a73a49cad2fc986e8e704bba1;hb=b1086eef813ecee09bd6b8ae364acf0fad065cba;hp=a9b06b8d8e3ff185ffbd9cb90ff00e1ee0528fc3;hpb=ef88b7dba2b47c70037a34a599d383462bb74bd3;p=powerpc.git diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index a9b06b8d8e..5c2824be4e 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h @@ -100,14 +100,14 @@ #define SMC_IO_SHIFT 0 #define SMC_NOWAIT 1 -#define SMC_inb(a, r) inb((a) + (r)) -#define SMC_insb(a, r, p, l) insb((a) + (r), p, (l)) -#define SMC_inw(a, r) inw((a) + (r)) -#define SMC_insw(a, r, p, l) insw((a) + (r), p, l) -#define SMC_outb(v, a, r) outb(v, (a) + (r)) -#define SMC_outsb(a, r, p, l) outsb((a) + (r), p, (l)) -#define SMC_outw(v, a, r) outw(v, (a) + (r)) -#define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) +#define SMC_inb(a, r) readb((a) + (r)) +#define SMC_insb(a, r, p, l) readsb((a) + (r), p, (l)) +#define SMC_inw(a, r) readw((a) + (r)) +#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l) +#define SMC_outb(v, a, r) writeb(v, (a) + (r)) +#define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) +#define SMC_outw(v, a, r) writew(v, (a) + (r)) +#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l) #define set_irq_type(irq, type) do {} while (0) @@ -230,12 +230,12 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) #define SMC_CAN_USE_16BIT 1 #define SMC_CAN_USE_32BIT 0 -#define SMC_inb(a, r) inb((a) + (r) - 0xa0000000) -#define SMC_inw(a, r) inw((a) + (r) - 0xa0000000) -#define SMC_outb(v, a, r) outb(v, (a) + (r) - 0xa0000000) -#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000) -#define SMC_insw(a, r, p, l) insw((a) + (r) - 0xa0000000, p, l) -#define SMC_outsw(a, r, p, l) outsw((a) + (r) - 0xa0000000, p, l) +#define SMC_inb(a, r) inb((u32)a) + (r)) +#define SMC_inw(a, r) inw(((u32)a) + (r)) +#define SMC_outb(v, a, r) outb(v, ((u32)a) + (r)) +#define SMC_outw(v, a, r) outw(v, ((u32)a) + (r)) +#define SMC_insw(a, r, p, l) insw(((u32)a) + (r), p, l) +#define SMC_outsw(a, r, p, l) outsw(((u32)a) + (r), p, l) #define set_irq_type(irq, type) do {} while(0) @@ -289,6 +289,38 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l) #define RPC_LSA_DEFAULT RPC_LED_TX_RX #define RPC_LSB_DEFAULT RPC_LED_100_10 +#elif defined(CONFIG_SOC_AU1X00) + +#include + +/* We can only do 16-bit reads and writes in the static memory space. */ +#define SMC_CAN_USE_8BIT 0 +#define SMC_CAN_USE_16BIT 1 +#define SMC_CAN_USE_32BIT 0 +#define SMC_IO_SHIFT 0 +#define SMC_NOWAIT 1 + +#define SMC_inw(a, r) au_readw((unsigned long)((a) + (r))) +#define SMC_insw(a, r, p, l) \ + do { \ + unsigned long _a = (unsigned long)((a) + (r)); \ + int _l = (l); \ + u16 *_p = (u16 *)(p); \ + while (_l-- > 0) \ + *_p++ = au_readw(_a); \ + } while(0) +#define SMC_outw(v, a, r) au_writew(v, (unsigned long)((a) + (r))) +#define SMC_outsw(a, r, p, l) \ + do { \ + unsigned long _a = (unsigned long)((a) + (r)); \ + int _l = (l); \ + const u16 *_p = (const u16 *)(p); \ + while (_l-- > 0) \ + au_writew(*_p++ , _a); \ + } while(0) + +#define set_irq_type(irq, type) do {} while (0) + #else #define SMC_CAN_USE_8BIT 1 @@ -986,7 +1018,7 @@ static const char * chip_ids[ 16 ] = { }) #endif -#if SMC_CAN_USE_DATACS +#ifdef SMC_CAN_USE_DATACS #define SMC_PUSH_DATA(p, l) \ if ( lp->datacs ) { \ unsigned char *__ptr = (p); \