summaryrefslogtreecommitdiff
path: root/arch/powerpc/cpu/mpc8xxx/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/cpu/mpc8xxx/cpu.c')
-rw-r--r--arch/powerpc/cpu/mpc8xxx/cpu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/cpu/mpc8xxx/cpu.c b/arch/powerpc/cpu/mpc8xxx/cpu.c
index dc3da16..97a94f4 100644
--- a/arch/powerpc/cpu/mpc8xxx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xxx/cpu.c
@@ -110,8 +110,14 @@ struct cpu_type *identify_cpu(u32 ver)
}
int cpu_numcores() {
- struct cpu_type *cpu;
- cpu = gd->cpu;
+ ccsr_pic_t __iomem *pic = (void *)CONFIG_SYS_MPC85xx_PIC_ADDR;
+ struct cpu_type *cpu = gd->cpu;
+
+ /* better to query feature reporting register than just assume 1 */
+ if (cpu == &cpu_type_unknown)
+ return ((in_be32(&pic->frr) & MPC85xx_PICFRR_NCPU_MASK) >>
+ MPC85xx_PICFRR_NCPU_SHIFT) + 1;
+
return cpu->num_cores;
}