summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/booke
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2009-06-05 09:46:00 +0000
committerraj <raj@FreeBSD.org>2009-06-05 09:46:00 +0000
commit8a4e071b7271a82ac39476786b0281f970445da9 (patch)
tree660518d7e8765420b64fecd2bb186fafd90b54b4 /sys/powerpc/booke
parent3f1308d2b54e9280f365e435a0c8910d48fb41ef (diff)
downloadFreeBSD-src-8a4e071b7271a82ac39476786b0281f970445da9.zip
FreeBSD-src-8a4e071b7271a82ac39476786b0281f970445da9.tar.gz
Discover and handle the number of E500 CPUs in run time.
Diffstat (limited to 'sys/powerpc/booke')
-rw-r--r--sys/powerpc/booke/platform_bare.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/powerpc/booke/platform_bare.c b/sys/powerpc/booke/platform_bare.c
index a9ee450..92d8ec8 100644
--- a/sys/powerpc/booke/platform_bare.c
+++ b/sys/powerpc/booke/platform_bare.c
@@ -56,7 +56,7 @@ extern uint8_t __boot_page[]; /* Boot page body */
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++;
OpenPOWER on IntegriCloud