Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / arch / sh / boards / snapgear / setup.c
blob7022483f98e8d8f6e73a0e6d6dbf99b3f05e9b99
1 /*
2 * linux/arch/sh/boards/snapgear/setup.c
4 * Copyright (C) 2002 David McCullough <davidm@snapgear.com>
5 * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
7 * Based on files with the following comments:
9 * Copyright (C) 2000 Kazumoto Kojima
11 * Modified for 7751 Solution Engine by
12 * Ian da Silva and Jeremy Siegel, 2001.
14 #include <linux/init.h>
15 #include <linux/irq.h>
16 #include <linux/interrupt.h>
17 #include <linux/timer.h>
18 #include <linux/delay.h>
19 #include <linux/module.h>
20 #include <linux/sched.h>
21 #include <asm/machvec.h>
22 #include <asm/snapgear.h>
23 #include <asm/irq.h>
24 #include <asm/io.h>
25 #include <asm/cpu/timer.h>
28 * EraseConfig handling functions
31 static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
33 (void)ctrl_inb(0xb8000000); /* dummy read */
35 printk("SnapGear: erase switch interrupt!\n");
37 return IRQ_HANDLED;
40 static int __init eraseconfig_init(void)
42 printk("SnapGear: EraseConfig init\n");
43 /* Setup "EraseConfig" switch on external IRQ 0 */
44 if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED,
45 "Erase Config", NULL))
46 printk("SnapGear: failed to register IRQ%d for Reset witch\n",
47 IRL0_IRQ);
48 else
49 printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
50 IRL0_IRQ);
51 return(0);
54 module_init(eraseconfig_init);
56 /****************************************************************************/
58 * Initialize IRQ setting
60 * IRL0 = erase switch
61 * IRL1 = eth0
62 * IRL2 = eth1
63 * IRL3 = crypto
66 static void __init init_snapgear_IRQ(void)
68 printk("Setup SnapGear IRQ/IPR ...\n");
69 /* enable individual interrupt mode for externals */
70 plat_irq_setup_pins(IRQ_MODE_IRQ);
74 * The Machine Vector
76 static struct sh_machine_vector mv_snapgear __initmv = {
77 .mv_name = "SnapGear SecureEdge5410",
78 .mv_nr_irqs = 72,
80 .mv_inb = snapgear_inb,
81 .mv_inw = snapgear_inw,
82 .mv_inl = snapgear_inl,
83 .mv_outb = snapgear_outb,
84 .mv_outw = snapgear_outw,
85 .mv_outl = snapgear_outl,
87 .mv_inb_p = snapgear_inb_p,
88 .mv_inw_p = snapgear_inw,
89 .mv_inl_p = snapgear_inl,
90 .mv_outb_p = snapgear_outb_p,
91 .mv_outw_p = snapgear_outw,
92 .mv_outl_p = snapgear_outl,
94 .mv_init_irq = init_snapgear_IRQ,