summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib/board.c
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2012-08-17 08:20:22 +0000
committerAndy Fleming <afleming@freescale.com>2012-08-23 12:16:54 -0500
commit123bd96d533190a207c9fcea84ae6328732a16cc (patch)
treef8828f5698f38167604ade9ebdf5b0856986777b /arch/powerpc/lib/board.c
parent1ca8690d27871b87b8ec4afe8621d1e003d25d7a (diff)
downloadblackbird-obmc-uboot-123bd96d533190a207c9fcea84ae6328732a16cc.tar.gz
blackbird-obmc-uboot-123bd96d533190a207c9fcea84ae6328732a16cc.zip
powerpc/mpc8xxx: use topology registers to calculate number of cores
We have actual topology infomation to find out exactly which core is present. Calculate the number of cores if not specified. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'arch/powerpc/lib/board.c')
-rw-r--r--arch/powerpc/lib/board.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 435ef10a2e..07feaf55fc 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -345,6 +345,13 @@ ulong get_effective_memsize(void)
#endif
}
+int __fixup_cpu(void)
+{
+ return 0;
+}
+
+int fixup_cpu(void) __attribute__((weak, alias("__fixup_cpu")));
+
/*
* This is the first part of the initialization sequence that is
* implemented in C, but still running from ROM.
@@ -646,6 +653,12 @@ void board_init_r(gd_t *id, ulong dest_addr)
* We need to update it to point to the same CPU entry in RAM.
*/
gd->cpu += dest_addr - CONFIG_SYS_MONITOR_BASE;
+
+ /*
+ * If we didn't know the cpu mask & # cores, we can save them of
+ * now rather than 'computing' them constantly
+ */
+ fixup_cpu();
#endif
#ifdef CONFIG_SYS_EXTRA_ENV_RELOC
OpenPOWER on IntegriCloud