From patchwork Sat Sep 14 13:46:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2893331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7393B9F1BF for ; Sat, 14 Sep 2013 13:47:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A318820257 for ; Sat, 14 Sep 2013 13:47:06 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC89420184 for ; Sat, 14 Sep 2013 13:47:05 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKqBK-0002im-JB; Sat, 14 Sep 2013 13:46:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKqBA-0003l2-UC; Sat, 14 Sep 2013 13:46:28 +0000 Received: from mail-pb0-x235.google.com ([2607:f8b0:400e:c01::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKqB7-0003jm-J4 for linux-arm-kernel@lists.infradead.org; Sat, 14 Sep 2013 13:46:26 +0000 Received: by mail-pb0-f53.google.com with SMTP id up15so2352126pbc.12 for ; Sat, 14 Sep 2013 06:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=9hnvgjCLaIFx12LgIH7nnUW3RymCViabOwbzL0YjvAo=; b=b3K5RqbVN5ht0XxEiCJzaBQ+jI5H1cCrGryr7rO3itWhLHFQEkRxWabKBfhiRuI1sZ vgL8v2ze1NYEOA9c1tkgH9bxVqCrUPnEaXQLYbCD0we1Tni5NekjkY3SoKXrHHhnaxcu 6eoh216ZmyDHducexhU+odGBMo0j2ka/ZIZ1VTylhfK2vgubm59mLPtDSGcoi6pfXFPd BkWsrkb0/9ifmRpw/pxrJ02f/X/2SX5ZS/XYtP07+BPWeBWP97Zar4+ph8jgtmBBOxbi fHKZbjGFSvf6tvW+OASfT/XazHOWZRsoNcyxlFFRPHnXqLVn25lOFVFP3xhkQb/ds243 G26A== X-Received: by 10.66.218.166 with SMTP id ph6mr21237560pac.28.1379166363783; Sat, 14 Sep 2013 06:46:03 -0700 (PDT) Received: from [127.0.0.1] (ac230065.ppp.asahi-net.or.jp. [183.77.230.65]) by mx.google.com with ESMTPSA id xs1sm25235919pac.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Sep 2013 06:46:02 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Sat, 14 Sep 2013 22:46:25 +0900 Message-Id: <20130914134625.19258.10925.sendpatchset@w520> In-Reply-To: <20130914134616.19258.27110.sendpatchset@w520> References: <20130914134616.19258.27110.sendpatchset@w520> Subject: [PATCH 01/05] ARM: shmobile: Add CPU notifier based SCU boot vector code X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130914_094625_748090_D07BCE0B X-CRM114-Status: GOOD ( 11.61 ) X-Spam-Score: -2.0 (--) Cc: olof@lixom.net, horms@verge.net.au, Magnus Damm , arnd@arndb.de, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Add CPU notifiers for the shared mach-shmobile SCU code to allow removal of the shared SCU boot_secondary code. Regarding notifiers, at CPU_UP_PREPARE time the SMP boot vector is initialized so secondary CPU cores can boot. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/platsmp-scu.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) --- 0001/arch/arm/mach-shmobile/platsmp-scu.c +++ work/arch/arm/mach-shmobile/platsmp-scu.c 2013-09-14 22:15:07.000000000 +0900 @@ -7,6 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -16,6 +17,26 @@ #include #include +static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb, + unsigned long action, void *hcpu) +{ + unsigned int cpu = (long)hcpu; + + switch (action) { + case CPU_UP_PREPARE: + /* For this particular CPU register SCU SMP boot vector */ + shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu), + (unsigned long)shmobile_scu_base); + break; + }; + + return NOTIFY_OK; +} + +static struct notifier_block shmobile_smp_scu_notifier = { + .notifier_call = shmobile_smp_scu_notifier_call, +}; + void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus) { /* install boot code shared by all CPUs */ @@ -25,6 +46,9 @@ void __init shmobile_smp_scu_prepare_cpu /* enable SCU and cache coherency on booting CPU */ scu_enable(shmobile_scu_base); scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); + + /* Use CPU notifier for reset vector control */ + register_cpu_notifier(&shmobile_smp_scu_notifier); } int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle)