aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2012-12-13 22:19:24 -0500
committerBob Liu <lliubbo@gmail.com>2012-12-13 22:20:22 -0500
commit86794b43569c9b8936dff2e8eed503393379af6e (patch)
treea1e22a88f584c300792167de4b59bae7ec37d9a3 /arch/blackfin
parent1439d030b9032261f1111a2dd16b9a8ca11112ef (diff)
blackfin: SEC: clean up SEC interrupt initialization
Append the SEC IRQ after the IVG6, which is consistent to BF5xx SIC. Exclude SIC irqchip fucntions from SEC code. Call handle_fasteoi_irq in SEC error and fault handler. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/include/mach-common/irq.h5
-rw-r--r--arch/blackfin/mach-bf609/include/mach/irq.h3
-rw-r--r--arch/blackfin/mach-bf609/pm.c3
-rw-r--r--arch/blackfin/mach-common/ints-priority.c272
4 files changed, 137 insertions, 146 deletions
diff --git a/arch/blackfin/include/mach-common/irq.h b/arch/blackfin/include/mach-common/irq.h
index cab14e911dc2..af9fc8171ebc 100644
--- a/arch/blackfin/include/mach-common/irq.h
+++ b/arch/blackfin/include/mach-common/irq.h
@@ -40,8 +40,6 @@
40#define IRQ_HWERR 5 /* Hardware Error */ 40#define IRQ_HWERR 5 /* Hardware Error */
41#define IRQ_CORETMR 6 /* Core timer */ 41#define IRQ_CORETMR 6 /* Core timer */
42 42
43#define BFIN_IRQ(x) ((x) + 7)
44
45#define IVG7 7 43#define IVG7 7
46#define IVG8 8 44#define IVG8 8
47#define IVG9 9 45#define IVG9 9
@@ -52,6 +50,9 @@
52#define IVG14 14 50#define IVG14 14
53#define IVG15 15 51#define IVG15 15
54 52
53#define BFIN_IRQ(x) ((x) + IVG7)
54#define BFIN_SYSIRQ(x) ((x) - IVG7)
55
55#define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS) 56#define NR_IRQS (NR_MACH_IRQS + NR_SPARE_IRQS)
56 57
57#endif 58#endif
diff --git a/arch/blackfin/mach-bf609/include/mach/irq.h b/arch/blackfin/mach-bf609/include/mach/irq.h
index 23e74cdeeee8..fa0843d5d77a 100644
--- a/arch/blackfin/mach-bf609/include/mach/irq.h
+++ b/arch/blackfin/mach-bf609/include/mach/irq.h
@@ -9,9 +9,6 @@
9 9
10#include <mach-common/irq.h> 10#include <mach-common/irq.h>
11 11
12#undef BFIN_IRQ
13#define BFIN_IRQ(x) ((x) + IVG15)
14
15#define NR_PERI_INTS (5 * 32) 12#define NR_PERI_INTS (5 * 32)
16 13
17#define IRQ_SEC_ERR BFIN_IRQ(0) /* SEC Error */ 14#define IRQ_SEC_ERR BFIN_IRQ(0) /* SEC Error */
diff --git a/arch/blackfin/mach-bf609/pm.c b/arch/blackfin/mach-bf609/pm.c
index dacafc163f76..ad505d9db4a8 100644
--- a/arch/blackfin/mach-bf609/pm.c
+++ b/arch/blackfin/mach-bf609/pm.c
@@ -174,7 +174,6 @@ void bfin_hibernate_syscontrol(void)
174 bfin_write32(DPM0_RESTORE5, bfin_read32(DPM0_RESTORE5) | 4); 174 bfin_write32(DPM0_RESTORE5, bfin_read32(DPM0_RESTORE5) | 4);
175} 175}
176 176
177#define IRQ_SID(irq) ((irq) - IVG15)
178asmlinkage void enter_deepsleep(void); 177asmlinkage void enter_deepsleep(void);
179 178
180__attribute__((l1_text)) 179__attribute__((l1_text))
@@ -311,7 +310,7 @@ static irqreturn_t test_isr(int irq, void *dev_id)
311{ 310{
312 printk(KERN_DEBUG "gpio irq %d\n", irq); 311 printk(KERN_DEBUG "gpio irq %d\n", irq);
313 if (irq == 231) 312 if (irq == 231)
314 bfin_sec_raise_irq(IRQ_SID(IRQ_SOFT1)); 313 bfin_sec_raise_irq(BFIN_SYSIRQ(IRQ_SOFT1));
315 return IRQ_HANDLED; 314 return IRQ_HANDLED;
316} 315}
317 316
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index 902bebc434c6..83ff311fd6ea 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -28,12 +28,6 @@
28#include <asm/dpmc.h> 28#include <asm/dpmc.h>
29#include <asm/traps.h> 29#include <asm/traps.h>
30 30
31#ifndef SEC_GCTL
32# define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
33#else
34# define SIC_SYSIRQ(irq) ((irq) - IVG15)
35#endif
36
37/* 31/*
38 * NOTES: 32 * NOTES:
39 * - we have separated the physical Hardware interrupt from the 33 * - we have separated the physical Hardware interrupt from the
@@ -141,13 +135,13 @@ static void bfin_core_unmask_irq(struct irq_data *d)
141 return; 135 return;
142} 136}
143 137
138#ifndef SEC_GCTL
144void bfin_internal_mask_irq(unsigned int irq) 139void bfin_internal_mask_irq(unsigned int irq)
145{ 140{
146 unsigned long flags = hard_local_irq_save(); 141 unsigned long flags = hard_local_irq_save();
147#ifndef SEC_GCTL
148#ifdef SIC_IMASK0 142#ifdef SIC_IMASK0
149 unsigned mask_bank = SIC_SYSIRQ(irq) / 32; 143 unsigned mask_bank = BFIN_SYSIRQ(irq) / 32;
150 unsigned mask_bit = SIC_SYSIRQ(irq) % 32; 144 unsigned mask_bit = BFIN_SYSIRQ(irq) % 32;
151 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) & 145 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) &
152 ~(1 << mask_bit)); 146 ~(1 << mask_bit));
153# if defined(CONFIG_SMP) || defined(CONFIG_ICC) 147# if defined(CONFIG_SMP) || defined(CONFIG_ICC)
@@ -156,9 +150,8 @@ void bfin_internal_mask_irq(unsigned int irq)
156# endif 150# endif
157#else 151#else
158 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() & 152 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() &
159 ~(1 << SIC_SYSIRQ(irq))); 153 ~(1 << BFIN_SYSIRQ(irq)));
160#endif /* end of SIC_IMASK0 */ 154#endif /* end of SIC_IMASK0 */
161#endif
162 hard_local_irq_restore(flags); 155 hard_local_irq_restore(flags);
163} 156}
164 157
@@ -176,10 +169,9 @@ void bfin_internal_unmask_irq(unsigned int irq)
176{ 169{
177 unsigned long flags = hard_local_irq_save(); 170 unsigned long flags = hard_local_irq_save();
178 171
179#ifndef SEC_GCTL
180#ifdef SIC_IMASK0 172#ifdef SIC_IMASK0
181 unsigned mask_bank = SIC_SYSIRQ(irq) / 32; 173 unsigned mask_bank = BFIN_SYSIRQ(irq) / 32;
182 unsigned mask_bit = SIC_SYSIRQ(irq) % 32; 174 unsigned mask_bit = BFIN_SYSIRQ(irq) % 32;
183# ifdef CONFIG_SMP 175# ifdef CONFIG_SMP
184 if (cpumask_test_cpu(0, affinity)) 176 if (cpumask_test_cpu(0, affinity))
185# endif 177# endif
@@ -194,17 +186,103 @@ void bfin_internal_unmask_irq(unsigned int irq)
194# endif 186# endif
195#else 187#else
196 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() | 188 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() |
197 (1 << SIC_SYSIRQ(irq))); 189 (1 << BFIN_SYSIRQ(irq)));
190#endif
191 hard_local_irq_restore(flags);
192}
193
194#ifdef CONFIG_SMP
195static void bfin_internal_unmask_irq_chip(struct irq_data *d)
196{
197 bfin_internal_unmask_irq_affinity(d->irq, d->affinity);
198}
199
200static int bfin_internal_set_affinity(struct irq_data *d,
201 const struct cpumask *mask, bool force)
202{
203 bfin_internal_mask_irq(d->irq);
204 bfin_internal_unmask_irq_affinity(d->irq, mask);
205
206 return 0;
207}
208#else
209static void bfin_internal_unmask_irq_chip(struct irq_data *d)
210{
211 bfin_internal_unmask_irq(d->irq);
212}
198#endif 213#endif
214
215#if defined(CONFIG_PM)
216int bfin_internal_set_wake(unsigned int irq, unsigned int state)
217{
218 u32 bank, bit, wakeup = 0;
219 unsigned long flags;
220 bank = BFIN_SYSIRQ(irq) / 32;
221 bit = BFIN_SYSIRQ(irq) % 32;
222
223 switch (irq) {
224#ifdef IRQ_RTC
225 case IRQ_RTC:
226 wakeup |= WAKE;
227 break;
228#endif
229#ifdef IRQ_CAN0_RX
230 case IRQ_CAN0_RX:
231 wakeup |= CANWE;
232 break;
199#endif 233#endif
234#ifdef IRQ_CAN1_RX
235 case IRQ_CAN1_RX:
236 wakeup |= CANWE;
237 break;
238#endif
239#ifdef IRQ_USB_INT0
240 case IRQ_USB_INT0:
241 wakeup |= USBWE;
242 break;
243#endif
244#ifdef CONFIG_BF54x
245 case IRQ_CNT:
246 wakeup |= ROTWE;
247 break;
248#endif
249 default:
250 break;
251 }
252
253 flags = hard_local_irq_save();
254
255 if (state) {
256 bfin_sic_iwr[bank] |= (1 << bit);
257 vr_wakeup |= wakeup;
258
259 } else {
260 bfin_sic_iwr[bank] &= ~(1 << bit);
261 vr_wakeup &= ~wakeup;
262 }
263
200 hard_local_irq_restore(flags); 264 hard_local_irq_restore(flags);
265
266 return 0;
201} 267}
202 268
203#ifdef SEC_GCTL 269static int bfin_internal_set_wake_chip(struct irq_data *d, unsigned int state)
270{
271 return bfin_internal_set_wake(d->irq, state);
272}
273#else
274inline int bfin_internal_set_wake(unsigned int irq, unsigned int state)
275{
276 return 0;
277}
278# define bfin_internal_set_wake_chip NULL
279#endif
280
281#else /* SEC_GCTL */
204static void bfin_sec_preflow_handler(struct irq_data *d) 282static void bfin_sec_preflow_handler(struct irq_data *d)
205{ 283{
206 unsigned long flags = hard_local_irq_save(); 284 unsigned long flags = hard_local_irq_save();
207 unsigned int sid = SIC_SYSIRQ(d->irq); 285 unsigned int sid = BFIN_SYSIRQ(d->irq);
208 286
209 bfin_write_SEC_SCI(0, SEC_CSID, sid); 287 bfin_write_SEC_SCI(0, SEC_CSID, sid);
210 288
@@ -214,7 +292,7 @@ static void bfin_sec_preflow_handler(struct irq_data *d)
214static void bfin_sec_mask_ack_irq(struct irq_data *d) 292static void bfin_sec_mask_ack_irq(struct irq_data *d)
215{ 293{
216 unsigned long flags = hard_local_irq_save(); 294 unsigned long flags = hard_local_irq_save();
217 unsigned int sid = SIC_SYSIRQ(d->irq); 295 unsigned int sid = BFIN_SYSIRQ(d->irq);
218 296
219 bfin_write_SEC_SCI(0, SEC_CSID, sid); 297 bfin_write_SEC_SCI(0, SEC_CSID, sid);
220 298
@@ -224,7 +302,7 @@ static void bfin_sec_mask_ack_irq(struct irq_data *d)
224static void bfin_sec_unmask_irq(struct irq_data *d) 302static void bfin_sec_unmask_irq(struct irq_data *d)
225{ 303{
226 unsigned long flags = hard_local_irq_save(); 304 unsigned long flags = hard_local_irq_save();
227 unsigned int sid = SIC_SYSIRQ(d->irq); 305 unsigned int sid = BFIN_SYSIRQ(d->irq);
228 306
229 bfin_write32(SEC_END, sid); 307 bfin_write32(SEC_END, sid);
230 308
@@ -269,7 +347,7 @@ static void bfin_sec_enable_sci(unsigned int sid)
269 unsigned long flags = hard_local_irq_save(); 347 unsigned long flags = hard_local_irq_save();
270 uint32_t reg_sctl = bfin_read_SEC_SCTL(sid); 348 uint32_t reg_sctl = bfin_read_SEC_SCTL(sid);
271 349
272 if (sid == SIC_SYSIRQ(IRQ_WATCH0)) 350 if (sid == BFIN_SYSIRQ(IRQ_WATCH0))
273 reg_sctl |= SEC_SCTL_FAULT_EN; 351 reg_sctl |= SEC_SCTL_FAULT_EN;
274 else 352 else
275 reg_sctl |= SEC_SCTL_INT_EN; 353 reg_sctl |= SEC_SCTL_INT_EN;
@@ -292,7 +370,7 @@ static void bfin_sec_disable_sci(unsigned int sid)
292static void bfin_sec_enable(struct irq_data *d) 370static void bfin_sec_enable(struct irq_data *d)
293{ 371{
294 unsigned long flags = hard_local_irq_save(); 372 unsigned long flags = hard_local_irq_save();
295 unsigned int sid = SIC_SYSIRQ(d->irq); 373 unsigned int sid = BFIN_SYSIRQ(d->irq);
296 374
297 bfin_sec_enable_sci(sid); 375 bfin_sec_enable_sci(sid);
298 bfin_sec_enable_ssi(sid); 376 bfin_sec_enable_ssi(sid);
@@ -303,7 +381,7 @@ static void bfin_sec_enable(struct irq_data *d)
303static void bfin_sec_disable(struct irq_data *d) 381static void bfin_sec_disable(struct irq_data *d)
304{ 382{
305 unsigned long flags = hard_local_irq_save(); 383 unsigned long flags = hard_local_irq_save();
306 unsigned int sid = SIC_SYSIRQ(d->irq); 384 unsigned int sid = BFIN_SYSIRQ(d->irq);
307 385
308 bfin_sec_disable_sci(sid); 386 bfin_sec_disable_sci(sid);
309 bfin_sec_disable_ssi(sid); 387 bfin_sec_disable_ssi(sid);
@@ -328,9 +406,10 @@ static void bfin_sec_set_priority(unsigned int sec_int_levels, u8 *sec_int_prior
328 hard_local_irq_restore(flags); 406 hard_local_irq_restore(flags);
329} 407}
330 408
331void bfin_sec_raise_irq(unsigned int sid) 409void bfin_sec_raise_irq(unsigned int irq)
332{ 410{
333 unsigned long flags = hard_local_irq_save(); 411 unsigned long flags = hard_local_irq_save();
412 unsigned int sid = BFIN_SYSIRQ(irq);
334 413
335 bfin_write32(SEC_RAISE, sid); 414 bfin_write32(SEC_RAISE, sid);
336 415
@@ -341,8 +420,13 @@ static void init_software_driven_irq(void)
341{ 420{
342 bfin_sec_set_ssi_coreid(34, 0); 421 bfin_sec_set_ssi_coreid(34, 0);
343 bfin_sec_set_ssi_coreid(35, 1); 422 bfin_sec_set_ssi_coreid(35, 1);
423
424 bfin_sec_enable_sci(35);
425 bfin_sec_enable_ssi(35);
344 bfin_sec_set_ssi_coreid(36, 0); 426 bfin_sec_set_ssi_coreid(36, 0);
345 bfin_sec_set_ssi_coreid(37, 1); 427 bfin_sec_set_ssi_coreid(37, 1);
428 bfin_sec_enable_sci(37);
429 bfin_sec_enable_ssi(37);
346} 430}
347 431
348void bfin_sec_resume(void) 432void bfin_sec_resume(void)
@@ -412,6 +496,8 @@ void handle_sec_fault(unsigned int irq, struct irq_desc *desc)
412 } 496 }
413 497
414 raw_spin_unlock(&desc->lock); 498 raw_spin_unlock(&desc->lock);
499
500 handle_fasteoi_irq(irq, desc);
415} 501}
416 502
417void handle_core_fault(unsigned int irq, struct irq_desc *desc) 503void handle_core_fault(unsigned int irq, struct irq_desc *desc)
@@ -431,105 +517,18 @@ void handle_core_fault(unsigned int irq, struct irq_desc *desc)
431 printk(KERN_NOTICE "Kernel Stack\n"); 517 printk(KERN_NOTICE "Kernel Stack\n");
432 show_stack(current, NULL); 518 show_stack(current, NULL);
433 print_modules(); 519 print_modules();
434 panic("Kernel core hardware error"); 520 panic("Core 0 hardware error");
435 break; 521 break;
436 case IRQ_C0_NMI_L1_PARITY_ERR: 522 case IRQ_C0_NMI_L1_PARITY_ERR:
437 panic("NMI occurs unexpectedly"); 523 panic("Core 0 NMI L1 parity error");
438 break; 524 break;
439 default: 525 default:
440 panic("Core 1 fault occurs unexpectedly"); 526 panic("Core 1 fault %d occurs unexpectedly", irq);
441 } 527 }
442 528
443 raw_spin_unlock(&desc->lock); 529 raw_spin_unlock(&desc->lock);
444} 530}
445#endif 531#endif /* SEC_GCTL */
446
447#ifdef CONFIG_SMP
448static void bfin_internal_unmask_irq_chip(struct irq_data *d)
449{
450 bfin_internal_unmask_irq_affinity(d->irq, d->affinity);
451}
452
453static int bfin_internal_set_affinity(struct irq_data *d,
454 const struct cpumask *mask, bool force)
455{
456 bfin_internal_mask_irq(d->irq);
457 bfin_internal_unmask_irq_affinity(d->irq, mask);
458
459 return 0;
460}
461#else
462static void bfin_internal_unmask_irq_chip(struct irq_data *d)
463{
464 bfin_internal_unmask_irq(d->irq);
465}
466#endif
467
468#if defined(CONFIG_PM) && !defined(SEC_GCTL)
469int bfin_internal_set_wake(unsigned int irq, unsigned int state)
470{
471 u32 bank, bit, wakeup = 0;
472 unsigned long flags;
473 bank = SIC_SYSIRQ(irq) / 32;
474 bit = SIC_SYSIRQ(irq) % 32;
475
476 switch (irq) {
477#ifdef IRQ_RTC
478 case IRQ_RTC:
479 wakeup |= WAKE;
480 break;
481#endif
482#ifdef IRQ_CAN0_RX
483 case IRQ_CAN0_RX:
484 wakeup |= CANWE;
485 break;
486#endif
487#ifdef IRQ_CAN1_RX
488 case IRQ_CAN1_RX:
489 wakeup |= CANWE;
490 break;
491#endif
492#ifdef IRQ_USB_INT0
493 case IRQ_USB_INT0:
494 wakeup |= USBWE;
495 break;
496#endif
497#ifdef CONFIG_BF54x
498 case IRQ_CNT:
499 wakeup |= ROTWE;
500 break;
501#endif
502 default:
503 break;
504 }
505
506 flags = hard_local_irq_save();
507
508 if (state) {
509 bfin_sic_iwr[bank] |= (1 << bit);
510 vr_wakeup |= wakeup;
511
512 } else {
513 bfin_sic_iwr[bank] &= ~(1 << bit);
514 vr_wakeup &= ~wakeup;
515 }
516
517 hard_local_irq_restore(flags);
518
519 return 0;
520}
521
522static int bfin_internal_set_wake_chip(struct irq_data *d, unsigned int state)
523{
524 return bfin_internal_set_wake(d->irq, state);
525}
526#else
527inline int bfin_internal_set_wake(unsigned int irq, unsigned int state)
528{
529 return 0;
530}
531# define bfin_internal_set_wake_chip NULL
532#endif
533 532
534static struct irq_chip bfin_core_irqchip = { 533static struct irq_chip bfin_core_irqchip = {
535 .name = "CORE", 534 .name = "CORE",
@@ -537,6 +536,7 @@ static struct irq_chip bfin_core_irqchip = {
537 .irq_unmask = bfin_core_unmask_irq, 536 .irq_unmask = bfin_core_unmask_irq,
538}; 537};
539 538
539#ifndef SEC_GCTL
540static struct irq_chip bfin_internal_irqchip = { 540static struct irq_chip bfin_internal_irqchip = {
541 .name = "INTN", 541 .name = "INTN",
542 .irq_mask = bfin_internal_mask_irq_chip, 542 .irq_mask = bfin_internal_mask_irq_chip,
@@ -548,8 +548,7 @@ static struct irq_chip bfin_internal_irqchip = {
548#endif 548#endif
549 .irq_set_wake = bfin_internal_set_wake_chip, 549 .irq_set_wake = bfin_internal_set_wake_chip,
550}; 550};
551 551#else
552#ifdef SEC_GCTL
553static struct irq_chip bfin_sec_irqchip = { 552static struct irq_chip bfin_sec_irqchip = {
554 .name = "SEC", 553 .name = "SEC",
555 .irq_mask_ack = bfin_sec_mask_ack_irq, 554 .irq_mask_ack = bfin_sec_mask_ack_irq,
@@ -1138,7 +1137,9 @@ static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state)
1138 return -EINVAL; 1137 return -EINVAL;
1139 } 1138 }
1140 1139
1140#ifndef SEC_GCTL
1141 bfin_internal_set_wake(pint_irq, state); 1141 bfin_internal_set_wake(pint_irq, state);
1142#endif
1142 1143
1143 return 0; 1144 return 0;
1144} 1145}
@@ -1173,7 +1174,7 @@ static int sec_suspend(void)
1173 u32 bank; 1174 u32 bank;
1174 1175
1175 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) 1176 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++)
1176 save_pint_sec_ctl[bank] = bfin_read_SEC_SCTL(bank + SIC_SYSIRQ(IRQ_PINT0)); 1177 save_pint_sec_ctl[bank] = bfin_read_SEC_SCTL(bank + BFIN_SYSIRQ(IRQ_PINT0));
1177 return 0; 1178 return 0;
1178} 1179}
1179 1180
@@ -1187,7 +1188,7 @@ static void sec_resume(void)
1187 bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN); 1188 bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN);
1188 1189
1189 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) 1190 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++)
1190 bfin_write_SEC_SCTL(bank + SIC_SYSIRQ(IRQ_PINT0), save_pint_sec_ctl[bank]); 1191 bfin_write_SEC_SCTL(bank + BFIN_SYSIRQ(IRQ_PINT0), save_pint_sec_ctl[bank]);
1191} 1192}
1192 1193
1193static struct syscore_ops sec_pm_syscore_ops = { 1194static struct syscore_ops sec_pm_syscore_ops = {
@@ -1538,33 +1539,26 @@ int __init init_arch_irq(void)
1538 1539
1539 for (irq = 0; irq <= SYS_IRQS; irq++) { 1540 for (irq = 0; irq <= SYS_IRQS; irq++) {
1540 if (irq <= IRQ_CORETMR) { 1541 if (irq <= IRQ_CORETMR) {
1541 irq_set_chip(irq, &bfin_core_irqchip); 1542 irq_set_chip_and_handler(irq, &bfin_core_irqchip,
1542#ifdef CONFIG_TICKSOURCE_CORETMR 1543 handle_simple_irq);
1544#if defined(CONFIG_TICKSOURCE_CORETMR) && defined(CONFIG_SMP)
1543 if (irq == IRQ_CORETMR) 1545 if (irq == IRQ_CORETMR)
1544# ifdef CONFIG_SMP
1545 irq_set_handler(irq, handle_percpu_irq); 1546 irq_set_handler(irq, handle_percpu_irq);
1546# else
1547 irq_set_handler(irq, handle_simple_irq);
1548# endif
1549#endif 1547#endif
1550 } else if (irq < BFIN_IRQ(0)) {
1551 irq_set_chip_and_handler(irq, &bfin_internal_irqchip,
1552 handle_simple_irq);
1553 } else if (irq == IRQ_SEC_ERR) {
1554 irq_set_chip_and_handler(irq, &bfin_sec_irqchip,
1555 handle_sec_fault);
1556 } else if (irq < CORE_IRQS && irq >= IRQ_C0_DBL_FAULT) {
1557 irq_set_chip_and_handler(irq, &bfin_sec_irqchip,
1558 handle_core_fault);
1559 } else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) { 1548 } else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) {
1560 irq_set_chip(irq, &bfin_sec_irqchip); 1549 irq_set_chip(irq, &bfin_sec_irqchip);
1561 irq_set_chained_handler(irq, bfin_demux_gpio_irq); 1550 irq_set_chained_handler(irq, bfin_demux_gpio_irq);
1562 } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) { 1551 } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) {
1563 irq_set_chip(irq, &bfin_sec_irqchip);
1564 irq_set_handler(irq, handle_percpu_irq);
1565 } else {
1566 irq_set_chip_and_handler(irq, &bfin_sec_irqchip, 1552 irq_set_chip_and_handler(irq, &bfin_sec_irqchip,
1567 handle_fasteoi_irq); 1553 handle_percpu_irq);
1554 } else {
1555 irq_set_chip(irq, &bfin_sec_irqchip);
1556 if (irq == IRQ_SEC_ERR)
1557 irq_set_handler(irq, handle_sec_fault);
1558 else if (irq >= IRQ_C0_DBL_FAULT && irq < CORE_IRQS)
1559 irq_set_handler(irq, handle_core_fault);
1560 else
1561 irq_set_handler(irq, handle_fasteoi_irq);
1568 __irq_set_preflow_handler(irq, bfin_sec_preflow_handler); 1562 __irq_set_preflow_handler(irq, bfin_sec_preflow_handler);
1569 } 1563 }
1570 } 1564 }
@@ -1593,8 +1587,8 @@ int __init init_arch_irq(void)
1593 1587
1594 1588
1595 bfin_write_SEC_FCTL(SEC_FCTL_EN | SEC_FCTL_SYSRST_EN | SEC_FCTL_FLTIN_EN); 1589 bfin_write_SEC_FCTL(SEC_FCTL_EN | SEC_FCTL_SYSRST_EN | SEC_FCTL_FLTIN_EN);
1596 bfin_sec_enable_sci(SIC_SYSIRQ(IRQ_WATCH0)); 1590 bfin_sec_enable_sci(BFIN_SYSIRQ(IRQ_WATCH0));
1597 bfin_sec_enable_ssi(SIC_SYSIRQ(IRQ_WATCH0)); 1591 bfin_sec_enable_ssi(BFIN_SYSIRQ(IRQ_WATCH0));
1598 bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_RESET); 1592 bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_RESET);
1599 udelay(100); 1593 udelay(100);
1600 bfin_write_SEC_GCTL(SEC_GCTL_EN); 1594 bfin_write_SEC_GCTL(SEC_GCTL_EN);