From patchwork Sat Apr 30 02:08:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 742952 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3U28ljr027707 for ; Sat, 30 Apr 2011 02:09:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759078Ab1D3CJB (ORCPT ); Fri, 29 Apr 2011 22:09:01 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:55615 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755809Ab1D3CJA (ORCPT ); Fri, 29 Apr 2011 22:09:00 -0400 Received: by mail-gw0-f46.google.com with SMTP id a18so1492059gwa.19 for ; Fri, 29 Apr 2011 19:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=xlLVZOeW3CsA8D0OGx5x7n3lnoQEsRjKqwSsSwWQ/Kk=; b=EtUsdDzc+i29+DDa+pkl9h24MckRyICqvzN2lCoFuOlcWD+Jfkg+rzbutx5usvlX0P em7DHEpwFgiy91GYyCuPZfEnUfmOHTX/Hd4rcU+7hjpCCoTk8nm1sT793/Huu7eGzc8N qoYX4kyywsiFP3Iwm/A/Jbq02OhqY43ZGHn4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=BEH8kc/JJ0B8+dndvey5rG2IGQjGv/WrWihfh+ZSK0yL/5yCm/PF885kbRt2j2ej5z ZrDv+AGUWeLRJbQpLAd9tztJ4vkVgvmTUboHUQIEi4jrN4J3jKs/5tjwuHyR0P5yRhSY uJV2kjOQdcSW/jhwgJchAr3sXxDQJFeXkhx7w= Received: by 10.236.176.193 with SMTP id b41mr6763578yhm.280.1304129340333; Fri, 29 Apr 2011 19:09:00 -0700 (PDT) Received: from rob-laptop.grandecom.net (65-36-74-215.dyn.grandenetworks.net [65.36.74.215]) by mx.google.com with ESMTPS id w6sm3345086anf.32.2011.04.29.19.08.58 (version=SSLv3 cipher=OTHER); Fri, 29 Apr 2011 19:08:59 -0700 (PDT) From: Rob Herring To: linux-arm-msm@vger.kernel.org, linux-sh@vger.kernel.org, Srinidhi Kasagar , Linus Walleij , Russell King , David Brown , Daniel Walker , Paul Mundt , linux-arm-kernel@lists.infradead.org Cc: Rob Herring Subject: [PATCH 04/10] ARM: add common scu_init_cpus Date: Fri, 29 Apr 2011 21:08:11 -0500 Message-Id: <1304129297-6614-5-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1304129297-6614-1-git-send-email-robherring2@gmail.com> References: <1304129297-6614-1-git-send-email-robherring2@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 30 Apr 2011 02:09:05 +0000 (UTC) From: Rob Herring Cortex-A9 SCU based platforms use the same code for smp_init_cpus, so create a common implementation for systems with an SCU. Signed-off-by: Rob Herring --- arch/arm/include/asm/smp_scu.h | 1 + arch/arm/kernel/smp_scu.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h index 4eb6d00..6b03557 100644 --- a/arch/arm/include/asm/smp_scu.h +++ b/arch/arm/include/asm/smp_scu.h @@ -7,6 +7,7 @@ #ifndef __ASSEMBLER__ unsigned int scu_get_core_count(void __iomem *); +void scu_init_cpus(void __iomem *); void scu_enable(void __iomem *); int scu_power_mode(void __iomem *, unsigned int); #endif diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c index a1e757c..e58b8c4 100644 --- a/arch/arm/kernel/smp_scu.c +++ b/arch/arm/kernel/smp_scu.c @@ -29,6 +29,25 @@ unsigned int __init scu_get_core_count(void __iomem *scu_base) return (ncores & 0x03) + 1; } +void __init scu_init_cpus(void __iomem *scu_base) +{ + unsigned int i, ncores; + + ncores = scu_get_core_count(scu_base); + + /* sanity check */ + if (ncores > NR_CPUS) { + printk(KERN_WARNING + "SCU: No. of cores (%d) greater than configured " + "maximum of %d - clipping\n", + ncores, NR_CPUS); + ncores = NR_CPUS; + } + + for (i = 0; i < ncores; i++) + set_cpu_possible(i, true); +} + /* * Enable the SCU */