]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - arch/sh/boards/board-secureedge5410.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/kernel/linux.git] / arch / sh / boards / board-secureedge5410.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
373e68b5 2/*
1da177e4
LT
3 * Copyright (C) 2002 David McCullough <davidm@snapgear.com>
4 * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
5 *
6 * Based on files with the following comments:
7 *
8 * Copyright (C) 2000 Kazumoto Kojima
9 *
10 * Modified for 7751 Solution Engine by
11 * Ian da Silva and Jeremy Siegel, 2001.
12 */
1da177e4
LT
13#include <linux/init.h>
14#include <linux/irq.h>
15#include <linux/interrupt.h>
16#include <linux/timer.h>
17#include <linux/delay.h>
1da177e4 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{
1da177e4
LT
32 printk("SnapGear: erase switch interrupt!\n");
33
34 return IRQ_HANDLED;
35}
36
37static int __init eraseconfig_init(void)
38{
39c11984
PM
39 unsigned int irq = evt2irq(0x240);
40
1da177e4 41 printk("SnapGear: EraseConfig init\n");
39c11984 42
1da177e4 43 /* Setup "EraseConfig" switch on external IRQ 0 */
d11584a0 44 if (request_irq(irq, eraseconfig_interrupt, 0, "Erase Config", NULL))
1da177e4 45 printk("SnapGear: failed to register IRQ%d for Reset witch\n",
39c11984 46 irq);
1da177e4
LT
47 else
48 printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
39c11984
PM
49 irq);
50 return 0;
1da177e4 51}
f368d475 52device_initcall(eraseconfig_init);
1da177e4 53
1da177e4
LT
54/*
55 * Initialize IRQ setting
56 *
57 * IRL0 = erase switch
58 * IRL1 = eth0
59 * IRL2 = eth1
60 * IRL3 = crypto
61 */
1da177e4
LT
62static void __init init_snapgear_IRQ(void)
63{
1da177e4 64 printk("Setup SnapGear IRQ/IPR ...\n");
d59645d6
MD
65 /* enable individual interrupt mode for externals */
66 plat_irq_setup_pins(IRQ_MODE_IRQ);
1da177e4
LT
67}
68
1da177e4
LT
69/*
70 * The Machine Vector
71 */
82f81f47 72static struct sh_machine_vector mv_snapgear __initmv = {
2c7834a6 73 .mv_name = "SnapGear SecureEdge5410",
1da177e4
LT
74 .mv_init_irq = init_snapgear_IRQ,
75};