blob: 1f8f073f27be94c85d6e3202e97c3391615e45e2 [file] [log] [blame]
Magnus Damm897cfcd2007-09-10 12:06:03 +09001/*
2 * Renesas Solutions Highlander R7780MP Support.
3 *
4 * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
5 * Copyright (C) 2006 Paul Mundt
6 * Copyright (C) 2007 Magnus Damm
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/init.h>
13#include <linux/irq.h>
14#include <linux/io.h>
15#include <asm/r7780rp.h>
16
17enum {
18 UNUSED = 0,
19
20 /* board specific interrupt sources */
21 AX88796, /* Ethernet controller */
22 CF, /* Compact Flash */
23 PSW, /* Push Switch */
24 EXT1, /* EXT1n IRQ */
25 EXT4, /* EXT4n IRQ */
26};
27
28static struct intc_vect vectors[] __initdata = {
29 INTC_IRQ(CF, IRQ_CF),
30 INTC_IRQ(PSW, IRQ_PSW),
31 INTC_IRQ(AX88796, IRQ_AX88796),
32 INTC_IRQ(EXT1, IRQ_EXT1),
33 INTC_IRQ(EXT4, IRQ_EXT4),
34};
35
36static struct intc_mask_reg mask_registers[] __initdata = {
37 { 0xa4000000, 0, 16, /* IRLMSK */
38 { 0, 0, 0, 0, CF, 0, 0, 0,
39 0, 0, 0, EXT4, 0, EXT1, PSW, AX88796 } },
40};
41
42static unsigned char irl2irq[HL_NR_IRL] __initdata = {
43 0, IRQ_CF, 0, 0,
44 0, 0, 0, 0,
45 0, IRQ_EXT4, 0, IRQ_EXT1,
46 0, IRQ_AX88796, IRQ_PSW,
47};
48
49static DECLARE_INTC_DESC(intc_desc, "r7780mp", vectors,
Magnus Damm7f3edee2008-01-10 14:08:55 +090050 NULL, mask_registers, NULL, NULL);
Magnus Damm897cfcd2007-09-10 12:06:03 +090051
52unsigned char * __init highlander_init_irq_r7780mp(void)
53{
54 if ((ctrl_inw(0xa4000700) & 0xf000) == 0x2000) {
55 printk(KERN_INFO "Using r7780mp interrupt controller.\n");
56 register_intc_controller(&intc_desc);
57 return irl2irq;
58 }
59
60 return NULL;
61}