aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2007-06-15 05:56:19 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-06-15 05:56:19 -0400
commit68abdbbb03476a60d932eeba0035dd5069afec38 (patch)
treede3854f76d6d9aec121c432a3cd276bb756003c9 /arch/sh/boards
parent50f63f2518ee68bc132d357d2b6fdb7f60ef79e0 (diff)
sh: rework ipr code
This patch reworks the ipr code by grouping the offset array together with the ipr_data structure in a new data structure called ipr_desc. This new structure also contains the name of the controller in struct irq_chip. The idea behind putting struct irq_chip in there is that we can use offsetof() to locate the base addresses in the irq_chip callbacks. This strategy has much in common with the recently merged intc2 code. One logic change has been made - the original ipr code enabled the interrupts by default but with this patch they are all disabled by default. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/se/770x/irq.c124
-rw-r--r--arch/sh/boards/se/7722/irq.c15
-rw-r--r--arch/sh/boards/se/7751/irq.c59
-rw-r--r--arch/sh/boards/sh03/setup.c28
-rw-r--r--arch/sh/boards/shmin/setup.c30
-rw-r--r--arch/sh/boards/snapgear/setup.c28
-rw-r--r--arch/sh/boards/titan/setup.c22
7 files changed, 175 insertions, 131 deletions
diff --git a/arch/sh/boards/se/770x/irq.c b/arch/sh/boards/se/770x/irq.c
index c8eccff77a04..cdb0807928a5 100644
--- a/arch/sh/boards/se/770x/irq.c
+++ b/arch/sh/boards/se/770x/irq.c
@@ -15,46 +15,7 @@
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/se.h> 16#include <asm/se.h>
17 17
18/* 18static struct ipr_data ipr_irq_table[] = {
19 * If the problem of make_ipr_irq is solved,
20 * this code will become unnecessary. :-)
21 */
22static void se770x_disable_ipr_irq(unsigned int irq)
23{
24 struct ipr_data *p = get_irq_chip_data(irq);
25
26 ctrl_outw(ctrl_inw(p->addr) & (0xffff ^ (0xf << p->shift)), p->addr);
27}
28
29static void se770x_enable_ipr_irq(unsigned int irq)
30{
31 struct ipr_data *p = get_irq_chip_data(irq);
32
33 ctrl_outw(ctrl_inw(p->addr) | (p->priority << p->shift), p->addr);
34}
35
36static struct irq_chip se770x_irq_chip = {
37 .name = "MS770xSE-FPGA",
38 .mask = se770x_disable_ipr_irq,
39 .unmask = se770x_enable_ipr_irq,
40 .mask_ack = se770x_disable_ipr_irq,
41};
42
43void make_se770x_irq(struct ipr_data *table, unsigned int nr_irqs)
44{
45 int i;
46
47 for (i = 0; i < nr_irqs; i++) {
48 unsigned int irq = table[i].irq;
49 disable_irq_nosync(irq);
50 set_irq_chip_and_handler_name(irq, &se770x_irq_chip,
51 handle_level_irq, "level");
52 set_irq_chip_data(irq, &table[i]);
53 se770x_enable_ipr_irq(irq);
54 }
55}
56
57static struct ipr_data se770x_ipr_map[] = {
58 /* 19 /*
59 * Super I/O (Just mimic PC): 20 * Super I/O (Just mimic PC):
60 * 1: keyboard 21 * 1: keyboard
@@ -68,46 +29,67 @@ static struct ipr_data se770x_ipr_map[] = {
68 */ 29 */
69#if defined(CONFIG_CPU_SUBTYPE_SH7705) 30#if defined(CONFIG_CPU_SUBTYPE_SH7705)
70 /* This is default value */ 31 /* This is default value */
71 { 13, 0, 8, 0x0f-13 ,BCR_ILCRA}, 32 { 13, 0, 8, 0x0f-13, },
72 { 5 , 0, 4, 0x0f- 5 ,BCR_ILCRA}, 33 { 5 , 0, 4, 0x0f- 5, },
73 { 10, 0, 0, 0x0f-10, BCR_ILCRB}, 34 { 10, 1, 0, 0x0f-10, },
74 { 7 , 0, 4, 0x0f- 7, BCR_ILCRC}, 35 { 7 , 2, 4, 0x0f- 7, },
75 { 3 , 0, 0, 0x0f- 3, BCR_ILCRC}, 36 { 3 , 2, 0, 0x0f- 3, },
76 { 1 , 0, 12, 0x0f- 1, BCR_ILCRD}, 37 { 1 , 3, 12, 0x0f- 1, },
77 { 12, 0, 4, 0x0f-12, BCR_ILCRD}, /* LAN */ 38 { 12, 3, 4, 0x0f-12, }, /* LAN */
78 { 2 , 0, 8, 0x0f- 2, BCR_ILCRE}, /* PCIRQ2 */ 39 { 2 , 4, 8, 0x0f- 2, }, /* PCIRQ2 */
79 { 6 , 0, 4, 0x0f- 6, BCR_ILCRE}, /* PCIRQ1 */ 40 { 6 , 4, 4, 0x0f- 6, }, /* PCIRQ1 */
80 { 14, 0, 0, 0x0f-14, BCR_ILCRE}, /* PCIRQ0 */ 41 { 14, 4, 0, 0x0f-14, }, /* PCIRQ0 */
81 { 0 , 0, 12, 0x0f , BCR_ILCRF}, 42 { 0 , 5, 12, 0x0f , },
82 { 4 , 0, 4, 0x0f- 4, BCR_ILCRF}, 43 { 4 , 5, 4, 0x0f- 4, },
83 { 8 , 0, 12, 0x0f- 8, BCR_ILCRG}, 44 { 8 , 6, 12, 0x0f- 8, },
84 { 9 , 0, 8, 0x0f- 9, BCR_ILCRG}, 45 { 9 , 6, 8, 0x0f- 9, },
85 { 11, 0, 4, 0x0f-11, BCR_ILCRG}, 46 { 11, 6, 4, 0x0f-11, },
86#else 47#else
87 { 14, 0, 8, 0x0f-14 ,BCR_ILCRA}, 48 { 14, 0, 8, 0x0f-14, },
88 { 12, 0, 4, 0x0f-12 ,BCR_ILCRA}, 49 { 12, 0, 4, 0x0f-12, },
89 { 8, 0, 4, 0x0f- 8 ,BCR_ILCRB}, 50 { 8, 1, 4, 0x0f- 8, },
90 { 6, 0, 12, 0x0f- 6 ,BCR_ILCRC}, 51 { 6, 2, 12, 0x0f- 6, },
91 { 5, 0, 8, 0x0f- 5 ,BCR_ILCRC}, 52 { 5, 2, 8, 0x0f- 5, },
92 { 4, 0, 4, 0x0f- 4 ,BCR_ILCRC}, 53 { 4, 2, 4, 0x0f- 4, },
93 { 3, 0, 0, 0x0f- 3 ,BCR_ILCRC}, 54 { 3, 2, 0, 0x0f- 3, },
94 { 1, 0, 12, 0x0f- 1 ,BCR_ILCRD}, 55 { 1, 3, 12, 0x0f- 1, },
95#if defined(CONFIG_STNIC) 56#if defined(CONFIG_STNIC)
96 /* ST NIC */ 57 /* ST NIC */
97 { 10, 0, 4, 0x0f-10 ,BCR_ILCRD}, /* LAN */ 58 { 10, 3, 4, 0x0f-10, }, /* LAN */
98#endif 59#endif
99 /* MRSHPC IRQs setting */ 60 /* MRSHPC IRQs setting */
100 { 0, 0, 12, 0x0f- 0 ,BCR_ILCRE}, /* PCIRQ3 */ 61 { 0, 4, 12, 0x0f- 0, }, /* PCIRQ3 */
101 { 11, 0, 8, 0x0f-11 ,BCR_ILCRE}, /* PCIRQ2 */ 62 { 11, 4, 8, 0x0f-11, }, /* PCIRQ2 */
102 { 9, 0, 4, 0x0f- 9 ,BCR_ILCRE}, /* PCIRQ1 */ 63 { 9, 4, 4, 0x0f- 9, }, /* PCIRQ1 */
103 { 7, 0, 0, 0x0f- 7 ,BCR_ILCRE}, /* PCIRQ0 */ 64 { 7, 4, 0, 0x0f- 7, }, /* PCIRQ0 */
104 /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */ 65 /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
105 /* NOTE: #2 and #13 are not used on PC */ 66 /* NOTE: #2 and #13 are not used on PC */
106 { 13, 0, 4, 0x0f-13 ,BCR_ILCRG}, /* SLOTIRQ2 */ 67 { 13, 6, 4, 0x0f-13, }, /* SLOTIRQ2 */
107 { 2, 0, 0, 0x0f- 2 ,BCR_ILCRG}, /* SLOTIRQ1 */ 68 { 2, 6, 0, 0x0f- 2, }, /* SLOTIRQ1 */
108#endif 69#endif
109}; 70};
110 71
72static unsigned long ipr_offsets[] = {
73 BCR_ILCRA,
74 BCR_ILCRB,
75 BCR_ILCRC,
76 BCR_ILCRD,
77 BCR_ILCRE,
78 BCR_ILCRF,
79 BCR_ILCRG,
80};
81
82static struct ipr_desc ipr_irq_desc = {
83 .ipr_offsets = ipr_offsets,
84 .nr_offsets = ARRAY_SIZE(ipr_offsets),
85
86 .ipr_data = ipr_irq_table,
87 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
88 .chip = {
89 .name = "IPR-se770x",
90 },
91};
92
111/* 93/*
112 * Initialize IRQ setting 94 * Initialize IRQ setting
113 */ 95 */
@@ -122,5 +104,5 @@ void __init init_se_IRQ(void)
122 ctrl_outw(0, BCR_ILCRF); 104 ctrl_outw(0, BCR_ILCRF);
123 ctrl_outw(0, BCR_ILCRG); 105 ctrl_outw(0, BCR_ILCRG);
124 106
125 make_se770x_irq(se770x_ipr_map, ARRAY_SIZE(se770x_ipr_map)); 107 register_ipr_controller(&ipr_irq_desc);
126} 108}
diff --git a/arch/sh/boards/se/7722/irq.c b/arch/sh/boards/se/7722/irq.c
index 099e5deb77f8..26cff0efda40 100644
--- a/arch/sh/boards/se/7722/irq.c
+++ b/arch/sh/boards/se/7722/irq.c
@@ -19,15 +19,24 @@
19#define INTC_INTMSK0 0xFFD00044 19#define INTC_INTMSK0 0xFFD00044
20#define INTC_INTMSKCLR0 0xFFD00064 20#define INTC_INTMSKCLR0 0xFFD00064
21 21
22struct se7722_data {
23 unsigned char irq;
24 unsigned char ipr_idx;
25 unsigned char shift;
26 unsigned short priority;
27 unsigned long addr;
28};
29
30
22static void disable_se7722_irq(unsigned int irq) 31static void disable_se7722_irq(unsigned int irq)
23{ 32{
24 struct ipr_data *p = get_irq_chip_data(irq); 33 struct se7722_data *p = get_irq_chip_data(irq);
25 ctrl_outw( ctrl_inw( p->addr ) | p->priority , p->addr ); 34 ctrl_outw( ctrl_inw( p->addr ) | p->priority , p->addr );
26} 35}
27 36
28static void enable_se7722_irq(unsigned int irq) 37static void enable_se7722_irq(unsigned int irq)
29{ 38{
30 struct ipr_data *p = get_irq_chip_data(irq); 39 struct se7722_data *p = get_irq_chip_data(irq);
31 ctrl_outw( ctrl_inw( p->addr ) & ~p->priority , p->addr ); 40 ctrl_outw( ctrl_inw( p->addr ) & ~p->priority , p->addr );
32} 41}
33 42
@@ -38,7 +47,7 @@ static struct irq_chip se7722_irq_chip __read_mostly = {
38 .mask_ack = disable_se7722_irq, 47 .mask_ack = disable_se7722_irq,
39}; 48};
40 49
41static struct ipr_data ipr_irq_table[] = { 50static struct se7722_data ipr_irq_table[] = {
42 /* irq ,idx,sft, priority , addr */ 51 /* irq ,idx,sft, priority , addr */
43 { MRSHPC_IRQ0 , 0 , 0 , MRSHPC_BIT0 , IRQ01_MASK } , 52 { MRSHPC_IRQ0 , 0 , 0 , MRSHPC_BIT0 , IRQ01_MASK } ,
44 { MRSHPC_IRQ1 , 0 , 0 , MRSHPC_BIT1 , IRQ01_MASK } , 53 { MRSHPC_IRQ1 , 0 , 0 , MRSHPC_BIT1 , IRQ01_MASK } ,
diff --git a/arch/sh/boards/se/7751/irq.c b/arch/sh/boards/se/7751/irq.c
index e4c63a48296c..c3d12590e5db 100644
--- a/arch/sh/boards/se/7751/irq.c
+++ b/arch/sh/boards/se/7751/irq.c
@@ -14,44 +14,31 @@
14#include <asm/irq.h> 14#include <asm/irq.h>
15#include <asm/se7751.h> 15#include <asm/se7751.h>
16 16
17static struct ipr_data se7751_ipr_map[] = { 17static struct ipr_data ipr_irq_table[] = {
18 /* Leave old Solution Engine code in for reference. */ 18 { 13, 3, 3, 2 },
19#if defined(CONFIG_SH_SOLUTION_ENGINE) 19 /* Add additional entries here as drivers are added and tested. */
20 /* 20};
21 * Super I/O (Just mimic PC):
22 * 1: keyboard
23 * 3: serial 0
24 * 4: serial 1
25 * 5: printer
26 * 6: floppy
27 * 8: rtc
28 * 12: mouse
29 * 14: ide0
30 */
31 { 14, BCR_ILCRA, 2, 0x0f-14 },
32 { 12, BCR_ILCRA, 1, 0x0f-12 },
33 { 8, BCR_ILCRB, 1, 0x0f- 8 },
34 { 6, BCR_ILCRC, 3, 0x0f- 6 },
35 { 5, BCR_ILCRC, 2, 0x0f- 5 },
36 { 4, BCR_ILCRC, 1, 0x0f- 4 },
37 { 3, BCR_ILCRC, 0, 0x0f- 3 },
38 { 1, BCR_ILCRD, 3, 0x0f- 1 },
39 21
40 { 10, BCR_ILCRD, 1, 0x0f-10 }, /* LAN */ 22static unsigned long ipr_offsets[] = {
23 BCR_ILCRA,
24 BCR_ILCRB,
25 BCR_ILCRC,
26 BCR_ILCRD,
27 BCR_ILCRE,
28 BCR_ILCRF,
29 BCR_ILCRG,
30};
41 31
42 { 0, BCR_ILCRE, 3, 0x0f- 0 }, /* PCIRQ3 */ 32static struct ipr_desc ipr_irq_desc = {
43 { 11, BCR_ILCRE, 2, 0x0f-11 }, /* PCIRQ2 */ 33 .ipr_offsets = ipr_offsets,
44 { 9, BCR_ILCRE, 1, 0x0f- 9 }, /* PCIRQ1 */ 34 .nr_offsets = ARRAY_SIZE(ipr_offsets),
45 { 7, BCR_ILCRE, 0, 0x0f- 7 }, /* PCIRQ0 */
46 35
47 /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */ 36 .ipr_data = ipr_irq_table,
48 /* NOTE: #2 and #13 are not used on PC */ 37 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
49 { 13, BCR_ILCRG, 1, 0x0f-13 }, /* SLOTIRQ2 */ 38
50 { 2, BCR_ILCRG, 0, 0x0f- 2 }, /* SLOTIRQ1 */ 39 .chip = {
51#elif defined(CONFIG_SH_7751_SOLUTION_ENGINE) 40 .name = "IPR-se7751",
52 { 13, BCR_ILCRD, 3, 2 }, 41 },
53 /* Add additional entries here as drivers are added and tested. */
54#endif
55}; 42};
56 43
57/* 44/*
@@ -59,5 +46,5 @@ static struct ipr_data se7751_ipr_map[] = {
59 */ 46 */
60void __init init_7751se_IRQ(void) 47void __init init_7751se_IRQ(void)
61{ 48{
62 make_ipr_irq(se7751_ipr_map, ARRAY_SIZE(se7751_ipr_map)); 49 register_ipr_controller(&ipr_irq_desc);
63} 50}
diff --git a/arch/sh/boards/sh03/setup.c b/arch/sh/boards/sh03/setup.c
index d7867c190a96..9c031a8c0a1c 100644
--- a/arch/sh/boards/sh03/setup.c
+++ b/arch/sh/boards/sh03/setup.c
@@ -15,17 +15,33 @@
15#include <asm/sh03/sh03.h> 15#include <asm/sh03/sh03.h>
16#include <asm/addrspace.h> 16#include <asm/addrspace.h>
17 17
18static struct ipr_data sh03_ipr_map[] = { 18static struct ipr_data ipr_irq_table[] = {
19 { IRL0_IRQ, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY }, 19 { IRL0_IRQ, 0, IRL0_IPR_POS, IRL0_PRIORITY },
20 { IRL1_IRQ, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY }, 20 { IRL1_IRQ, 0, IRL1_IPR_POS, IRL1_PRIORITY },
21 { IRL2_IRQ, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY }, 21 { IRL2_IRQ, 0, IRL2_IPR_POS, IRL2_PRIORITY },
22 { IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY }, 22 { IRL3_IRQ, 0, IRL3_IPR_POS, IRL3_PRIORITY },
23};
24
25static unsigned long ipr_offsets[] = {
26 INTC_IPRD,
27};
28
29static struct ipr_desc ipr_irq_desc = {
30 .ipr_offsets = ipr_offsets,
31 .nr_offsets = ARRAY_SIZE(ipr_offsets),
32
33 .ipr_data = ipr_irq_table,
34 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
35
36 .chip = {
37 .name = "IPR-sh03",
38 },
23}; 39};
24 40
25static void __init init_sh03_IRQ(void) 41static void __init init_sh03_IRQ(void)
26{ 42{
27 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); 43 ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
28 make_ipr_irq(sh03_ipr_map, ARRAY_SIZE(sh03_ipr_map)); 44 register_ipr_controller(&ipr_irq_desc);
29} 45}
30 46
31extern void *cf_io_base; 47extern void *cf_io_base;
diff --git a/arch/sh/boards/shmin/setup.c b/arch/sh/boards/shmin/setup.c
index 9c8bb51eb4bb..dfd124509f42 100644
--- a/arch/sh/boards/shmin/setup.c
+++ b/arch/sh/boards/shmin/setup.c
@@ -6,28 +6,44 @@
6 * SHMIN Support. 6 * SHMIN Support.
7 */ 7 */
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/irq.h>
9#include <asm/machvec.h> 10#include <asm/machvec.h>
10#include <asm/shmin.h> 11#include <asm/shmin.h>
11#include <asm/clock.h> 12#include <asm/clock.h>
12#include <asm/irq.h>
13#include <asm/io.h> 13#include <asm/io.h>
14 14
15#define PFC_PHCR 0xa400010eUL 15#define PFC_PHCR 0xa400010eUL
16#define INTC_ICR1 0xa4000010UL 16#define INTC_ICR1 0xa4000010UL
17#define INTC_IPRC 0xa4000016UL 17#define INTC_IPRC 0xa4000016UL
18 18
19static struct ipr_data shmin_ipr_map[] = { 19static struct ipr_data ipr_irq_table[] = {
20 { .irq=32, .addr=INTC_IPRC, .shift= 0, .priority=0 }, 20 { 32, 0, 0, 0 },
21 { .irq=33, .addr=INTC_IPRC, .shift= 4, .priority=0 }, 21 { 33, 0, 4, 0 },
22 { .irq=34, .addr=INTC_IPRC, .shift= 8, .priority=8 }, 22 { 34, 0, 8, 8 },
23 { .irq=35, .addr=INTC_IPRC, .shift=12, .priority=0 }, 23 { 35, 0, 12, 0 },
24};
25
26static unsigned long ipr_offsets[] = {
27 INTC_IPRC,
28};
29
30static struct ipr_desc ipr_irq_desc = {
31 .ipr_offsets = ipr_offsets,
32 .nr_offsets = ARRAY_SIZE(ipr_offsets),
33
34 .ipr_data = ipr_irq_table,
35 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
36
37 .chip = {
38 .name = "IPR-shmin",
39 },
24}; 40};
25 41
26static void __init init_shmin_irq(void) 42static void __init init_shmin_irq(void)
27{ 43{
28 ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ 44 ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ
29 ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active. 45 ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active.
30 make_ipr_irq(shmin_ipr_map, ARRAY_SIZE(shmin_ipr_map)); 46 register_ipr_controller(&ipr_irq_desc);
31} 47}
32 48
33static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size) 49static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size)
diff --git a/arch/sh/boards/snapgear/setup.c b/arch/sh/boards/snapgear/setup.c
index b40124c092f5..84271d85a8dd 100644
--- a/arch/sh/boards/snapgear/setup.c
+++ b/arch/sh/boards/snapgear/setup.c
@@ -68,11 +68,27 @@ module_init(eraseconfig_init);
68 * IRL3 = crypto 68 * IRL3 = crypto
69 */ 69 */
70 70
71static struct ipr_data snapgear_ipr_map[] = { 71static struct ipr_data ipr_irq_table[] = {
72 make_ipr_irq(IRL0_IRQ, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY); 72 { IRL0_IRQ, 0, IRL0_IPR_POS, IRL0_PRIORITY },
73 make_ipr_irq(IRL1_IRQ, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY); 73 { IRL1_IRQ, 0, IRL1_IPR_POS, IRL1_PRIORITY },
74 make_ipr_irq(IRL2_IRQ, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY); 74 { IRL2_IRQ, 0, IRL2_IPR_POS, IRL2_PRIORITY },
75 make_ipr_irq(IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY); 75 { IRL3_IRQ, 0, IRL3_IPR_POS, IRL3_PRIORITY },
76};
77
78static unsigned long ipr_offsets[] = {
79 INTC_IPRD,
80};
81
82static struct ipr_desc ipr_irq_desc = {
83 .ipr_offsets = ipr_offsets,
84 .nr_offsets = ARRAY_SIZE(ipr_offsets),
85
86 .ipr_data = ipr_irq_table,
87 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
88
89 .chip = {
90 .name = "IPR-snapgear",
91 },
76}; 92};
77 93
78static void __init init_snapgear_IRQ(void) 94static void __init init_snapgear_IRQ(void)
@@ -82,7 +98,7 @@ static void __init init_snapgear_IRQ(void)
82 98
83 printk("Setup SnapGear IRQ/IPR ...\n"); 99 printk("Setup SnapGear IRQ/IPR ...\n");
84 100
85 make_ipr_irq(snapgear_ipr_map, ARRAY_SIZE(snapgear_ipr_map)); 101 register_ipr_controller(&ipr_irq_desc);
86} 102}
87 103
88/* 104/*
diff --git a/arch/sh/boards/titan/setup.c b/arch/sh/boards/titan/setup.c
index 630f62f69a36..606d25a4b870 100644
--- a/arch/sh/boards/titan/setup.c
+++ b/arch/sh/boards/titan/setup.c
@@ -12,7 +12,7 @@
12#include <asm/titan.h> 12#include <asm/titan.h>
13#include <asm/io.h> 13#include <asm/io.h>
14 14
15static struct ipr_data titan_ipr_map[] = { 15static struct ipr_data ipr_irq_table[] = {
16 /* IRQ, IPR idx, shift, prio */ 16 /* IRQ, IPR idx, shift, prio */
17 { TITAN_IRQ_WAN, 3, 12, 8 }, /* eth0 (WAN) */ 17 { TITAN_IRQ_WAN, 3, 12, 8 }, /* eth0 (WAN) */
18 { TITAN_IRQ_LAN, 3, 8, 8 }, /* eth1 (LAN) */ 18 { TITAN_IRQ_LAN, 3, 8, 8 }, /* eth1 (LAN) */
@@ -20,12 +20,30 @@ static struct ipr_data titan_ipr_map[] = {
20 { TITAN_IRQ_USB, 3, 0, 8 }, /* mPCI B (bottom), USB */ 20 { TITAN_IRQ_USB, 3, 0, 8 }, /* mPCI B (bottom), USB */
21}; 21};
22 22
23static unsigned long ipr_offsets[] = { /* stolen from setup-sh7750.c */
24 0xffd00004UL, /* 0: IPRA */
25 0xffd00008UL, /* 1: IPRB */
26 0xffd0000cUL, /* 2: IPRC */
27 0xffd00010UL, /* 3: IPRD */
28};
29
30static struct ipr_desc ipr_irq_desc = {
31 .ipr_offsets = ipr_offsets,
32 .nr_offsets = ARRAY_SIZE(ipr_offsets),
33
34 .ipr_data = ipr_irq_table,
35 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
36
37 .chip = {
38 .name = "IPR-titan",
39 },
40};
23static void __init init_titan_irq(void) 41static void __init init_titan_irq(void)
24{ 42{
25 /* enable individual interrupt mode for externals */ 43 /* enable individual interrupt mode for externals */
26 ipr_irq_enable_irlm(); 44 ipr_irq_enable_irlm();
27 /* register ipr irqs */ 45 /* register ipr irqs */
28 make_ipr_irq(titan_ipr_map, ARRAY_SIZE(titan_ipr_map)); 46 register_ipr_controller(&ipr_irq_desc);
29} 47}
30 48
31static struct sh_machine_vector mv_titan __initmv = { 49static struct sh_machine_vector mv_titan __initmv = {