diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/mpic.h | 12 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 34 |
2 files changed, 46 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index c2ccca53b991..a002682f3a6d 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h | |||
@@ -22,6 +22,14 @@ | |||
22 | #define MPIC_GREG_FEATURE_1 0x00010 | 22 | #define MPIC_GREG_FEATURE_1 0x00010 |
23 | #define MPIC_GREG_GLOBAL_CONF_0 0x00020 | 23 | #define MPIC_GREG_GLOBAL_CONF_0 0x00020 |
24 | #define MPIC_GREG_GCONF_RESET 0x80000000 | 24 | #define MPIC_GREG_GCONF_RESET 0x80000000 |
25 | /* On the FSL mpic implementations the Mode field is expand to be | ||
26 | * 2 bits wide: | ||
27 | * 0b00 = pass through (interrupts routed to IRQ0) | ||
28 | * 0b01 = Mixed mode | ||
29 | * 0b10 = reserved | ||
30 | * 0b11 = External proxy / coreint | ||
31 | */ | ||
32 | #define MPIC_GREG_GCONF_COREINT 0x60000000 | ||
25 | #define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 | 33 | #define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 |
26 | #define MPIC_GREG_GCONF_NO_BIAS 0x10000000 | 34 | #define MPIC_GREG_GCONF_NO_BIAS 0x10000000 |
27 | #define MPIC_GREG_GCONF_BASE_MASK 0x000fffff | 35 | #define MPIC_GREG_GCONF_BASE_MASK 0x000fffff |
@@ -357,6 +365,8 @@ struct mpic | |||
357 | #define MPIC_BROKEN_FRR_NIRQS 0x00000800 | 365 | #define MPIC_BROKEN_FRR_NIRQS 0x00000800 |
358 | /* Destination only supports a single CPU at a time */ | 366 | /* Destination only supports a single CPU at a time */ |
359 | #define MPIC_SINGLE_DEST_CPU 0x00001000 | 367 | #define MPIC_SINGLE_DEST_CPU 0x00001000 |
368 | /* Enable CoreInt delivery of interrupts */ | ||
369 | #define MPIC_ENABLE_COREINT 0x00002000 | ||
360 | 370 | ||
361 | /* MPIC HW modification ID */ | 371 | /* MPIC HW modification ID */ |
362 | #define MPIC_REGSET_MASK 0xf0000000 | 372 | #define MPIC_REGSET_MASK 0xf0000000 |
@@ -470,6 +480,8 @@ extern void mpic_end_irq(unsigned int irq); | |||
470 | extern unsigned int mpic_get_one_irq(struct mpic *mpic); | 480 | extern unsigned int mpic_get_one_irq(struct mpic *mpic); |
471 | /* This one gets from the primary mpic */ | 481 | /* This one gets from the primary mpic */ |
472 | extern unsigned int mpic_get_irq(void); | 482 | extern unsigned int mpic_get_irq(void); |
483 | /* This one gets from the primary mpic via CoreInt*/ | ||
484 | extern unsigned int mpic_get_coreint_irq(void); | ||
473 | /* Fetch Machine Check interrupt from primary mpic */ | 485 | /* Fetch Machine Check interrupt from primary mpic */ |
474 | extern unsigned int mpic_get_mcirq(void); | 486 | extern unsigned int mpic_get_mcirq(void); |
475 | 487 | ||
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 532e205303a2..21b956701596 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1170,6 +1170,12 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1170 | mb(); | 1170 | mb(); |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | /* CoreInt */ | ||
1174 | if (flags & MPIC_ENABLE_COREINT) | ||
1175 | mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0), | ||
1176 | mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) | ||
1177 | | MPIC_GREG_GCONF_COREINT); | ||
1178 | |||
1173 | if (flags & MPIC_ENABLE_MCK) | 1179 | if (flags & MPIC_ENABLE_MCK) |
1174 | mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0), | 1180 | mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0), |
1175 | mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) | 1181 | mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) |
@@ -1525,6 +1531,34 @@ unsigned int mpic_get_irq(void) | |||
1525 | return mpic_get_one_irq(mpic); | 1531 | return mpic_get_one_irq(mpic); |
1526 | } | 1532 | } |
1527 | 1533 | ||
1534 | unsigned int mpic_get_coreint_irq(void) | ||
1535 | { | ||
1536 | #ifdef CONFIG_BOOKE | ||
1537 | struct mpic *mpic = mpic_primary; | ||
1538 | u32 src; | ||
1539 | |||
1540 | BUG_ON(mpic == NULL); | ||
1541 | |||
1542 | src = mfspr(SPRN_EPR); | ||
1543 | |||
1544 | if (unlikely(src == mpic->spurious_vec)) { | ||
1545 | if (mpic->flags & MPIC_SPV_EOI) | ||
1546 | mpic_eoi(mpic); | ||
1547 | return NO_IRQ; | ||
1548 | } | ||
1549 | if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { | ||
1550 | if (printk_ratelimit()) | ||
1551 | printk(KERN_WARNING "%s: Got protected source %d !\n", | ||
1552 | mpic->name, (int)src); | ||
1553 | return NO_IRQ; | ||
1554 | } | ||
1555 | |||
1556 | return irq_linear_revmap(mpic->irqhost, src); | ||
1557 | #else | ||
1558 | return NO_IRQ; | ||
1559 | #endif | ||
1560 | } | ||
1561 | |||
1528 | unsigned int mpic_get_mcirq(void) | 1562 | unsigned int mpic_get_mcirq(void) |
1529 | { | 1563 | { |
1530 | struct mpic *mpic = mpic_primary; | 1564 | struct mpic *mpic = mpic_primary; |