summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/booke/platform_bare.c
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2012-05-26 13:42:55 +0000
committerraj <raj@FreeBSD.org>2012-05-26 13:42:55 +0000
commite87745389c1f8ff4a6e9cd3e38e90c639fdf2432 (patch)
tree6ecf3b0d865640b7268cba6afb8052099298e9e6 /sys/powerpc/booke/platform_bare.c
parent8c2ef762a7721f74d75545435d90e9302cd27153 (diff)
downloadFreeBSD-src-e87745389c1f8ff4a6e9cd3e38e90c639fdf2432.zip
FreeBSD-src-e87745389c1f8ff4a6e9cd3e38e90c639fdf2432.tar.gz
Retrieve CPU number info from the device tree.
Obtained from: Freescale, Semihalf.
Diffstat (limited to 'sys/powerpc/booke/platform_bare.c')
-rw-r--r--sys/powerpc/booke/platform_bare.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/sys/powerpc/booke/platform_bare.c b/sys/powerpc/booke/platform_bare.c
index 02d0f87..7b98059 100644
--- a/sys/powerpc/booke/platform_bare.c
+++ b/sys/powerpc/booke/platform_bare.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2008-2009 Semihalf, Rafal Jaworowski
+ * Copyright (c) 2008-2012 Semihalf.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -101,26 +101,16 @@ PLATFORM_DEF(bare_platform);
static int
bare_probe(platform_t plat)
{
- uint32_t ver, sr;
+ phandle_t cpus, child;
+ uint32_t sr;
int i, law_max, tgt;
- ver = SVR_VER(mfspr(SPR_SVR));
- switch (ver & ~0x0008) { /* Mask Security Enabled bit */
- case SVR_P4080:
- maxcpu = 8;
- break;
- case SVR_P4040:
- maxcpu = 4;
- break;
- case SVR_MPC8572:
- case SVR_P1020:
- case SVR_P2020:
- maxcpu = 2;
- break;
- default:
+ if ((cpus = OF_finddevice("/cpus")) != 0) {
+ for (maxcpu = 0, child = OF_child(cpus); child != 0;
+ child = OF_peer(child), maxcpu++)
+ ;
+ } else
maxcpu = 1;
- break;
- }
/*
* Clear local access windows. Skip DRAM entries, so we don't shoot
OpenPOWER on IntegriCloud