diff options
author | Kyle Moffett <Kyle.D.Moffett@boeing.com> | 2011-12-02 01:28:03 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-12-06 21:43:08 -0500 |
commit | be8bec56dfac0574c4c08a50cd37e09bea941e3f (patch) | |
tree | 2c31c63a1b56f8cd79a49c358be9b6020118e7c8 /arch/powerpc/sysdev/mpic.c | |
parent | 996983b75cebb1bc1c2c545f20336f24ebfa17af (diff) |
powerpc/mpic: Invert the meaning of MPIC_PRIMARY
It turns out that there are only 2 in-tree platforms which use MPICs
which are not "primary": IBM Cell and PowerMac. To reduce the
complexity of the typical board setup code, invert the MPIC_PRIMARY bit
into MPIC_SECONDARY.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/mpic.c')
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index bb72a6266480..6d42ad1491a9 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -154,7 +154,7 @@ static inline unsigned int mpic_processor_id(struct mpic *mpic) | |||
154 | { | 154 | { |
155 | unsigned int cpu = 0; | 155 | unsigned int cpu = 0; |
156 | 156 | ||
157 | if (mpic->flags & MPIC_PRIMARY) | 157 | if (!(mpic->flags & MPIC_SECONDARY)) |
158 | cpu = hard_smp_processor_id(); | 158 | cpu = hard_smp_processor_id(); |
159 | 159 | ||
160 | return cpu; | 160 | return cpu; |
@@ -990,7 +990,7 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq, | |||
990 | 990 | ||
991 | #ifdef CONFIG_SMP | 991 | #ifdef CONFIG_SMP |
992 | else if (hw >= mpic->ipi_vecs[0]) { | 992 | else if (hw >= mpic->ipi_vecs[0]) { |
993 | WARN_ON(!(mpic->flags & MPIC_PRIMARY)); | 993 | WARN_ON(mpic->flags & MPIC_SECONDARY); |
994 | 994 | ||
995 | DBG("mpic: mapping as IPI\n"); | 995 | DBG("mpic: mapping as IPI\n"); |
996 | irq_set_chip_data(virq, mpic); | 996 | irq_set_chip_data(virq, mpic); |
@@ -1001,7 +1001,7 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq, | |||
1001 | #endif /* CONFIG_SMP */ | 1001 | #endif /* CONFIG_SMP */ |
1002 | 1002 | ||
1003 | if (hw >= mpic->timer_vecs[0] && hw <= mpic->timer_vecs[7]) { | 1003 | if (hw >= mpic->timer_vecs[0] && hw <= mpic->timer_vecs[7]) { |
1004 | WARN_ON(!(mpic->flags & MPIC_PRIMARY)); | 1004 | WARN_ON(mpic->flags & MPIC_SECONDARY); |
1005 | 1005 | ||
1006 | DBG("mpic: mapping as timer\n"); | 1006 | DBG("mpic: mapping as timer\n"); |
1007 | irq_set_chip_data(virq, mpic); | 1007 | irq_set_chip_data(virq, mpic); |
@@ -1184,12 +1184,12 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1184 | 1184 | ||
1185 | mpic->hc_irq = mpic_irq_chip; | 1185 | mpic->hc_irq = mpic_irq_chip; |
1186 | mpic->hc_irq.name = name; | 1186 | mpic->hc_irq.name = name; |
1187 | if (flags & MPIC_PRIMARY) | 1187 | if (!(flags & MPIC_SECONDARY)) |
1188 | mpic->hc_irq.irq_set_affinity = mpic_set_affinity; | 1188 | mpic->hc_irq.irq_set_affinity = mpic_set_affinity; |
1189 | #ifdef CONFIG_MPIC_U3_HT_IRQS | 1189 | #ifdef CONFIG_MPIC_U3_HT_IRQS |
1190 | mpic->hc_ht_irq = mpic_irq_ht_chip; | 1190 | mpic->hc_ht_irq = mpic_irq_ht_chip; |
1191 | mpic->hc_ht_irq.name = name; | 1191 | mpic->hc_ht_irq.name = name; |
1192 | if (flags & MPIC_PRIMARY) | 1192 | if (!(flags & MPIC_SECONDARY)) |
1193 | mpic->hc_ht_irq.irq_set_affinity = mpic_set_affinity; | 1193 | mpic->hc_ht_irq.irq_set_affinity = mpic_set_affinity; |
1194 | #endif /* CONFIG_MPIC_U3_HT_IRQS */ | 1194 | #endif /* CONFIG_MPIC_U3_HT_IRQS */ |
1195 | 1195 | ||
@@ -1375,7 +1375,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1375 | mpic->next = mpics; | 1375 | mpic->next = mpics; |
1376 | mpics = mpic; | 1376 | mpics = mpic; |
1377 | 1377 | ||
1378 | if (flags & MPIC_PRIMARY) { | 1378 | if (!(flags & MPIC_SECONDARY)) { |
1379 | mpic_primary = mpic; | 1379 | mpic_primary = mpic; |
1380 | irq_set_default_host(mpic->irqhost); | 1380 | irq_set_default_host(mpic->irqhost); |
1381 | } | 1381 | } |
@@ -1450,7 +1450,7 @@ void __init mpic_init(struct mpic *mpic) | |||
1450 | 1450 | ||
1451 | /* Do the HT PIC fixups on U3 broken mpic */ | 1451 | /* Do the HT PIC fixups on U3 broken mpic */ |
1452 | DBG("MPIC flags: %x\n", mpic->flags); | 1452 | DBG("MPIC flags: %x\n", mpic->flags); |
1453 | if ((mpic->flags & MPIC_U3_HT_IRQS) && (mpic->flags & MPIC_PRIMARY)) { | 1453 | if ((mpic->flags & MPIC_U3_HT_IRQS) && !(mpic->flags & MPIC_SECONDARY)) { |
1454 | mpic_scan_ht_pics(mpic); | 1454 | mpic_scan_ht_pics(mpic); |
1455 | mpic_u3msi_init(mpic); | 1455 | mpic_u3msi_init(mpic); |
1456 | } | 1456 | } |