aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2007-09-09 23:03:50 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-09-20 22:57:51 -0400
commit953c8ef250fc6c329d1607cf9cd7fac1d72d7579 (patch)
treebd327af6c320d890ab61dd6893fbdd35fca86c80 /arch/sh/kernel/cpu/sh4a/setup-sh7785.c
parent123f5f188638bfc673aca22ade64b863ec3a2804 (diff)
sh: intc - irl mode update for sh7780 and sh7785
This patch contains the following fixes and improvements: - Fix address typo for INTMSK2 / INTMSKCLR2 registers on sh7780. - Adds IRQ_MODE_IRLnnnn_MASK using intc controller for IRL masking. - Good old IRQ_MODE_IRLnnnn should not register any intc controller. - plat_irq_setup_pins() now selects IRL or IRQ mode. - the holding function is now disabled using ICR0. By default all external pin interrupts are disabled. 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/sh4a/setup-sh7785.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7785.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index a595203f74c6..486dabe4d272 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -10,6 +10,7 @@
10#include <linux/platform_device.h> 10#include <linux/platform_device.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/serial.h> 12#include <linux/serial.h>
13#include <linux/io.h>
13#include <asm/sci.h> 14#include <asm/sci.h>
14 15
15static struct plat_sci_port sci_platform_data[] = { 16static struct plat_sci_port sci_platform_data[] = {
@@ -282,24 +283,66 @@ static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7785-irl0123", vectors_irl0123,
282static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7785-irl4567", vectors_irl4567, 283static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7785-irl4567", vectors_irl4567,
283 NULL, NULL, mask_registers, NULL, NULL); 284 NULL, NULL, mask_registers, NULL, NULL);
284 285
286#define INTC_ICR0 0xffd00000
287#define INTC_INTMSK0 0xffd00044
288#define INTC_INTMSK1 0xffd00048
289#define INTC_INTMSK2 0xffd40080
290#define INTC_INTMSKCLR1 0xffd00068
291#define INTC_INTMSKCLR2 0xffd40084
292
285void __init plat_irq_setup(void) 293void __init plat_irq_setup(void)
286{ 294{
295 /* disable IRQ3-0 + IRQ7-4 */
296 ctrl_outl(0xff000000, INTC_INTMSK0);
297
298 /* disable IRL3-0 + IRL7-4 */
299 ctrl_outl(0xc0000000, INTC_INTMSK1);
300 ctrl_outl(0xfffefffe, INTC_INTMSK2);
301
302 /* select IRL mode for IRL3-0 + IRL7-4 */
303 ctrl_outl(ctrl_inl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
304
305 /* disable holding function, ie enable "SH-4 Mode" */
306 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00200000, INTC_ICR0);
307
287 register_intc_controller(&intc_desc); 308 register_intc_controller(&intc_desc);
288} 309}
289 310
290void __init plat_irq_setup_pins(int mode) 311void __init plat_irq_setup_pins(int mode)
291{ 312{
313 ctrl_outl(0xc0000000, INTC_INTMSKCLR1);
314 ctrl_outl(0xfffefffe, INTC_INTMSKCLR2);
315 return;
316
292 switch (mode) { 317 switch (mode) {
293 case IRQ_MODE_IRQ7654: 318 case IRQ_MODE_IRQ7654:
319 /* select IRQ mode for IRL7-4 */
320 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00400000, INTC_ICR0);
294 register_intc_controller(&intc_desc_irq4567); 321 register_intc_controller(&intc_desc_irq4567);
295 break; 322 break;
296 case IRQ_MODE_IRQ3210: 323 case IRQ_MODE_IRQ3210:
324 /* select IRQ mode for IRL3-0 */
325 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00800000, INTC_ICR0);
297 register_intc_controller(&intc_desc_irq0123); 326 register_intc_controller(&intc_desc_irq0123);
298 break; 327 break;
299 case IRQ_MODE_IRL7654: 328 case IRQ_MODE_IRL7654:
300 register_intc_controller(&intc_desc_irl4567); 329 /* enable IRL7-4 but don't provide any masking */
330 ctrl_outl(0x40000000, INTC_INTMSKCLR1);
331 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2);
301 break; 332 break;
302 case IRQ_MODE_IRL3210: 333 case IRQ_MODE_IRL3210:
334 /* enable IRL0-3 but don't provide any masking */
335 ctrl_outl(0x80000000, INTC_INTMSKCLR1);
336 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2);
337 break;
338 case IRQ_MODE_IRL7654_MASK:
339 /* enable IRL7-4 and mask using cpu intc controller */
340 ctrl_outl(0x40000000, INTC_INTMSKCLR1);
341 register_intc_controller(&intc_desc_irl4567);
342 break;
343 case IRQ_MODE_IRL3210_MASK:
344 /* enable IRL0-3 and mask using cpu intc controller */
345 ctrl_outl(0x80000000, INTC_INTMSKCLR1);
303 register_intc_controller(&intc_desc_irl0123); 346 register_intc_controller(&intc_desc_irl0123);
304 break; 347 break;
305 default: 348 default: