From patchwork Wed Mar 4 04:55:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 5928681 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 B4C4CBF440 for ; Wed, 4 Mar 2015 04:56:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D86E2203EB for ; Wed, 4 Mar 2015 04:56:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E60FF203C1 for ; Wed, 4 Mar 2015 04:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757707AbbCDE43 (ORCPT ); Tue, 3 Mar 2015 23:56:29 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:52416 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755288AbbCDE43 (ORCPT ); Tue, 3 Mar 2015 23:56:29 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 04 Mar 2015 13:56:27 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 5E26645D57; Wed, 4 Mar 2015 13:56:27 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 3E57A480A5; Wed, 4 Mar 2015 13:56:27 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 2A910480A4; Wed, 4 Mar 2015 13:56:27 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id PAY27913; Wed, 4 Mar 2015 13:56:27 +0900 X-IronPort-AV: E=Sophos;i="5.09,685,1418050800"; d="scan'208";a="181119575" Received: from mail-sg1lp0092.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.92]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Mar 2015 13:56:26 +0900 Received: from localhost (211.11.155.147) by HKXPR06MB0567.apcprd06.prod.outlook.com (25.161.177.145) with Microsoft SMTP Server (TLS) id 15.1.99.14; Wed, 4 Mar 2015 04:56:25 +0000 From: Keita Kobayashi To: , CC: , , , Keita Kobayashi Subject: [RFC/PATCH 5/6] ARM: shmobile: r8a7790: Add Core-Standby CPUIdle support for r8a7790 Date: Wed, 4 Mar 2015 13:55:45 +0900 Message-ID: <1425444946-3084-6-git-send-email-keita.kobayashi.ym@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.2 In-Reply-To: <1425444946-3084-1-git-send-email-keita.kobayashi.ym@renesas.com> References: <1425444946-3084-1-git-send-email-keita.kobayashi.ym@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: OS2PR01CA0001.jpnprd01.prod.outlook.com (25.161.74.139) To HKXPR06MB0567.apcprd06.prod.outlook.com (25.161.177.145) Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB0567; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006); SRVR:HKXPR06MB0567; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB0567; X-Forefront-PRVS: 0505147DDB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(77156002)(47776003)(19580405001)(19580395003)(92566002)(50226001)(78352002)(122386002)(87976001)(33646002)(76176999)(46102003)(42382002)(50466002)(229853001)(66066001)(76506005)(62966003)(40100003)(2950100001)(42186005)(50986999)(36756003)(48376002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB0567; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2015 04:56:25.1697 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB0567 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 the CPUIdle support power state support for the r8a7790 SoC. This patch add the wfi and Core-Standby for CPUIdle power states support for the Cortex-A15 and add the wfi power state support for the Cortex-A7. Signed-off-by: Keita Kobayashi --- arch/arm/mach-shmobile/pm-r8a7790.c | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c index 80e8d95..6a3751f 100644 --- a/arch/arm/mach-shmobile/pm-r8a7790.c +++ b/arch/arm/mach-shmobile/pm-r8a7790.c @@ -10,8 +10,13 @@ * for more details. */ +#include #include #include +#include +#include +#include +#include #include #include "common.h" #include "pm-rcar.h" @@ -48,6 +53,55 @@ static inline void r8a7790_sysc_init(void) {} #endif /* CONFIG_SMP */ +#ifdef CONFIG_ARM_RENESAS_CPUIDLE +static struct cpuidle_driver r8a7790_ca15_cpuidle_driver = { + .name = "rcar_r8a7790_ca15_cpuidle", + .owner = THIS_MODULE, + .states = { + [0] = ARM_CPUIDLE_WFI_STATE, + [1] = { + .name = "Core-Standby", + .desc = "Core Standby Mode", + .exit_latency = 3000, + .target_residency = 3000, + .enter = shmobile_smp_apmu_enter_cpuidle, + }, + }, + .state_count = 2, +}; + +static struct cpuidle_driver r8a7790_ca7_cpuidle_driver = { + .name = "rcar_r8a7790_ca7_cpuidle", + .owner = THIS_MODULE, + .states[0] = ARM_CPUIDLE_WFI_STATE, + .safe_state_index = 0, /* C1 */ + .state_count = 1, +}; + +static struct renesas_cpuidle_driver r8a7790_cpuidle[] = { + [0] = { + .target_cpu = ARM_CPU_PART_CORTEX_A15, + .renesas_drv = &r8a7790_ca15_cpuidle_driver, + }, + [1] = { + .target_cpu = ARM_CPU_PART_CORTEX_A7, + .renesas_drv = &r8a7790_ca7_cpuidle_driver, + }, +}; + +static struct renesas_cpuidle r8a7790_data = { + .num_drvs = ARRAY_SIZE(r8a7790_cpuidle), + .rcd = r8a7790_cpuidle, +}; + +static void __init r8a7790_cpuidle_init(void) +{ + shmobile_cpuidle_set_driver(&r8a7790_data); +} +#else +static void __init r8a7790_cpuidle_init(void) {} +#endif + void __init r8a7790_pm_init(void) { void __iomem *p; @@ -79,4 +133,5 @@ void __init r8a7790_pm_init(void) r8a7790_sysc_init(); shmobile_smp_apmu_suspend_init(); + r8a7790_cpuidle_init(); }