From owner-svn-src-all@FreeBSD.ORG Fri Jun 5 09:46:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A96541065670; Fri, 5 Jun 2009 09:46:00 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 973338FC17; Fri, 5 Jun 2009 09:46:00 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n559k0SN020725; Fri, 5 Jun 2009 09:46:00 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n559k0xD020724; Fri, 5 Jun 2009 09:46:00 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200906050946.n559k0xD020724@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 5 Jun 2009 09:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193492 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 09:46:01 -0000 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++;