From patchwork Fri Jun 6 07:21:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 4310211 Return-Path: X-Original-To: patchwork-linux-sh@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 1BE899F387 for ; Fri, 6 Jun 2014 07:19:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34010201C8 for ; Fri, 6 Jun 2014 07:19:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C571201C7 for ; Fri, 6 Jun 2014 07:19:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752243AbaFFHTJ (ORCPT ); Fri, 6 Jun 2014 03:19:09 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:51622 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751658AbaFFHTI (ORCPT ); Fri, 6 Jun 2014 03:19:08 -0400 Received: by mail-pd0-f177.google.com with SMTP id g10so2202154pdj.22 for ; Fri, 06 Jun 2014 00:19:07 -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=MzHxcUlx+MZWsPxsbqDisT0QtQQsOd0w0+6uzPnjZAg=; b=iwBbPWczRw4UqU/8gx/PSlkUoTJX8XHIX4Gvxik7rYmGUNcyw0YyIvFpiVZm99qd64 vwlL31e+rDIs0U4Wk2rk2cRyCR09yieMZm+VAT8RBqhZyXsLfCWuFbj7Hy5uIrMNoY33 tiT//++7Qh8Ln2cwPKmF2LFUI2LXWbGZAVHoXEzVMujweLEwC3G2xUVxlsY7dsBMtsNx lAVvbZLw7iKM3Jq2yBNmvlsTI1ZqSYixBr5nFcQiH989JJfJ0zuu5Cc/U2V3c/6VF5NJ Dmr7wfaPVViCuwpWAu7qPgZynJFyDyuQLuoTlxeclCYjqv361wD52kjMY4hwQVv16mMg Cmww== X-Received: by 10.68.173.65 with SMTP id bi1mr5668543pbc.130.1402039147614; Fri, 06 Jun 2014 00:19:07 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id gw8sm32063200pbc.28.2014.06.06.00.19.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 00:19:06 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , horms@verge.net.au, geert@linux-m68k.org, keita.kobayashi.ym@renesas.com Date: Fri, 06 Jun 2014 16:21:11 +0900 Message-Id: <20140606072111.14868.23305.sendpatchset@w520> In-Reply-To: <20140606072010.14868.5474.sendpatchset@w520> References: <20140606072010.14868.5474.sendpatchset@w520> Subject: [PATCH v2 06/07] ARM: shmobile: Move r8a7791 reset code to pm-r8a7791.c Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Move r8a7791 specific reset vector setup code from the SMP glue code to PM code. This makes the code one step closer to allow PM operations such as Suspend-to-RAM in the case when SMP is disabled in the kernel config. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/pm-r8a7791.c | 28 ++++++++++++++++++++++++++-- arch/arm/mach-shmobile/smp-r8a7791.c | 24 ------------------------ 2 files changed, 26 insertions(+), 26 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/arch/arm/mach-shmobile/pm-r8a7791.c +++ work/arch/arm/mach-shmobile/pm-r8a7791.c 2014-06-06 14:58:04.000000000 +0900 @@ -9,12 +9,18 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ - -#include #include +#include +#include +#include #include #include +#define RST 0xe6160000 +#define CA15BAR 0x0020 +#define CA15RESCNT 0x0040 +#define RAM 0xe6300000 + /* SYSC */ #define SYSCIER 0x0c #define SYSCIMR 0x10 @@ -38,10 +44,28 @@ static inline void r8a7791_sysc_init(voi void __init r8a7791_pm_init(void) { + void __iomem *p; + u32 bar; static int once; if (once++) return; + /* RAM for jump stub, because BAR requires 256KB aligned address */ + p = ioremap_nocache(RAM, shmobile_boot_size); + memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); + iounmap(p); + + /* setup reset vectors */ + p = ioremap_nocache(RST, 0x63); + bar = (RAM >> 8) & 0xfffffc00; + writel_relaxed(bar, p + CA15BAR); + writel_relaxed(bar | 0x10, p + CA15BAR); + + /* enable clocks to all CPUs */ + writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, + p + CA15RESCNT); + iounmap(p); + r8a7791_sysc_init(); } --- 0001/arch/arm/mach-shmobile/smp-r8a7791.c +++ work/arch/arm/mach-shmobile/smp-r8a7791.c 2014-06-06 14:58:20.000000000 +0900 @@ -22,35 +22,11 @@ #include #include -#define RST 0xe6160000 -#define CA15BAR 0x0020 -#define CA15RESCNT 0x0040 -#define RAM 0xe6300000 - static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) { - void __iomem *p; - u32 bar; - /* let APMU code install data related to shmobile_boot_vector */ shmobile_smp_apmu_prepare_cpus(max_cpus); - /* RAM for jump stub, because BAR requires 256KB aligned address */ - p = ioremap_nocache(RAM, shmobile_boot_size); - memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); - iounmap(p); - - /* setup reset vectors */ - p = ioremap_nocache(RST, 0x63); - bar = (RAM >> 8) & 0xfffffc00; - writel_relaxed(bar, p + CA15BAR); - writel_relaxed(bar | 0x10, p + CA15BAR); - - /* enable clocks to all CPUs */ - writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, - p + CA15RESCNT); - iounmap(p); - r8a7791_pm_init(); shmobile_smp_apmu_suspend_init(); }