/* * linux/arch/sh/boards/snapgear/setup.c * * Copyright (C) 2002 David McCullough * Copyright (C) 2003 Paul Mundt * * 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 #include #include #include #include #include #include #include #include #include #include #include /* * EraseConfig handling functions */ static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) { (void)ctrl_inb(0xb8000000); /* dummy read */ printk("SnapGear: erase switch interrupt!\n"); return IRQ_HANDLED; } static int __init eraseconfig_init(void) { printk("SnapGear: EraseConfig init\n"); /* Setup "EraseConfig" switch on external IRQ 0 */ if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED, "Erase Config", NULL)) printk("SnapGear: failed to register IRQ%d for Reset witch\n", IRL0_IRQ); else printk("SnapGear: registered EraseConfig switch on IRQ%d\n", IRL0_IRQ); return(0); } 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"); /* enable individual interrupt mode for externals */ plat_irq_setup_pins(IRQ_MODE_IRQ); } /* * The Machine Vector */ static struct sh_machine_vector mv_snapgear __initmv = { .mv_name = "SnapGear SecureEdge5410", .mv_nr_irqs = 72, .mv_inb = snapgear_inb, .mv_inw = snapgear_inw, .mv_inl = snapgear_inl, .mv_outb = snapgear_outb, .mv_outw = snapgear_outw, .mv_outl = snapgear_outl, .mv_inb_p = snapgear_inb_p, .mv_inw_p = snapgear_inw, .mv_inl_p = snapgear_inl, .mv_outb_p = snapgear_outb_p, .mv_outw_p = snapgear_outw, .mv_outl_p = snapgear_outl, .mv_init_irq = init_snapgear_IRQ, };