1 /*
2  * include/asm-arm/arch-l7200/irq.h
3  *
4  * Copyright (C) 2000 Rob Scott (rscott@mtrob.fdns.ne
5  *                    Steve Hill (sjhill@cotw.com)
6  *
7  * Changelog:
8  *   01-02-2000	RS	Created l7200 version, derived from ebsa110 code
9  *   04-15-2000 RS      Made dependent on hardware.h
10  *   05-05-2000 SJH     Complete rewrite
11  */
12 
13 #include <asm/arch/hardware.h>
14 
15 /*
16  * IRQ base register
17  */
18 #define	IRQ_BASE	(IO_BASE_2 + 0x1000)
19 
20 /*
21  * Normal IRQ registers
22  */
23 #define IRQ_STATUS	(*(volatile unsigned long *) (IRQ_BASE + 0x000))
24 #define IRQ_RAWSTATUS	(*(volatile unsigned long *) (IRQ_BASE + 0x004))
25 #define IRQ_ENABLE	(*(volatile unsigned long *) (IRQ_BASE + 0x008))
26 #define IRQ_ENABLECLEAR	(*(volatile unsigned long *) (IRQ_BASE + 0x00c))
27 #define IRQ_SOFT	(*(volatile unsigned long *) (IRQ_BASE + 0x010))
28 #define IRQ_SOURCESEL	(*(volatile unsigned long *) (IRQ_BASE + 0x018))
29 
30 /*
31  * Fast IRQ registers
32  */
33 #define FIQ_STATUS	(*(volatile unsigned long *) (IRQ_BASE + 0x100))
34 #define FIQ_RAWSTATUS	(*(volatile unsigned long *) (IRQ_BASE + 0x104))
35 #define FIQ_ENABLE	(*(volatile unsigned long *) (IRQ_BASE + 0x108))
36 #define FIQ_ENABLECLEAR	(*(volatile unsigned long *) (IRQ_BASE + 0x10c))
37 #define FIQ_SOFT	(*(volatile unsigned long *) (IRQ_BASE + 0x110))
38 #define FIQ_SOURCESEL	(*(volatile unsigned long *) (IRQ_BASE + 0x118))
39 
40 #define fixup_irq(x) (x)
41 
l7200_mask_irq(unsigned int irq)42 static void l7200_mask_irq(unsigned int irq)
43 {
44 	IRQ_ENABLECLEAR = 1 << irq;
45 }
46 
l7200_unmask_irq(unsigned int irq)47 static void l7200_unmask_irq(unsigned int irq)
48 {
49 	IRQ_ENABLE = 1 << irq;
50 }
51 
irq_init_irq(void)52 static __inline__ void irq_init_irq(void)
53 {
54 	int irq;
55 
56 	IRQ_ENABLECLEAR = 0xffffffff;	/* clear all interrupt enables */
57 	FIQ_ENABLECLEAR = 0xffffffff;	/* clear all fast interrupt enables */
58 
59 	for (irq = 0; irq < NR_IRQS; irq++) {
60 		irq_desc[irq].valid	= 1;
61 		irq_desc[irq].probe_ok	= 1;
62 		irq_desc[irq].mask_ack	= l7200_mask_irq;
63 		irq_desc[irq].mask	= l7200_mask_irq;
64 		irq_desc[irq].unmask	= l7200_unmask_irq;
65 	}
66 
67 	init_FIQ();
68 }
69