Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jun 2009 09:46:00 +0000 (UTC)
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r193492 - head/sys/powerpc/booke
Message-ID:  <200906050946.n559k0xD020724@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: raj
Date: Fri Jun  5 09:46:00 2009
New Revision: 193492
URL: http://svn.freebsd.org/changeset/base/193492

Log:
  Discover and handle the number of E500 CPUs in run time.

Modified:
  head/sys/powerpc/booke/platform_bare.c

Modified: head/sys/powerpc/booke/platform_bare.c
==============================================================================
--- head/sys/powerpc/booke/platform_bare.c	Fri Jun  5 09:21:03 2009	(r193491)
+++ head/sys/powerpc/booke/platform_bare.c	Fri Jun  5 09:46:00 2009	(r193492)
@@ -56,7 +56,7 @@ extern uint8_t __boot_page[];		/* Boot p
 extern uint32_t kernload;		/* Kernel physical load address */
 #endif
 
-static int cpu;
+static int cpu, maxcpu;
 
 static int bare_probe(platform_t);
 static void bare_mem_regions(platform_t, struct mem_region **phys, int *physsz,
@@ -91,6 +91,13 @@ PLATFORM_DEF(bare_platform);
 static int
 bare_probe(platform_t plat)
 {
+	uint32_t ver;
+
+	ver = SVR_VER(mfspr(SPR_SVR));
+	if (ver == SVR_MPC8572E || ver == SVR_MPC8572)
+		maxcpu = 2;
+	else
+		maxcpu = 1;
 
 	return (BUS_PROBE_GENERIC);
 }
@@ -161,7 +168,7 @@ static int
 bare_smp_next_cpu(platform_t plat, struct cpuref *cpuref)
 {
 
-	if (cpu >= MAXCPU)
+	if (cpu >= maxcpu)
 		return (ENOENT);
 
 	cpuref->cr_cpuid = cpu++;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906050946.n559k0xD020724>