From patchwork Tue Jul 9 12:50:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2825269 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 96392C0AB2 for ; Tue, 9 Jul 2013 12:50:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8B30200DE for ; Tue, 9 Jul 2013 12:50:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B18C20136 for ; Tue, 9 Jul 2013 12:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753717Ab3GIMuL (ORCPT ); Tue, 9 Jul 2013 08:50:11 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:46057 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690Ab3GIMuK (ORCPT ); Tue, 9 Jul 2013 08:50:10 -0400 Received: by mail-pa0-f54.google.com with SMTP id kx10so5517771pab.13 for ; Tue, 09 Jul 2013 05:50:10 -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=/QsF9KwTKDOI3lQS9L8IrUwD/m3metetC4qxGnrMv/g=; b=sSjY+vXxN+kab2vK+AkIMCNDL/NsnJ9CkqrOMAqeTT0DVLraQHdWbh0eRgSt+b6n7i nfH/ZjMYki5fjKL1P4Lk3TPskHL4Jlfu9xtbGUA4yhxXyot0U41Yjcln+7ldWZ8QKOki GaqRsPzbVxT4t2b5PdOVXj+sspEnCmc1LU1qc4FOPOqo3aqqgAHQ+/7CjPBcX6xjkPCn dVRKC5RxNfQIWyiQPAXF+USEZfaKcRg7I8HeqnWd0J+yol3s8HU6z8g95KFMD6vuTxi6 1AuKO9N6elKX7bZxE/NI4atQtzd6wXEXjksaXx9+lXpXNysVj8DSsa2dN+2AhXP1fuqR rLIg== X-Received: by 10.66.9.71 with SMTP id x7mr23840298paa.37.1373374210196; Tue, 09 Jul 2013 05:50:10 -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 wi6sm28137628pbc.22.2013.07.09.05.50.08 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Jul 2013 05:50:09 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: arnd@arndb.de, horms@verge.net.au, ulrich.hecht@gmail.com, olof@lixom.net, shinya.kuribayashi.px@renesas.com, Magnus Damm , linux-arm-kernel@lists.infradead.org Date: Tue, 09 Jul 2013 21:50:16 +0900 Message-Id: <20130709125016.4388.47414.sendpatchset@w520> In-Reply-To: <20130709125007.4388.15701.sendpatchset@w520> References: <20130709125007.4388.15701.sendpatchset@w520> Subject: [PATCH 01/02] ARM: shmobile: Introduce r8a7790_read_mode_pins() 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.1 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 Break out the r8a7790 boot mode code into a separate function so it can be shared by multiple users. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/clock-r8a7790.c | 11 ++--------- arch/arm/mach-shmobile/include/mach/r8a7790.h | 3 +++ arch/arm/mach-shmobile/setup-r8a7790.c | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 9 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/clock-r8a7790.c +++ work/arch/arm/mach-shmobile/clock-r8a7790.c 2013-07-09 20:03:09.000000000 +0900 @@ -24,6 +24,7 @@ #include #include #include +#include /* * MD EXTAL PLL0 PLL1 PLL3 @@ -42,8 +43,6 @@ * see "p1 / 2" on R8A7790_CLOCK_ROOT() below */ -#define MD(nr) (1 << nr) - #define CPG_BASE 0xe6150000 #define CPG_LEN 0x1000 @@ -53,7 +52,6 @@ #define SMSTPCR5 0xe6150144 #define SMSTPCR7 0xe615014c -#define MODEMR 0xE6160060 #define SDCKCR 0xE6150074 #define SD2CKCR 0xE6150078 #define SD3CKCR 0xE615007C @@ -288,14 +286,9 @@ static struct clk_lookup lookups[] = { void __init r8a7790_clock_init(void) { - void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); - u32 mode; + u32 mode = r8a7790_read_mode_pins(); int k, ret = 0; - BUG_ON(!modemr); - mode = ioread32(modemr); - iounmap(modemr); - switch (mode & (MD(14) | MD(13))) { case 0: R8A7790_CLOCK_ROOT(15, &extal_clk, 172, 208, 106, 88); --- 0001/arch/arm/mach-shmobile/include/mach/r8a7790.h +++ work/arch/arm/mach-shmobile/include/mach/r8a7790.h 2013-07-09 20:02:34.000000000 +0900 @@ -8,4 +8,7 @@ void r8a7790_pinmux_init(void); void r8a7790_init_delay(void); void r8a7790_timer_init(void); +#define MD(nr) BIT(nr) +u32 r8a7790_read_mode_pins(void); + #endif /* __ASM_R8A7790_H__ */ --- 0001/arch/arm/mach-shmobile/setup-r8a7790.c +++ work/arch/arm/mach-shmobile/setup-r8a7790.c 2013-07-09 19:59:37.000000000 +0900 @@ -201,6 +201,20 @@ void __init r8a7790_add_standard_devices r8a7790_register_thermal(); } +#define MODEMR 0xe6160060 + +u32 __init r8a7790_read_mode_pins(void) +{ + void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); + u32 mode; + + BUG_ON(!modemr); + mode = ioread32(modemr); + iounmap(modemr); + + return mode; +} + void __init r8a7790_timer_init(void) { void __iomem *cntcr;