From patchwork Wed Feb 12 18:01:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dirk.brandewie@gmail.com X-Patchwork-Id: 3639771 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 252B89F334 for ; Wed, 12 Feb 2014 18:03:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51903201CE for ; Wed, 12 Feb 2014 18:03:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4982420160 for ; Wed, 12 Feb 2014 18:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753646AbaBLSCb (ORCPT ); Wed, 12 Feb 2014 13:02:31 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:47993 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753377AbaBLSBj (ORCPT ); Wed, 12 Feb 2014 13:01:39 -0500 Received: by mail-pa0-f50.google.com with SMTP id kp14so9498528pab.23 for ; Wed, 12 Feb 2014 10:01:38 -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; bh=sAb7iQzyZQZ7z9AF0pj9Vjnmc5mDCjktra+MFkV2yCk=; b=JILJryHDnFw/kz9DafpoVNUjzRnFKXqlrNVbgo3Yvf6ys+MGxXQnCpl5R02U6jsKlB zdQSegSHWFh2cXsieuBb4ghznGLv+xErczQWUrdgcuyOP5+vHnvBkWLfM+XnY52mHDDl 7Q/mGwUkR20jaakme5qWeJ5nPlB4Fy2hjdhBumuoRT8XAe4PD9iLwbv3KjOqTANZosw0 m/hClbL5NiCajwitYBrxLraguS8unfmebYTx+e0JpQOOTPY54DTVmcIq8tgeuHdRwkNo LImSOVekyrKC9PPOvE4Ou05VQWvCcLJ+yQo2/sCakDLTj6XPw/dOL5aYbFCFztV+cNS2 h3Nw== X-Received: by 10.66.145.166 with SMTP id sv6mr41510228pab.31.1392228098761; Wed, 12 Feb 2014 10:01:38 -0800 (PST) Received: from echolake.localdomain (static-50-43-42-35.bvtn.or.frontiernet.net. [50.43.42.35]) by mx.google.com with ESMTPSA id ss2sm66199689pab.8.2014.02.12.10.01.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Feb 2014 10:01:37 -0800 (PST) From: dirk.brandewie@gmail.com To: linux-pm@vger.kernel.org, rjw@rjwysocki.net Cc: linux-kernel@vger.kernel.org, Dirk Brandewie Subject: [PATCH 5/5] intel_pstate: Add support for Baytrail turbo P states Date: Wed, 12 Feb 2014 10:01:07 -0800 Message-Id: <1392228067-14817-6-git-send-email-dirk.j.brandewie@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1392228067-14817-1-git-send-email-dirk.j.brandewie@intel.com> References: <1392228067-14817-1-git-send-email-dirk.j.brandewie@intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.4 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 From: Dirk Brandewie A documentation update exposed the existance of the turbo ratio register. Update baytrail support to use the turbo range. Signed-off-by: Dirk Brandewie --- drivers/cpufreq/intel_pstate.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index ff45ce1..ea58eb6 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -34,8 +34,10 @@ #define SAMPLE_COUNT 3 -#define BYT_RATIOS 0x66a -#define BYT_VIDS 0x66b +#define BYT_RATIOS 0x66a +#define BYT_VIDS 0x66b +#define BYT_TURBO_RATIOS 0x66c + #define FRAC_BITS 8 #define int_tofp(X) ((int64_t)(X) << FRAC_BITS) @@ -366,6 +368,13 @@ static int byt_get_max_pstate(void) return (value >> 16) & 0xFF; } +static int byt_get_turbo_pstate(void) +{ + u64 value; + rdmsrl(BYT_TURBO_RATIOS, value); + return value & 0x3F; +} + static void byt_set_pstate(struct cpudata *cpudata, int pstate) { u64 val; @@ -468,7 +477,7 @@ static struct cpu_defaults byt_params = { .funcs = { .get_max = byt_get_max_pstate, .get_min = byt_get_min_pstate, - .get_turbo = byt_get_max_pstate, + .get_turbo = byt_get_turbo_pstate, .set = byt_set_pstate, .get_vid = byt_get_vid, },