2006-09-27 00:41:24 -06:00
|
|
|
/*
|
2005-04-16 16:20:36 -06:00
|
|
|
* Copyright (C) 2002 David McCullough <davidm@snapgear.com>
|
|
|
|
* Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
|
|
|
|
*
|
|
|
|
* Based on files with the following comments:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2000 Kazumoto Kojima
|
|
|
|
*
|
|
|
|
* Modified for 7751 Solution Engine by
|
|
|
|
* Ian da Silva and Jeremy Siegel, 2001.
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/irq.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/timer.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <asm/machvec.h>
|
2010-10-29 04:06:53 -06:00
|
|
|
#include <mach/secureedge5410.h>
|
2005-04-16 16:20:36 -06:00
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/io.h>
|
2008-07-28 17:09:44 -06:00
|
|
|
#include <cpu/timer.h>
|
2005-04-16 16:20:36 -06:00
|
|
|
|
2010-10-29 03:59:58 -06:00
|
|
|
unsigned short secureedge5410_ioport;
|
|
|
|
|
2005-04-16 16:20:36 -06:00
|
|
|
/*
|
|
|
|
* EraseConfig handling functions
|
|
|
|
*/
|
2006-10-06 00:31:16 -06:00
|
|
|
static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
|
|
|
printk("SnapGear: erase switch interrupt!\n");
|
|
|
|
|
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int __init eraseconfig_init(void)
|
|
|
|
{
|
2010-10-29 03:59:58 -06:00
|
|
|
unsigned int irq = evt2irq(0x240);
|
|
|
|
|
2005-04-16 16:20:36 -06:00
|
|
|
printk("SnapGear: EraseConfig init\n");
|
2010-10-29 03:59:58 -06:00
|
|
|
|
2005-04-16 16:20:36 -06:00
|
|
|
/* Setup "EraseConfig" switch on external IRQ 0 */
|
2010-10-29 03:59:58 -06:00
|
|
|
if (request_irq(irq, eraseconfig_interrupt, IRQF_DISABLED,
|
2005-04-16 16:20:36 -06:00
|
|
|
"Erase Config", NULL))
|
|
|
|
printk("SnapGear: failed to register IRQ%d for Reset witch\n",
|
2010-10-29 03:59:58 -06:00
|
|
|
irq);
|
2005-04-16 16:20:36 -06:00
|
|
|
else
|
|
|
|
printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
|
2010-10-29 03:59:58 -06:00
|
|
|
irq);
|
|
|
|
return 0;
|
2005-04-16 16:20:36 -06:00
|
|
|
}
|
|
|
|
module_init(eraseconfig_init);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize IRQ setting
|
|
|
|
*
|
|
|
|
* IRL0 = erase switch
|
|
|
|
* IRL1 = eth0
|
|
|
|
* IRL2 = eth1
|
|
|
|
* IRL3 = crypto
|
|
|
|
*/
|
|
|
|
static void __init init_snapgear_IRQ(void)
|
|
|
|
{
|
|
|
|
printk("Setup SnapGear IRQ/IPR ...\n");
|
2007-08-02 23:23:35 -06:00
|
|
|
/* enable individual interrupt mode for externals */
|
|
|
|
plat_irq_setup_pins(IRQ_MODE_IRQ);
|
2005-04-16 16:20:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The Machine Vector
|
|
|
|
*/
|
2007-05-15 00:19:34 -06:00
|
|
|
static struct sh_machine_vector mv_snapgear __initmv = {
|
2006-09-27 03:17:31 -06:00
|
|
|
.mv_name = "SnapGear SecureEdge5410",
|
2005-04-16 16:20:36 -06:00
|
|
|
.mv_nr_irqs = 72,
|
|
|
|
.mv_init_irq = init_snapgear_IRQ,
|
|
|
|
};
|