Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-arm/arch-pxa/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 | */ |
Russell King | be50972 | 2008-08-04 10:41:28 +0100 | [diff] [blame] | 10 | #include <asm/arch/hardware.h> |
Russell King | 78ff18a | 2006-01-03 17:39:34 +0000 | [diff] [blame] | 11 | #include <asm/arch/irqs.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | |
| 13 | .macro disable_fiq |
| 14 | .endm |
| 15 | |
Dan Williams | f80dff9 | 2007-02-16 22:16:32 +0100 | [diff] [blame] | 16 | .macro get_irqnr_preamble, base, tmp |
| 17 | .endm |
| 18 | |
| 19 | .macro arch_ret_to_user, tmp1, tmp2 |
| 20 | .endm |
| 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
Eric Miao | 8118d12 | 2007-06-06 06:49:59 +0100 | [diff] [blame] | 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 |
| 27 | bhi 1004f |
| 28 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000 |
| 30 | add \base, \base, #0x00d00000 |
| 31 | ldr \irqstat, [\base, #0] @ ICIP |
| 32 | ldr \irqnr, [\base, #4] @ ICMR |
Eric Miao | 8118d12 | 2007-06-06 06:49:59 +0100 | [diff] [blame] | 33 | b 1002f |
| 34 | |
| 35 | 1004: |
| 36 | mrc p6, 0, \irqstat, c6, c0, 0 @ ICIP2 |
| 37 | mrc p6, 0, \irqnr, c7, c0, 0 @ ICMR2 |
eric miao | a3359e2 | 2008-02-27 01:59:28 +0100 | [diff] [blame] | 38 | ands \irqnr, \irqstat, \irqnr |
Eric Miao | 8118d12 | 2007-06-06 06:49:59 +0100 | [diff] [blame] | 39 | beq 1003f |
| 40 | rsb \irqstat, \irqnr, #0 |
| 41 | and \irqstat, \irqstat, \irqnr |
| 42 | clz \irqnr, \irqstat |
| 43 | rsb \irqnr, \irqnr, #31 |
| 44 | add \irqnr, \irqnr, #32 |
| 45 | b 1001f |
| 46 | 1003: |
| 47 | mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP |
| 48 | mrc p6, 0, \irqnr, c1, c0, 0 @ ICMR |
| 49 | 1002: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | ands \irqnr, \irqstat, \irqnr |
| 51 | beq 1001f |
| 52 | rsb \irqstat, \irqnr, #0 |
| 53 | and \irqstat, \irqstat, \irqnr |
| 54 | clz \irqnr, \irqstat |
Eric Miao | 486c955 | 2007-06-06 06:22:20 +0100 | [diff] [blame] | 55 | rsb \irqnr, \irqnr, #31 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | 1001: |
| 57 | .endm |