Commit c7141bba authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk/linux-2.6-rmk

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 5a530b5a d97fac8f
...@@ -5,7 +5,7 @@ Due to an unfortunate oversight when the Card Engines were designed, ...@@ -5,7 +5,7 @@ Due to an unfortunate oversight when the Card Engines were designed,
the signals that control access to some peripherals, most notably the the signals that control access to some peripherals, most notably the
SMC91C9111 ethernet controller, are not properly handled. SMC91C9111 ethernet controller, are not properly handled.
The symptom is that back to back IO with the peripheral returns The symptom is that some back to back IO with the peripheral returns
unreliable data. With the SMC chip, you'll see errors about the bank unreliable data. With the SMC chip, you'll see errors about the bank
register being 'screwed'. register being 'screwed'.
...@@ -13,20 +13,33 @@ The cause is that the AEN signal to the SMC chip does not transition ...@@ -13,20 +13,33 @@ The cause is that the AEN signal to the SMC chip does not transition
for every memory access. It is driven through the CPLD from the CS7 for every memory access. It is driven through the CPLD from the CS7
line of the CPU's static memory controller which is optimized to line of the CPU's static memory controller which is optimized to
eliminate unnecessary transitions. Yet, the SMC requires a transition eliminate unnecessary transitions. Yet, the SMC requires a transition
for every access. The Sharp website has more information on the for every write access. The Sharp website has more information about
effect of this power conservation feature on peripheral interfacing. the effect this power-conserving feature has on peripheral
interfacing.
The solution is to follow every access to the SMC chip with an access The solution is to follow every write access to the SMC chip with an
to another memory region that will force the CPU to release the chip access to another memory region that will force the CPU to release the
select line. Note that it is important to guarantee that the access chip select line. It is important to guarantee that this access
will force the CPU off-chip. We map a page of SDRAM as if it were an forces the CPU off-chip. We map a page of SDRAM as if it were an
uncacheable IO device and read from it after every SMC IO operation. uncacheable IO device and read from it after every SMC IO write
operation.
SMC IO SMC IO
BARRIER IO BARRIER IO
You might be tempted to believe that we must access another device Only this sequence is important. It does not matter that there is no
BARRIER IO before the access to the SMC chip because the AEN latch
only needs occurs after the SMC IO write cycle. The routines that
implement this work-around make an additional concession which is to
disable interrupts during the IO sequence. Other hardware devices
(the LogicPD CPLD) have registers in the same the physical memory
region as the SMC chip. An interrupt might allow an access to one of
those registers while SMC IO is being performed.
You might be tempted to think that we have to access another device
attached to the static memory controller, but the empirical evidence attached to the static memory controller, but the empirical evidence
indicates that this is not so. Mapping 0x00000000 (flash) and indicates that this is not so. Mapping 0x00000000 (flash) and
0xc0000000 (SDRAM) appear to have the same effect. Using SDRAM seems 0xc0000000 (SDRAM) appear to have the same effect. Using SDRAM seems
to be faster. to be faster. Choosing to access an undecoded memory region is not
desirable as there is no way to know how that chip select will be used
in the future.
...@@ -317,7 +317,7 @@ config ISA_DMA ...@@ -317,7 +317,7 @@ config ISA_DMA
config FIQ config FIQ
bool bool
depends on ARCH_ACORN || ARCH_L7200 || ARCH_LH7A400 depends on ARCH_ACORN || ARCH_L7200
default y default y
# Compressed boot loader in ROM. Yes, we really want to ask about # Compressed boot loader in ROM. Yes, we really want to ask about
......
...@@ -267,7 +267,7 @@ MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10") ...@@ -267,7 +267,7 @@ MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10")
BOOT_PARAMS (0xc0000100) BOOT_PARAMS (0xc0000100)
MAPIO (lpd7a400_map_io) MAPIO (lpd7a400_map_io)
INITIRQ (lh7a400_init_irq) INITIRQ (lh7a400_init_irq)
.timer = &lpd7a40x_timer, .timer = &lh7a40x_timer,
INIT_MACHINE (lpd7a40x_init) INIT_MACHINE (lpd7a40x_init)
MACHINE_END MACHINE_END
...@@ -281,7 +281,7 @@ MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10") ...@@ -281,7 +281,7 @@ MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10")
BOOT_PARAMS (0xc0000100) BOOT_PARAMS (0xc0000100)
MAPIO (lpd7a400_map_io) MAPIO (lpd7a400_map_io)
INITIRQ (lh7a404_init_irq) INITIRQ (lh7a404_init_irq)
.timer = &lpd7a40x_timer, .timer = &lh7a40x_timer,
INIT_MACHINE (lpd7a40x_init) INIT_MACHINE (lpd7a40x_init)
MACHINE_END MACHINE_END
......
/* /* arch/arm/mach-lh7a40x/common.h
* linux/arch/arm/mach-lh7a40x/common.h *
* Copyright (C) 2004 Marc Singer
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
* *
* Header file for common stuff.
*/ */
struct sys_timer;
extern struct sys_timer lh7a40x_timer; extern struct sys_timer lh7a40x_timer;
extern void lh7a400_init_irq (void); extern void lh7a400_init_irq (void);
extern void lh7a404_init_irq (void);
...@@ -71,5 +71,5 @@ static void __init lh7a40x_timer_init(void) ...@@ -71,5 +71,5 @@ static void __init lh7a40x_timer_init(void)
} }
struct sys_timer lh7a40x_timer = { struct sys_timer lh7a40x_timer = {
.init = &lh7a40x_timer, .init = &lh7a40x_timer_init,
}; };
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include "generic.h" #include "generic.h"
#warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
static struct map_desc lart_io_desc[] __initdata = { static struct map_desc lart_io_desc[] __initdata = {
/* virtual physical length type */ /* virtual physical length type */
{ 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */ { 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */
......
...@@ -216,7 +216,7 @@ static void __exit ixp4xx_wdt_exit(void) ...@@ -216,7 +216,7 @@ static void __exit ixp4xx_wdt_exit(void)
module_init(ixp4xx_wdt_init); module_init(ixp4xx_wdt_init);
module_exit(ixp4xx_wdt_exit); module_exit(ixp4xx_wdt_exit);
MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net">); MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
MODULE_DESCRIPTION("IXP4xx Network Processor Watchdog"); MODULE_DESCRIPTION("IXP4xx Network Processor Watchdog");
module_param(heartbeat, int, 0); module_param(heartbeat, int, 0);
......
...@@ -1244,6 +1244,11 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1244,6 +1244,11 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
spin_lock(&lp->lock); spin_lock(&lp->lock);
/* A preamble may be used when there is a potential race
* between the interruptible transmit functions and this
* ISR. */
SMC_INTERRUPT_PREAMBLE;
saved_pointer = SMC_GET_PTR(); saved_pointer = SMC_GET_PTR();
mask = SMC_GET_INT_MASK(); mask = SMC_GET_INT_MASK();
SMC_SET_INT_MASK(0); SMC_SET_INT_MASK(0);
......
...@@ -193,6 +193,53 @@ SMC_outw(u16 val, unsigned long ioaddr, int reg) ...@@ -193,6 +193,53 @@ SMC_outw(u16 val, unsigned long 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)
/* The LPD7A40X_IOBARRIER is necessary to overcome a mismatch between
* the way that the CPU handles chip selects and the way that the SMC
* chip expects the chip select to operate. Refer to
* Documentation/arm/Sharp-LH/IOBarrier for details. The read from
* IOBARRIER is a byte as a least-common denominator of possible
* regions to use as the barrier. It would be wasteful to read 32
* bits from a byte oriented region.
*
* There is no explicit protection against interrupts intervening
* between the writew and the IOBARRIER. In SMC ISR there is a
* preamble that performs an IOBARRIER in the extremely unlikely event
* that the driver interrupts itself between a writew to the chip an
* the IOBARRIER that follows *and* the cache is large enough that the
* first off-chip access while handing the interrupt is to the SMC
* chip. Other devices in the same address space as the SMC chip must
* be aware of the potential for trouble and perform a similar
* IOBARRIER on entry to their ISR.
*/
#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 LPD7A40X_IOBARRIER readb (IOBARRIER_VIRT)
#define SMC_inw(a,r) readw ((void*) ((a) + (r)))
#define SMC_insw(a,r,p,l) readsw ((void*) ((a) + (r)), p, l)
#define SMC_outw(v,a,r) ({ writew ((v), (a) + (r)); LPD7A40X_IOBARRIER; })
static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)
{
unsigned short* ps = (unsigned short*) p;
while (l-- > 0) {
writew (*ps++, a + r);
LPD7A40X_IOBARRIER;
}
}
#define SMC_INTERRUPT_PREAMBLE LPD7A40X_IOBARRIER
#define RPC_LSA_DEFAULT RPC_LED_TX_RX
#define RPC_LSB_DEFAULT RPC_LED_100_10
#else #else
#define SMC_CAN_USE_8BIT 1 #define SMC_CAN_USE_8BIT 1
...@@ -894,5 +941,8 @@ static const char * chip_ids[ 16 ] = { ...@@ -894,5 +941,8 @@ static const char * chip_ids[ 16 ] = {
}) })
#endif #endif
#if !defined (SMC_INTERRUPT_PREAMBLE)
# define SMC_INTERRUPT_PREAMBLE
#endif
#endif /* _SMC91X_H_ */ #endif /* _SMC91X_H_ */
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#error "This code is broken and needs update to match with current ide support"
/* /*
* Set up a hw structure for a specified data port, control port and IRQ. * Set up a hw structure for a specified data port, control port and IRQ.
......
...@@ -17,10 +17,6 @@ ...@@ -17,10 +17,6 @@
#define MAX_HWIFS 4 #define MAX_HWIFS 4
#endif #endif
#if defined(CONFIG_ARCH_SA1100)
# include <asm/arch/ide.h> /* obsolete + broken */
#endif
#if !defined(CONFIG_ARCH_L7200) #if !defined(CONFIG_ARCH_L7200)
# define IDE_ARCH_OBSOLETE_INIT # define IDE_ARCH_OBSOLETE_INIT
# ifdef CONFIG_ARCH_CLPS7500 # ifdef CONFIG_ARCH_CLPS7500
......
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