diff options
Diffstat (limited to 'arch/mn10300/unit-asb2364/unit-init.c')
-rw-r--r-- | arch/mn10300/unit-asb2364/unit-init.c | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/arch/mn10300/unit-asb2364/unit-init.c b/arch/mn10300/unit-asb2364/unit-init.c new file mode 100644 index 000000000000..a3fc09b43f84 --- /dev/null +++ b/arch/mn10300/unit-asb2364/unit-init.c | |||
@@ -0,0 +1,85 @@ | |||
1 | /* ASB2364 initialisation | ||
2 | * | ||
3 | * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/param.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <linux/delay.h> | ||
17 | |||
18 | #include <asm/io.h> | ||
19 | #include <asm/setup.h> | ||
20 | #include <asm/processor.h> | ||
21 | #include <asm/irq.h> | ||
22 | #include <asm/intctl-regs.h> | ||
23 | |||
24 | /* | ||
25 | * initialise some of the unit hardware before gdbstub is set up | ||
26 | */ | ||
27 | asmlinkage void __init unit_init(void) | ||
28 | { | ||
29 | /* set up the external interrupts */ | ||
30 | |||
31 | /* XIRQ[0]: NAND RXBY */ | ||
32 | /* SET_XIRQ_TRIGGER(0, XIRQ_TRIGGER_LOWLEVEL); */ | ||
33 | |||
34 | /* XIRQ[1]: LAN, UART, I2C, USB, PCI, FPGA */ | ||
35 | SET_XIRQ_TRIGGER(1, XIRQ_TRIGGER_LOWLEVEL); | ||
36 | |||
37 | /* XIRQ[2]: Extend Slot 1-9 */ | ||
38 | /* SET_XIRQ_TRIGGER(2, XIRQ_TRIGGER_LOWLEVEL); */ | ||
39 | |||
40 | #if defined(CONFIG_EXT_SERIAL_IRQ_LEVEL) && \ | ||
41 | defined(CONFIG_ETHERNET_IRQ_LEVEL) && \ | ||
42 | (CONFIG_EXT_SERIAL_IRQ_LEVEL != CONFIG_ETHERNET_IRQ_LEVEL) | ||
43 | # error CONFIG_EXT_SERIAL_IRQ_LEVEL != CONFIG_ETHERNET_IRQ_LEVEL | ||
44 | #endif | ||
45 | |||
46 | #if defined(CONFIG_EXT_SERIAL_IRQ_LEVEL) | ||
47 | set_intr_level(XIRQ1, NUM2GxICR_LEVEL(CONFIG_EXT_SERIAL_IRQ_LEVEL)); | ||
48 | #elif defined(CONFIG_ETHERNET_IRQ_LEVEL) | ||
49 | set_intr_level(XIRQ1, NUM2GxICR_LEVEL(CONFIG_ETHERNET_IRQ_LEVEL)); | ||
50 | #endif | ||
51 | } | ||
52 | |||
53 | /* | ||
54 | * initialise the rest of the unit hardware after gdbstub is ready | ||
55 | */ | ||
56 | asmlinkage void __init unit_setup(void) | ||
57 | { | ||
58 | |||
59 | } | ||
60 | |||
61 | /* | ||
62 | * initialise the external interrupts used by a unit of this type | ||
63 | */ | ||
64 | void __init unit_init_IRQ(void) | ||
65 | { | ||
66 | unsigned int extnum; | ||
67 | |||
68 | for (extnum = 0 ; extnum < NR_XIRQS ; extnum++) { | ||
69 | switch (GET_XIRQ_TRIGGER(extnum)) { | ||
70 | /* LEVEL triggered interrupts should be made | ||
71 | * post-ACK'able as they hold their lines until | ||
72 | * serviced | ||
73 | */ | ||
74 | case XIRQ_TRIGGER_HILEVEL: | ||
75 | case XIRQ_TRIGGER_LOWLEVEL: | ||
76 | mn10300_set_lateack_irq_type(XIRQ2IRQ(extnum)); | ||
77 | break; | ||
78 | default: | ||
79 | break; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | #define IRQCTL __SYSREG(0xd5000090, u32) | ||
84 | IRQCTL |= 0x02; | ||
85 | } | ||