1 /*****************************************************************************
2 * Copyright 2006 - 2008 Broadcom Corporation. All rights reserved.
4 * Unless you and Broadcom execute a separate written software license
5 * agreement governing use of this software, this software is licensed to you
6 * under the terms of the GNU General Public License version 2, available at
7 * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
9 * Notwithstanding the above, under no circumstances may you combine this
10 * software in any way with any other Broadcom software provided under a
11 * license other than the GPL, without Broadcom's express prior written
13 *****************************************************************************/
17 * Low-level IRQ helper macros for BCMRing-based platforms
20 #include <mach/irqs.h>
21 #include <mach/hardware.h>
22 #include <mach/csp/mm_io.h>
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 ldr \base, =(MM_IO_BASE_INTC0)
26 ldr \irqstat, [\base, #0] @ get status
27 ldr \irqnr, [\base, #0x10] @ mask with enable register
28 ands \irqstat, \irqstat, \irqnr
29 mov \irqnr, #IRQ_INTC0_START
33 ldr \base, =(MM_IO_BASE_INTC1)
34 ldr \irqstat, [\base, #0] @ get status
35 ldr \irqnr, [\base, #0x10] @ mask with enable register
36 ands \irqstat, \irqstat, \irqnr
37 mov \irqnr, #IRQ_INTC1_START
41 ldr \base, =(MM_IO_BASE_SINTC)
42 ldr \irqstat, [\base, #0] @ get status
43 ldr \irqnr, [\base, #0x10] @ mask with enable register
44 ands \irqstat, \irqstat, \irqnr
45 mov \irqnr, #0xffffffff @ code meaning no interrupt bits set
49 mov \irqnr, #IRQ_SINTC_START @ something is set, so fixup return value
52 movs \tmp, \irqstat, lsl #16
54 addeq \irqnr, \irqnr, #16
56 movs \tmp, \irqstat, lsl #8
58 addeq \irqnr, \irqnr, #8
60 movs \tmp, \irqstat, lsl #4
62 addeq \irqnr, \irqnr, #4
64 movs \tmp, \irqstat, lsl #2
66 addeq \irqnr, \irqnr, #2
68 movs \tmp, \irqstat, lsl #1
69 addeq \irqnr, \irqnr, #1
72 1002: @ irqnr will be set to 0xffffffff if no irq bits are set
75 .macro get_irqnr_preamble, base, tmp