]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
net: add ColdFire support to the smc91x driver
authorGreg Ungerer <gerg@uclinux.org>
Wed, 10 Mar 2010 15:37:06 +0000 (07:37 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Mar 2010 15:37:06 +0000 (07:37 -0800)
Some embedded ColdFire based boards use the SMC 91x family of ethernet
devices. (For example the Freescale M5249C3 and MoretonBay NETtel).

Add IO access support to the SMC91x driver, and allow this driver to
be configured for ColdFire platforms.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/Kconfig
drivers/net/smc91x.h

index 7029cd50c458897e1686925bb2aef9da70d82c92..0ba5b8e50a7cde9fba5ba976e656682dedfa2164 100644 (file)
@@ -907,7 +907,7 @@ config SMC91X
        select CRC32
        select MII
        depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \
-               MIPS || BLACKFIN || MN10300
+               MIPS || BLACKFIN || MN10300 || COLDFIRE
        help
          This is a driver for SMC's 91x series of Ethernet chipsets,
          including the SMC91C94 and the SMC91C111. Say Y if you want it
index a6ee883d1b0edc506fdf7000f283cf5bbd4da462..8d2772cc42f2ba5e174e501de81c966c6cd97474 100644 (file)
@@ -344,6 +344,34 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r,
 
 #define SMC_IRQ_FLAGS          IRQF_TRIGGER_HIGH
 
+#elif defined(CONFIG_COLDFIRE)
+
+#define SMC_CAN_USE_8BIT       0
+#define SMC_CAN_USE_16BIT      1
+#define SMC_CAN_USE_32BIT      0
+#define SMC_NOWAIT             1
+
+static inline void mcf_insw(void *a, unsigned char *p, int l)
+{
+       u16 *wp = (u16 *) p;
+       while (l-- > 0)
+               *wp++ = readw(a);
+}
+
+static inline void mcf_outsw(void *a, unsigned char *p, int l)
+{
+       u16 *wp = (u16 *) p;
+       while (l-- > 0)
+               writew(*wp++, a);
+}
+
+#define SMC_inw(a, r)          _swapw(readw((a) + (r)))
+#define SMC_outw(v, a, r)      writew(_swapw(v), (a) + (r))
+#define SMC_insw(a, r, p, l)   mcf_insw(a + r, p, l)
+#define SMC_outsw(a, r, p, l)  mcf_outsw(a + r, p, l)
+
+#define SMC_IRQ_FLAGS          (IRQF_DISABLED)
+
 #else
 
 /*