2 * include/asm-arm/arch-s3c2410/entry-macro.S
4 * Low-level IRQ helper macros for S3C2410-based platforms
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
11 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
13 #include <asm/hardware.h>
14 #include <asm/arch/irqs.h>
17 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
19 mov \tmp, #S3C24XX_VA_IRQ
20 ldr \irqnr, [ \tmp, #0x14 ] @ get irq no
24 beq 1002f @ external irq reg
26 @ debug check to see if interrupt reported is the same
31 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND
32 mov \irqstat, \irqstat, lsr \irqnr
36 /* debug/warning if we get an invalud response from the
37 * INTOFFSET register */
39 stmfd r13!, { r0 - r4 , r8-r12, r14 }
40 ldr r1, [ \tmp, #0x14 ] @ INTOFFSET
41 ldr r2, [ \tmp, #0x10 ] @ INTPND
42 ldr r3, [ \tmp, #0x00 ] @ SRCPND
48 .ascii "<7>irq: err - bad offset %d, intpnd=%08x, srcpnd=%08x\n"
53 mov \tmp, #S3C24XX_VA_IRQ
54 ldmfd r13!, { r0 - r4 , r8-r12, r14 }
57 @ try working out interrupt number for ourselves
59 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND
61 movs \irqstat, \irqstat, lsr#1
62 bcs 30000b @ try and re-start the proccess
63 add \irqnr, \irqnr, #1
67 @ found no interrupt, set Z flag and leave
73 @ we base the s3c2410x interrupts at 16 and above to allow
74 @ isa peripherals to have their standard interrupts, also
75 @ ensure that Z flag is un-set on exit
77 @ note, we cannot be sure if we get IRQ_EINT0 (0) that
78 @ there is simply no interrupt pending, so in all other
79 @ cases we jump to say we have found something, otherwise
80 @ we check to see if the interrupt really is assrted
81 adds \irqnr, \irqnr, #IRQ_EINT0
82 teq \irqnr, #IRQ_EINT0
84 ldr \irqstat, [ \tmp, #0x10 ] @ INTPND
89 @ we get here from no main or external interrupts pending
91 add \tmp, \tmp, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ
92 ldr \irqstat, [ \tmp, # 0xa8 ] @ EXTINTPEND
93 ldr \irqnr, [ \tmp, # 0xa4 ] @ EXTINTMASK
95 bic \irqstat, \irqstat, \irqnr @ clear masked irqs
97 mov \irqnr, #IRQ_EINT4 @ start extint nos
98 mov \irqstat, \irqstat, lsr#4 @ ignore bottom 4 bits
100 movs \irqstat, \irqstat, lsr#1
102 add \irqnr, \irqnr, #1
103 cmp \irqnr, #IRQ_EINT23
106 @ found no interrupt, set Z flag and leave
109 1004: @ ensure Z flag clear in case our MOVS shifted out the last bit
116 /* currently don't need an disable_fiq macro */