From patchwork Thu Aug 17 23:01:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 9907255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73EB060244 for ; Thu, 17 Aug 2017 23:02:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 661D528BFA for ; Thu, 17 Aug 2017 23:02:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AB6C28C04; Thu, 17 Aug 2017 23:02:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED72828C06 for ; Thu, 17 Aug 2017 23:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=okEAENnhziFQZT0HflUDVDzD5ZZXAaoFJiBfc/YyRC0=; b=Zba+2uJBEK3QoY/6LcQFRWzMYP VRv/TwN3qBEg7q9GUeWJDSSm0BoKG20J8Z5OsYrULqaJVk3tWgJGZepKqbtkTTfIexIsdlp+4doC/ KeH2JBc/nymORG+cfRFegM5P9SJ6OMlVpnl0CUclnMhcz8frP9mcDX+3DEgfc9bNMBKscay4PV2/t zxCxdfMq+RLXHMCgx0JQjnd2m1oswUu7C+7OpFEJLME7mM6pHR3UjoZx//B9TDk5bRuJD46SH5cOq cwIljS/v/tQjPVqbtKIXV+sj7HcfCAkZblQ/PxKAbqG/dCY+RWhlbJNkXlGFvCM0zIEhyZtz3r+59 Bl7zmbaQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1diTnx-0001gb-Os; Thu, 17 Aug 2017 23:02:21 +0000 Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1diTnd-00018P-PP for linux-arm-kernel@lists.infradead.org; Thu, 17 Aug 2017 23:02:03 +0000 Received: from sampyla.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 2A8D782D6; Thu, 17 Aug 2017 23:01:48 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Subject: [PATCH 1/3] ARM: OMAP2+: Separate dra7 cpuidle from omap5 Date: Thu, 17 Aug 2017 16:01:20 -0700 Message-Id: <20170817230122.30655-2-tony@atomide.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170817230122.30655-1-tony@atomide.com> References: <20170817230122.30655-1-tony@atomide.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170817_160201_912938_796DCA4F X-CRM114-Status: UNSURE ( 8.38 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Dave Gerlach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As omap5 supports deeper idle states compared to dra7, let's separate dra7 from omap5 in preparation for adding more support for omap5. Cc: Dave Gerlach Cc: Nishanth Menon Cc: Santosh Shilimkar Cc: Tero Kristo Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/cpuidle44xx.c | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c @@ -65,6 +65,19 @@ static struct idle_statedata omap5_idle_data[] = { }, }; +static struct idle_statedata dra7_idle_data[] = { + { + .cpu_state = PWRDM_POWER_ON, + .mpu_state = PWRDM_POWER_ON, + .mpu_logic_state = PWRDM_POWER_ON, + }, + { + .cpu_state = PWRDM_POWER_RET, + .mpu_state = PWRDM_POWER_RET, + .mpu_logic_state = PWRDM_POWER_RET, + }, +}; + static struct powerdomain *mpu_pd, *cpu_pd[MAX_CPUS]; static struct clockdomain *cpu_clkdm[MAX_CPUS]; @@ -288,6 +301,32 @@ static struct cpuidle_driver omap5_idle_driver = { .safe_state_index = 0, }; +static struct cpuidle_driver dra7_idle_driver = { + .name = "dra7_idle", + .owner = THIS_MODULE, + .states = { + { + /* C1 - CPU0 ON + CPU1 ON + MPU ON */ + .exit_latency = 2 + 2, + .target_residency = 5, + .enter = omap_enter_idle_simple, + .name = "C1", + .desc = "CPUx WFI, MPUSS ON" + }, + { + /* C2 - CPU0 RET + CPU1 RET + MPU CSWR */ + .exit_latency = 48 + 60, + .target_residency = 100, + .flags = CPUIDLE_FLAG_TIMER_STOP, + .enter = omap_enter_idle_smp, + .name = "C2", + .desc = "CPUx CSWR, MPUSS CSWR", + }, + }, + .state_count = ARRAY_SIZE(dra7_idle_data), + .safe_state_index = 0, +}; + /* Public functions */ /** @@ -303,6 +342,9 @@ int __init omap4_idle_init(void) if (soc_is_omap54xx()) { state_ptr = &omap5_idle_data[0]; idle_driver = &omap5_idle_driver; + } else if (soc_is_dra7xx()) { + state_ptr = &dra7_idle_data[0]; + idle_driver = &dra7_idle_driver; } else { state_ptr = &omap4_idle_data[0]; idle_driver = &omap4_idle_driver;