From patchwork Tue Mar 3 01:20:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaku Inami X-Patchwork-Id: 5918651 X-Patchwork-Delegate: horms@verge.net.au 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E8DC2BF440 for ; Tue, 3 Mar 2015 01:25:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02FB52025B for ; Tue, 3 Mar 2015 01:25:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C6A42025A for ; Tue, 3 Mar 2015 01:25:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754631AbbCCBZp (ORCPT ); Mon, 2 Mar 2015 20:25:45 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:38726 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753730AbbCCBZp (ORCPT ); Mon, 2 Mar 2015 20:25:45 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 03 Mar 2015 10:25:43 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id BE9B443207; Tue, 3 Mar 2015 10:25:43 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id B39401806F; Tue, 3 Mar 2015 10:25:43 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 6EE9A1800A; Tue, 3 Mar 2015 10:25:43 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id LAJ09542; Tue, 3 Mar 2015 10:25:43 +0900 X-IronPort-AV: E=Sophos;i="5.09,679,1418050800"; d="scan'208";a="182108153" Received: from mail-hk1lp0122.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.122]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 03 Mar 2015 10:25:43 +0900 Received: from [10.164.207.238] (211.11.155.149) by HK2PR06MB0529.apcprd06.prod.outlook.com (25.161.183.147) with Microsoft SMTP Server (TLS) id 15.1.99.14; Tue, 3 Mar 2015 01:25:41 +0000 Message-ID: <54F50C56.5030605@bp.renesas.com> Date: Tue, 3 Mar 2015 10:20:22 +0900 From: Gaku Inami User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: CC: , Subject: [PATCH 1/5] ARM: shmobile: r8a7794 SYSC setup code X-Originating-IP: [211.11.155.149] X-ClientProxiedBy: HKNPR06CA0061.apcprd06.prod.outlook.com (10.141.16.51) To HK2PR06MB0529.apcprd06.prod.outlook.com (25.161.183.147) Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0529; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006); SRVR:HK2PR06MB0529; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0529; X-Forefront-PRVS: 0504F29D72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6049001)(22564002)(77096005)(42186005)(575784001)(86362001)(92566002)(54356999)(23736002)(65816999)(19580405001)(50986999)(19580395003)(120846001)(83506001)(87976001)(50466002)(40100003)(122386002)(77156002)(62966003)(110136001)(229853001)(2351001)(66066001)(65956001)(47776003)(65806001)(46102003)(33656002); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0529; H:[10.164.207.238]; FPR:; SPF:None; MLV:sfv; LANG:en; X-OriginatorOrg: bp.renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2015 01:25:41.5657 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0529 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 r8a7794 SYSC power management support. Signed-off-by: Gaku Inami --- arch/arm/mach-shmobile/Makefile | 2 +- arch/arm/mach-shmobile/pm-r8a7794.c | 44 +++++++++++++++++++++++++++++++++++ arch/arm/mach-shmobile/r8a7794.h | 6 +++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-shmobile/pm-r8a7794.c create mode 100644 arch/arm/mach-shmobile/r8a7794.h diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index d3aca07..cde95f8 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -13,7 +13,7 @@ obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o pm-r8a7779.o obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o pm-r8a7790.o obj-$(CONFIG_ARCH_R8A7791) += setup-r8a7791.o pm-r8a7791.o -obj-$(CONFIG_ARCH_R8A7794) += setup-r8a7794.o +obj-$(CONFIG_ARCH_R8A7794) += setup-r8a7794.o pm-r8a7794.o obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o obj-$(CONFIG_ARCH_R7S72100) += setup-r7s72100.o diff --git a/arch/arm/mach-shmobile/pm-r8a7794.c b/arch/arm/mach-shmobile/pm-r8a7794.c new file mode 100644 index 0000000..a8a94cf --- /dev/null +++ b/arch/arm/mach-shmobile/pm-r8a7794.c @@ -0,0 +1,44 @@ +/* + * r8a7794 Power management support + * + * Copyright (C) 2015 Renesas Electronics Corporation + * + * 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 "pm-rcar.h" +#include "r8a7794.h" + +/* SYSC */ +#define SYSCIER 0x0c +#define SYSCIMR 0x10 + +#if defined(CONFIG_SMP) + +static void __init r8a7794_sysc_init(void) +{ + void __iomem *base = rcar_sysc_init(0xe6180000); + + /* enable all interrupt sources, but do not use interrupt handler */ + iowrite32(0x00310060, base + SYSCIER); + iowrite32(0, base + SYSCIMR); +} + +#else /* CONFIG_SMP */ + +static inline void r8a7794_sysc_init(void) {} + +#endif /* CONFIG_SMP */ + +void __init r8a7794_pm_init(void) +{ + static int once; + + if (once++) + return; + + r8a7794_sysc_init(); +} diff --git a/arch/arm/mach-shmobile/r8a7794.h b/arch/arm/mach-shmobile/r8a7794.h new file mode 100644 index 0000000..b83d387 --- /dev/null +++ b/arch/arm/mach-shmobile/r8a7794.h @@ -0,0 +1,6 @@ +#ifndef __ASM_R8A7794_H__ +#define __ASM_R8A7794_H__ + +void r8a7794_pm_init(void); + +#endif /* __ASM_R8A7794_H__ */