Commit d4adcffb authored by Marc Singer's avatar Marc Singer Committed by Russell King

[ARM] 3406/1: lpd7x: compilation fix for smc91x

Patch from Marc Singer

Reworking of the adaptation macros to allow driver to compile again
for the lpd7x's.  Also, support added for the lh79520 so it may use
the smc91x.
Signed-off-by: default avatarMarc Singer <elf@buici.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent c9789861
...@@ -242,15 +242,17 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) ...@@ -242,15 +242,17 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define RPC_LSA_DEFAULT RPC_LED_TX_RX #define RPC_LSA_DEFAULT RPC_LED_TX_RX
#define RPC_LSB_DEFAULT RPC_LED_100_10 #define RPC_LSB_DEFAULT RPC_LED_100_10
#elif defined(CONFIG_MACH_LPD7A400) || defined(CONFIG_MACH_LPD7A404) #elif defined(CONFIG_MACH_LPD79520) \
|| defined(CONFIG_MACH_LPD7A400) \
|| defined(CONFIG_MACH_LPD7A404)
/* The LPD7A40X_IOBARRIER is necessary to overcome a mismatch between /* The LPD7X_IOBARRIER is necessary to overcome a mismatch between the
* the way that the CPU handles chip selects and the way that the SMC * way that the CPU handles chip selects and the way that the SMC chip
* chip expects the chip select to operate. Refer to * expects the chip select to operate. Refer to
* Documentation/arm/Sharp-LH/IOBarrier for details. The read from * Documentation/arm/Sharp-LH/IOBarrier for details. The read from
* IOBARRIER is a byte as a least-common denominator of possible * IOBARRIER is a byte, in order that we read the least-common
* regions to use as the barrier. It would be wasteful to read 32 * denominator. It would be wasteful to read 32 bits from an 8-bit
* bits from a byte oriented region. * accessible region.
* *
* There is no explicit protection against interrupts intervening * There is no explicit protection against interrupts intervening
* between the writew and the IOBARRIER. In SMC ISR there is a * between the writew and the IOBARRIER. In SMC ISR there is a
...@@ -269,25 +271,35 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) ...@@ -269,25 +271,35 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_16BIT 1 #define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 0 #define SMC_CAN_USE_32BIT 0
#define SMC_NOWAIT 0 #define SMC_NOWAIT 0
#define LPD7A40X_IOBARRIER readb (IOBARRIER_VIRT) #define LPD7X_IOBARRIER readb (IOBARRIER_VIRT)
#define SMC_inw(a,r) readw ((void*) ((a) + (r))) #define SMC_inw(a,r)\
#define SMC_insw(a,r,p,l) readsw ((void*) ((a) + (r)), p, l) ({ unsigned short v = readw ((void*) ((a) + (r))); LPD7X_IOBARRIER; v; })
#define SMC_outw(v,a,r) ({ writew ((v), (a) + (r)); LPD7A40X_IOBARRIER; }) #define SMC_outw(v,a,r) ({ writew ((v), (a) + (r)); LPD7X_IOBARRIER; })
#define SMC_outsw LPD7A40X_SMC_outsw #define SMC_insw LPD7_SMC_insw
static inline void LPD7_SMC_insw (unsigned char* a, int r,
unsigned char* p, int l)
{
unsigned short* ps = (unsigned short*) p;
while (l-- > 0) {
*ps++ = readw (a + r);
LPD7X_IOBARRIER;
}
}
static inline void LPD7A40X_SMC_outsw(unsigned long a, int r, #define SMC_outsw LPD7_SMC_outsw
static inline void LPD7_SMC_outsw (unsigned char* a, int r,
unsigned char* p, int l) unsigned char* p, int l)
{ {
unsigned short* ps = (unsigned short*) p; unsigned short* ps = (unsigned short*) p;
while (l-- > 0) { while (l-- > 0) {
writew (*ps++, a + r); writew (*ps++, a + r);
LPD7A40X_IOBARRIER; LPD7X_IOBARRIER;
} }
} }
#define SMC_INTERRUPT_PREAMBLE LPD7A40X_IOBARRIER #define SMC_INTERRUPT_PREAMBLE LPD7X_IOBARRIER
#define RPC_LSA_DEFAULT RPC_LED_TX_RX #define RPC_LSA_DEFAULT RPC_LED_TX_RX
#define RPC_LSB_DEFAULT RPC_LED_100_10 #define RPC_LSB_DEFAULT RPC_LED_100_10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment