]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Patch 2/2 enable smc91x enet driver for use by PPC
authorDale Farnsworth <dale@farnsworth.org>
Wed, 30 Jun 2004 19:30:38 +0000 (15:30 -0400)
committerDale Farnsworth <dale@farnsworth.org>
Wed, 30 Jun 2004 19:30:38 +0000 (15:30 -0400)
Hi,

Patch 2 of 2 to enable the smc91x driver to be used by the IBM Redwood5
and Redwood6 boards.

Enable smc91x driver to support IBM Redwood5 and Redwood6 boards

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
drivers/net/smc91x.c
drivers/net/smc91x.h

index 3968a1cd50d773e0b0f8ddbe5d30d8f34f5ad97c..0bacd06a3d7687b725888707376fe611b117e342 100644 (file)
@@ -86,7 +86,9 @@ static const char version[] =
 #include <linux/skbuff.h>
 
 #include <asm/io.h>
+#ifdef CONFIG_ARM
 #include <asm/hardware.h>
+#endif
 #include <asm/irq.h>
 
 #include "smc91x.h"
index 5212e3763bcb86928f350f221100d4388753ebaf..7679022c072954dbf80a5ebe3aec5e1fdb6fceec 100644 (file)
 #define SMC_insw(a, r, p, l)   readsw((a) + (r), p, l)
 #define SMC_outsw(a, r, p, l)  writesw((a) + (r), p, l)
 
+#elif defined(CONFIG_REDWOOD_5) || defined(CONFIG_REDWOOD_6)
+
+/* 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_NOWAIT             1
+
+#define SMC_IO_SHIFT           0
+
+#define SMC_inw(a, r)          in_be16((volatile u16 *)((a) + (r)))
+#define SMC_outw(v, a, r)      out_be16((volatile u16 *)((a) + (r)), v)
+#define SMC_insw(a, r, p, l)                                           \
+       do {                                                            \
+               unsigned long __port = (a) + (r);                       \
+               u16 *__p = (u16 *)(p);                                  \
+               int __l = (l);                                          \
+               insw(__port, __p, __l);                                 \
+               while (__l > 0) {                                       \
+                       *__p = swab16(*__p);                            \
+                       __p++;                                          \
+                       __l--;                                          \
+               }                                                       \
+       } while (0)
+#define SMC_outsw(a, r, p, l)                                          \
+       do {                                                            \
+               unsigned long __port = (a) + (r);                       \
+               u16 *__p = (u16 *)(p);                                  \
+               int __l = (l);                                          \
+               while (__l > 0) {                                       \
+                       /* Believe it or not, the swab isn't needed. */ \
+                       outw( /* swab16 */ (*__p++), __port);           \
+                       __l--;                                          \
+               }                                                       \
+       } while (0)
+#define set_irq_type(irq, type)
+
 #elif defined(CONFIG_SA1100_ASSABET)
 
 #include <asm/arch/neponset.h>