[U-Boot] [PATCH 3/3] ppc4xx: Add routine to retrieve the CPU number for boards with multiple CPU's.
Adam Graham
agraham at amcc.com
Wed Sep 24 10:11:44 CEST 2008
Provide a weak defined routine to retrieve the CPU number for reference boards that have multiple CPU's. Default behavior is the existing single CPU print output. Reference boards with multiple CPU's need to provide a board specific routine. See board/amcc/arches/arches.c for an example.
Signed-off-by: Adam Graham <agraham at amcc.com>
Signed-off-by: Victor Gallardo <vgallardo at amcc.com>
---
cpu/ppc4xx/cpu.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
index bc9335a..71d4ad9 100644
--- a/cpu/ppc4xx/cpu.c
+++ b/cpu/ppc4xx/cpu.c
@@ -41,6 +41,18 @@ DECLARE_GLOBAL_DATA_PTR;
void board_reset(void);
+/*
+ * To provide an interface to detect CPU number for boards that support
+ * more then one CPU, we implement the "weak" default functions here.
+ *
+ * Returns CPU number, else -1 if not known.
+ */
+u32 __get_cpu_num(void)
+{
+ return -1;
+}
+u32 get_cpu_num(void) __attribute__((weak, alias("__get_cpu_num")));
+
#if defined(CONFIG_405GP) || \
defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
@@ -274,8 +286,13 @@ int checkcpu (void)
#if !defined(CONFIG_IOP480)
char addstr[64] = "";
sys_info_t sys_info;
+ int cpu_num;
- puts ("CPU: ");
+ cpu_num = get_cpu_num();
+ if (cpu_num >= 0)
+ printf("CPU%d: ", cpu_num);
+ else
+ puts("CPU: ");
get_sys_info(&sys_info);
--
1.5.5
More information about the U-Boot
mailing list