Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-arm/arch-ixp2000/entry-macro.S |
| 3 | * |
| 4 | * Low-level IRQ helper macros for IXP2000-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 | 78ff18a | 2006-01-03 17:39:34 +0000 | [diff] [blame] | 10 | #include <asm/arch/irqs.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
| 12 | .macro disable_fiq |
| 13 | .endm |
| 14 | |
Dan Williams | f80dff9 | 2007-02-16 22:16:32 +0100 | [diff] [blame] | 15 | .macro get_irqnr_preamble, base, tmp |
| 16 | .endm |
| 17 | |
| 18 | .macro arch_ret_to_user, tmp1, tmp2 |
| 19 | .endm |
| 20 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
| 22 | |
| 23 | mov \irqnr, #0x0 @clear out irqnr as default |
| 24 | mov \base, #0xfe000000 |
| 25 | orr \base, \base, #0x00e00000 |
| 26 | orr \base, \base, #0x08 |
| 27 | ldr \irqstat, [\base] @ get interrupts |
| 28 | |
| 29 | cmp \irqstat, #0 |
| 30 | beq 1001f |
| 31 | |
| 32 | clz \irqnr, \irqstat |
| 33 | mov \base, #31 |
| 34 | subs \irqnr, \base, \irqnr |
| 35 | |
| 36 | /* |
| 37 | * We handle PCIA and PCIB here so we don't have an |
| 38 | * extra layer of code just to check these two bits. |
| 39 | */ |
| 40 | cmp \irqnr, #IRQ_IXP2000_PCI |
| 41 | bne 1001f |
| 42 | |
| 43 | mov \base, #0xfe000000 |
| 44 | orr \base, \base, #0x00c00000 |
| 45 | orr \base, \base, #0x00000100 |
| 46 | orr \base, \base, #0x00000058 |
| 47 | ldr \irqstat, [\base] |
| 48 | |
| 49 | mov \tmp, #(1<<26) |
| 50 | tst \irqstat, \tmp |
| 51 | movne \irqnr, #IRQ_IXP2000_PCIA |
| 52 | bne 1001f |
| 53 | |
| 54 | mov \tmp, #(1<<27) |
| 55 | tst \irqstat, \tmp |
| 56 | movne \irqnr, #IRQ_IXP2000_PCIB |
| 57 | |
| 58 | 1001: |
| 59 | .endm |
| 60 | |