1 /* linux/arch/arm/mach-s3c2410/bast-irq.c
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * http://www.simtec.co.uk/products/EB2410ITX/
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * 08-Jan-2003 BJD Moved from central IRQ code
27 #include <linux/init.h>
28 #include <linux/module.h>
29 #include <linux/ioport.h>
30 #include <linux/ptrace.h>
31 #include <linux/sysdev.h>
33 #include <asm/hardware.h>
37 #include <asm/mach/irq.h>
38 #include <asm/hardware/s3c2410/irq.h>
41 #include <asm/debug-ll.h>
48 /* handle PC104 ISA interrupts from the system CPLD */
50 /* table of ISA irq nos to the relevant mask... zero means
51 * the irq is not implemented
53 static unsigned char bast_pc104_irqmasks
[] = {
72 static unsigned char bast_pc104_irqs
[] = { 3, 5, 7, 10 };
75 bast_pc104_mask(unsigned int irqno
)
79 temp
= __raw_readb(BAST_VA_PC104_IRQMASK
);
80 temp
&= ~bast_pc104_irqmasks
[irqno
];
81 __raw_writeb(temp
, BAST_VA_PC104_IRQMASK
);
84 bast_extint_mask(IRQ_ISA
);
88 bast_pc104_ack(unsigned int irqno
)
90 bast_extint_ack(IRQ_ISA
);
94 bast_pc104_unmask(unsigned int irqno
)
98 temp
= __raw_readb(BAST_VA_PC104_IRQMASK
);
99 temp
|= bast_pc104_irqmasks
[irqno
];
100 __raw_writeb(temp
, BAST_VA_PC104_IRQMASK
);
102 bast_extint_unmask(IRQ_ISA
);
105 static struct bast_pc104_chip
= {
106 .mask
= bast_pc104_mask
,
107 .unmask
= bast_pc104_unmask
,
108 .ack
= bast_pc104_ack
112 bast_irq_pc104_demux(unsigned int irq
,
113 struct irqdesc
*desc
,
114 struct pt_regs
*regs
)
120 stat
= __raw_readb(BAST_VA_PC104_IRQREQ
) & 0xf;
122 for (i
= 0; i
< 4 && stat
!= 0; i
++) {
124 irqno
= bast_pc104_irqs
[i
];
125 desc
= irq_desc
+ irqno
;
127 desc
->handle(irqno
, desc
, regs
);