Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp383475imm; Tue, 22 May 2018 21:30:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpTLXVPsSxmgJXkXyXBCf8CjfbwsBzvsnP05hO5FzELTTGgNr5mJKKjmf48VwjrroC5Dp2G X-Received: by 2002:a63:6fcf:: with SMTP id k198-v6mr1036799pgc.307.1527049859361; Tue, 22 May 2018 21:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527049859; cv=none; d=google.com; s=arc-20160816; b=zYKa8AYP/o2xawjn21M383NlrqCaz4gJCS/FF36B5lXTn0AzZQECcJBJGB+9qZleM9 SAMbcs18dg6Q5lS9sxHvL+Ss/4/w7S7PGS06upv6N+SvePVzwUKMMv7H/c1kOHRnIKID Xc86sbTAkF5zpWerPmhThknqoOMukP7PhJNoz5qhPlU72C5h5MxhqgrJOIGfqn85oaZv d0JFP66cBQLFZbKPNeDAVzrac4ln4xBFQR2NFbEY/hFPDWNSFM9OZ3JLa9vJ58elsypr R99byWn3whSNqmTXg7LMPL3h1PMu4JX+ftoI6t+hltumoA1OKvU3B4DE66whOmFSzoDq YD8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=cyqDiMqBuj74DzNuZSCodwd6n5VkCH72gkq1AJznjvM=; b=l9LbUIgoeQiGm+O/2QU9Pr7/VmFIZXA6WZ9yzPrPRIzQhH0PtpVfIIoHxCsuRwXvqd 0xhhAsHt1jKDlqAfTrUs1uRjqnsA7pbvIk8jWmBc9ONuuJVw4mGzcg4pc/Zu49gqiDtr erYgh2owG4eIAYlAIAE64f44PLYB5LugMoGz7sP85+U9scDBiYIhu3gAg6ww4xUZMO7/ M0C476NxfQsGuM3ABacK4NXHxXB+oyRKkRtTvaUnX/qVuuWXaeXF3HLe1khviUc9Q4cz W810f8EUQ6ycq2bl1lPsBdJtuULNf8gU1lX65Z8sSUkkXM/rpM/MZaZ7sj0UXg9Wlt6k d/dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=af7Od53X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9-v6si16565468plb.522.2018.05.22.21.30.44; Tue, 22 May 2018 21:30:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=af7Od53X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753856AbeEWEaM (ORCPT + 99 others); Wed, 23 May 2018 00:30:12 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:40742 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753314AbeEWEaK (ORCPT ); Wed, 23 May 2018 00:30:10 -0400 Received: by mail-pl0-f65.google.com with SMTP id t12-v6so12205579plo.7 for ; Tue, 22 May 2018 21:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cyqDiMqBuj74DzNuZSCodwd6n5VkCH72gkq1AJznjvM=; b=af7Od53XZ3cf8R7JE8PEFlcTw2mE/ySDc/ROr9AsO/QGCiKz10niV1tLAf26bs1G59 XEIQY+WAFviLb11tYe1Diydf3SebVHKXIJ0shVqiIdIP4dDu2McGZ6zVk1zx4HqoZOUn iB7Fzn8h/1IOW1pJ9f4iaCOPIKV+yMcuhsBOs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=cyqDiMqBuj74DzNuZSCodwd6n5VkCH72gkq1AJznjvM=; b=RjTtVlCx7N5FoUD0nfLszt2CqOTpXyWQV5cEf1spJ25o2MYwU2IeoOPeGCU7DPRuAc 7ccQYlfSGcyMpDKP1jC8ZDn6A5BqDofCRuu075XP+O//8/FpxRIXA/14eHhw9Ujmq0RO jmldGRJgnhRsz7zlQfXVrOqbqUHuFKwQYPUUJg3p2kS3YgOb7ZS85oqBiuvD8JTNh7qD olx+NBGzKzI+pQXCNecoLbtoWJ8cMuFB04bDZH1l+hfy/9+C63O7n728jT1APscj+17H smg7mV7t9XMdfCdzw4Ysx3Hn8eUbomh7r1RZNZM3Ar2LjoTo5TTnh9XrAwZ64d01gNpB pTMQ== X-Gm-Message-State: ALKqPwd+8xFJTA/KrD9V4E9VIo5jwt+tHz2wYWW6xEEZQ7xg1/+JApPS UNaMw2bfZsKLWaE6IEGcRKxe6A== X-Received: by 2002:a17:902:3103:: with SMTP id w3-v6mr1293107plb.37.1527049809663; Tue, 22 May 2018 21:30:09 -0700 (PDT) Received: from localhost ([122.167.163.112]) by smtp.gmail.com with ESMTPSA id i1-v6sm34968677pfj.83.2018.05.22.21.30.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 21:30:09 -0700 (PDT) Date: Wed, 23 May 2018 10:00:06 +0530 From: Viresh Kumar To: =?utf-8?Q?S=C3=A9bastien?= Szymanski Cc: linux-arm-kernel@lists.infradead.org, "Rafael J . Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo , Sascha Hauer , Fabio Estevam , Stefan Agner , Rob Herring , Mark Rutland , devicetree@vger.kernel.org Subject: Re: [PATCH v3 1/3] cpufreq: imx6q: check speed grades for i.MX6ULL Message-ID: <20180523043006.2zlqfhyk5fe7uikz@vireshk-i7> References: <20180522062853.24799-1-sebastien.szymanski@armadeus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180522062853.24799-1-sebastien.szymanski@armadeus.com> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22-05-18, 08:28, S?bastien Szymanski wrote: > Check the max speed supported from the fuses for i.MX6ULL and update the > operating points table accordingly. > > Signed-off-by: S?bastien Szymanski > --- > > Changes for v3: > - none > > Changes for v2: > - none > > drivers/cpufreq/imx6q-cpufreq.c | 29 +++++++++++++++++++++++------ > 1 file changed, 23 insertions(+), 6 deletions(-) > > diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c > index 83cf631fc9bc..f094687cae52 100644 > --- a/drivers/cpufreq/imx6q-cpufreq.c > +++ b/drivers/cpufreq/imx6q-cpufreq.c > @@ -266,6 +266,8 @@ static void imx6q_opp_check_speed_grading(struct device *dev) > } > > #define OCOTP_CFG3_6UL_SPEED_696MHZ 0x2 > +#define OCOTP_CFG3_6ULL_SPEED_792MHZ 0x2 > +#define OCOTP_CFG3_6ULL_SPEED_900MHZ 0x3 > > static void imx6ul_opp_check_speed_grading(struct device *dev) > { > @@ -287,16 +289,30 @@ static void imx6ul_opp_check_speed_grading(struct device *dev) > * Speed GRADING[1:0] defines the max speed of ARM: > * 2b'00: Reserved; > * 2b'01: 528000000Hz; > - * 2b'10: 696000000Hz; > - * 2b'11: Reserved; > + * 2b'10: 696000000Hz on i.MX6UL, 792000000Hz on i.MX6ULL; > + * 2b'11: 900000000Hz on i.MX6ULL only; > * We need to set the max speed of ARM according to fuse map. > */ > val = readl_relaxed(base + OCOTP_CFG3); > val >>= OCOTP_CFG3_SPEED_SHIFT; > val &= 0x3; > - if (val != OCOTP_CFG3_6UL_SPEED_696MHZ) > - if (dev_pm_opp_disable(dev, 696000000)) > - dev_warn(dev, "failed to disable 696MHz OPP\n"); > + > + if (of_machine_is_compatible("fsl,imx6ul")) { > + if (val != OCOTP_CFG3_6UL_SPEED_696MHZ) > + if (dev_pm_opp_disable(dev, 696000000)) > + dev_warn(dev, "failed to disable 696MHz OPP\n"); > + } > + > + if (of_machine_is_compatible("fsl,imx6ull")) { > + if (val != OCOTP_CFG3_6ULL_SPEED_792MHZ) > + if (dev_pm_opp_disable(dev, 792000000)) > + dev_warn(dev, "failed to disable 792MHz OPP\n"); > + > + if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ) > + if (dev_pm_opp_disable(dev, 900000000)) > + dev_warn(dev, "failed to disable 900MHz OPP\n"); > + } > + > iounmap(base); > put_node: > of_node_put(np); > @@ -356,7 +372,8 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) > goto put_reg; > } > > - if (of_machine_is_compatible("fsl,imx6ul")) > + if (of_machine_is_compatible("fsl,imx6ul") || > + of_machine_is_compatible("fsl,imx6ull")) > imx6ul_opp_check_speed_grading(cpu_dev); > else > imx6q_opp_check_speed_grading(cpu_dev); Acked-by: Viresh Kumar -- viresh