aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-05-21 16:59:23 -0400
committerPaul Mackerras <paulus@samba.org>2008-05-23 01:27:26 -0400
commit475ca391b490a683d66bf19999a8a7a24913f139 (patch)
treee7818dcd25169b9d9c9ed35723b3cafd2be455fd
parent2ca7633dc73405ee775a2e9b7961b47a38bc882d (diff)
[POWERPC] mpic: Deal with bogus NIRQ in Feature Reporting Register
Some chips (like the SoCs from Freescale) report the wrong value in NIRQ and this causes issues if its doesn't match or exceed the value of irq_count. Add a flag that board code can set to just use irq_count instead of FRR[NIRQ]. Eventually we'll add a device tree property with the number of sources. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/sysdev/mpic.c9
-rw-r--r--include/asm-powerpc/mpic.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 8619f2a3f1f6..466e2183e86c 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1144,9 +1144,12 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1144 mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK) 1144 mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK)
1145 >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1; 1145 >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
1146 if (isu_size == 0) 1146 if (isu_size == 0)
1147 mpic->num_sources = 1147 if (flags & MPIC_BROKEN_FRR_NIRQS)
1148 ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK) 1148 mpic->num_sources = mpic->irq_count;
1149 >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1; 1149 else
1150 mpic->num_sources =
1151 ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
1152 >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
1150 1153
1151 /* Map the per-CPU registers */ 1154 /* Map the per-CPU registers */
1152 for (i = 0; i < mpic->num_cpus; i++) { 1155 for (i = 0; i < mpic->num_cpus; i++) {
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index 943c5a3fac8a..6802570f4240 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -353,6 +353,8 @@ struct mpic
353#define MPIC_ENABLE_MCK 0x00000200 353#define MPIC_ENABLE_MCK 0x00000200
354/* Disable bias among target selection, spread interrupts evenly */ 354/* Disable bias among target selection, spread interrupts evenly */
355#define MPIC_NO_BIAS 0x00000400 355#define MPIC_NO_BIAS 0x00000400
356/* Ignore NIRQS as reported by FRR */
357#define MPIC_BROKEN_FRR_NIRQS 0x00000800
356 358
357/* MPIC HW modification ID */ 359/* MPIC HW modification ID */
358#define MPIC_REGSET_MASK 0xf0000000 360#define MPIC_REGSET_MASK 0xf0000000