]> bbs.cooldavid.org Git - net-next-2.6.git/blame - arch/sh/boards/board-secureedge5410.c
Merge branch 'upstream/core' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
[net-next-2.6.git] / arch / sh / boards / board-secureedge5410.c
CommitLineData
373e68b5 1/*
1da177e4
LT
2 * Copyright (C) 2002 David McCullough <davidm@snapgear.com>
3 * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
4 *
5 * Based on files with the following comments:
6 *
7 * Copyright (C) 2000 Kazumoto Kojima
8 *
9 * Modified for 7751 Solution Engine by
10 * Ian da Silva and Jeremy Siegel, 2001.
11 */
1da177e4
LT
12#include <linux/init.h>
13#include <linux/irq.h>
14#include <linux/interrupt.h>
15#include <linux/timer.h>
16#include <linux/delay.h>
17#include <linux/module.h>
18#include <linux/sched.h>
1da177e4 19#include <asm/machvec.h>
f6eec8d6 20#include <mach/secureedge5410.h>
1da177e4
LT
21#include <asm/irq.h>
22#include <asm/io.h>
f15cbe6f 23#include <cpu/timer.h>
1da177e4 24
39c11984
PM
25unsigned short secureedge5410_ioport;
26
1da177e4
LT
27/*
28 * EraseConfig handling functions
29 */
35f3c518 30static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
1da177e4 31{
39c11984 32 ctrl_delay(); /* dummy read */
1da177e4
LT
33
34 printk("SnapGear: erase switch interrupt!\n");
35
36 return IRQ_HANDLED;
37}
38
39static int __init eraseconfig_init(void)
40{
39c11984
PM
41 unsigned int irq = evt2irq(0x240);
42
1da177e4 43 printk("SnapGear: EraseConfig init\n");
39c11984 44
1da177e4 45 /* Setup "EraseConfig" switch on external IRQ 0 */
39c11984 46 if (request_irq(irq, eraseconfig_interrupt, IRQF_DISABLED,
1da177e4
LT
47 "Erase Config", NULL))
48 printk("SnapGear: failed to register IRQ%d for Reset witch\n",
39c11984 49 irq);
1da177e4
LT
50 else
51 printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
39c11984
PM
52 irq);
53 return 0;
1da177e4 54}
1da177e4
LT
55module_init(eraseconfig_init);
56
1da177e4
LT
57/*
58 * Initialize IRQ setting
59 *
60 * IRL0 = erase switch
61 * IRL1 = eth0
62 * IRL2 = eth1
63 * IRL3 = crypto
64 */
1da177e4
LT
65static void __init init_snapgear_IRQ(void)
66{
1da177e4 67 printk("Setup SnapGear IRQ/IPR ...\n");
d59645d6
MD
68 /* enable individual interrupt mode for externals */
69 plat_irq_setup_pins(IRQ_MODE_IRQ);
1da177e4
LT
70}
71
1da177e4
LT
72/*
73 * The Machine Vector
74 */
82f81f47 75static struct sh_machine_vector mv_snapgear __initmv = {
2c7834a6 76 .mv_name = "SnapGear SecureEdge5410",
1da177e4 77 .mv_nr_irqs = 72,
1da177e4
LT
78 .mv_init_irq = init_snapgear_IRQ,
79};