From patchwork Wed Jul 31 18:38:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2836527 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 B2DC29F9C8 for ; Wed, 31 Jul 2013 18:39:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF68520356 for ; Wed, 31 Jul 2013 18:39:16 +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 B5C8620333 for ; Wed, 31 Jul 2013 18:39:15 +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 1V4bIX-0004c0-U5; Wed, 31 Jul 2013 18:38:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4bIR-0007Bp-9I; Wed, 31 Jul 2013 18:38:51 +0000 Received: from mail-pb0-x232.google.com ([2607:f8b0:400e:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4bIE-00079P-5l for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2013 18:38:39 +0000 Received: by mail-pb0-f50.google.com with SMTP id uo5so1109577pbc.9 for ; Wed, 31 Jul 2013 11:38:16 -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=9VHl/9fWBYXg+n9qsB2T+eAXSk18hgkNFb1GRgjHTDw=; b=z/joThPVUUdCgC0fET+c/JJJwJ0z00fLOLwkjGDqeWBcAGJ/vyy+nImBgwqnUsLC+x fs5OCgHOBvOzw5OnlDUfl9RoNk0lQq93MHNEjRY9hw3I4DlM44aGw1G+bQMh3U3T1LQ3 9cXIKZUwDTP0Ym9b30UbPv12QhSVwRTnOQwnbvqtpQjmgj9UHk/9SNnHO/bfmFyxlxN5 kbLt9yelnSbb6BW2CN3rZXz6PSmvv/JZMZsn13OX/9Nbmf7b/Efzv1CAAKG7brBvWTFB zvD9xZIDipqDntSpQ7DL72OcEyzMMtHZSZmpUD86SD/EbBoZIu1Z6WmSWOy6Cz7eT3HD VLTQ== X-Received: by 10.69.4.5 with SMTP id ca5mr82130771pbd.109.1375295896637; Wed, 31 Jul 2013 11:38:16 -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 a5sm1309425pbw.4.2013.07.31.11.38.14 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 11:38:15 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Thu, 01 Aug 2013 03:38:27 +0900 Message-Id: <20130731183827.31551.83583.sendpatchset@w520> In-Reply-To: <20130731183808.31551.47235.sendpatchset@w520> References: <20130731183808.31551.47235.sendpatchset@w520> Subject: [PATCH 02/02] ARM: shmobile: Per-CPU SMP boot / sleep code for SCU SoCs X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130731_143838_373253_652F4A61 X-CRM114-Status: GOOD ( 11.41 ) X-Spam-Score: -2.0 (--) Cc: olof@lixom.net, horms@verge.net.au, Magnus Damm , linux-arm-kernel@lists.infradead.org, arnd@arndb.de 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.6 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 Hook in the per-CPU boot and sleep code in the shared mach-shmobile SCU code. CPUs may be kept in the asm routine until ->boot_secondary() when the per-CPU boot vector is installed. At the end of ->die() the asm sleep routine is invoked. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/platsmp-scu.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) --- 0006/arch/arm/mach-shmobile/platsmp-scu.c +++ work/arch/arm/mach-shmobile/platsmp-scu.c 2013-07-31 12:18:32.000000000 +0900 @@ -18,8 +18,9 @@ void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus) { - shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); - shmobile_boot_arg = (unsigned long)shmobile_scu_base; + /* install boot code shared by all CPUs */ + shmobile_boot_fn = virt_to_phys(shmobile_smp_boot); + shmobile_boot_arg = MPIDR_HWID_BITMASK; /* enable SCU and cache coherency on booting CPU */ scu_enable(shmobile_scu_base); @@ -28,22 +29,26 @@ void __init shmobile_smp_scu_prepare_cpu int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle) { - /* do nothing for now */ + /* For this particular CPU register SCU boot vector */ + shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu), + (unsigned long)shmobile_scu_base); return 0; } #ifdef CONFIG_HOTPLUG_CPU void shmobile_smp_scu_cpu_die(unsigned int cpu) { + /* For this particular CPU deregister boot vector */ + shmobile_smp_hook(cpu, 0, 0); + dsb(); flush_cache_all(); /* disable cache coherency */ scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF); - /* Endless loop until reset */ - while (1) - cpu_do_idle(); + /* jump to shared mach-shmobile sleep / reset code */ + shmobile_smp_sleep(); } static int shmobile_smp_scu_psr_core_disabled(int cpu)