blob: c9be6d4d83e27cfd034cd8ea8df34948d3364a8c [file] [log] [blame]
Tony Lindgrenc97c6862009-10-19 17:26:19 -07001/*
2 * arch/arm/mach-omap1/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for OMAP-based platforms
5 *
6 * Copyright (C) 2009 Texas Instruments
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12#include <mach/hardware.h>
13#include <mach/io.h>
14#include <mach/irqs.h>
15#include <asm/hardware/gic.h>
16
Tony Lindgren03a9e512010-12-09 15:49:23 -080017/*
18 * We use __glue to avoid errors with multiple definitions of
19 * .globl omap_irq_flags as it's included from entry-armv.S but not
20 * from entry-common.S.
21 */
22#ifdef __glue
23 .pushsection .data
24 .globl omap_irq_flags
25omap_irq_flags:
26 .word 0
27 .popsection
Tony Lindgrenc97c6862009-10-19 17:26:19 -070028#endif
29
30 .macro disable_fiq
31 .endm
32
33 .macro get_irqnr_preamble, base, tmp
34 .endm
35
36 .macro arch_ret_to_user, tmp1, tmp2
37 .endm
38
39 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
40 ldr \base, =OMAP1_IO_ADDRESS(OMAP_IH1_BASE)
41 ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
42 ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET]
43 mov \irqstat, #0xffffffff
44 bic \tmp, \irqstat, \tmp
45 tst \irqnr, \tmp
46 beq 1510f
47
48 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
Tony Lindgren03a9e512010-12-09 15:49:23 -080049 ldr \tmp, =omap_irq_flags @ irq flags address
50 ldr \tmp, [\tmp, #0] @ irq flags value
Tony Lindgrenc97c6862009-10-19 17:26:19 -070051 cmp \irqnr, #0
52 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
Tony Lindgren03a9e512010-12-09 15:49:23 -080053 cmpeq \irqnr, \tmp
Tony Lindgrenc97c6862009-10-19 17:26:19 -070054 ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE)
55 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
56 addeqs \irqnr, \irqnr, #32
571510:
58 .endm
59