diff options
author | raj <raj@FreeBSD.org> | 2009-06-05 09:46:00 +0000 |
---|---|---|
committer | raj <raj@FreeBSD.org> | 2009-06-05 09:46:00 +0000 |
commit | 8a4e071b7271a82ac39476786b0281f970445da9 (patch) | |
tree | 660518d7e8765420b64fecd2bb186fafd90b54b4 /sys/powerpc/booke | |
parent | 3f1308d2b54e9280f365e435a0c8910d48fb41ef (diff) | |
download | FreeBSD-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.c | 11 |
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++; |