From patchwork Thu Mar 5 08:59:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: keita kobayashi X-Patchwork-Id: 5944191 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 B2375BF440 for ; Thu, 5 Mar 2015 08:59:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D8EC520364 for ; Thu, 5 Mar 2015 08:59:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 079E3202AE for ; Thu, 5 Mar 2015 08:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754706AbbCEI7m (ORCPT ); Thu, 5 Mar 2015 03:59:42 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:5460 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754270AbbCEI7m (ORCPT ); Thu, 5 Mar 2015 03:59:42 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 05 Mar 2015 17:59:41 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 19E334DCFB; Thu, 5 Mar 2015 17:59:41 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id EA27A480A4; Thu, 5 Mar 2015 17:59:40 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id E1EE2480A3; Thu, 5 Mar 2015 17:59:40 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id TAN04274; Thu, 5 Mar 2015 17:59:40 +0900 X-IronPort-AV: E=Sophos;i="5.11,345,1422889200"; d="scan'208";a="182365012" Received: from mail-sg1lp0088.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.88]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 05 Mar 2015 17:59:40 +0900 Received: from localhost (211.11.155.147) by HK2PR06MB0564.apcprd06.prod.outlook.com (25.161.183.16) with Microsoft SMTP Server (TLS) id 15.1.106.15; Thu, 5 Mar 2015 08:59:38 +0000 From: Keita Kobayashi To: , CC: , , , , Keita Kobayashi Subject: [RFC/PATCH v2 5/6] ARM: shmobile: r8a7790: Add Core-Standby CPUIdle support for r8a7790 Date: Thu, 5 Mar 2015 17:59:02 +0900 Message-ID: <1425545943-1440-6-git-send-email-keita.kobayashi.ym@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.2 In-Reply-To: <1425545943-1440-1-git-send-email-keita.kobayashi.ym@renesas.com> References: <1425545943-1440-1-git-send-email-keita.kobayashi.ym@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: OS2PR01CA0022.jpnprd01.prod.outlook.com (25.161.74.160) To HK2PR06MB0564.apcprd06.prod.outlook.com (25.161.183.16) Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0564; X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(6069001)(87976001)(229853001)(50466002)(48376002)(33646002)(42382002)(19580395003)(76176999)(2950100001)(50986999)(46102003)(92566002)(62966003)(77156002)(78352002)(122386002)(40100003)(76506005)(19580405001)(47776003)(36756003)(50226001)(66066001)(42186005); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0564; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002007)(5005006); SRVR:HK2PR06MB0564; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0564; X-Forefront-PRVS: 05066DEDBB X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2015 08:59:38.4753 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0564 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 | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c index 80e8d95..70b2334 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,46 @@ static inline void r8a7790_sysc_init(void) {} #endif /* CONFIG_SMP */ +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, +}; + void __init r8a7790_pm_init(void) { void __iomem *p; @@ -79,4 +124,6 @@ void __init r8a7790_pm_init(void) r8a7790_sysc_init(); shmobile_smp_apmu_suspend_init(); + if (IS_ENABLED(CONFIG_ARM_RENESAS_CPUIDLE)) + shmobile_cpuidle_set_driver(&r8a7790_data); }