Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-pxa/include/mach/entry-macro.S |
| 3 | * |
| 4 | * Low-level IRQ helper macros for PXA-based platforms |
| 5 | * |
| 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. |
| 9 | */ |
| 10 | #include <mach/hardware.h> |
| 11 | #include <mach/irqs.h> |
| 12 | |
| 13 | .macro disable_fiq |
| 14 | .endm |
| 15 | |
| 16 | .macro get_irqnr_preamble, base, tmp |
| 17 | .endm |
| 18 | |
| 19 | .macro arch_ret_to_user, tmp1, tmp2 |
| 20 | .endm |
| 21 | |
| 22 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
| 23 | mrc p15, 0, \tmp, c0, c0, 0 @ CPUID |
| 24 | mov \tmp, \tmp, lsr #13 |
| 25 | and \tmp, \tmp, #0x7 @ Core G |
| 26 | cmp \tmp, #1 |
Haojian Zhuang | d2c3706 | 2009-08-19 19:49:31 +0800 | [diff] [blame] | 27 | bhi 1002f |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 28 | |
Haojian Zhuang | d2c3706 | 2009-08-19 19:49:31 +0800 | [diff] [blame] | 29 | @ Core Generation 1 (PXA25x) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 30 | mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000 |
| 31 | add \base, \base, #0x00d00000 |
| 32 | ldr \irqstat, [\base, #0] @ ICIP |
| 33 | ldr \irqnr, [\base, #4] @ ICMR |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 34 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 35 | ands \irqnr, \irqstat, \irqnr |
| 36 | beq 1001f |
| 37 | rsb \irqstat, \irqnr, #0 |
| 38 | and \irqstat, \irqstat, \irqnr |
| 39 | clz \irqnr, \irqstat |
Marc Zyngier | 57a7a62 | 2008-09-01 13:03:32 +0100 | [diff] [blame] | 40 | rsb \irqnr, \irqnr, #(31 + PXA_IRQ(0)) |
Haojian Zhuang | d2c3706 | 2009-08-19 19:49:31 +0800 | [diff] [blame] | 41 | b 1001f |
| 42 | 1002: |
| 43 | @ Core Generation 2 (PXA27x) or Core Generation 3 (PXA3xx) |
| 44 | mrc p6, 0, \irqstat, c5, c0, 0 @ ICHP |
| 45 | tst \irqstat, #0x80000000 |
| 46 | beq 1001f |
| 47 | bic \irqstat, \irqstat, #0x80000000 |
| 48 | mov \irqnr, \irqstat, lsr #16 |
Marc Zyngier | b2b3631 | 2009-11-05 08:10:10 +0100 | [diff] [blame] | 49 | add \irqnr, \irqnr, #(PXA_IRQ(0)) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 50 | 1001: |
| 51 | .endm |