Commit 73229285 authored by Linus Torvalds's avatar Linus Torvalds

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

into home.osdl.org:/home/torvalds/v2.5/linux
parents 099e99f0 39e53789
......@@ -168,14 +168,14 @@ sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
{
unsigned int stat0, stat1, i;
stat0 = INTSTATCLR0;
stat1 = INTSTATCLR1;
stat0 = sa1111_readl(desc->data + SA1111_INTSTATCLR0);
stat1 = sa1111_readl(desc->data + SA1111_INTSTATCLR1);
INTSTATCLR0 = stat0;
sa1111_writel(stat0, desc->data + SA1111_INTSTATCLR0);
desc->chip->ack(irq);
INTSTATCLR1 = stat1;
sa1111_writel(stat1, desc->data + SA1111_INTSTATCLR1);
if (stat0 == 0 && stat1 == 0) {
do_bad_IRQ(irq, desc, regs);
......@@ -203,12 +203,22 @@ static void sa1111_ack_irq(unsigned int irq)
static void sa1111_mask_lowirq(unsigned int irq)
{
INTEN0 &= ~SA1111_IRQMASK_LO(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long ie0;
ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
ie0 &= ~SA1111_IRQMASK_LO(irq);
writel(ie0, mapbase + SA1111_INTEN0);
}
static void sa1111_unmask_lowirq(unsigned int irq)
{
INTEN0 |= SA1111_IRQMASK_LO(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long ie0;
ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
ie0 |= SA1111_IRQMASK_LO(irq);
sa1111_writel(ie0, mapbase + SA1111_INTEN0);
}
/*
......@@ -221,12 +231,15 @@ static void sa1111_unmask_lowirq(unsigned int irq)
static int sa1111_retrigger_lowirq(unsigned int irq)
{
unsigned int mask = SA1111_IRQMASK_LO(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long ip0;
int i;
ip0 = sa1111_readl(mapbase + SA1111_INTPOL0);
for (i = 0; i < 8; i++) {
INTPOL0 ^= mask;
INTPOL0 ^= mask;
if (INTSTATCLR1 & mask)
sa1111_writel(ip0 ^ mask, mapbase + SA1111_INTPOL0);
sa1111_writel(ip0, mapbase + SA1111_INTPOL0);
if (sa1111_readl(mapbase + SA1111_INTSTATCLR1) & mask)
break;
}
......@@ -239,6 +252,8 @@ static int sa1111_retrigger_lowirq(unsigned int irq)
static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
{
unsigned int mask = SA1111_IRQMASK_LO(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long ip0;
if (flags == IRQT_PROBE)
return 0;
......@@ -246,11 +261,13 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0)
return -EINVAL;
ip0 = sa1111_readl(mapbase + SA1111_INTPOL0);
if (flags & __IRQT_RISEDGE)
INTPOL0 &= ~mask;
ip0 &= ~mask;
else
INTPOL0 |= mask;
WAKE_POL0 = INTPOL0;
ip0 |= mask;
sa1111_writel(ip0, mapbase + SA1111_INTPOL0);
sa1111_writel(ip0, mapbase + SA1111_WAKEPOL0);
return 0;
}
......@@ -258,11 +275,15 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
{
unsigned int mask = SA1111_IRQMASK_LO(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long we0;
we0 = sa1111_readl(mapbase + SA1111_WAKEEN0);
if (on)
WAKE_EN0 |= mask;
we0 |= mask;
else
WAKE_EN0 &= ~mask;
we0 &= ~mask;
sa1111_writel(we0, mapbase + SA1111_WAKEEN0);
return 0;
}
......@@ -278,12 +299,22 @@ static struct irqchip sa1111_low_chip = {
static void sa1111_mask_highirq(unsigned int irq)
{
INTEN1 &= ~SA1111_IRQMASK_HI(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long ie1;
ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
ie1 &= ~SA1111_IRQMASK_HI(irq);
sa1111_writel(ie1, mapbase + SA1111_INTEN1);
}
static void sa1111_unmask_highirq(unsigned int irq)
{
INTEN1 |= SA1111_IRQMASK_HI(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long ie1;
ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
ie1 |= SA1111_IRQMASK_HI(irq);
sa1111_writel(ie1, mapbase + SA1111_INTEN1);
}
/*
......@@ -296,12 +327,15 @@ static void sa1111_unmask_highirq(unsigned int irq)
static int sa1111_retrigger_highirq(unsigned int irq)
{
unsigned int mask = SA1111_IRQMASK_HI(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long ip1;
int i;
ip1 = sa1111_readl(mapbase + SA1111_INTPOL1);
for (i = 0; i < 8; i++) {
INTPOL1 ^= mask;
INTPOL1 ^= mask;
if (INTSTATCLR1 & mask)
sa1111_writel(ip1 ^ mask, mapbase + SA1111_INTPOL1);
sa1111_writel(ip1, mapbase + SA1111_INTPOL1);
if (sa1111_readl(mapbase + SA1111_INTSTATCLR1) & mask)
break;
}
......@@ -314,6 +348,8 @@ static int sa1111_retrigger_highirq(unsigned int irq)
static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
{
unsigned int mask = SA1111_IRQMASK_HI(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long ip1;
if (flags == IRQT_PROBE)
return 0;
......@@ -321,11 +357,13 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0)
return -EINVAL;
ip1 = sa1111_readl(mapbase + SA1111_INTPOL1);
if (flags & __IRQT_RISEDGE)
INTPOL1 &= ~mask;
ip1 &= ~mask;
else
INTPOL1 |= mask;
WAKE_POL1 = INTPOL1;
ip1 |= mask;
sa1111_writel(ip1, mapbase + SA1111_INTPOL1);
sa1111_writel(ip1, mapbase + SA1111_WAKEPOL1);
return 0;
}
......@@ -333,11 +371,15 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
{
unsigned int mask = SA1111_IRQMASK_HI(irq);
void *mapbase = get_irq_chipdata(irq);
unsigned long we1;
we1 = sa1111_readl(mapbase + SA1111_WAKEEN1);
if (on)
WAKE_EN1 |= mask;
we1 |= mask;
else
WAKE_EN1 &= ~mask;
we1 &= ~mask;
sa1111_writel(we1, mapbase + SA1111_WAKEEN1);
return 0;
}
......@@ -381,12 +423,14 @@ static void __init sa1111_init_irq(struct sa1111_dev *sadev)
for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) {
set_irq_chip(irq, &sa1111_low_chip);
set_irq_chipdata(irq, sadev->mapbase);
set_irq_handler(irq, do_edge_IRQ);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
}
for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) {
set_irq_chip(irq, &sa1111_high_chip);
set_irq_chipdata(irq, sadev->mapbase);
set_irq_handler(irq, do_edge_IRQ);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
}
......@@ -395,6 +439,7 @@ static void __init sa1111_init_irq(struct sa1111_dev *sadev)
* Register SA1111 interrupt
*/
set_irq_type(sadev->irq[0], IRQT_RISING);
set_irq_data(sadev->irq[0], sadev->mapbase);
set_irq_chained_handler(sadev->irq[0], sa1111_irq_handler);
}
......
......@@ -41,7 +41,6 @@
*/
/* init funcs */
static void __init get_hackkit_scr(void);
static int __init hackkit_init(void);
static void __init hackkit_init_irq(void);
static void __init hackkit_map_io(void);
......
......@@ -23,7 +23,7 @@
#include <asm/hardware.h>
#include <asm/hardware/ssp.h>
static void ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static irqreturn_t ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
unsigned int status = Ser4SSSR;
......@@ -32,6 +32,8 @@ static void ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
Ser4SSSR = SSSR_ROR;
return status ? IRQ_HANDLED : IRQ_NONE;
}
/**
......
......@@ -6,7 +6,7 @@
# To add an entry into this database, please see Documentation/arm/README,
# or contact rmk@arm.linux.org.uk
#
# Last update: Thu Jun 19 18:42:39 2003
# Last update: Sun Aug 3 16:26:10 2003
#
# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
#
......@@ -228,7 +228,7 @@ csb226 ARCH_CSB226 CSB226 216
arnold SA1100_ARNOLD ARNOLD 217
psiboard SA1100_PSIBOARD PSIBOARD 218
jz8028 ARCH_JZ8028 JZ8028 219
h5400 ARCH_IPAQ3 IPAQ3 220
h5400 ARCH_H5400 H5400 220
forte SA1100_FORTE FORTE 221
acam SA1100_ACAM ACAM 222
abox SA1100_ABOX ABOX 223
......@@ -300,7 +300,7 @@ wep_ep250 ARCH_WEP_EP250 WEP_EP250 288
inhandelf3 ARCH_INHANDELF3 INHANDELF3 289
adi_coyote ARCH_ADI_COYOTE ADI_COYOTE 290
iyonix ARCH_IYONIX IYONIX 291
damicam_sa1110 ARCH_DAMICAM_SA1110 DAMICAM_SA1110 292
damicam1 ARCH_DAMICAM_SA1110 DAMICAM_SA1110 292
meg03 ARCH_MEG03 MEG03 293
pxa_whitechapel ARCH_PXA_WHITECHAPEL PXA_WHITECHAPEL 294
nwsc ARCH_NWSC NWSC 295
......@@ -355,3 +355,15 @@ niop ARCH_NIOP NIOP 343
dm310 ARCH_DM310 DM310 344
seedpxa_c2 ARCH_SEEDPXA_C2 SEEDPXA_C2 345
ixp4xx_mguardpci ARCH_IXP4XX_MGUARD_PCI IXP4XX_MGUARD_PCI 346
h1940 ARCH_H1940 H1940 347
scorpio ARCH_SCORPIO SCORPIO 348
viva ARCH_VIVA VIVA 349
pxa_xcard ARCH_PXA_XCARD PXA_XCARD 350
csb335 ARCH_CSB335 CSB335 351
ixrd425 ARCH_IXRD425 IXRD425 352
iq80315 ARCH_IQ80315 IQ80315 353
nmp7312 ARCH_NMP7312 NMP7312 354
cx861xx ARCH_CX861XX CX861XX 355
ixp2000 ARCH_IXP2000 IXP2000 356
xda SA1100_XDA XDA 357
csir_ims ARCH_CSIR_IMS CSIR_IMS 358
......@@ -237,7 +237,7 @@ static const char *arxescsi_info(struct Scsi_Host *host)
*/
static int
arxescsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length,
int host_no, int inout)
int inout)
{
struct arxescsi_info *info;
char *p = buffer;
......@@ -264,7 +264,7 @@ static Scsi_Host_Template arxescsi_template = {
.proc_info = arxescsi_proc_info,
.name = "ARXE SCSI card",
.info = arxescsi_info,
.queuecommand = fas216_queue_command,
.queuecommand = fas216_noqueue_command,
.eh_host_reset_handler = fas216_eh_host_reset,
.eh_bus_reset_handler = fas216_eh_bus_reset,
.eh_device_reset_handler = fas216_eh_device_reset,
......
......@@ -444,10 +444,11 @@ int eesoxscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_
p += sprintf(p, "Term : o%s\n",
info->control & EESOX_TERM_ENABLE ? "n" : "ff");
pos += fas216_print_stats(&info->info, buffer + pos);
p += fas216_print_stats(&info->info, p);
p += fas216_print_devices(&info->info, p);
*start = buffer + offset;
pos = p - buffer - offset;
if (pos > length)
pos = length;
......
......@@ -225,7 +225,8 @@ static void fas216_dumpinfo(FAS216_Info *info)
printk(" dma={ transfer_type=%X setup=%p pseudo=%p stop=%p }\n",
info->dma.transfer_type, info->dma.setup,
info->dma.pseudo, info->dma.stop);
printk(" magic_end=%lX }\n", info->magic_end);
printk(" internal_done=%X magic_end=%lX }\n",
info->internal_done, info->magic_end);
}
#ifdef CHECK_STRUCTURE
......@@ -2252,6 +2253,75 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
return result;
}
/**
* fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command
* @SCpnt: Command to wake
*
* Trigger restart of a waiting thread in fas216_command
*/
static void fas216_internal_done(Scsi_Cmnd *SCpnt)
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
fas216_checkmagic(info);
info->internal_done = 1;
}
/**
* fas216_noqueue_command - process a command for the adapter.
* @SCpnt: Command to queue
*
* Queue a command for adapter to process.
* Returns: scsi result code.
* Notes: io_request_lock is held, interrupts are disabled.
*/
int fas216_noqueue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
fas216_checkmagic(info);
/*
* We should only be using this if we don't have an interrupt.
* Provide some "incentive" to use the queueing code.
*/
BUG_ON(info->scsi.irq != NO_IRQ);
info->internal_done = 0;
fas216_queue_command(SCpnt, fas216_internal_done);
/*
* This wastes time, since we can't return until the command is
* complete. We can't sleep either since we may get re-entered!
* However, we must re-enable interrupts, or else we'll be
* waiting forever.
*/
spin_unlock_irq(info->host->host_lock);
while (!info->internal_done) {
/*
* If we don't have an IRQ, then we must poll the card for
* it's interrupt, and use that to call this driver's
* interrupt routine. That way, we keep the command
* progressing. Maybe we can add some inteligence here
* and go to sleep if we know that the device is going
* to be some time (eg, disconnected).
*/
if (fas216_readb(info, REG_STAT) & STAT_INT) {
spin_lock_irq(info->host->host_lock);
fas216_intr(info);
spin_unlock_irq(info->host->host_lock);
}
}
spin_lock_irq(info->host->host_lock);
done(SCpnt);
return 0;
}
/*
* Error handler timeout function. Indicate that we timed out,
* and wake up any error handler process so it can continue.
......@@ -2962,7 +3032,7 @@ int fas216_print_devices(FAS216_Info *info, char *buffer)
EXPORT_SYMBOL(fas216_init);
EXPORT_SYMBOL(fas216_add);
EXPORT_SYMBOL(fas216_queue_command);
EXPORT_SYMBOL(fas216_command);
EXPORT_SYMBOL(fas216_noqueue_command);
EXPORT_SYMBOL(fas216_intr);
EXPORT_SYMBOL(fas216_remove);
EXPORT_SYMBOL(fas216_release);
......
......@@ -310,6 +310,7 @@ typedef struct {
} dma;
/* miscellaneous */
int internal_done; /* flag to indicate request done */
unsigned long magic_end;
} FAS216_Info;
......@@ -335,6 +336,14 @@ extern int fas216_add (struct Scsi_Host *instance, struct device *dev);
*/
extern int fas216_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
/* Function: int fas216_noqueue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
* Purpose : queue a command for adapter to process, and process it to completion.
* Params : SCpnt - Command to queue
* done - done function to call once command is complete
* Returns : 0 - success, else error
*/
extern int fas216_noqueue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
/* Function: irqreturn_t fas216_intr (FAS216_Info *info)
* Purpose : handle interrupts from the interface to progress a command
* Params : info - interface to service
......
......@@ -19,7 +19,7 @@
struct platform_device;
extern int platform_add_devices(struct platform_device *, int);
extern int platform_add_devices(struct platform_device **, int);
extern int platform_add_device(struct platform_device *);
#endif
......
......@@ -429,22 +429,6 @@
#define SA1111_WAKEPOL0 0x0034
#define SA1111_WAKEPOL1 0x0038
#define INTTEST0 __CCREG(SA1111_INTC + SA1111_INTTEST0)
#define INTTEST1 __CCREG(SA1111_INTC + SA1111_INTTEST1)
#define INTEN0 __CCREG(SA1111_INTC + SA1111_INTEN0)
#define INTEN1 __CCREG(SA1111_INTC + SA1111_INTEN1)
#define INTPOL0 __CCREG(SA1111_INTC + SA1111_INTPOL0)
#define INTPOL1 __CCREG(SA1111_INTC + SA1111_INTPOL1)
#define INTTSTSEL __CCREG(SA1111_INTC + SA1111_INTTSTSEL)
#define INTSTATCLR0 __CCREG(SA1111_INTC + SA1111_INTSTATCLR0)
#define INTSTATCLR1 __CCREG(SA1111_INTC + SA1111_INTSTATCLR1)
#define INTSET0 __CCREG(SA1111_INTC + SA1111_INTSET0)
#define INTSET1 __CCREG(SA1111_INTC + SA1111_INTSET1)
#define WAKE_EN0 __CCREG(SA1111_INTC + SA1111_WAKEEN0)
#define WAKE_EN1 __CCREG(SA1111_INTC + SA1111_WAKEEN1)
#define WAKE_POL0 __CCREG(SA1111_INTC + SA1111_WAKEPOL0)
#define WAKE_POL1 __CCREG(SA1111_INTC + SA1111_WAKEPOL1)
/*
* PS/2 Trackpad and Mouse Interfaces
*
......
#include <asm-generic/local.h>
......@@ -54,6 +54,8 @@ struct irqdesc {
struct irqchip *chip;
struct irqaction *action;
struct list_head pend;
void *chipdata;
void *data;
unsigned int disable_depth;
unsigned int triggered: 1; /* IRQ has occurred */
......@@ -88,6 +90,9 @@ void __set_irq_handler(unsigned int irq, irq_handler_t, int);
*/
#define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0)
#define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1)
#define set_irq_data(irq,d) do { irq_desc[irq].data = d; } while (0)
#define set_irq_chipdata(irq,d) do { irq_desc[irq].chipdata = d; } while (0)
#define get_irq_chipdata(irq) (irq_desc[irq].chipdata)
void set_irq_chip(unsigned int irq, struct irqchip *);
void set_irq_flags(unsigned int irq, unsigned int flags);
......
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