diff options
Diffstat (limited to 'arch/m32r/platforms/mappi3/setup.c')
-rw-r--r-- | arch/m32r/platforms/mappi3/setup.c | 92 |
1 files changed, 31 insertions, 61 deletions
diff --git a/arch/m32r/platforms/mappi3/setup.c b/arch/m32r/platforms/mappi3/setup.c index 882de25c6e8..b44f5ded2bb 100644 --- a/arch/m32r/platforms/mappi3/setup.c +++ b/arch/m32r/platforms/mappi3/setup.c | |||
@@ -46,128 +46,98 @@ static void enable_mappi3_irq(unsigned int irq) | |||
46 | outl(data, port); | 46 | outl(data, port); |
47 | } | 47 | } |
48 | 48 | ||
49 | static void mask_and_ack_mappi3(unsigned int irq) | 49 | static void mask_mappi3(struct irq_data *data) |
50 | { | 50 | { |
51 | disable_mappi3_irq(irq); | 51 | disable_mappi3_irq(data->irq); |
52 | } | 52 | } |
53 | 53 | ||
54 | static void end_mappi3_irq(unsigned int irq) | 54 | static void unmask_mappi3(struct irq_data *data) |
55 | { | 55 | { |
56 | enable_mappi3_irq(irq); | 56 | enable_mappi3_irq(data->irq); |
57 | } | 57 | } |
58 | 58 | ||
59 | static unsigned int startup_mappi3_irq(unsigned int irq) | 59 | static void shutdown_mappi3(struct irq_data *data) |
60 | { | ||
61 | enable_mappi3_irq(irq); | ||
62 | return (0); | ||
63 | } | ||
64 | |||
65 | static void shutdown_mappi3_irq(unsigned int irq) | ||
66 | { | 60 | { |
67 | unsigned long port; | 61 | unsigned long port; |
68 | 62 | ||
69 | port = irq2port(irq); | 63 | port = irq2port(data->irq); |
70 | outl(M32R_ICUCR_ILEVEL7, port); | 64 | outl(M32R_ICUCR_ILEVEL7, port); |
71 | } | 65 | } |
72 | 66 | ||
73 | static struct irq_chip mappi3_irq_type = | 67 | static struct irq_chip mappi3_irq_type = { |
74 | { | 68 | .name = "MAPPI3-IRQ", |
75 | .name = "MAPPI3-IRQ", | 69 | .irq_shutdown = shutdown_mappi3, |
76 | .startup = startup_mappi3_irq, | 70 | .irq_mask = mask_mappi3, |
77 | .shutdown = shutdown_mappi3_irq, | 71 | .irq_unmask = unmask_mappi3, |
78 | .enable = enable_mappi3_irq, | ||
79 | .disable = disable_mappi3_irq, | ||
80 | .ack = mask_and_ack_mappi3, | ||
81 | .end = end_mappi3_irq | ||
82 | }; | 72 | }; |
83 | 73 | ||
84 | void __init init_IRQ(void) | 74 | void __init init_IRQ(void) |
85 | { | 75 | { |
86 | #if defined(CONFIG_SMC91X) | 76 | #if defined(CONFIG_SMC91X) |
87 | /* INT0 : LAN controller (SMC91111) */ | 77 | /* INT0 : LAN controller (SMC91111) */ |
88 | irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED; | 78 | set_irq_chip_and_handler(M32R_IRQ_INT0, &mappi3_irq_type, |
89 | irq_desc[M32R_IRQ_INT0].chip = &mappi3_irq_type; | 79 | handle_level_irq); |
90 | irq_desc[M32R_IRQ_INT0].action = 0; | ||
91 | irq_desc[M32R_IRQ_INT0].depth = 1; | ||
92 | icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; | 80 | icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; |
93 | disable_mappi3_irq(M32R_IRQ_INT0); | 81 | disable_mappi3_irq(M32R_IRQ_INT0); |
94 | #endif /* CONFIG_SMC91X */ | 82 | #endif /* CONFIG_SMC91X */ |
95 | 83 | ||
96 | /* MFT2 : system timer */ | 84 | /* MFT2 : system timer */ |
97 | irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; | 85 | set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi3_irq_type, |
98 | irq_desc[M32R_IRQ_MFT2].chip = &mappi3_irq_type; | 86 | handle_level_irq); |
99 | irq_desc[M32R_IRQ_MFT2].action = 0; | ||
100 | irq_desc[M32R_IRQ_MFT2].depth = 1; | ||
101 | icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; | 87 | icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; |
102 | disable_mappi3_irq(M32R_IRQ_MFT2); | 88 | disable_mappi3_irq(M32R_IRQ_MFT2); |
103 | 89 | ||
104 | #ifdef CONFIG_SERIAL_M32R_SIO | 90 | #ifdef CONFIG_SERIAL_M32R_SIO |
105 | /* SIO0_R : uart receive data */ | 91 | /* SIO0_R : uart receive data */ |
106 | irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; | 92 | set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi3_irq_type, |
107 | irq_desc[M32R_IRQ_SIO0_R].chip = &mappi3_irq_type; | 93 | handle_level_irq); |
108 | irq_desc[M32R_IRQ_SIO0_R].action = 0; | ||
109 | irq_desc[M32R_IRQ_SIO0_R].depth = 1; | ||
110 | icu_data[M32R_IRQ_SIO0_R].icucr = 0; | 94 | icu_data[M32R_IRQ_SIO0_R].icucr = 0; |
111 | disable_mappi3_irq(M32R_IRQ_SIO0_R); | 95 | disable_mappi3_irq(M32R_IRQ_SIO0_R); |
112 | 96 | ||
113 | /* SIO0_S : uart send data */ | 97 | /* SIO0_S : uart send data */ |
114 | irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; | 98 | set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi3_irq_type, |
115 | irq_desc[M32R_IRQ_SIO0_S].chip = &mappi3_irq_type; | 99 | handle_level_irq); |
116 | irq_desc[M32R_IRQ_SIO0_S].action = 0; | ||
117 | irq_desc[M32R_IRQ_SIO0_S].depth = 1; | ||
118 | icu_data[M32R_IRQ_SIO0_S].icucr = 0; | 100 | icu_data[M32R_IRQ_SIO0_S].icucr = 0; |
119 | disable_mappi3_irq(M32R_IRQ_SIO0_S); | 101 | disable_mappi3_irq(M32R_IRQ_SIO0_S); |
120 | /* SIO1_R : uart receive data */ | 102 | /* SIO1_R : uart receive data */ |
121 | irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; | 103 | set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi3_irq_type, |
122 | irq_desc[M32R_IRQ_SIO1_R].chip = &mappi3_irq_type; | 104 | handle_level_irq); |
123 | irq_desc[M32R_IRQ_SIO1_R].action = 0; | ||
124 | irq_desc[M32R_IRQ_SIO1_R].depth = 1; | ||
125 | icu_data[M32R_IRQ_SIO1_R].icucr = 0; | 105 | icu_data[M32R_IRQ_SIO1_R].icucr = 0; |
126 | disable_mappi3_irq(M32R_IRQ_SIO1_R); | 106 | disable_mappi3_irq(M32R_IRQ_SIO1_R); |
127 | 107 | ||
128 | /* SIO1_S : uart send data */ | 108 | /* SIO1_S : uart send data */ |
129 | irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; | 109 | set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi3_irq_type, |
130 | irq_desc[M32R_IRQ_SIO1_S].chip = &mappi3_irq_type; | 110 | handle_level_irq); |
131 | irq_desc[M32R_IRQ_SIO1_S].action = 0; | ||
132 | irq_desc[M32R_IRQ_SIO1_S].depth = 1; | ||
133 | icu_data[M32R_IRQ_SIO1_S].icucr = 0; | 111 | icu_data[M32R_IRQ_SIO1_S].icucr = 0; |
134 | disable_mappi3_irq(M32R_IRQ_SIO1_S); | 112 | disable_mappi3_irq(M32R_IRQ_SIO1_S); |
135 | #endif /* CONFIG_M32R_USE_DBG_CONSOLE */ | 113 | #endif /* CONFIG_M32R_USE_DBG_CONSOLE */ |
136 | 114 | ||
137 | #if defined(CONFIG_USB) | 115 | #if defined(CONFIG_USB) |
138 | /* INT1 : USB Host controller interrupt */ | 116 | /* INT1 : USB Host controller interrupt */ |
139 | irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED; | 117 | set_irq_chip_and_handler(M32R_IRQ_INT1, &mappi3_irq_type, |
140 | irq_desc[M32R_IRQ_INT1].chip = &mappi3_irq_type; | 118 | handle_level_irq); |
141 | irq_desc[M32R_IRQ_INT1].action = 0; | ||
142 | irq_desc[M32R_IRQ_INT1].depth = 1; | ||
143 | icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01; | 119 | icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01; |
144 | disable_mappi3_irq(M32R_IRQ_INT1); | 120 | disable_mappi3_irq(M32R_IRQ_INT1); |
145 | #endif /* CONFIG_USB */ | 121 | #endif /* CONFIG_USB */ |
146 | 122 | ||
147 | /* CFC IREQ */ | 123 | /* CFC IREQ */ |
148 | irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; | 124 | set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &mappi3_irq_type, |
149 | irq_desc[PLD_IRQ_CFIREQ].chip = &mappi3_irq_type; | 125 | handle_level_irq); |
150 | irq_desc[PLD_IRQ_CFIREQ].action = 0; | ||
151 | irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ | ||
152 | icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; | 126 | icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; |
153 | disable_mappi3_irq(PLD_IRQ_CFIREQ); | 127 | disable_mappi3_irq(PLD_IRQ_CFIREQ); |
154 | 128 | ||
155 | #if defined(CONFIG_M32R_CFC) | 129 | #if defined(CONFIG_M32R_CFC) |
156 | /* ICUCR41: CFC Insert & eject */ | 130 | /* ICUCR41: CFC Insert & eject */ |
157 | irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; | 131 | set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &mappi3_irq_type, |
158 | irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi3_irq_type; | 132 | handle_level_irq); |
159 | irq_desc[PLD_IRQ_CFC_INSERT].action = 0; | ||
160 | irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ | ||
161 | icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; | 133 | icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; |
162 | disable_mappi3_irq(PLD_IRQ_CFC_INSERT); | 134 | disable_mappi3_irq(PLD_IRQ_CFC_INSERT); |
163 | 135 | ||
164 | #endif /* CONFIG_M32R_CFC */ | 136 | #endif /* CONFIG_M32R_CFC */ |
165 | 137 | ||
166 | /* IDE IREQ */ | 138 | /* IDE IREQ */ |
167 | irq_desc[PLD_IRQ_IDEIREQ].status = IRQ_DISABLED; | 139 | set_irq_chip_and_handler(PLD_IRQ_IDEIREQ, &mappi3_irq_type, |
168 | irq_desc[PLD_IRQ_IDEIREQ].chip = &mappi3_irq_type; | 140 | handle_level_irq); |
169 | irq_desc[PLD_IRQ_IDEIREQ].action = 0; | ||
170 | irq_desc[PLD_IRQ_IDEIREQ].depth = 1; /* disable nested irq */ | ||
171 | icu_data[PLD_IRQ_IDEIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; | 141 | icu_data[PLD_IRQ_IDEIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; |
172 | disable_mappi3_irq(PLD_IRQ_IDEIREQ); | 142 | disable_mappi3_irq(PLD_IRQ_IDEIREQ); |
173 | 143 | ||