From patchwork Wed Jul 31 07:07:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2836116 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 E503F9F4D4 for ; Wed, 31 Jul 2013 07:08:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05F0D2015D for ; Wed, 31 Jul 2013 07:08:53 +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 AD9C9200EC for ; Wed, 31 Jul 2013 07:08:51 +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 1V4QW8-00074a-C9; Wed, 31 Jul 2013 07:08:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QVq-0005Hr-0G; Wed, 31 Jul 2013 07:07:58 +0000 Received: from mail-pb0-x22c.google.com ([2607:f8b0:400e:c01::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QVb-0005EX-U2 for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2013 07:07:44 +0000 Received: by mail-pb0-f44.google.com with SMTP id xa7so416844pbc.31 for ; Wed, 31 Jul 2013 00:07:21 -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=BPSsHiDObHKQE1HqtB531ugy77m7PXlg2Tai8P5wS8g=; b=Vr/IdiZ02rbtdC9HWBk0W+qYDRwbWq+LFy/A65ew4g6fObvyfhw0wS8BRi/+LGlABc RXboYiXDUFGOuzCVUg528PuUrzTrt48zolhG9q5XCRcfXiQf0MiK9jiNuuTAceAlXRsM L60z54DDDRcUcpnNBRtr20sk2/Ta++uW9NW/EArLf3ZGRVR0G4vuIvlLV+cxMi+C+Jut DSRDU18YbLjQow3tUWdLQq8PlOf/JxvNqSmip3FNm+rTk7lLCr4SJs+AAKtDCkuljkUS JEWCKcOi99BlFEYpHKztm9hhf5QP1Zom72i9QPoKrJQOJ07CRX6PZpxC+87psVVKzVUP w4Gg== X-Received: by 10.66.25.70 with SMTP id a6mr69409303pag.68.1375254440936; Wed, 31 Jul 2013 00:07:20 -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 sp4sm269099pbc.45.2013.07.31.00.07.18 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 00:07:19 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Wed, 31 Jul 2013 16:07:31 +0900 Message-Id: <20130731070731.14444.50089.sendpatchset@w520> In-Reply-To: <20130731070702.14444.64961.sendpatchset@w520> References: <20130731070702.14444.64961.sendpatchset@w520> Subject: [PATCH 03/07] ARM: shmobile: Use shared SCU SMP boot code on r8a7779 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130731_030744_044440_2B12D492 X-CRM114-Status: GOOD ( 12.86 ) 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 r8a7779 for SMP boot. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/Makefile | 2 +- arch/arm/mach-shmobile/smp-r8a7779.c | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) --- 0003/arch/arm/mach-shmobile/Makefile +++ work/arch/arm/mach-shmobile/Makefile 2013-07-31 11:56:16.000000000 +0900 @@ -33,7 +33,7 @@ endif # SMP objects smp-y := platsmp.o headsmp.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_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o # IRQ objects --- 0001/arch/arm/mach-shmobile/smp-r8a7779.c +++ work/arch/arm/mach-shmobile/smp-r8a7779.c 2013-07-31 11:55:30.000000000 +0900 @@ -84,33 +84,34 @@ static int r8a7779_platform_cpu_kill(uns static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) { struct r8a7779_pm_ch *ch = NULL; - int ret = -EIO; + unsigned int lcpu = cpu_logical_map(cpu); + int ret; - cpu = cpu_logical_map(cpu); + ret = shmobile_smp_scu_boot_secondary(cpu, idle); + if (ret) + return ret; - if (cpu < ARRAY_SIZE(r8a7779_ch_cpu)) - ch = r8a7779_ch_cpu[cpu]; + if (lcpu < ARRAY_SIZE(r8a7779_ch_cpu)) + ch = r8a7779_ch_cpu[lcpu]; if (ch) ret = r8a7779_sysc_power_up(ch); + else + ret = -EIO; return ret; } static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus) { - - /* setup r8a7779 specific SCU base */ - shmobile_scu_base = IOMEM(R8A7779_SCU_BASE); - scu_enable(shmobile_scu_base); - /* Map the reset vector (in headsmp-scu.S, headsmp.S) */ __raw_writel(__pa(shmobile_boot_vector), AVECR); 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 r8a7779 specific SCU bits */ + shmobile_scu_base = IOMEM(R8A7779_SCU_BASE); + shmobile_smp_scu_prepare_cpus(max_cpus); r8a7779_pm_init();