From patchwork Thu May 29 07:10:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 4262371 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 4A39CBF90B for ; Thu, 29 May 2014 07:11:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F0F920109 for ; Thu, 29 May 2014 07:10:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EFA020103 for ; Thu, 29 May 2014 07:10:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754209AbaE2HK5 (ORCPT ); Thu, 29 May 2014 03:10:57 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:25583 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753763AbaE2HK5 (ORCPT ); Thu, 29 May 2014 03:10:57 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 29 May 2014 16:10:56 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 20935483D3; Thu, 29 May 2014 16:10:56 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 20DC980195; Thu, 29 May 2014 16:10:56 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 1B38A80193; Thu, 29 May 2014 16:10:56 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id SAD13190; Thu, 29 May 2014 16:10:56 +0900 X-IronPort-AV: E=Sophos;i="4.98,932,1392130800"; d="scan'208";a="160870933" Received: from mail-hk1lp0119.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.119]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES128-SHA; 29 May 2014 16:10:55 +0900 Received: from [10.161.20.223] (211.11.155.147) by SIXPR06MB126.apcprd06.prod.outlook.com (10.242.148.22) with Microsoft SMTP Server (TLS) id 15.0.949.11; Thu, 29 May 2014 07:10:53 +0000 Message-ID: <5386DD74.3000202@renesas.com> Date: Thu, 29 May 2014 16:10:44 +0900 From: keita kobayashi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: CC: , Subject: [PATCH] ARM: shmobile: r8a7791 SYSC setup code X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: SINPR06CA018.apcprd06.prod.outlook.com (10.141.109.48) To SIXPR06MB126.apcprd06.prod.outlook.com (10.242.148.22) X-Forefront-PRVS: 022649CC2C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(6009001)(6049001)(428001)(22564002)(199002)(189002)(74502001)(74662001)(50466002)(31966008)(87976001)(59896001)(4396001)(77982001)(85852003)(83072002)(76482001)(46102001)(42186004)(81342001)(81542001)(50986999)(99396002)(36756003)(101416001)(33656002)(87266999)(54356999)(20776003)(92566001)(47776003)(86152002)(64706001)(86362001)(65816999)(575784001)(92726001)(21056001)(66066001)(79102001)(102836001)(65956001)(80022001)(65806001)(83506001)(19580405001)(83322001)(19580395003)(64126003)(23736002); DIR:OUT; SFP:; SCL:1; SRVR:SIXPR06MB126; H:[10.161.20.223]; FPR:; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=keita.kobayashi.ym@renesas.com; X-OriginatorOrg: renesas.com 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Add r8a7791 SYSC power management support. Signed-off-by: Keita Kobayashi --- arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/include/mach/r8a7791.h | 1 + arch/arm/mach-shmobile/pm-r8a7791.c | 47 +++++++++++++++++++++++++ arch/arm/mach-shmobile/smp-r8a7791.c | 2 ++ 4 files changed, 51 insertions(+) create mode 100644 arch/arm/mach-shmobile/pm-r8a7791.c diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 0d6a04c..29034aa 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -53,6 +53,7 @@ obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o +obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o # Board objects ifdef CONFIG_ARCH_SHMOBILE_MULTI diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h index 664274c..86eae7b 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7791.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7791.h @@ -5,6 +5,7 @@ void r8a7791_add_standard_devices(void); void r8a7791_add_dt_devices(void); void r8a7791_clock_init(void); void r8a7791_pinmux_init(void); +void r8a7791_pm_init(void); extern struct smp_operations r8a7791_smp_ops; #endif /* __ASM_R8A7791_H__ */ diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c new file mode 100644 index 0000000..657918a --- /dev/null +++ b/arch/arm/mach-shmobile/pm-r8a7791.c @@ -0,0 +1,47 @@ +/* + * r8a7791 Power management support + * + * Copyright (C) 2013 Renesas Electronics Corporation + * Copyright (C) 2011 Renesas Solutions Corp. + * Copyright (C) 2011 Magnus Damm + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#include +#include +#include +#include + +/* SYSC */ +#define SYSCIER 0x0c +#define SYSCIMR 0x10 + +#if defined(CONFIG_SMP) + +static void __init r8a7791_sysc_init(void) +{ + void __iomem *base = rcar_sysc_init(0xe6180000); + + /* enable all interrupt sources, but do not use interrupt handler */ + iowrite32(0x0131000e, base + SYSCIER); + iowrite32(0, base + SYSCIMR); +} + +#else /* CONFIG_SMP */ + +static inline void r8a7791_sysc_init(void) {} + +#endif /* CONFIG_SMP */ + +void __init r8a7791_pm_init(void) +{ + static int once; + + if (once++) + return; + + r8a7791_sysc_init(); +} diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index ec97952..ddccef6 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c @@ -50,6 +50,8 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, p + CA15RESCNT); iounmap(p); + + r8a7791_pm_init(); } static int r8a7791_smp_boot_secondary(unsigned int cpu,