This patch adds support for the Logic Product Development Card Engines to the SMC91x driver. The code has a bit wonkiness because of a peculiarity in the chip interface. Every access to the controller must be interleaved with access to another region of memory. This action toggles the chip select line. # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/08/11 11:11:04-07:00 elf@florence.buici.com # Add proper LED definitions for LPD7a40x and SMC91x. # # drivers/net/smc91x.h # 2004/08/11 11:10:58-07:00 elf@florence.buici.com +3 -0 # Add proper LED definitions for LPD7a40x and SMC91x. # # ChangeSet # 2004/08/11 00:07:38-07:00 elf@florence.buici.com # Support for LPD Card Engines in SMC91x network driver. # # drivers/net/smc91x.h # 2004/08/11 00:07:32-07:00 elf@florence.buici.com +40 -0 # Support for LPD Card Engines in SMC91x network driver. # diff -Nru a/drivers/net/smc91x.h b/drivers/net/smc91x.h --- a/drivers/net/smc91x.h Wed Aug 11 11:26:15 2004 +++ b/drivers/net/smc91x.h Wed Aug 11 11:26:15 2004 @@ -160,6 +160,49 @@ #define SMC_insw(a, r, p, l) insw((a) + (r), p, l) #define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) +#elif defined(CONFIG_MACH_LPD7A400) || defined(CONFIG_MACH_LPD7A404) + +#include <asm/arch/constants.h> /* IOBARRIER_VIRT */ + +#define SMC_CAN_USE_8BIT 0 +#define SMC_CAN_USE_16BIT 1 +#define SMC_CAN_USE_32BIT 0 +#define SMC_NOWAIT 0 +#define SMC_IOBARRIER ({ barrier (); readl (IOBARRIER_VIRT); }) + +static inline unsigned short SMC_inw (unsigned long a, int r) +{ + unsigned short v; + v = readw (a + r); + SMC_IOBARRIER; + return v; +} + +static inline void SMC_outw (unsigned short v, unsigned long a, int r) +{ + writew (v, a + r); + SMC_IOBARRIER; +} + +static inline void SMC_insw (unsigned long a, int r, unsigned char* p, int l) +{ + while (l-- > 0) { + *((unsigned short*)p)++ = readw (a + r); + SMC_IOBARRIER; + } +} + +static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l) +{ + while (l-- > 0) { + writew (*((unsigned short*)p)++, a + r); + SMC_IOBARRIER; + } +} + +#define RPC_LSA_DEFAULT RPC_LED_TX_RX +#define RPC_LSB_DEFAULT RPC_LED_100_10 + #else #define SMC_CAN_USE_8BIT 1 - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html