Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 1 | /* arch/arm/mach-tegra/include/mach/entry-macro.S |
| 2 | * |
| 3 | * Copyright (C) 2009 Palm, Inc. |
| 4 | * |
| 5 | * This software is licensed under the terms of the GNU General Public |
| 6 | * License version 2, as published by the Free Software Foundation, and |
| 7 | * may be copied, distributed, and modified under those terms. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | */ |
| 15 | #include <mach/iomap.h> |
| 16 | #include <mach/io.h> |
| 17 | |
| 18 | #if defined(CONFIG_ARM_GIC) |
Russell King | 7627dc8 | 2010-12-05 08:51:38 +0000 | [diff] [blame] | 19 | #define HAVE_GET_IRQNR_PREAMBLE |
Magnus Damm | 0005b34 | 2010-11-16 01:00:40 +0100 | [diff] [blame] | 20 | #include <asm/hardware/entry-macro-gic.S> |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 21 | |
| 22 | /* Uses the GIC interrupt controller built into the cpu */ |
| 23 | #define ICTRL_BASE (IO_CPU_VIRT + 0x100) |
| 24 | |
| 25 | .macro disable_fiq |
| 26 | .endm |
| 27 | |
| 28 | .macro get_irqnr_preamble, base, tmp |
| 29 | movw \base, #(ICTRL_BASE & 0x0000ffff) |
| 30 | movt \base, #((ICTRL_BASE & 0xffff0000) >> 16) |
| 31 | .endm |
| 32 | |
| 33 | .macro arch_ret_to_user, tmp1, tmp2 |
| 34 | .endm |
Erik Gilling | c5f8006 | 2010-01-21 16:53:02 -0800 | [diff] [blame] | 35 | #else |
| 36 | /* legacy interrupt controller for AP16 */ |
| 37 | .macro disable_fiq |
| 38 | .endm |
| 39 | |
| 40 | .macro get_irqnr_preamble, base, tmp |
| 41 | @ enable imprecise aborts |
| 42 | cpsie a |
| 43 | @ EVP base at 0xf010f000 |
| 44 | mov \base, #0xf0000000 |
| 45 | orr \base, #0x00100000 |
| 46 | orr \base, #0x0000f000 |
| 47 | .endm |
| 48 | |
| 49 | .macro arch_ret_to_user, tmp1, tmp2 |
| 50 | .endm |
| 51 | |
| 52 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
| 53 | ldr \irqnr, [\base, #0x20] @ EVT_IRQ_STS |
| 54 | cmp \irqnr, #0x80 |
| 55 | .endm |
| 56 | #endif |