diff options
Diffstat (limited to 'arch/blackfin/mach-common/ints-priority.c')
-rw-r--r-- | arch/blackfin/mach-common/ints-priority.c | 208 |
1 files changed, 121 insertions, 87 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index c4b94c42db83..a7e97a3607da 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <asm/irq_handler.h> | 27 | #include <asm/irq_handler.h> |
28 | #include <asm/dpmc.h> | 28 | #include <asm/dpmc.h> |
29 | 29 | ||
30 | #ifndef CONFIG_BF60x | 30 | #ifndef SEC_GCTL |
31 | # define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1)) | 31 | # define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1)) |
32 | #else | 32 | #else |
33 | # define SIC_SYSIRQ(irq) ((irq) - IVG15) | 33 | # define SIC_SYSIRQ(irq) ((irq) - IVG15) |
@@ -56,7 +56,7 @@ unsigned long bfin_sic_iwr[3]; /* Up to 3 SIC_IWRx registers */ | |||
56 | unsigned vr_wakeup; | 56 | unsigned vr_wakeup; |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #ifndef CONFIG_BF60x | 59 | #ifndef SEC_GCTL |
60 | static struct ivgx { | 60 | static struct ivgx { |
61 | /* irq number for request_irq, available in mach-bf5xx/irq.h */ | 61 | /* irq number for request_irq, available in mach-bf5xx/irq.h */ |
62 | unsigned int irqno; | 62 | unsigned int irqno; |
@@ -143,7 +143,7 @@ static void bfin_core_unmask_irq(struct irq_data *d) | |||
143 | void bfin_internal_mask_irq(unsigned int irq) | 143 | void bfin_internal_mask_irq(unsigned int irq) |
144 | { | 144 | { |
145 | unsigned long flags = hard_local_irq_save(); | 145 | unsigned long flags = hard_local_irq_save(); |
146 | #ifndef CONFIG_BF60x | 146 | #ifndef SEC_GCTL |
147 | #ifdef SIC_IMASK0 | 147 | #ifdef SIC_IMASK0 |
148 | unsigned mask_bank = SIC_SYSIRQ(irq) / 32; | 148 | unsigned mask_bank = SIC_SYSIRQ(irq) / 32; |
149 | unsigned mask_bit = SIC_SYSIRQ(irq) % 32; | 149 | unsigned mask_bit = SIC_SYSIRQ(irq) % 32; |
@@ -175,7 +175,7 @@ void bfin_internal_unmask_irq(unsigned int irq) | |||
175 | { | 175 | { |
176 | unsigned long flags = hard_local_irq_save(); | 176 | unsigned long flags = hard_local_irq_save(); |
177 | 177 | ||
178 | #ifndef CONFIG_BF60x | 178 | #ifndef SEC_GCTL |
179 | #ifdef SIC_IMASK0 | 179 | #ifdef SIC_IMASK0 |
180 | unsigned mask_bank = SIC_SYSIRQ(irq) / 32; | 180 | unsigned mask_bank = SIC_SYSIRQ(irq) / 32; |
181 | unsigned mask_bit = SIC_SYSIRQ(irq) % 32; | 181 | unsigned mask_bit = SIC_SYSIRQ(irq) % 32; |
@@ -199,7 +199,7 @@ void bfin_internal_unmask_irq(unsigned int irq) | |||
199 | hard_local_irq_restore(flags); | 199 | hard_local_irq_restore(flags); |
200 | } | 200 | } |
201 | 201 | ||
202 | #ifdef CONFIG_BF60x | 202 | #ifdef SEC_GCTL |
203 | static void bfin_sec_preflow_handler(struct irq_data *d) | 203 | static void bfin_sec_preflow_handler(struct irq_data *d) |
204 | { | 204 | { |
205 | unsigned long flags = hard_local_irq_save(); | 205 | unsigned long flags = hard_local_irq_save(); |
@@ -419,7 +419,7 @@ static void bfin_internal_unmask_irq_chip(struct irq_data *d) | |||
419 | } | 419 | } |
420 | #endif | 420 | #endif |
421 | 421 | ||
422 | #if defined(CONFIG_PM) && !defined(CONFIG_BF60x) | 422 | #if defined(CONFIG_PM) && !defined(SEC_GCTL) |
423 | int bfin_internal_set_wake(unsigned int irq, unsigned int state) | 423 | int bfin_internal_set_wake(unsigned int irq, unsigned int state) |
424 | { | 424 | { |
425 | u32 bank, bit, wakeup = 0; | 425 | u32 bank, bit, wakeup = 0; |
@@ -503,7 +503,7 @@ static struct irq_chip bfin_internal_irqchip = { | |||
503 | .irq_set_wake = bfin_internal_set_wake_chip, | 503 | .irq_set_wake = bfin_internal_set_wake_chip, |
504 | }; | 504 | }; |
505 | 505 | ||
506 | #ifdef CONFIG_BF60x | 506 | #ifdef SEC_GCTL |
507 | static struct irq_chip bfin_sec_irqchip = { | 507 | static struct irq_chip bfin_sec_irqchip = { |
508 | .name = "SEC", | 508 | .name = "SEC", |
509 | .irq_mask_ack = bfin_sec_mask_ack_irq, | 509 | .irq_mask_ack = bfin_sec_mask_ack_irq, |
@@ -512,7 +512,6 @@ static struct irq_chip bfin_sec_irqchip = { | |||
512 | .irq_eoi = bfin_sec_unmask_irq, | 512 | .irq_eoi = bfin_sec_unmask_irq, |
513 | .irq_disable = bfin_sec_disable, | 513 | .irq_disable = bfin_sec_disable, |
514 | .irq_enable = bfin_sec_enable, | 514 | .irq_enable = bfin_sec_enable, |
515 | .irq_set_wake = bfin_internal_set_wake, | ||
516 | }; | 515 | }; |
517 | #endif | 516 | #endif |
518 | 517 | ||
@@ -854,14 +853,6 @@ void bfin_demux_gpio_irq(unsigned int inta_irq, | |||
854 | 853 | ||
855 | #else | 854 | #else |
856 | 855 | ||
857 | # ifndef CONFIG_BF60x | ||
858 | #define NR_PINT_SYS_IRQS 4 | ||
859 | #define NR_PINTS 160 | ||
860 | # else | ||
861 | #define NR_PINT_SYS_IRQS 6 | ||
862 | #define NR_PINTS 112 | ||
863 | #endif | ||
864 | |||
865 | #define NR_PINT_BITS 32 | 856 | #define NR_PINT_BITS 32 |
866 | #define IRQ_NOT_AVAIL 0xFF | 857 | #define IRQ_NOT_AVAIL 0xFF |
867 | 858 | ||
@@ -883,29 +874,21 @@ static struct bfin_pint_regs * const pint[NR_PINT_SYS_IRQS] = { | |||
883 | #endif | 874 | #endif |
884 | }; | 875 | }; |
885 | 876 | ||
886 | #ifndef CONFIG_BF60x | ||
887 | inline unsigned int get_irq_base(u32 bank, u8 bmap) | 877 | inline unsigned int get_irq_base(u32 bank, u8 bmap) |
888 | { | 878 | { |
889 | unsigned int irq_base; | 879 | unsigned int irq_base; |
890 | 880 | ||
881 | #ifndef CONFIG_BF60x | ||
891 | if (bank < 2) { /*PA-PB */ | 882 | if (bank < 2) { /*PA-PB */ |
892 | irq_base = IRQ_PA0 + bmap * 16; | 883 | irq_base = IRQ_PA0 + bmap * 16; |
893 | } else { /*PC-PJ */ | 884 | } else { /*PC-PJ */ |
894 | irq_base = IRQ_PC0 + bmap * 16; | 885 | irq_base = IRQ_PC0 + bmap * 16; |
895 | } | 886 | } |
896 | |||
897 | return irq_base; | ||
898 | } | ||
899 | #else | 887 | #else |
900 | inline unsigned int get_irq_base(u32 bank, u8 bmap) | ||
901 | { | ||
902 | unsigned int irq_base; | ||
903 | |||
904 | irq_base = IRQ_PA0 + bank * 16 + bmap * 16; | 888 | irq_base = IRQ_PA0 + bank * 16 + bmap * 16; |
905 | 889 | #endif | |
906 | return irq_base; | 890 | return irq_base; |
907 | } | 891 | } |
908 | #endif | ||
909 | 892 | ||
910 | /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ | 893 | /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ |
911 | void init_pint_lut(void) | 894 | void init_pint_lut(void) |
@@ -1138,7 +1121,7 @@ void bfin_pint_resume(void) | |||
1138 | } | 1121 | } |
1139 | } | 1122 | } |
1140 | 1123 | ||
1141 | #ifdef CONFIG_BF60x | 1124 | #ifdef SEC_GCTL |
1142 | static int sec_suspend(void) | 1125 | static int sec_suspend(void) |
1143 | { | 1126 | { |
1144 | u32 bank; | 1127 | u32 bank; |
@@ -1272,6 +1255,7 @@ void __cpuinit init_exception_vectors(void) | |||
1272 | CSYNC(); | 1255 | CSYNC(); |
1273 | } | 1256 | } |
1274 | 1257 | ||
1258 | #ifndef SEC_GCTL | ||
1275 | /* | 1259 | /* |
1276 | * This function should be called during kernel startup to initialize | 1260 | * This function should be called during kernel startup to initialize |
1277 | * the BFin IRQ handling routines. | 1261 | * the BFin IRQ handling routines. |
@@ -1282,7 +1266,6 @@ int __init init_arch_irq(void) | |||
1282 | int irq; | 1266 | int irq; |
1283 | unsigned long ilat = 0; | 1267 | unsigned long ilat = 0; |
1284 | 1268 | ||
1285 | #ifndef CONFIG_BF60x | ||
1286 | /* Disable all the peripheral intrs - page 4-29 HW Ref manual */ | 1269 | /* Disable all the peripheral intrs - page 4-29 HW Ref manual */ |
1287 | #ifdef SIC_IMASK0 | 1270 | #ifdef SIC_IMASK0 |
1288 | bfin_write_SIC_IMASK0(SIC_UNMASK_ALL); | 1271 | bfin_write_SIC_IMASK0(SIC_UNMASK_ALL); |
@@ -1297,9 +1280,6 @@ int __init init_arch_irq(void) | |||
1297 | #else | 1280 | #else |
1298 | bfin_write_SIC_IMASK(SIC_UNMASK_ALL); | 1281 | bfin_write_SIC_IMASK(SIC_UNMASK_ALL); |
1299 | #endif | 1282 | #endif |
1300 | #else /* CONFIG_BF60x */ | ||
1301 | bfin_write_SEC_GCTL(SEC_GCTL_RESET); | ||
1302 | #endif | ||
1303 | 1283 | ||
1304 | local_irq_disable(); | 1284 | local_irq_disable(); |
1305 | 1285 | ||
@@ -1309,10 +1289,6 @@ int __init init_arch_irq(void) | |||
1309 | pint[1]->assign = CONFIG_PINT1_ASSIGN; | 1289 | pint[1]->assign = CONFIG_PINT1_ASSIGN; |
1310 | pint[2]->assign = CONFIG_PINT2_ASSIGN; | 1290 | pint[2]->assign = CONFIG_PINT2_ASSIGN; |
1311 | pint[3]->assign = CONFIG_PINT3_ASSIGN; | 1291 | pint[3]->assign = CONFIG_PINT3_ASSIGN; |
1312 | # ifdef CONFIG_BF60x | ||
1313 | pint[4]->assign = CONFIG_PINT4_ASSIGN; | ||
1314 | pint[5]->assign = CONFIG_PINT5_ASSIGN; | ||
1315 | # endif | ||
1316 | # endif | 1292 | # endif |
1317 | /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ | 1293 | /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ |
1318 | init_pint_lut(); | 1294 | init_pint_lut(); |
@@ -1325,7 +1301,6 @@ int __init init_arch_irq(void) | |||
1325 | irq_set_chip(irq, &bfin_internal_irqchip); | 1301 | irq_set_chip(irq, &bfin_internal_irqchip); |
1326 | 1302 | ||
1327 | switch (irq) { | 1303 | switch (irq) { |
1328 | #ifndef CONFIG_BF60x | ||
1329 | #if BFIN_GPIO_PINT | 1304 | #if BFIN_GPIO_PINT |
1330 | case IRQ_PINT0: | 1305 | case IRQ_PINT0: |
1331 | case IRQ_PINT1: | 1306 | case IRQ_PINT1: |
@@ -1361,7 +1336,6 @@ int __init init_arch_irq(void) | |||
1361 | irq_set_handler(irq, handle_percpu_irq); | 1336 | irq_set_handler(irq, handle_percpu_irq); |
1362 | break; | 1337 | break; |
1363 | #endif | 1338 | #endif |
1364 | #endif | ||
1365 | 1339 | ||
1366 | #ifdef CONFIG_TICKSOURCE_CORETMR | 1340 | #ifdef CONFIG_TICKSOURCE_CORETMR |
1367 | case IRQ_CORETMR: | 1341 | case IRQ_CORETMR: |
@@ -1391,8 +1365,7 @@ int __init init_arch_irq(void) | |||
1391 | 1365 | ||
1392 | init_mach_irq(); | 1366 | init_mach_irq(); |
1393 | 1367 | ||
1394 | #ifndef CONFIG_BF60x | 1368 | #if (defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) |
1395 | #if (defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) && !defined(CONFIG_BF60x) | ||
1396 | for (irq = IRQ_MAC_PHYINT; irq <= IRQ_MAC_STMDONE; irq++) | 1369 | for (irq = IRQ_MAC_PHYINT; irq <= IRQ_MAC_STMDONE; irq++) |
1397 | irq_set_chip_and_handler(irq, &bfin_mac_status_irqchip, | 1370 | irq_set_chip_and_handler(irq, &bfin_mac_status_irqchip, |
1398 | handle_level_irq); | 1371 | handle_level_irq); |
@@ -1402,28 +1375,6 @@ int __init init_arch_irq(void) | |||
1402 | irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++) | 1375 | irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++) |
1403 | irq_set_chip_and_handler(irq, &bfin_gpio_irqchip, | 1376 | irq_set_chip_and_handler(irq, &bfin_gpio_irqchip, |
1404 | handle_level_irq); | 1377 | handle_level_irq); |
1405 | #else | ||
1406 | for (irq = BFIN_IRQ(0); irq <= SYS_IRQS; irq++) { | ||
1407 | if (irq < CORE_IRQS && irq != IRQ_CGU_EVT) { | ||
1408 | irq_set_chip(irq, &bfin_sec_irqchip); | ||
1409 | __irq_set_handler(irq, handle_sec_fault, 0, NULL); | ||
1410 | } else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) { | ||
1411 | irq_set_chip(irq, &bfin_sec_irqchip); | ||
1412 | irq_set_chained_handler(irq, bfin_demux_gpio_irq); | ||
1413 | } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) { | ||
1414 | irq_set_chip(irq, &bfin_sec_irqchip); | ||
1415 | irq_set_handler(irq, handle_percpu_irq); | ||
1416 | } else { | ||
1417 | irq_set_chip_and_handler(irq, &bfin_sec_irqchip, | ||
1418 | handle_fasteoi_irq); | ||
1419 | __irq_set_preflow_handler(irq, bfin_sec_preflow_handler); | ||
1420 | } | ||
1421 | } | ||
1422 | for (irq = GPIO_IRQ_BASE; | ||
1423 | irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++) | ||
1424 | irq_set_chip_and_handler(irq, &bfin_gpio_irqchip, | ||
1425 | handle_level_irq); | ||
1426 | #endif | ||
1427 | bfin_write_IMASK(0); | 1378 | bfin_write_IMASK(0); |
1428 | CSYNC(); | 1379 | CSYNC(); |
1429 | ilat = bfin_read_ILAT(); | 1380 | ilat = bfin_read_ILAT(); |
@@ -1435,7 +1386,6 @@ int __init init_arch_irq(void) | |||
1435 | /* IMASK=xxx is equivalent to STI xx or bfin_irq_flags=xx, | 1386 | /* IMASK=xxx is equivalent to STI xx or bfin_irq_flags=xx, |
1436 | * local_irq_enable() | 1387 | * local_irq_enable() |
1437 | */ | 1388 | */ |
1438 | #ifndef CONFIG_BF60x | ||
1439 | program_IAR(); | 1389 | program_IAR(); |
1440 | /* Therefore it's better to setup IARs before interrupts enabled */ | 1390 | /* Therefore it's better to setup IARs before interrupts enabled */ |
1441 | search_IAR(); | 1391 | search_IAR(); |
@@ -1469,23 +1419,6 @@ int __init init_arch_irq(void) | |||
1469 | #else | 1419 | #else |
1470 | bfin_write_SIC_IWR(IWR_DISABLE_ALL); | 1420 | bfin_write_SIC_IWR(IWR_DISABLE_ALL); |
1471 | #endif | 1421 | #endif |
1472 | #else /* CONFIG_BF60x */ | ||
1473 | /* Enable interrupts IVG7-15 */ | ||
1474 | bfin_irq_flags |= IMASK_IVG15 | | ||
1475 | IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 | | ||
1476 | IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW; | ||
1477 | |||
1478 | |||
1479 | bfin_write_SEC_FCTL(SEC_FCTL_EN | SEC_FCTL_SYSRST_EN | SEC_FCTL_FLTIN_EN); | ||
1480 | bfin_sec_enable_sci(SIC_SYSIRQ(IRQ_WATCH0)); | ||
1481 | bfin_sec_enable_ssi(SIC_SYSIRQ(IRQ_WATCH0)); | ||
1482 | bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_RESET); | ||
1483 | udelay(100); | ||
1484 | bfin_write_SEC_GCTL(SEC_GCTL_EN); | ||
1485 | bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN); | ||
1486 | init_software_driven_irq(); | ||
1487 | register_syscore_ops(&sec_pm_syscore_ops); | ||
1488 | #endif | ||
1489 | return 0; | 1422 | return 0; |
1490 | } | 1423 | } |
1491 | 1424 | ||
@@ -1494,14 +1427,11 @@ __attribute__((l1_text)) | |||
1494 | #endif | 1427 | #endif |
1495 | static int vec_to_irq(int vec) | 1428 | static int vec_to_irq(int vec) |
1496 | { | 1429 | { |
1497 | #ifndef CONFIG_BF60x | ||
1498 | struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst; | 1430 | struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst; |
1499 | struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop; | 1431 | struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop; |
1500 | unsigned long sic_status[3]; | 1432 | unsigned long sic_status[3]; |
1501 | #endif | ||
1502 | if (likely(vec == EVT_IVTMR_P)) | 1433 | if (likely(vec == EVT_IVTMR_P)) |
1503 | return IRQ_CORETMR; | 1434 | return IRQ_CORETMR; |
1504 | #ifndef CONFIG_BF60x | ||
1505 | #ifdef SIC_ISR | 1435 | #ifdef SIC_ISR |
1506 | sic_status[0] = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR(); | 1436 | sic_status[0] = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR(); |
1507 | #else | 1437 | #else |
@@ -1530,11 +1460,112 @@ static int vec_to_irq(int vec) | |||
1530 | #endif | 1460 | #endif |
1531 | return ivg->irqno; | 1461 | return ivg->irqno; |
1532 | } | 1462 | } |
1533 | #else | 1463 | } |
1534 | /* for bf60x read */ | 1464 | |
1465 | #else /* SEC_GCTL */ | ||
1466 | |||
1467 | /* | ||
1468 | * This function should be called during kernel startup to initialize | ||
1469 | * the BFin IRQ handling routines. | ||
1470 | */ | ||
1471 | |||
1472 | int __init init_arch_irq(void) | ||
1473 | { | ||
1474 | int irq; | ||
1475 | unsigned long ilat = 0; | ||
1476 | |||
1477 | bfin_write_SEC_GCTL(SEC_GCTL_RESET); | ||
1478 | |||
1479 | local_irq_disable(); | ||
1480 | |||
1481 | #if BFIN_GPIO_PINT | ||
1482 | # ifdef CONFIG_PINTx_REASSIGN | ||
1483 | pint[0]->assign = CONFIG_PINT0_ASSIGN; | ||
1484 | pint[1]->assign = CONFIG_PINT1_ASSIGN; | ||
1485 | pint[2]->assign = CONFIG_PINT2_ASSIGN; | ||
1486 | pint[3]->assign = CONFIG_PINT3_ASSIGN; | ||
1487 | pint[4]->assign = CONFIG_PINT4_ASSIGN; | ||
1488 | pint[5]->assign = CONFIG_PINT5_ASSIGN; | ||
1489 | # endif | ||
1490 | /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ | ||
1491 | init_pint_lut(); | ||
1492 | #endif | ||
1493 | |||
1494 | for (irq = 0; irq <= SYS_IRQS; irq++) { | ||
1495 | if (irq <= IRQ_CORETMR) { | ||
1496 | irq_set_chip(irq, &bfin_core_irqchip); | ||
1497 | #ifdef CONFIG_TICKSOURCE_CORETMR | ||
1498 | if (irq == IRQ_CORETMR) | ||
1499 | # ifdef CONFIG_SMP | ||
1500 | irq_set_handler(irq, handle_percpu_irq); | ||
1501 | # else | ||
1502 | irq_set_handler(irq, handle_simple_irq); | ||
1503 | # endif | ||
1504 | #endif | ||
1505 | } else if (irq < BFIN_IRQ(0)) { | ||
1506 | irq_set_chip_and_handler(irq, &bfin_internal_irqchip, | ||
1507 | handle_simple_irq); | ||
1508 | } else if (irq < CORE_IRQS && irq != IRQ_CGU_EVT) { | ||
1509 | irq_set_chip_and_handler(irq, &bfin_sec_irqchip, | ||
1510 | handle_sec_fault); | ||
1511 | } else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) { | ||
1512 | irq_set_chip(irq, &bfin_sec_irqchip); | ||
1513 | irq_set_chained_handler(irq, bfin_demux_gpio_irq); | ||
1514 | } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) { | ||
1515 | irq_set_chip(irq, &bfin_sec_irqchip); | ||
1516 | irq_set_handler(irq, handle_percpu_irq); | ||
1517 | } else { | ||
1518 | irq_set_chip_and_handler(irq, &bfin_sec_irqchip, | ||
1519 | handle_fasteoi_irq); | ||
1520 | __irq_set_preflow_handler(irq, bfin_sec_preflow_handler); | ||
1521 | } | ||
1522 | } | ||
1523 | for (irq = GPIO_IRQ_BASE; | ||
1524 | irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++) | ||
1525 | irq_set_chip_and_handler(irq, &bfin_gpio_irqchip, | ||
1526 | handle_level_irq); | ||
1527 | |||
1528 | bfin_write_IMASK(0); | ||
1529 | CSYNC(); | ||
1530 | ilat = bfin_read_ILAT(); | ||
1531 | CSYNC(); | ||
1532 | bfin_write_ILAT(ilat); | ||
1533 | CSYNC(); | ||
1534 | |||
1535 | printk(KERN_INFO "Configuring Blackfin Priority Driven Interrupts\n"); | ||
1536 | |||
1537 | /* Enable interrupts IVG7-15 */ | ||
1538 | bfin_irq_flags |= IMASK_IVG15 | | ||
1539 | IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 | | ||
1540 | IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW; | ||
1541 | |||
1542 | |||
1543 | bfin_write_SEC_FCTL(SEC_FCTL_EN | SEC_FCTL_SYSRST_EN | SEC_FCTL_FLTIN_EN); | ||
1544 | bfin_sec_enable_sci(SIC_SYSIRQ(IRQ_WATCH0)); | ||
1545 | bfin_sec_enable_ssi(SIC_SYSIRQ(IRQ_WATCH0)); | ||
1546 | bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_RESET); | ||
1547 | udelay(100); | ||
1548 | bfin_write_SEC_GCTL(SEC_GCTL_EN); | ||
1549 | bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN); | ||
1550 | bfin_write_SEC_SCI(1, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN); | ||
1551 | |||
1552 | init_software_driven_irq(); | ||
1553 | register_syscore_ops(&sec_pm_syscore_ops); | ||
1554 | |||
1555 | return 0; | ||
1556 | } | ||
1557 | |||
1558 | #ifdef CONFIG_DO_IRQ_L1 | ||
1559 | __attribute__((l1_text)) | ||
1560 | #endif | ||
1561 | static int vec_to_irq(int vec) | ||
1562 | { | ||
1563 | if (likely(vec == EVT_IVTMR_P)) | ||
1564 | return IRQ_CORETMR; | ||
1565 | |||
1535 | return BFIN_IRQ(bfin_read_SEC_SCI(0, SEC_CSID)); | 1566 | return BFIN_IRQ(bfin_read_SEC_SCI(0, SEC_CSID)); |
1536 | #endif /* end of CONFIG_BF60x */ | ||
1537 | } | 1567 | } |
1568 | #endif /* SEC_GCTL */ | ||
1538 | 1569 | ||
1539 | #ifdef CONFIG_DO_IRQ_L1 | 1570 | #ifdef CONFIG_DO_IRQ_L1 |
1540 | __attribute__((l1_text)) | 1571 | __attribute__((l1_text)) |
@@ -1556,6 +1587,10 @@ int __ipipe_get_irq_priority(unsigned irq) | |||
1556 | if (irq <= IRQ_CORETMR) | 1587 | if (irq <= IRQ_CORETMR) |
1557 | return irq; | 1588 | return irq; |
1558 | 1589 | ||
1590 | #ifdef SEC_GCTL | ||
1591 | if (irq >= BFIN_IRQ(0)) | ||
1592 | return IVG11; | ||
1593 | #else | ||
1559 | for (ient = 0; ient < NR_PERI_INTS; ient++) { | 1594 | for (ient = 0; ient < NR_PERI_INTS; ient++) { |
1560 | struct ivgx *ivg = ivg_table + ient; | 1595 | struct ivgx *ivg = ivg_table + ient; |
1561 | if (ivg->irqno == irq) { | 1596 | if (ivg->irqno == irq) { |
@@ -1566,6 +1601,7 @@ int __ipipe_get_irq_priority(unsigned irq) | |||
1566 | } | 1601 | } |
1567 | } | 1602 | } |
1568 | } | 1603 | } |
1604 | #endif | ||
1569 | 1605 | ||
1570 | return IVG15; | 1606 | return IVG15; |
1571 | } | 1607 | } |
@@ -1578,8 +1614,6 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs) | |||
1578 | { | 1614 | { |
1579 | struct ipipe_percpu_domain_data *p = ipipe_root_cpudom_ptr(); | 1615 | struct ipipe_percpu_domain_data *p = ipipe_root_cpudom_ptr(); |
1580 | struct ipipe_domain *this_domain = __ipipe_current_domain; | 1616 | struct ipipe_domain *this_domain = __ipipe_current_domain; |
1581 | struct ivgx *ivg_stop = ivg7_13[vec-IVG7].istop; | ||
1582 | struct ivgx *ivg = ivg7_13[vec-IVG7].ifirst; | ||
1583 | int irq, s = 0; | 1617 | int irq, s = 0; |
1584 | 1618 | ||
1585 | irq = vec_to_irq(vec); | 1619 | irq = vec_to_irq(vec); |