diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-05-07 22:58:37 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-07 23:46:48 -0400 |
commit | 05af7bd2d75e5098021864d83fbb831111755fa0 (patch) | |
tree | c5319ce0410fdf732679175fa5a4df25cbb0e830 /arch/powerpc/sysdev/mpic.c | |
parent | a7de7c74227edda719b257eb15aecd73790ff894 (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.c | 12 |
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 | ||
621 | static void mpic_unmask_irq(unsigned int irq) | 621 | void 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 | ||
641 | static void mpic_mask_irq(unsigned int irq) | 641 | void 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 | ||
662 | static void mpic_end_irq(unsigned int irq) | 662 | void 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 | ||
795 | static int mpic_set_irq_type(unsigned int virq, unsigned int flow_type) | 795 | int 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 */ |