From patchwork Fri May 30 05:18:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 4268711 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 CCA49BEEA7 for ; Fri, 30 May 2014 05:18:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD6A62034B for ; Fri, 30 May 2014 05:18:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95734201F7 for ; Fri, 30 May 2014 05:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751115AbaE3FSz (ORCPT ); Fri, 30 May 2014 01:18:55 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:62679 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750892AbaE3FSz (ORCPT ); Fri, 30 May 2014 01:18:55 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 30 May 2014 14:18:53 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 5E58D42954; Fri, 30 May 2014 14:18:53 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 51624180A0; Fri, 30 May 2014 14:18:53 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 4FD24180A1; Fri, 30 May 2014 14:18:53 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id QAP00834; Fri, 30 May 2014 14:18:53 +0900 X-IronPort-AV: E=Sophos;i="4.98,938,1392130800"; d="scan'208";a="161998048" Received: from mail-hk1lp0120.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.120]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES128-SHA; 30 May 2014 14:18:52 +0900 Received: from [10.161.20.223] (211.11.155.147) by HKXPR06MB117.apcprd06.prod.outlook.com (10.242.122.140) with Microsoft SMTP Server (TLS) id 15.0.954.9; Fri, 30 May 2014 05:18:51 +0000 Message-ID: <538814B8.1060406@renesas.com> Date: Fri, 30 May 2014 14:18:48 +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 v2] ARM: shmobile: r8a7791 SYSC setup code X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: HKXPR04CA008.apcprd04.prod.outlook.com (10.242.96.38) To HKXPR06MB117.apcprd06.prod.outlook.com (10.242.122.140) X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 02272225C5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(6049001)(6009001)(428001)(189002)(199002)(22564002)(85852003)(83072002)(31966008)(74502001)(20776003)(47776003)(66066001)(86152002)(92566001)(92726001)(79102001)(65956001)(74662001)(101416001)(4396001)(64706001)(80022001)(86362001)(50986999)(575784001)(54356999)(87266999)(65816999)(23736002)(77982001)(81542001)(42186004)(36756003)(64126003)(87976001)(99396002)(102836001)(81342001)(83506001)(83322001)(19580395003)(80316001)(19580405001)(33656002)(46102001)(76482001)(59896001)(21056001)(50466002); DIR:OUT; SFP:; SCL:1; SRVR:HKXPR06MB117; H:[10.161.20.223]; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A: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 Acked-by: Magnus Damm --- Changes since v2: - Fix typo - Fix in alphabetical order 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..fa651d6 --- /dev/null +++ b/arch/arm/mach-shmobile/pm-r8a7791.c @@ -0,0 +1,47 @@ +/* + * r8a7791 Power management support + * + * Copyright (C) 2014 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,