From patchwork Wed Jul 31 07:07:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2836113 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 08C609F4D4 for ; Wed, 31 Jul 2013 07:08:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFAE22015D for ; Wed, 31 Jul 2013 07:08:14 +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 E562E200EC for ; Wed, 31 Jul 2013 07:08:13 +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 1V4QVm-0006ru-KY; Wed, 31 Jul 2013 07:07:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QVd-0005Gr-Ko; Wed, 31 Jul 2013 07:07:45 +0000 Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QVR-0005E0-9e for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2013 07:07:34 +0000 Received: by mail-pd0-f172.google.com with SMTP id z10so409627pdj.17 for ; Wed, 31 Jul 2013 00:07:11 -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=t2iUkX4afXn55i7HM4sUatfZ/lFrKUGpcZZGRC8MsH4=; b=jYysca/sd4ChLRz268F3e4PGbexdsqCtPUUBnuCNHkYNAmXPV5+JliAsygyx2ke4XY hIOvKptFtyNdxxs0QK3/XhwzchATxYKeByhR+BBH+cTpi41+VMrR/HnqjoOaodbqmTGV 4mjTJhNfp0zNnyrzdZB9XmbfEzQ18RBQeTw5Ca4g9Jr8+L3WUs9VZKuHC8K9ZxucNGHd DdOIrekG/GFfTcAO3/6JICvhsjw2jZFE2uM3JAJIz8g/LWxTuiQnhg9gEpAzBsv4HRef DMmuzbocswv1GLoA7lmf87cLKDjc4SLYo6X0qyz/Eh1SICadaUTgFoio+Y3UsRc/zyrU nWPA== X-Received: by 10.66.145.34 with SMTP id sr2mr78786947pab.94.1375254431647; Wed, 31 Jul 2013 00:07:11 -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 eq5sm315550pbc.15.2013.07.31.00.07.08 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 00:07:10 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Wed, 31 Jul 2013 16:07:21 +0900 Message-Id: <20130731070721.14444.80422.sendpatchset@w520> In-Reply-To: <20130731070702.14444.64961.sendpatchset@w520> References: <20130731070702.14444.64961.sendpatchset@w520> Subject: [PATCH 02/07] ARM: shmobile: Use shared SCU SMP boot code on sh73a0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130731_030733_485482_592A27C3 X-CRM114-Status: GOOD ( 12.31 ) X-Spam-Score: -2.0 (--) Cc: arnd@arndb.de, Magnus Damm , horms@verge.net.au, ulrich.hecht@gmail.com, olof@lixom.net, 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.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 Use shared SCU code on sh73a0 for SMP boot. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/Makefile | 2 +- arch/arm/mach-shmobile/smp-sh73a0.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) --- 0001/arch/arm/mach-shmobile/Makefile +++ work/arch/arm/mach-shmobile/Makefile 2013-07-29 21:40:18.000000000 +0900 @@ -17,7 +17,7 @@ obj-$(CONFIG_ARCH_EMEV2) += setup-emev2. # SMP objects smp-y := platsmp.o headsmp.o -smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o +smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o --- 0002/arch/arm/mach-shmobile/smp-sh73a0.c +++ work/arch/arm/mach-shmobile/smp-sh73a0.c 2013-07-29 21:41:27.000000000 +0900 @@ -50,30 +50,30 @@ void __init sh73a0_register_twd(void) static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle) { - cpu = cpu_logical_map(cpu); + unsigned int lcpu = cpu_logical_map(cpu); + int ret; - if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3) - __raw_writel(1 << cpu, WUPCR); /* wake up */ + ret = shmobile_smp_scu_boot_secondary(cpu, idle); + if (ret) + return ret; + + if (((__raw_readl(PSTR) >> (4 * lcpu)) & 3) == 3) + __raw_writel(1 << lcpu, WUPCR); /* wake up */ else - __raw_writel(1 << cpu, SRESCR); /* reset */ + __raw_writel(1 << lcpu, SRESCR); /* reset */ return 0; } static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) { - /* setup sh73a0 specific SCU base */ - shmobile_scu_base = IOMEM(SH73A0_SCU_BASE); - scu_enable(shmobile_scu_base); - - /* Map the reset vector (in headsmp-scu.S, headsmp.S) */ + /* Map the reset vector (in headsmp.S) */ __raw_writel(0, APARMBAREA); /* 4k */ __raw_writel(__pa(shmobile_boot_vector), SBAR); - shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); - shmobile_boot_arg = (unsigned long)shmobile_scu_base; - /* enable cache coherency on booting CPU */ - scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); + /* setup sh73a0 specific SCU bits */ + shmobile_scu_base = IOMEM(SH73A0_SCU_BASE); + shmobile_smp_scu_prepare_cpus(max_cpus); } #ifdef CONFIG_HOTPLUG_CPU