From owner-svn-src-all@FreeBSD.ORG Sun Mar 2 19:46:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0885947; Sun, 2 Mar 2014 19:46:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2AC611F8; Sun, 2 Mar 2014 19:46:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s22Jk4Es035999; Sun, 2 Mar 2014 19:46:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22Jk43s035997; Sun, 2 Mar 2014 19:46:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403021946.s22Jk43s035997@svn.freebsd.org> From: Ian Lepore Date: Sun, 2 Mar 2014 19:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262695 - in head/sys/arm: conf freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 02 Mar 2014 19:46:04 -0000 Author: ian Date: Sun Mar 2 19:46:03 2014 New Revision: 262695 URL: http://svnweb.freebsd.org/changeset/base/262695 Log: Add a tunable to set the number of active cores, and enable SMP by default. Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/imx6_mp.c Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Sun Mar 2 17:19:19 2014 (r262694) +++ head/sys/arm/conf/IMX6 Sun Mar 2 19:46:03 2014 (r262695) @@ -143,7 +143,7 @@ options ROOTDEVNAME=\"ufs:mmcsd0s2a\" # ARM and SoC-specific options options FDT # Configure using FDT/DTB data. -#options SMP # Enable multiple cores +options SMP # Enable multiple cores options VFP # Enable floating point hardware support options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) Modified: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Sun Mar 2 17:19:19 2014 (r262694) +++ head/sys/arm/freescale/imx/imx6_mp.c Sun Mar 2 19:46:03 2014 (r262695) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -72,6 +73,7 @@ void platform_mp_setmaxid(void) { bus_space_handle_t scu; + int hwcpu, ncpu; uint32_t val; /* If we've already set the global vars don't bother to do it again. */ @@ -81,10 +83,16 @@ platform_mp_setmaxid(void) if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) panic("Couldn't map the SCU\n"); val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONFIG_REG); + hwcpu = (val & SCU_CONFIG_REG_NCPU_MASK) + 1; bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); - mp_maxid = (val & SCU_CONFIG_REG_NCPU_MASK); - mp_ncpus = mp_maxid + 1; + ncpu = hwcpu; + TUNABLE_INT_FETCH("hw.ncpu", &ncpu); + if (ncpu < 1 || ncpu > hwcpu) + ncpu = hwcpu; + + mp_ncpus = ncpu; + mp_maxid = ncpu - 1; } int