svn commit: r193492 - head/sys/powerpc/booke
Rafal Jaworowski
raj at FreeBSD.org
Fri Jun 5 09:46:01 UTC 2009
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++;
More information about the svn-src-head
mailing list