2005-04-17 06:20:36 +08:00
|
|
|
/*
|
2008-08-05 23:14:15 +08:00
|
|
|
* arch/arm/mach-pxa/include/mach/entry-macro.S
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* Low-level IRQ helper macros for PXA-based platforms
|
|
|
|
*
|
|
|
|
* This file is licensed under the terms of the GNU General Public
|
|
|
|
* License version 2. This program is licensed "as is" without any
|
|
|
|
* warranty of any kind, whether express or implied.
|
|
|
|
*/
|
2008-08-05 23:14:15 +08:00
|
|
|
#include <mach/hardware.h>
|
|
|
|
#include <mach/irqs.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
.macro disable_fiq
|
|
|
|
.endm
|
|
|
|
|
2007-02-17 05:16:32 +08:00
|
|
|
.macro get_irqnr_preamble, base, tmp
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro arch_ret_to_user, tmp1, tmp2
|
|
|
|
.endm
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
|
2007-06-06 13:49:59 +08:00
|
|
|
mrc p15, 0, \tmp, c0, c0, 0 @ CPUID
|
|
|
|
mov \tmp, \tmp, lsr #13
|
|
|
|
and \tmp, \tmp, #0x7 @ Core G
|
|
|
|
cmp \tmp, #1
|
2009-08-19 19:49:31 +08:00
|
|
|
bhi 1002f
|
2007-06-06 13:49:59 +08:00
|
|
|
|
2009-08-19 19:49:31 +08:00
|
|
|
@ Core Generation 1 (PXA25x)
|
2005-04-17 06:20:36 +08:00
|
|
|
mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000
|
|
|
|
add \base, \base, #0x00d00000
|
|
|
|
ldr \irqstat, [\base, #0] @ ICIP
|
|
|
|
ldr \irqnr, [\base, #4] @ ICMR
|
2007-06-06 13:49:59 +08:00
|
|
|
|
2008-02-27 08:59:28 +08:00
|
|
|
ands \irqnr, \irqstat, \irqnr
|
2009-08-19 19:49:31 +08:00
|
|
|
beq 1001f
|
2007-06-06 13:49:59 +08:00
|
|
|
rsb \irqstat, \irqnr, #0
|
|
|
|
and \irqstat, \irqstat, \irqnr
|
|
|
|
clz \irqnr, \irqstat
|
2009-08-19 19:49:31 +08:00
|
|
|
rsb \irqnr, \irqnr, #(31 + PXA_IRQ(0))
|
2007-06-06 13:49:59 +08:00
|
|
|
b 1001f
|
|
|
|
1002:
|
2009-08-19 19:49:31 +08:00
|
|
|
@ Core Generation 2 (PXA27x) or Core Generation 3 (PXA3xx)
|
|
|
|
mrc p6, 0, \irqstat, c5, c0, 0 @ ICHP
|
|
|
|
tst \irqstat, #0x80000000
|
2005-04-17 06:20:36 +08:00
|
|
|
beq 1001f
|
2009-08-19 19:49:31 +08:00
|
|
|
bic \irqstat, \irqstat, #0x80000000
|
|
|
|
mov \irqnr, \irqstat, lsr #16
|
2009-11-05 15:10:10 +08:00
|
|
|
add \irqnr, \irqnr, #(PXA_IRQ(0))
|
2005-04-17 06:20:36 +08:00
|
|
|
1001:
|
|
|
|
.endm
|