diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-12 05:34:26 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-12 06:37:26 -0400 |
commit | 67d889bd828a3cbf36ef27bd4a5c5f7ec76e20b9 (patch) | |
tree | 57668a930f4726d93cc0b4ace5c211485d774956 /arch/sh/kernel/cpu/sh4 | |
parent | 5f8a29ba39d52b2eaaed907b3cb3016b949a8f9b (diff) |
sh: add sh4-202 INTC tables
This patch adds INTC tables for sh4-202 with support
for HUDI, TMU0, TMU1, TMU2, RTC, SCIF and WDT.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4')
-rw-r--r-- | arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c index 034c069f7155..be79fa136255 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * SH4-202 Setup | 2 | * SH4-202 Setup |
3 | * | 3 | * |
4 | * Copyright (C) 2006 Paul Mundt | 4 | * Copyright (C) 2006 Paul Mundt |
5 | * Copyright (C) 2009 Magnus Damm | ||
5 | * | 6 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
7 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
@@ -12,6 +13,7 @@ | |||
12 | #include <linux/serial.h> | 13 | #include <linux/serial.h> |
13 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
14 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
16 | #include <linux/io.h> | ||
15 | 17 | ||
16 | static struct plat_sci_port sci_platform_data[] = { | 18 | static struct plat_sci_port sci_platform_data[] = { |
17 | { | 19 | { |
@@ -150,7 +152,59 @@ void __init plat_early_device_setup(void) | |||
150 | ARRAY_SIZE(sh4202_early_devices)); | 152 | ARRAY_SIZE(sh4202_early_devices)); |
151 | } | 153 | } |
152 | 154 | ||
155 | enum { | ||
156 | UNUSED = 0, | ||
157 | |||
158 | /* interrupt sources */ | ||
159 | IRL0, IRL1, IRL2, IRL3, /* only IRLM mode supported */ | ||
160 | HUDI, TMU0, TMU1, TMU2, RTC, SCIF, WDT, | ||
161 | }; | ||
162 | |||
163 | static struct intc_vect vectors[] __initdata = { | ||
164 | INTC_VECT(HUDI, 0x600), | ||
165 | INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), | ||
166 | INTC_VECT(TMU2, 0x440), INTC_VECT(TMU2, 0x460), | ||
167 | INTC_VECT(RTC, 0x480), INTC_VECT(RTC, 0x4a0), | ||
168 | INTC_VECT(RTC, 0x4c0), | ||
169 | INTC_VECT(SCIF, 0x700), INTC_VECT(SCIF, 0x720), | ||
170 | INTC_VECT(SCIF, 0x740), INTC_VECT(SCIF, 0x760), | ||
171 | INTC_VECT(WDT, 0x560), | ||
172 | }; | ||
173 | |||
174 | static struct intc_prio_reg prio_registers[] __initdata = { | ||
175 | { 0xffd00004, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, | ||
176 | { 0xffd00008, 0, 16, 4, /* IPRB */ { WDT, 0, 0, 0 } }, | ||
177 | { 0xffd0000c, 0, 16, 4, /* IPRC */ { 0, 0, SCIF, HUDI } }, | ||
178 | { 0xffd00010, 0, 16, 4, /* IPRD */ { IRL0, IRL1, IRL2, IRL3 } }, | ||
179 | }; | ||
180 | |||
181 | static DECLARE_INTC_DESC(intc_desc, "sh4-202", vectors, NULL, | ||
182 | NULL, prio_registers, NULL); | ||
183 | |||
184 | static struct intc_vect vectors_irlm[] __initdata = { | ||
185 | INTC_VECT(IRL0, 0x240), INTC_VECT(IRL1, 0x2a0), | ||
186 | INTC_VECT(IRL2, 0x300), INTC_VECT(IRL3, 0x360), | ||
187 | }; | ||
188 | |||
189 | static DECLARE_INTC_DESC(intc_desc_irlm, "sh4-202_irlm", vectors_irlm, NULL, | ||
190 | NULL, prio_registers, NULL); | ||
191 | |||
153 | void __init plat_irq_setup(void) | 192 | void __init plat_irq_setup(void) |
154 | { | 193 | { |
155 | /* do nothing - all IRL interrupts are handled by the board code */ | 194 | register_intc_controller(&intc_desc); |
195 | } | ||
196 | |||
197 | #define INTC_ICR 0xffd00000UL | ||
198 | #define INTC_ICR_IRLM (1<<7) | ||
199 | |||
200 | void __init plat_irq_setup_pins(int mode) | ||
201 | { | ||
202 | switch (mode) { | ||
203 | case IRQ_MODE_IRQ: /* individual interrupt mode for IRL3-0 */ | ||
204 | ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); | ||
205 | register_intc_controller(&intc_desc_irlm); | ||
206 | break; | ||
207 | default: | ||
208 | BUG(); | ||
209 | } | ||
156 | } | 210 | } |