blob: 27e124132e4cde02926eae5b52aeb26cdefbd896 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * include/asm-arm/arch-ixp4xx/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IXP4xx-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 King78ff18a2006-01-03 17:39:34 +000010#include <asm/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12 .macro disable_fiq
13 .endm
14
15 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
16 ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET)
17 ldr \irqstat, [\irqstat] @ get interrupts
18 cmp \irqstat, #0
Kenneth Tan251b9282005-10-18 07:53:35 +010019 beq 1001f @ upper IRQ?
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 clz \irqnr, \irqstat
21 mov \base, #31
Kenneth Tan251b9282005-10-18 07:53:35 +010022 sub \irqnr, \base, \irqnr
23 b 1002f @ lower IRQ being
24 @ handled
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
261001:
27 /*
28 * IXP465 has an upper IRQ status register
29 */
30#if defined(CONFIG_CPU_IXP46X)
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET)
32 ldr \irqstat, [\irqstat] @ get upper interrupts
33 mov \irqnr, #63
34 clz \irqstat, \irqstat
35 cmp \irqstat, #32
36 subne \irqnr, \irqnr, \irqstat
Linus Torvalds1da177e2005-04-16 15:20:36 -070037#endif
Kenneth Tan251b9282005-10-18 07:53:35 +0100381002:
Linus Torvalds1da177e2005-04-16 15:20:36 -070039 .endm
40
41