From patchwork Mon Feb 15 18:02:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 8317551 Return-Path: X-Original-To: patchwork-linux-omap@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 2BCA8C02AA for ; Mon, 15 Feb 2016 18:04:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A8462039C for ; Mon, 15 Feb 2016 18:04:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40D0E2038E for ; Mon, 15 Feb 2016 18:04:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751964AbcBOSDf (ORCPT ); Mon, 15 Feb 2016 13:03:35 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36281 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbcBOSDe (ORCPT ); Mon, 15 Feb 2016 13:03:34 -0500 Received: by mail-wm0-f42.google.com with SMTP id g62so70841016wme.1; Mon, 15 Feb 2016 10:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=hnp+sNmY1JhDeg/4WsyssrYCRW1HvqC3e594VybQ/Hk=; b=e4X9PzZq+uKaB4BieoWiWeIX3mfH8hU6IJPfFVz9CnQKSEoLKwTHcO+Ijy0T+PBFSS ilbmI3scmQhjPnQiWwe/5mn6sSl0iTPpjiKmSzQB5ApX7MyiEv2isBt94SiObR8plXnN EX/ip6PbPHZi4q6t5keirAzfT+WjWZK4bt0NTdtjHGBblak7gUQL0YYsZ48akhG5mWmh VtqeSZffxIisxaXaFOLYBWXD03ZQw8weTgCHLApmJELpc4BHQvH2dJ3pzB7HsMWle5mt 7OWR2CdAgnTZWDaBoFOFIJHKpgc/0jg571BM3cLqy/oj8DPhJmJI/P7PYDVsXqxt61AM 0YHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=hnp+sNmY1JhDeg/4WsyssrYCRW1HvqC3e594VybQ/Hk=; b=f/rnyyxrIyJlB23W2SiK84KB0+47yITjY+oWAMs67s9Qcq5ucSA9afN8KblvRXjBha 6nh8LNNKNRdun2HsB2VBL7jT1C3QWM5aAQMj0Bm2HTtSsC5ZGJBlNFgkWyqKqZFdeCYU /ON1l5/uf173Xp2wIXMOpSo8857w+UQUBnM8UGOq4rIU0+qk3RaahKE6QTfqChmEMHl8 hdrUoSxoMmw3kTBb1vZmFfoOeLDEpVy+wKnsqiKsRxaOIBhJC+5H6q973mIlQYUhjaJv JCDvztJwJKJXLm3+MxsYY3u2FaYu9GSkV6N42n8ZJeSRQdD5lHNKDko2IWUIuqOmsFNe T3Rg== X-Gm-Message-State: AG10YOSgByRensAu7p4Hg/0VY8/Ngl0jzJl5zpo7z37QpAmdyy1yVKdqitulVZpqpEh5WA== X-Received: by 10.194.238.34 with SMTP id vh2mr16421620wjc.157.1455559412941; Mon, 15 Feb 2016 10:03:32 -0800 (PST) Received: from localhost.localdomain (pali.kolej.mff.cuni.cz. [78.128.193.202]) by smtp.gmail.com with ESMTPSA id g1sm22735104wmc.0.2016.02.15.10.03.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Feb 2016 10:03:31 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Tony Lindgren , Daniel Lezcano , Nishanth Menon , Pavel Machel , Aaro Koskinen , Sebastian Reichel , Ivaylo Dimitrov , Lorenzo Pieralisi , linux-kernel@vger.kernel.org Cc: linux-omap@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH] omap3: Add cpuidle parameters table for omap3430 Date: Mon, 15 Feb 2016 19:02:08 +0100 Message-Id: <1455559328-19783-1-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <20160215152542.GS19432@atomide.com> References: <20160215152542.GS19432@atomide.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 Based on CPU type choose generic omap3 or omap3430 specific cpuidle parameters. Parameters for omap3430 were measured on Nokia N900 device and added by commit 5a1b1d3a9efa ("OMAP3: RX-51: Pass cpu idle parameters") which were later removed by commit 231900afba52 ("ARM: OMAP3: cpuidle - remove rx51 cpuidle parameters table") due to huge code complexity. This patch brings cpuidle parameters for omap3430 devices again, but uses simple condition based on CPU type. Signed-off-by: Pali Rohár Fixes: 231900afba52d6faddfb480cde4132d4edc089bc Acked-by: Daniel Lezcano --- arch/arm/mach-omap2/cpuidle34xx.c | 69 ++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index aa7b379..2a3db0b 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -34,6 +34,7 @@ #include "pm.h" #include "control.h" #include "common.h" +#include "soc.h" /* Mach specific information to be recorded in the C-state driver_data */ struct omap3_idle_statedata { @@ -315,6 +316,69 @@ static struct cpuidle_driver omap3_idle_driver = { .safe_state_index = 0, }; +/* + * Numbers based on measurements made in October 2009 for PM optimized kernel + * with CPU freq enabled on device Nokia N900. Assumes OPP2 (main idle OPP, + * and worst case latencies). + */ +static struct cpuidle_driver omap3430_idle_driver = { + .name = "omap3430_idle", + .owner = THIS_MODULE, + .states = { + { + .enter = omap3_enter_idle_bm, + .exit_latency = 110 + 162, + .target_residency = 5, + .name = "C1", + .desc = "MPU ON + CORE ON", + }, + { + .enter = omap3_enter_idle_bm, + .exit_latency = 106 + 180, + .target_residency = 309, + .name = "C2", + .desc = "MPU ON + CORE ON", + }, + { + .enter = omap3_enter_idle_bm, + .exit_latency = 107 + 410, + .target_residency = 46057, + .name = "C3", + .desc = "MPU RET + CORE ON", + }, + { + .enter = omap3_enter_idle_bm, + .exit_latency = 121 + 3374, + .target_residency = 46057, + .name = "C4", + .desc = "MPU OFF + CORE ON", + }, + { + .enter = omap3_enter_idle_bm, + .exit_latency = 855 + 1146, + .target_residency = 46057, + .name = "C5", + .desc = "MPU RET + CORE RET", + }, + { + .enter = omap3_enter_idle_bm, + .exit_latency = 7580 + 4134, + .target_residency = 484329, + .name = "C6", + .desc = "MPU OFF + CORE RET", + }, + { + .enter = omap3_enter_idle_bm, + .exit_latency = 7505 + 15274, + .target_residency = 484329, + .name = "C7", + .desc = "MPU OFF + CORE OFF", + }, + }, + .state_count = ARRAY_SIZE(omap3_idle_data), + .safe_state_index = 0, +}; + /* Public functions */ /** @@ -333,5 +397,8 @@ int __init omap3_idle_init(void) if (!mpu_pd || !core_pd || !per_pd || !cam_pd) return -ENODEV; - return cpuidle_register(&omap3_idle_driver, NULL); + if (cpu_is_omap3430()) + return cpuidle_register(&omap3430_idle_driver, NULL); + else + return cpuidle_register(&omap3_idle_driver, NULL); }