diff options
author | Tony Lindgren <tony@atomide.com> | 2011-11-07 15:27:23 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-11-07 15:27:23 -0500 |
commit | d30cc16c8e48368e0518f4975a78711e53e14a0f (patch) | |
tree | 26b57f7ab5a963cc3d6c57dff6951bd930875583 /arch/powerpc/sysdev/mpic.c | |
parent | 41eb2d813f558900884e240c2f723e36c7bd151f (diff) | |
parent | a1bcc1dcef8451b4291ea2a1b2677cb194102952 (diff) |
Merge branch 'fixes-modulesplit' into fixes
Diffstat (limited to 'arch/powerpc/sysdev/mpic.c')
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index d5d3ff3d757e..0842c6f8a3e6 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1285,13 +1285,11 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1285 | mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) | 1285 | mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) |
1286 | | MPIC_GREG_GCONF_MCK); | 1286 | | MPIC_GREG_GCONF_MCK); |
1287 | 1287 | ||
1288 | /* Read feature register, calculate num CPUs and, for non-ISU | 1288 | /* |
1289 | * MPICs, num sources as well. On ISU MPICs, sources are counted | 1289 | * Read feature register. For non-ISU MPICs, num sources as well. On |
1290 | * as ISUs are added | 1290 | * ISU MPICs, sources are counted as ISUs are added |
1291 | */ | 1291 | */ |
1292 | greg_feature = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0)); | 1292 | greg_feature = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0)); |
1293 | mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK) | ||
1294 | >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1; | ||
1295 | if (isu_size == 0) { | 1293 | if (isu_size == 0) { |
1296 | if (flags & MPIC_BROKEN_FRR_NIRQS) | 1294 | if (flags & MPIC_BROKEN_FRR_NIRQS) |
1297 | mpic->num_sources = mpic->irq_count; | 1295 | mpic->num_sources = mpic->irq_count; |
@@ -1301,10 +1299,18 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1301 | >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1; | 1299 | >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1; |
1302 | } | 1300 | } |
1303 | 1301 | ||
1302 | /* | ||
1303 | * The MPIC driver will crash if there are more cores than we | ||
1304 | * can initialize, so we may as well catch that problem here. | ||
1305 | */ | ||
1306 | BUG_ON(num_possible_cpus() > MPIC_MAX_CPUS); | ||
1307 | |||
1304 | /* Map the per-CPU registers */ | 1308 | /* Map the per-CPU registers */ |
1305 | for (i = 0; i < mpic->num_cpus; i++) { | 1309 | for_each_possible_cpu(i) { |
1306 | mpic_map(mpic, node, paddr, &mpic->cpuregs[i], | 1310 | unsigned int cpu = get_hard_smp_processor_id(i); |
1307 | MPIC_INFO(CPU_BASE) + i * MPIC_INFO(CPU_STRIDE), | 1311 | |
1312 | mpic_map(mpic, node, paddr, &mpic->cpuregs[cpu], | ||
1313 | MPIC_INFO(CPU_BASE) + cpu * MPIC_INFO(CPU_STRIDE), | ||
1308 | 0x1000); | 1314 | 0x1000); |
1309 | } | 1315 | } |
1310 | 1316 | ||
@@ -1343,7 +1349,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1343 | } | 1349 | } |
1344 | printk(KERN_INFO "mpic: Setting up MPIC \"%s\" version %s at %llx," | 1350 | printk(KERN_INFO "mpic: Setting up MPIC \"%s\" version %s at %llx," |
1345 | " max %d CPUs\n", | 1351 | " max %d CPUs\n", |
1346 | name, vers, (unsigned long long)paddr, mpic->num_cpus); | 1352 | name, vers, (unsigned long long)paddr, num_possible_cpus()); |
1347 | printk(KERN_INFO "mpic: ISU size: %d, shift: %d, mask: %x\n", | 1353 | printk(KERN_INFO "mpic: ISU size: %d, shift: %d, mask: %x\n", |
1348 | mpic->isu_size, mpic->isu_shift, mpic->isu_mask); | 1354 | mpic->isu_size, mpic->isu_shift, mpic->isu_mask); |
1349 | 1355 | ||
@@ -1742,6 +1748,7 @@ void mpic_reset_core(int cpu) | |||
1742 | struct mpic *mpic = mpic_primary; | 1748 | struct mpic *mpic = mpic_primary; |
1743 | u32 pir; | 1749 | u32 pir; |
1744 | int cpuid = get_hard_smp_processor_id(cpu); | 1750 | int cpuid = get_hard_smp_processor_id(cpu); |
1751 | int i; | ||
1745 | 1752 | ||
1746 | /* Set target bit for core reset */ | 1753 | /* Set target bit for core reset */ |
1747 | pir = mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT)); | 1754 | pir = mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT)); |
@@ -1753,6 +1760,15 @@ void mpic_reset_core(int cpu) | |||
1753 | pir &= ~(1 << cpuid); | 1760 | pir &= ~(1 << cpuid); |
1754 | mpic_write(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT), pir); | 1761 | mpic_write(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT), pir); |
1755 | mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT)); | 1762 | mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT)); |
1763 | |||
1764 | /* Perform 15 EOI on each reset core to clear pending interrupts. | ||
1765 | * This is required for FSL CoreNet based devices */ | ||
1766 | if (mpic->flags & MPIC_FSL) { | ||
1767 | for (i = 0; i < 15; i++) { | ||
1768 | _mpic_write(mpic->reg_type, &mpic->cpuregs[cpuid], | ||
1769 | MPIC_CPU_EOI, 0); | ||
1770 | } | ||
1771 | } | ||
1756 | } | 1772 | } |
1757 | #endif /* CONFIG_SMP */ | 1773 | #endif /* CONFIG_SMP */ |
1758 | 1774 | ||