From patchwork Wed Jan 15 12:25:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3491651 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 1F6519F32F for ; Wed, 15 Jan 2014 12:25:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08EEC20171 for ; Wed, 15 Jan 2014 12:25:51 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C683B20166 for ; Wed, 15 Jan 2014 12:25:49 +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 1W3PX9-0006GV-O4; Wed, 15 Jan 2014 12:25:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W3PX1-0005YY-Gz; Wed, 15 Jan 2014 12:25:15 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W3PWy-0005WL-Ub for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2014 12:25:14 +0000 Received: by mail-pa0-f43.google.com with SMTP id rd3so1078284pab.2 for ; Wed, 15 Jan 2014 04:24:51 -0800 (PST) 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=xFtIRj0Ex8gsQGUhaiDV1rIzS3PmRY55+DHPlBhZ0Dk=; b=eetAY0gzI0lgSxp/7EQY2Sf9isO6CbfNjc/FvqQobHB6WwiHepGGeNvMDW4rhzS3n0 gTAJuDNujhcfe72OVeymMrO48gkWW8yyFdVn8L673mcquepSm8eB1FejKfw6xhLh3+Ua Ijc8tMopayBLORP79HJt68mt9ShGI0uyb6ShmmYrqh7PcDIlGCH3Mp+5DWHZ13Re3hoB jiL+1cpYnMu6pQFky4tdCeurA2zWSxqJ7Dh0n5sZ4XBBk5Z6OuBMixb3rs1DFESMxST9 1cmawdKbHKqj/w1aXJwaLzKGgP6jIyLFZdeFUpzzXhP9tasiA8uRA48jg0BaxBD8URIH 1Ayw== X-Received: by 10.68.203.163 with SMTP id kr3mr2360058pbc.33.1389788685502; Wed, 15 Jan 2014 04:24:45 -0800 (PST) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id vp4sm10047078pab.8.2014.01.15.04.24.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jan 2014 04:24:44 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Wed, 15 Jan 2014 21:25:49 +0900 Message-Id: <20140115122549.9437.86422.sendpatchset@w520> In-Reply-To: <20140115122539.9437.63968.sendpatchset@w520> References: <20140115122539.9437.63968.sendpatchset@w520> Subject: [PATCH 01/04] ARM: shmobile: r8a7790 SYSC setup code X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140115_072513_056491_738DAEE8 X-CRM114-Status: GOOD ( 11.61 ) X-Spam-Score: -2.0 (--) Cc: horms@verge.net.au, Magnus Damm , 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=-4.4 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: Hisashi Nakamura Add r8a7790 SYSC power management support. Signed-off-by: Hisashi Nakamura Signed-off-by: Ryo Kataoka [damm@opensource.se: Converted to use broken out SYSC code] Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/Makefile | 1 arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 arch/arm/mach-shmobile/pm-r8a7790.c | 45 +++++++++++++++++++++++++ 3 files changed, 47 insertions(+) --- 0002/arch/arm/mach-shmobile/Makefile +++ work/arch/arm/mach-shmobile/Makefile 2014-01-15 14:21:49.000000000 +0900 @@ -53,6 +53,7 @@ obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o 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 # Board objects ifdef CONFIG_ARCH_SHMOBILE_MULTI --- 0001/arch/arm/mach-shmobile/include/mach/r8a7790.h +++ work/arch/arm/mach-shmobile/include/mach/r8a7790.h 2014-01-15 14:26:29.000000000 +0900 @@ -32,6 +32,7 @@ void r8a7790_add_standard_devices(void); void r8a7790_add_dt_devices(void); void r8a7790_clock_init(void); void r8a7790_pinmux_init(void); +void r8a7790_pm_init(void); void r8a7790_init_early(void); extern struct smp_operations r8a7790_smp_ops; --- /dev/null +++ work/arch/arm/mach-shmobile/pm-r8a7790.c 2014-01-15 14:23:40.000000000 +0900 @@ -0,0 +1,45 @@ +/* + * r8a7790 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 r8a7790_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 r8a7790_sysc_init(void) {} + +#endif /* CONFIG_SMP */ + +void __init r8a7790_pm_init(void) +{ + static int once; + + if (!once++) + r8a7790_sysc_init(); +}