aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/cpu/irq/imask.c68
-rw-r--r--arch/sh/kernel/cpu/irq/intc-sh5.c10
-rw-r--r--arch/sh/kernel/cpu/irq/ipr.c12
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7770.c246
-rw-r--r--arch/sh/kernel/irq.c77
-rw-r--r--arch/sh/kernel/sh_ksyms_32.c8
6 files changed, 332 insertions, 89 deletions
diff --git a/arch/sh/kernel/cpu/irq/imask.c b/arch/sh/kernel/cpu/irq/imask.c
index f43753b54e1d..6b5d191eec3a 100644
--- a/arch/sh/kernel/cpu/irq/imask.c
+++ b/arch/sh/kernel/cpu/irq/imask.c
@@ -18,38 +18,17 @@
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/cache.h> 19#include <linux/cache.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/bitmap.h>
21#include <asm/system.h> 22#include <asm/system.h>
22#include <asm/irq.h> 23#include <asm/irq.h>
23 24
24/* Bitmap of IRQ masked */ 25/* Bitmap of IRQ masked */
25static unsigned long imask_mask = 0x7fff;
26static int interrupt_priority = 0;
27
28static void enable_imask_irq(unsigned int irq);
29static void disable_imask_irq(unsigned int irq);
30static void shutdown_imask_irq(unsigned int irq);
31static void mask_and_ack_imask(unsigned int);
32static void end_imask_irq(unsigned int irq);
33
34#define IMASK_PRIORITY 15 26#define IMASK_PRIORITY 15
35 27
36static unsigned int startup_imask_irq(unsigned int irq) 28static DECLARE_BITMAP(imask_mask, IMASK_PRIORITY);
37{ 29static int interrupt_priority;
38 /* Nothing to do */
39 return 0; /* never anything pending */
40}
41 30
42static struct irq_chip imask_irq_type = { 31static inline void set_interrupt_registers(int ip)
43 .typename = "SR.IMASK",
44 .startup = startup_imask_irq,
45 .shutdown = shutdown_imask_irq,
46 .enable = enable_imask_irq,
47 .disable = disable_imask_irq,
48 .ack = mask_and_ack_imask,
49 .end = end_imask_irq
50};
51
52void static inline set_interrupt_registers(int ip)
53{ 32{
54 unsigned long __dummy; 33 unsigned long __dummy;
55 34
@@ -72,42 +51,31 @@ void static inline set_interrupt_registers(int ip)
72 : "t"); 51 : "t");
73} 52}
74 53
75static void disable_imask_irq(unsigned int irq) 54static void mask_imask_irq(unsigned int irq)
76{ 55{
77 clear_bit(irq, &imask_mask); 56 clear_bit(irq, imask_mask);
78 if (interrupt_priority < IMASK_PRIORITY - irq) 57 if (interrupt_priority < IMASK_PRIORITY - irq)
79 interrupt_priority = IMASK_PRIORITY - irq; 58 interrupt_priority = IMASK_PRIORITY - irq;
80
81 set_interrupt_registers(interrupt_priority); 59 set_interrupt_registers(interrupt_priority);
82} 60}
83 61
84static void enable_imask_irq(unsigned int irq) 62static void unmask_imask_irq(unsigned int irq)
85{ 63{
86 set_bit(irq, &imask_mask); 64 set_bit(irq, imask_mask);
87 interrupt_priority = IMASK_PRIORITY - ffz(imask_mask); 65 interrupt_priority = IMASK_PRIORITY -
88 66 find_first_zero_bit(imask_mask, IMASK_PRIORITY);
89 set_interrupt_registers(interrupt_priority); 67 set_interrupt_registers(interrupt_priority);
90} 68}
91 69
92static void mask_and_ack_imask(unsigned int irq) 70static struct irq_chip imask_irq_chip = {
93{ 71 .typename = "SR.IMASK",
94 disable_imask_irq(irq); 72 .mask = mask_imask_irq,
95} 73 .unmask = unmask_imask_irq,
96 74 .mask_ack = mask_imask_irq,
97static void end_imask_irq(unsigned int irq) 75};
98{
99 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
100 enable_imask_irq(irq);
101}
102
103static void shutdown_imask_irq(unsigned int irq)
104{
105 /* Nothing to do */
106}
107 76
108void make_imask_irq(unsigned int irq) 77void make_imask_irq(unsigned int irq)
109{ 78{
110 disable_irq_nosync(irq); 79 set_irq_chip_and_handler_name(irq, &imask_irq_chip,
111 irq_desc[irq].chip = &imask_irq_type; 80 handle_level_irq, "level");
112 enable_irq(irq);
113} 81}
diff --git a/arch/sh/kernel/cpu/irq/intc-sh5.c b/arch/sh/kernel/cpu/irq/intc-sh5.c
index a619eaf6e6b4..6c092f1f5557 100644
--- a/arch/sh/kernel/cpu/irq/intc-sh5.c
+++ b/arch/sh/kernel/cpu/irq/intc-sh5.c
@@ -152,14 +152,6 @@ static void end_intc_irq(unsigned int irq)
152 enable_intc_irq(irq); 152 enable_intc_irq(irq);
153} 153}
154 154
155/* For future use, if we ever support IRLM=0) */
156void make_intc_irq(unsigned int irq)
157{
158 disable_irq_nosync(irq);
159 irq_desc[irq].chip = &intc_irq_type;
160 disable_intc_irq(irq);
161}
162
163void __init plat_irq_setup(void) 155void __init plat_irq_setup(void)
164{ 156{
165 unsigned long long __dummy0, __dummy1=~0x00000000100000f0; 157 unsigned long long __dummy0, __dummy1=~0x00000000100000f0;
@@ -174,7 +166,7 @@ void __init plat_irq_setup(void)
174 166
175 /* Set default: per-line enable/disable, priority driven ack/eoi */ 167 /* Set default: per-line enable/disable, priority driven ack/eoi */
176 for (i = 0; i < NR_INTC_IRQS; i++) 168 for (i = 0; i < NR_INTC_IRQS; i++)
177 irq_desc[i].chip = &intc_irq_type; 169 set_irq_chip_and_handler(i, &intc_irq_type, handle_level_irq);
178 170
179 171
180 /* Disable all interrupts and set all priorities to 0 to avoid trouble */ 172 /* Disable all interrupts and set all priorities to 0 to avoid trouble */
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c
index 3eb17ee5540e..6ad40dbad881 100644
--- a/arch/sh/kernel/cpu/irq/ipr.c
+++ b/arch/sh/kernel/cpu/irq/ipr.c
@@ -59,10 +59,22 @@ void register_ipr_controller(struct ipr_desc *desc)
59 59
60 for (i = 0; i < desc->nr_irqs; i++) { 60 for (i = 0; i < desc->nr_irqs; i++) {
61 struct ipr_data *p = desc->ipr_data + i; 61 struct ipr_data *p = desc->ipr_data + i;
62#ifdef CONFIG_SPARSE_IRQ
63 struct irq_desc *irq_desc;
64#endif
62 65
63 BUG_ON(p->ipr_idx >= desc->nr_offsets); 66 BUG_ON(p->ipr_idx >= desc->nr_offsets);
64 BUG_ON(!desc->ipr_offsets[p->ipr_idx]); 67 BUG_ON(!desc->ipr_offsets[p->ipr_idx]);
65 68
69#ifdef CONFIG_SPARSE_IRQ
70 irq_desc = irq_to_desc_alloc_cpu(p->irq, smp_processor_id());
71 if (unlikely(!irq_desc)) {
72 printk(KERN_INFO "can not get irq_desc for %d\n",
73 p->irq);
74 continue;
75 }
76#endif
77
66 disable_irq_nosync(p->irq); 78 disable_irq_nosync(p->irq);
67 set_irq_chip_and_handler_name(p->irq, &desc->chip, 79 set_irq_chip_and_handler_name(p->irq, &desc->chip,
68 handle_level_irq, "level"); 80 handle_level_irq, "level");
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index 12fb8752d4ff..1e86209db284 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -12,6 +12,7 @@
12#include <linux/serial.h> 12#include <linux/serial.h>
13#include <linux/serial_sci.h> 13#include <linux/serial_sci.h>
14#include <linux/sh_timer.h> 14#include <linux/sh_timer.h>
15#include <linux/io.h>
15 16
16static struct plat_sci_port sci_platform_data[] = { 17static struct plat_sci_port sci_platform_data[] = {
17 { 18 {
@@ -387,6 +388,251 @@ void __init plat_early_device_setup(void)
387 ARRAY_SIZE(sh7770_early_devices)); 388 ARRAY_SIZE(sh7770_early_devices));
388} 389}
389 390
391enum {
392 UNUSED = 0,
393
394 /* interrupt sources */
395 IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH,
396 IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH,
397 IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH,
398 IRL_HHLL, IRL_HHLH, IRL_HHHL,
399
400 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5,
401
402 GPIO,
403 TMU0, TMU1, TMU2, TMU2_TICPI,
404 TMU3, TMU4, TMU5, TMU5_TICPI,
405 TMU6, TMU7, TMU8,
406 HAC, IPI, SPDIF, HUDI, I2C,
407 DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2,
408 I2S0, I2S1, I2S2, I2S3,
409 SRC_RX, SRC_TX, SRC_SPDIF,
410 DU, VIDEO_IN, REMOTE, YUV, USB, ATAPI, CAN, GPS, GFX2D,
411 GFX3D_MBX, GFX3D_DMAC,
412 EXBUS_ATA,
413 SPI0, SPI1,
414 SCIF089, SCIF1234, SCIF567,
415 ADC,
416 BBDMAC_0_3, BBDMAC_4_7, BBDMAC_8_10, BBDMAC_11_14,
417 BBDMAC_15_18, BBDMAC_19_22, BBDMAC_23_26, BBDMAC_27,
418 BBDMAC_28, BBDMAC_29, BBDMAC_30, BBDMAC_31,
419
420 /* interrupt groups */
421 TMU, DMAC, I2S, SRC, GFX3D, SPI, SCIF, BBDMAC,
422};
423
424static struct intc_vect vectors[] __initdata = {
425 INTC_VECT(GPIO, 0x3e0),
426 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
427 INTC_VECT(TMU2, 0x440), INTC_VECT(TMU2_TICPI, 0x460),
428 INTC_VECT(TMU3, 0x480), INTC_VECT(TMU4, 0x4a0),
429 INTC_VECT(TMU5, 0x4c0), INTC_VECT(TMU5_TICPI, 0x4e0),
430 INTC_VECT(TMU6, 0x500), INTC_VECT(TMU7, 0x520),
431 INTC_VECT(TMU8, 0x540),
432 INTC_VECT(HAC, 0x580), INTC_VECT(IPI, 0x5c0),
433 INTC_VECT(SPDIF, 0x5e0),
434 INTC_VECT(HUDI, 0x600), INTC_VECT(I2C, 0x620),
435 INTC_VECT(DMAC0_DMINT0, 0x640), INTC_VECT(DMAC0_DMINT1, 0x660),
436 INTC_VECT(DMAC0_DMINT2, 0x680),
437 INTC_VECT(I2S0, 0x6a0), INTC_VECT(I2S1, 0x6c0),
438 INTC_VECT(I2S2, 0x6e0), INTC_VECT(I2S3, 0x700),
439 INTC_VECT(SRC_RX, 0x720), INTC_VECT(SRC_TX, 0x740),
440 INTC_VECT(SRC_SPDIF, 0x760),
441 INTC_VECT(DU, 0x780), INTC_VECT(VIDEO_IN, 0x7a0),
442 INTC_VECT(REMOTE, 0x7c0), INTC_VECT(YUV, 0x7e0),
443 INTC_VECT(USB, 0x840), INTC_VECT(ATAPI, 0x860),
444 INTC_VECT(CAN, 0x880), INTC_VECT(GPS, 0x8a0),
445 INTC_VECT(GFX2D, 0x8c0),
446 INTC_VECT(GFX3D_MBX, 0x900), INTC_VECT(GFX3D_DMAC, 0x920),
447 INTC_VECT(EXBUS_ATA, 0x940),
448 INTC_VECT(SPI0, 0x960), INTC_VECT(SPI1, 0x980),
449 INTC_VECT(SCIF089, 0x9a0), INTC_VECT(SCIF1234, 0x9c0),
450 INTC_VECT(SCIF1234, 0x9e0), INTC_VECT(SCIF1234, 0xa00),
451 INTC_VECT(SCIF1234, 0xa20), INTC_VECT(SCIF567, 0xa40),
452 INTC_VECT(SCIF567, 0xa60), INTC_VECT(SCIF567, 0xa80),
453 INTC_VECT(SCIF089, 0xaa0), INTC_VECT(SCIF089, 0xac0),
454 INTC_VECT(ADC, 0xb20),
455 INTC_VECT(BBDMAC_0_3, 0xba0), INTC_VECT(BBDMAC_0_3, 0xbc0),
456 INTC_VECT(BBDMAC_0_3, 0xbe0), INTC_VECT(BBDMAC_0_3, 0xc00),
457 INTC_VECT(BBDMAC_4_7, 0xc20), INTC_VECT(BBDMAC_4_7, 0xc40),
458 INTC_VECT(BBDMAC_4_7, 0xc60), INTC_VECT(BBDMAC_4_7, 0xc80),
459 INTC_VECT(BBDMAC_8_10, 0xca0), INTC_VECT(BBDMAC_8_10, 0xcc0),
460 INTC_VECT(BBDMAC_8_10, 0xce0), INTC_VECT(BBDMAC_11_14, 0xd00),
461 INTC_VECT(BBDMAC_11_14, 0xd20), INTC_VECT(BBDMAC_11_14, 0xd40),
462 INTC_VECT(BBDMAC_11_14, 0xd60), INTC_VECT(BBDMAC_15_18, 0xd80),
463 INTC_VECT(BBDMAC_15_18, 0xda0), INTC_VECT(BBDMAC_15_18, 0xdc0),
464 INTC_VECT(BBDMAC_15_18, 0xde0), INTC_VECT(BBDMAC_19_22, 0xe00),
465 INTC_VECT(BBDMAC_19_22, 0xe20), INTC_VECT(BBDMAC_19_22, 0xe40),
466 INTC_VECT(BBDMAC_19_22, 0xe60), INTC_VECT(BBDMAC_23_26, 0xe80),
467 INTC_VECT(BBDMAC_23_26, 0xea0), INTC_VECT(BBDMAC_23_26, 0xec0),
468 INTC_VECT(BBDMAC_23_26, 0xee0), INTC_VECT(BBDMAC_27, 0xf00),
469 INTC_VECT(BBDMAC_28, 0xf20), INTC_VECT(BBDMAC_29, 0xf40),
470 INTC_VECT(BBDMAC_30, 0xf60), INTC_VECT(BBDMAC_31, 0xf80),
471};
472
473static struct intc_group groups[] __initdata = {
474 INTC_GROUP(TMU, TMU0, TMU1, TMU2, TMU2_TICPI, TMU3, TMU4, TMU5,
475 TMU5_TICPI, TMU6, TMU7, TMU8),
476 INTC_GROUP(DMAC, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2),
477 INTC_GROUP(I2S, I2S0, I2S1, I2S2, I2S3),
478 INTC_GROUP(SRC, SRC_RX, SRC_TX, SRC_SPDIF),
479 INTC_GROUP(GFX3D, GFX3D_MBX, GFX3D_DMAC),
480 INTC_GROUP(SPI, SPI0, SPI1),
481 INTC_GROUP(SCIF, SCIF089, SCIF1234, SCIF567),
482 INTC_GROUP(BBDMAC,
483 BBDMAC_0_3, BBDMAC_4_7, BBDMAC_8_10, BBDMAC_11_14,
484 BBDMAC_15_18, BBDMAC_19_22, BBDMAC_23_26, BBDMAC_27,
485 BBDMAC_28, BBDMAC_29, BBDMAC_30, BBDMAC_31),
486};
487
488static struct intc_mask_reg mask_registers[] __initdata = {
489 { 0xffe00040, 0xffe00044, 32, /* INT2MSKR / INT2MSKCR */
490 { 0, BBDMAC, ADC, SCIF, SPI, EXBUS_ATA, GFX3D, GFX2D,
491 GPS, CAN, ATAPI, USB, YUV, REMOTE, VIDEO_IN, DU, SRC, I2S,
492 DMAC, I2C, HUDI, SPDIF, IPI, HAC, TMU, GPIO } },
493};
494
495static struct intc_prio_reg prio_registers[] __initdata = {
496 { 0xffe00000, 0, 32, 8, /* INT2PRI0 */ { GPIO, TMU0, 0, HAC } },
497 { 0xffe00004, 0, 32, 8, /* INT2PRI1 */ { IPI, SPDIF, HUDI, I2C } },
498 { 0xffe00008, 0, 32, 8, /* INT2PRI2 */ { DMAC, I2S, SRC, DU } },
499 { 0xffe0000c, 0, 32, 8, /* INT2PRI3 */ { VIDEO_IN, REMOTE, YUV, USB } },
500 { 0xffe00010, 0, 32, 8, /* INT2PRI4 */ { ATAPI, CAN, GPS, GFX2D } },
501 { 0xffe00014, 0, 32, 8, /* INT2PRI5 */ { 0, GFX3D, EXBUS_ATA, SPI } },
502 { 0xffe00018, 0, 32, 8, /* INT2PRI6 */ { SCIF1234, SCIF567, SCIF089 } },
503 { 0xffe0001c, 0, 32, 8, /* INT2PRI7 */ { ADC, 0, 0, BBDMAC_0_3 } },
504 { 0xffe00020, 0, 32, 8, /* INT2PRI8 */
505 { BBDMAC_4_7, BBDMAC_8_10, BBDMAC_11_14, BBDMAC_15_18 } },
506 { 0xffe00024, 0, 32, 8, /* INT2PRI9 */
507 { BBDMAC_19_22, BBDMAC_23_26, BBDMAC_27, BBDMAC_28 } },
508 { 0xffe00028, 0, 32, 8, /* INT2PRI10 */
509 { BBDMAC_29, BBDMAC_30, BBDMAC_31 } },
510 { 0xffe0002c, 0, 32, 8, /* INT2PRI11 */
511 { TMU1, TMU2, TMU2_TICPI, TMU3 } },
512 { 0xffe00030, 0, 32, 8, /* INT2PRI12 */
513 { TMU4, TMU5, TMU5_TICPI, TMU6 } },
514 { 0xffe00034, 0, 32, 8, /* INT2PRI13 */
515 { TMU7, TMU8 } },
516};
517
518static DECLARE_INTC_DESC(intc_desc, "sh7770", vectors, groups,
519 mask_registers, prio_registers, NULL);
520
521/* Support for external interrupt pins in IRQ mode */
522static struct intc_vect irq_vectors[] __initdata = {
523 INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),
524 INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300),
525 INTC_VECT(IRQ4, 0x340), INTC_VECT(IRQ5, 0x380),
526};
527
528static struct intc_mask_reg irq_mask_registers[] __initdata = {
529 { 0xffd00044, 0xffd00064, 32, /* INTMSK0 / INTMSKCLR0 */
530 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, } },
531};
532
533static struct intc_prio_reg irq_prio_registers[] __initdata = {
534 { 0xffd00010, 0, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3,
535 IRQ4, IRQ5, } },
536};
537
538static struct intc_sense_reg irq_sense_registers[] __initdata = {
539 { 0xffd0001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3,
540 IRQ4, IRQ5, } },
541};
542
543static DECLARE_INTC_DESC(intc_irq_desc, "sh7770-irq", irq_vectors,
544 NULL, irq_mask_registers, irq_prio_registers,
545 irq_sense_registers);
546
547/* External interrupt pins in IRL mode */
548static struct intc_vect irl_vectors[] __initdata = {
549 INTC_VECT(IRL_LLLL, 0x200), INTC_VECT(IRL_LLLH, 0x220),
550 INTC_VECT(IRL_LLHL, 0x240), INTC_VECT(IRL_LLHH, 0x260),
551 INTC_VECT(IRL_LHLL, 0x280), INTC_VECT(IRL_LHLH, 0x2a0),
552 INTC_VECT(IRL_LHHL, 0x2c0), INTC_VECT(IRL_LHHH, 0x2e0),
553 INTC_VECT(IRL_HLLL, 0x300), INTC_VECT(IRL_HLLH, 0x320),
554 INTC_VECT(IRL_HLHL, 0x340), INTC_VECT(IRL_HLHH, 0x360),
555 INTC_VECT(IRL_HHLL, 0x380), INTC_VECT(IRL_HHLH, 0x3a0),
556 INTC_VECT(IRL_HHHL, 0x3c0),
557};
558
559static struct intc_mask_reg irl3210_mask_registers[] __initdata = {
560 { 0xffd40080, 0xffd40084, 32, /* INTMSK2 / INTMSKCLR2 */
561 { IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH,
562 IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH,
563 IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH,
564 IRL_HHLL, IRL_HHLH, IRL_HHHL, } },
565};
566
567static struct intc_mask_reg irl7654_mask_registers[] __initdata = {
568 { 0xffd40080, 0xffd40084, 32, /* INTMSK2 / INTMSKCLR2 */
569 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
570 IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH,
571 IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH,
572 IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH,
573 IRL_HHLL, IRL_HHLH, IRL_HHHL, } },
574};
575
576static DECLARE_INTC_DESC(intc_irl7654_desc, "sh7780-irl7654", irl_vectors,
577 NULL, irl7654_mask_registers, NULL, NULL);
578
579static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7780-irl3210", irl_vectors,
580 NULL, irl3210_mask_registers, NULL, NULL);
581
582#define INTC_ICR0 0xffd00000
583#define INTC_INTMSK0 0xffd00044
584#define INTC_INTMSK1 0xffd00048
585#define INTC_INTMSK2 0xffd40080
586#define INTC_INTMSKCLR1 0xffd00068
587#define INTC_INTMSKCLR2 0xffd40084
588
390void __init plat_irq_setup(void) 589void __init plat_irq_setup(void)
391{ 590{
591 /* disable IRQ7-0 */
592 ctrl_outl(0xff000000, INTC_INTMSK0);
593
594 /* disable IRL3-0 + IRL7-4 */
595 ctrl_outl(0xc0000000, INTC_INTMSK1);
596 ctrl_outl(0xfffefffe, INTC_INTMSK2);
597
598 /* select IRL mode for IRL3-0 + IRL7-4 */
599 ctrl_outl(ctrl_inl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
600
601 /* disable holding function, ie enable "SH-4 Mode" */
602 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00200000, INTC_ICR0);
603
604 register_intc_controller(&intc_desc);
605}
606
607void __init plat_irq_setup_pins(int mode)
608{
609 switch (mode) {
610 case IRQ_MODE_IRQ:
611 /* select IRQ mode for IRL3-0 + IRL7-4 */
612 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00c00000, INTC_ICR0);
613 register_intc_controller(&intc_irq_desc);
614 break;
615 case IRQ_MODE_IRL7654:
616 /* enable IRL7-4 but don't provide any masking */
617 ctrl_outl(0x40000000, INTC_INTMSKCLR1);
618 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2);
619 break;
620 case IRQ_MODE_IRL3210:
621 /* enable IRL0-3 but don't provide any masking */
622 ctrl_outl(0x80000000, INTC_INTMSKCLR1);
623 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2);
624 break;
625 case IRQ_MODE_IRL7654_MASK:
626 /* enable IRL7-4 and mask using cpu intc controller */
627 ctrl_outl(0x40000000, INTC_INTMSKCLR1);
628 register_intc_controller(&intc_irl7654_desc);
629 break;
630 case IRQ_MODE_IRL3210_MASK:
631 /* enable IRL0-3 and mask using cpu intc controller */
632 ctrl_outl(0x80000000, INTC_INTMSKCLR1);
633 register_intc_controller(&intc_irl3210_desc);
634 break;
635 default:
636 BUG();
637 }
392} 638}
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 3f1372eb0091..3d09062f4682 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -31,39 +31,64 @@ void ack_bad_irq(unsigned int irq)
31} 31}
32 32
33#if defined(CONFIG_PROC_FS) 33#if defined(CONFIG_PROC_FS)
34/*
35 * /proc/interrupts printing:
36 */
37static int show_other_interrupts(struct seq_file *p, int prec)
38{
39 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
40 return 0;
41}
42
34int show_interrupts(struct seq_file *p, void *v) 43int show_interrupts(struct seq_file *p, void *v)
35{ 44{
36 int i = *(loff_t *) v, j; 45 unsigned long flags, any_count = 0;
37 struct irqaction * action; 46 int i = *(loff_t *)v, j, prec;
38 unsigned long flags; 47 struct irqaction *action;
48 struct irq_desc *desc;
49
50 if (i > nr_irqs)
51 return 0;
52
53 for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
54 j *= 10;
55
56 if (i == nr_irqs)
57 return show_other_interrupts(p, prec);
39 58
40 if (i == 0) { 59 if (i == 0) {
41 seq_puts(p, " "); 60 seq_printf(p, "%*s", prec + 8, "");
42 for_each_online_cpu(j) 61 for_each_online_cpu(j)
43 seq_printf(p, "CPU%d ",j); 62 seq_printf(p, "CPU%-8d", j);
44 seq_putc(p, '\n'); 63 seq_putc(p, '\n');
45 } 64 }
46 65
47 if (i < sh_mv.mv_nr_irqs) { 66 desc = irq_to_desc(i);
48 spin_lock_irqsave(&irq_desc[i].lock, flags); 67 if (!desc)
49 action = irq_desc[i].action; 68 return 0;
50 if (!action) 69
51 goto unlock; 70 spin_lock_irqsave(&desc->lock, flags);
52 seq_printf(p, "%3d: ",i); 71 for_each_online_cpu(j)
53 for_each_online_cpu(j) 72 any_count |= kstat_irqs_cpu(i, j);
54 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 73 action = desc->action;
55 seq_printf(p, " %14s", irq_desc[i].chip->name); 74 if (!action && !any_count)
56 seq_printf(p, "-%-8s", irq_desc[i].name); 75 goto out;
57 seq_printf(p, " %s", action->name); 76
77 seq_printf(p, "%*d: ", prec, i);
78 for_each_online_cpu(j)
79 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
80 seq_printf(p, " %14s", desc->chip->name);
81 seq_printf(p, "-%-8s", desc->name);
58 82
59 for (action=action->next; action; action = action->next) 83 if (action) {
84 seq_printf(p, " %s", action->name);
85 while ((action = action->next) != NULL)
60 seq_printf(p, ", %s", action->name); 86 seq_printf(p, ", %s", action->name);
61 seq_putc(p, '\n'); 87 }
62unlock:
63 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
64 } else if (i == sh_mv.mv_nr_irqs)
65 seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count));
66 88
89 seq_putc(p, '\n');
90out:
91 spin_unlock_irqrestore(&desc->lock, flags);
67 return 0; 92 return 0;
68} 93}
69#endif 94#endif
@@ -254,3 +279,11 @@ void __init init_IRQ(void)
254 279
255 irq_ctx_init(smp_processor_id()); 280 irq_ctx_init(smp_processor_id());
256} 281}
282
283#ifdef CONFIG_SPARSE_IRQ
284int __init arch_probe_nr_irqs(void)
285{
286 nr_irqs = sh_mv.mv_nr_irqs;
287 return 0;
288}
289#endif
diff --git a/arch/sh/kernel/sh_ksyms_32.c b/arch/sh/kernel/sh_ksyms_32.c
index 2d868c60aa6e..fcc5de31f83b 100644
--- a/arch/sh/kernel/sh_ksyms_32.c
+++ b/arch/sh/kernel/sh_ksyms_32.c
@@ -23,9 +23,6 @@ extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
23/* platform dependent support */ 23/* platform dependent support */
24EXPORT_SYMBOL(dump_fpu); 24EXPORT_SYMBOL(dump_fpu);
25EXPORT_SYMBOL(kernel_thread); 25EXPORT_SYMBOL(kernel_thread);
26EXPORT_SYMBOL(irq_desc);
27EXPORT_SYMBOL(no_irq_chip);
28
29EXPORT_SYMBOL(strlen); 26EXPORT_SYMBOL(strlen);
30 27
31/* PCI exports */ 28/* PCI exports */
@@ -40,11 +37,6 @@ EXPORT_SYMBOL(memcpy);
40EXPORT_SYMBOL(memset); 37EXPORT_SYMBOL(memset);
41EXPORT_SYMBOL(memmove); 38EXPORT_SYMBOL(memmove);
42EXPORT_SYMBOL(__copy_user); 39EXPORT_SYMBOL(__copy_user);
43
44#ifdef CONFIG_MMU
45EXPORT_SYMBOL(get_vm_area);
46#endif
47
48EXPORT_SYMBOL(__udelay); 40EXPORT_SYMBOL(__udelay);
49EXPORT_SYMBOL(__ndelay); 41EXPORT_SYMBOL(__ndelay);
50EXPORT_SYMBOL(__const_udelay); 42EXPORT_SYMBOL(__const_udelay);