1/*
2 * include/asm-arm/arch-tbox/irq.h
3 *
4 * Copyright (C) 1998, 1999, 2000 Philip Blundell
5 */
6
7/*
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#include <asm/io.h>
15
16#define fixup_irq(x) (x)
17
18extern unsigned long soft_irq_mask;
19
20static void tbox_mask_irq(unsigned int irq)
21{
22	__raw_writel(0, INTCONT + (irq << 2));
23	soft_irq_mask &= ~(1<<irq);
24}
25
26static void tbox_unmask_irq(unsigned int irq)
27{
28	soft_irq_mask |= (1<<irq);
29	__raw_writel(1, INTCONT + (irq << 2));
30}
31
32static __inline__ void irq_init_irq(void)
33{
34	unsigned int i;
35
36	/* Disable all interrupts initially. */
37	for (i = 0; i < NR_IRQS; i++) {
38		if (i <= 10 || (i >= 12 && i <= 13)) {
39			irq_desc[i].valid	= 1;
40			irq_desc[i].probe_ok	= 0;
41			irq_desc[i].mask_ack	= tbox_mask_irq;
42			irq_desc[i].mask	= tbox_mask_irq;
43			irq_desc[i].unmask	= tbox_unmask_irq;
44			tbox_mask_irq(i);
45		} else {
46			irq_desc[i].valid	= 0;
47			irq_desc[i].probe_ok	= 0;
48		}
49	}
50}
51