aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/mpic.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-05-07 22:58:37 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-07 23:46:48 -0400
commit05af7bd2d75e5098021864d83fbb831111755fa0 (patch)
treec5319ce0410fdf732679175fa5a4df25cbb0e830 /arch/powerpc/sysdev/mpic.c
parenta7de7c74227edda719b257eb15aecd73790ff894 (diff)
[POWERPC] MPIC U3/U4 MSI backend
MPIC U3/U4 MSI backend. Based on code from Segher, heavily hacked by me. This only deals with MSI on U3/U4 MPICs, aka. CPC 9x5. If we find a U3/U4 then we enable this backend, ie. take over the ppc_md MSI hooks. We might need more elaborate logic in future to decide which backend is enabled. We need our own irq_chip so that we can do MSI masking/unmasking on the device itself. We also need to mask explicitly on shutdown to make sure we don't get bitten by lazy-disable semantics. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev/mpic.c')
-rw-r--r--arch/powerpc/sysdev/mpic.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index fc0428aea0c0..4fd2bec89916 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -618,7 +618,7 @@ static irqreturn_t mpic_ipi_action(int irq, void *dev_id)
618 */ 618 */
619 619
620 620
621static void mpic_unmask_irq(unsigned int irq) 621void mpic_unmask_irq(unsigned int irq)
622{ 622{
623 unsigned int loops = 100000; 623 unsigned int loops = 100000;
624 struct mpic *mpic = mpic_from_irq(irq); 624 struct mpic *mpic = mpic_from_irq(irq);
@@ -638,7 +638,7 @@ static void mpic_unmask_irq(unsigned int irq)
638 } while(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK); 638 } while(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK);
639} 639}
640 640
641static void mpic_mask_irq(unsigned int irq) 641void mpic_mask_irq(unsigned int irq)
642{ 642{
643 unsigned int loops = 100000; 643 unsigned int loops = 100000;
644 struct mpic *mpic = mpic_from_irq(irq); 644 struct mpic *mpic = mpic_from_irq(irq);
@@ -659,7 +659,7 @@ static void mpic_mask_irq(unsigned int irq)
659 } while(!(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK)); 659 } while(!(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK));
660} 660}
661 661
662static void mpic_end_irq(unsigned int irq) 662void mpic_end_irq(unsigned int irq)
663{ 663{
664 struct mpic *mpic = mpic_from_irq(irq); 664 struct mpic *mpic = mpic_from_irq(irq);
665 665
@@ -792,7 +792,7 @@ static unsigned int mpic_type_to_vecpri(struct mpic *mpic, unsigned int type)
792 } 792 }
793} 793}
794 794
795static int mpic_set_irq_type(unsigned int virq, unsigned int flow_type) 795int mpic_set_irq_type(unsigned int virq, unsigned int flow_type)
796{ 796{
797 struct mpic *mpic = mpic_from_irq(virq); 797 struct mpic *mpic = mpic_from_irq(virq);
798 unsigned int src = mpic_irq_to_hw(virq); 798 unsigned int src = mpic_irq_to_hw(virq);
@@ -1203,8 +1203,10 @@ void __init mpic_init(struct mpic *mpic)
1203 1203
1204 /* Do the HT PIC fixups on U3 broken mpic */ 1204 /* Do the HT PIC fixups on U3 broken mpic */
1205 DBG("MPIC flags: %x\n", mpic->flags); 1205 DBG("MPIC flags: %x\n", mpic->flags);
1206 if ((mpic->flags & MPIC_U3_HT_IRQS) && (mpic->flags & MPIC_PRIMARY)) 1206 if ((mpic->flags & MPIC_U3_HT_IRQS) && (mpic->flags & MPIC_PRIMARY)) {
1207 mpic_scan_ht_pics(mpic); 1207 mpic_scan_ht_pics(mpic);
1208 mpic_u3msi_init(mpic);
1209 }
1208 1210
1209 for (i = 0; i < mpic->num_sources; i++) { 1211 for (i = 0; i < mpic->num_sources; i++) {
1210 /* start with vector = source number, and masked */ 1212 /* start with vector = source number, and masked */