[U-Boot] [PATCH] 85xx: Add support for not releasing secondary cores via 'mp_holdoff'

Peter Tyser ptyser at xes-inc.com
Wed Sep 29 20:44:07 CEST 2010


From: Aaron Sierra <asierra at xes-inc.com>

Some OSes require that secondary cores not be initialized when they
are booted (eg VxWorks).  By default when U-Boot is compiled with the
CONFIG_MP option all secondary cores are brought out of reset and held
in spinloops.  Setting the "mp_holdoff" environment variable to a
non-null value will cause U-Boot to leave secondary cores in their
default state.

Signed-off-by: Aaron Sierra <asierra at xes-inc.com>
Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
 arch/powerpc/cpu/mpc85xx/mp.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c
index 603baef..7ad5efb 100644
--- a/arch/powerpc/cpu/mpc85xx/mp.c
+++ b/arch/powerpc/cpu/mpc85xx/mp.c
@@ -51,6 +51,11 @@ int cpu_status(int nr)
 {
 	u32 *table, id = get_my_id();
 
+	if (getenv("mp_holdoff")) {
+		printf("Secondary cores are disabled; mp_holdoff is set\n");
+		return 0;
+	}
+
 	if (nr == id) {
 		table = (u32 *)get_spin_virt_addr();
 		printf("table base @ 0x%p\n", table);
@@ -133,6 +138,11 @@ int cpu_release(int nr, int argc, char * const argv[])
 	u32 i, val, *table = (u32 *)get_spin_virt_addr() + nr * NUM_BOOT_ENTRY;
 	u64 boot_addr;
 
+	if (getenv("mp_holdoff")) {
+		printf("Secondary cores are disabled; mp_holdoff is set\n");
+		return 0;
+	}
+
 	if (nr == get_my_id()) {
 		printf("Invalid to release the boot core.\n\n");
 		return 1;
@@ -353,6 +363,14 @@ void setup_mp(void)
 	ulong fixup = (ulong)&__secondary_start_page;
 	u32 bootpg = determine_mp_bootpg();
 
+	/*
+	 * Some OSes expect the secondary cores to be held in reset when the OS
+	 * boots.  Use the optional 'mp_holdoff' environment variable to allow
+	 * users to disable the bring up of secondary cores.
+	 */
+	if (getenv("mp_holdoff"))
+		return;
+
 	/* Store the bootpg's SDRAM address for use by secondary CPU cores */
 	__bootpg_addr = bootpg;
 
-- 
1.7.0.4



More information about the U-Boot mailing list