Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Low-level IRQ helper macros for TI DaVinci-based platforms |
| 3 | * |
| 4 | * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com> |
| 5 | * |
| 6 | * 2007 (c) MontaVista Software, Inc. This file is licensed under |
| 7 | * the terms of the GNU General Public License version 2. This program |
| 8 | * is licensed "as is" without any warranty of any kind, whether express |
| 9 | * or implied. |
| 10 | */ |
| 11 | #include <mach/io.h> |
| 12 | #include <mach/irqs.h> |
| 13 | |
| 14 | .macro disable_fiq |
| 15 | .endm |
| 16 | |
| 17 | .macro get_irqnr_preamble, base, tmp |
Mark A. Greer | 673dd36 | 2009-04-15 12:40:00 -0700 | [diff] [blame] | 18 | ldr \base, =davinci_intc_base |
| 19 | ldr \base, [\base] |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 20 | .endm |
| 21 | |
| 22 | .macro arch_ret_to_user, tmp1, tmp2 |
| 23 | .endm |
| 24 | |
| 25 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
Mark A. Greer | 0b0c4c2 | 2009-04-15 12:41:40 -0700 | [diff] [blame] | 26 | #if defined(CONFIG_AINTC) && defined(CONFIG_CP_INTC) |
| 27 | ldr \tmp, =davinci_intc_type |
| 28 | ldr \tmp, [\tmp] |
| 29 | cmp \tmp, #DAVINCI_INTC_TYPE_CP_INTC |
| 30 | beq 1001f |
| 31 | #endif |
| 32 | #if defined(CONFIG_AINTC) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 33 | ldr \tmp, [\base, #0x14] |
Troy Kisky | ce8ccaf | 2008-02-11 14:44:07 -0700 | [diff] [blame] | 34 | movs \tmp, \tmp, lsr #2 |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 35 | sub \irqnr, \tmp, #1 |
Mark A. Greer | 0b0c4c2 | 2009-04-15 12:41:40 -0700 | [diff] [blame] | 36 | b 1002f |
| 37 | #endif |
| 38 | #if defined(CONFIG_CP_INTC) |
| 39 | 1001: ldr \irqnr, [\base, #0x80] /* get irq number */ |
| 40 | and \irqnr, \irqnr, #0xff /* irq is in bits 0-9 */ |
| 41 | mov \tmp, \irqnr, lsr #3 |
| 42 | and \tmp, \tmp, #0xfc |
| 43 | add \tmp, \tmp, #0x280 /* get the register offset */ |
| 44 | ldr \irqstat, [\base, \tmp] /* get the intc status */ |
| 45 | cmp \irqstat, #0x0 |
| 46 | #endif |
| 47 | 1002: |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 48 | .endm |
| 49 | |
| 50 | .macro irq_prio_table |
| 51 | .endm |