From patchwork Wed Jul 31 07:07:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2836119 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 2C5039F4D4 for ; Wed, 31 Jul 2013 07:10:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 006F720114 for ; Wed, 31 Jul 2013 07:10:05 +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 B4E1320111 for ; Wed, 31 Jul 2013 07:10:03 +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 1V4QWs-0007al-32; Wed, 31 Jul 2013 07:09:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QWO-0005KS-Ie; Wed, 31 Jul 2013 07:08:32 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QW3-0005HZ-CT for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2013 07:08:12 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj1so523575pad.14 for ; Wed, 31 Jul 2013 00:07:49 -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=Sx366N7zTA/vdJHC7+m+CrPEyOtQEwo1m55GSe8X+Mg=; b=wPjg3x7Go/zQelEud3uemKE4Xgj7BL85gkoGZD4ee0Iv2Kev0+6KMqZESNvB1A5Z5D B4g5M7Hzk8Mjgu/FTYInKEf3EmaAdHgxTEPHpqxpJK9y6d/CHUjnCh7L1jViYONYv/8N evP9l1OFxbA/YoK6dKWnf1uoZZmg2LlUXPEqFY8K+tDuhUBpelSk3cxjZfafJY9wa8NL mEhdS+xWbBwE4HbJdlk+AbxRZdDNtnpV+FGXyYosUvve68Dzq4OF0+2jxeRpLgiflGh7 TBIrfbdMFygB+IP8SnfPt630FLZ19qYyjeayYHH1tsWmZXqeedJJkmc8fB4Y4O7z/GhW y+GA== X-Received: by 10.66.40.212 with SMTP id z20mr68553281pak.51.1375254469824; Wed, 31 Jul 2013 00:07:49 -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 ib9sm273395pbc.43.2013.07.31.00.07.46 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 00:07:48 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Wed, 31 Jul 2013 16:07:59 +0900 Message-Id: <20130731070759.14444.7805.sendpatchset@w520> In-Reply-To: <20130731070702.14444.64961.sendpatchset@w520> References: <20130731070702.14444.64961.sendpatchset@w520> Subject: [PATCH 06/07] ARM: shmobile: Use shared SCU CPU Hotplug code on sh73a0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130731_030811_584156_7475E17B X-CRM114-Status: GOOD ( 14.26 ) 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 Update the sh73a0 specific CPU Hotplug code to make use of the recently introduced shared SCU functions. The sh73a0 power control hardware relies on SCU_PM_POWEROFF with WFI so the shared SCU code will as-is power down the hardware as expected. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/smp-sh73a0.c | 41 ++--------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) --- 0005/arch/arm/mach-shmobile/smp-sh73a0.c +++ work/arch/arm/mach-shmobile/smp-sh73a0.c 2013-07-29 21:48:41.000000000 +0900 @@ -20,14 +20,11 @@ #include #include #include -#include #include #include #include -#include -#include #include -#include +#include #include #define WUPCR IOMEM(0xe6151010) @@ -36,8 +33,6 @@ #define SBAR IOMEM(0xe6180020) #define APARMBAREA IOMEM(0xe6f10020) -#define PSTR_SHUTDOWN_MODE 3 - #define SH73A0_SCU_BASE 0xf0000000 #ifdef CONFIG_HAVE_ARM_TWD @@ -77,36 +72,6 @@ static void __init sh73a0_smp_prepare_cp } #ifdef CONFIG_HOTPLUG_CPU -static int sh73a0_cpu_kill(unsigned int cpu) -{ - - int k; - u32 pstr; - - /* - * wait until the power status register confirms the shutdown of the - * offline target - */ - for (k = 0; k < 1000; k++) { - pstr = (__raw_readl(PSTR) >> (4 * cpu)) & 3; - if (pstr == PSTR_SHUTDOWN_MODE) - return 1; - - mdelay(1); - } - - return 0; -} - -static void sh73a0_cpu_die(unsigned int cpu) -{ - /* Set power off mode. This takes the CPU out of the MP cluster */ - scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF); - - /* Enter shutdown mode */ - cpu_do_idle(); -} - static int sh73a0_cpu_disable(unsigned int cpu) { return 0; /* CPU0 and CPU1 supported */ @@ -117,8 +82,8 @@ struct smp_operations sh73a0_smp_ops __i .smp_prepare_cpus = sh73a0_smp_prepare_cpus, .smp_boot_secondary = sh73a0_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU - .cpu_kill = sh73a0_cpu_kill, - .cpu_die = sh73a0_cpu_die, .cpu_disable = sh73a0_cpu_disable, + .cpu_die = shmobile_smp_scu_cpu_die, + .cpu_kill = shmobile_smp_scu_cpu_kill, #endif };