Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp271046imm; Mon, 21 May 2018 05:58:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpn0/0qA3Qw5HQcKnVP6WyRIPO6GDT04/mwCWHMt/CzVPQjZo2pnnQt/dD1IyU7HY98fjMJ X-Received: by 2002:a17:902:7c18:: with SMTP id x24-v6mr20832591pll.173.1526907491493; Mon, 21 May 2018 05:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526907491; cv=none; d=google.com; s=arc-20160816; b=oIfmdj9rRNE7+GmkLl+rBW572ZSbvGucESM8Ai5639rsOZCJJicatwsBTr18NQQbe/ Oce+lj4WCemRHyZSYU1l3LJJrQQHLeqd+FrT0gdC6qjqX6HcISCvRGD+A0qzlx2/eLHb fW4ETWw1udOZZRDPHaDjstRFGQbt5U1E0p990Pq/lmC2BiR05rOFtc/yLlcRCQgLlCdK W+w+xEIaJX08M5G0sZ5ojI1u/4p5lkGHS10779ECeuWGzFujqIN1XIyF91Wznc1jSf/L lxrkCBKMJ8IZN5CRfvQ66oKWPaV2ysmgSqt4X9ymiRrwHngSEJBjJ4i5qJpkph3ZFoqi m8QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=o4PMsDc01exnDh0Sub9euOyx/SP4kznVms4tnGb4n84=; b=i3ebSeCsouIiG4fRMu+DiF8iQWP89f/+JQlGp8aadTX03PRvNEEb47TJ0TWtY4xOzG 6iVOv9uKq8mD4IoDzhBEgViPS0NFkJrbPJx6Y7uYrMUOR8Wu2tqu7csYAMUFHeGZsT0q e6PShEeJnm1+wGqUSgMHXXefocdw8ooys4Ak0hkcHdLzXXkiPVW9twtKRTvRoojXhHzg BC9f4eIXzhxbCFVU+bLwbg9iLVq+oY7xpUQbPhYjBvU9wXsETsEBHj7L9aLb+bbzeec4 v7T7lCh0aqjExWVOr7NQXUsPo3xoxfaKmPiRsyqoebxE+LIKX3n6rzsJ43iZOYiz2vED CoJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=iGJkh7ro; dkim=pass header.i=@codeaurora.org header.s=default header.b=Ybsk0w6T; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10-v6si8277101pgq.131.2018.05.21.05.57.56; Mon, 21 May 2018 05:58:11 -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=@codeaurora.org header.s=default header.b=iGJkh7ro; dkim=pass header.i=@codeaurora.org header.s=default header.b=Ybsk0w6T; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751214AbeEUM5q (ORCPT + 99 others); Mon, 21 May 2018 08:57:46 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44914 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbeEUM5k (ORCPT ); Mon, 21 May 2018 08:57:40 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8D9536081C; Mon, 21 May 2018 12:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526907459; bh=mLS2y70Z39NLY4fSKFu9WRrLJTfOntxByVWRue4EDtQ=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=iGJkh7roJgzTari5c6OOXSvyllbhBJwiXsz8lrSgcOjkF7zIv3G6ImTL1Km75NqoV SaatANGe+h4Rq6C1u3b+quwt6ijiYxAlSraTJpfkSChNEcJv7fI1VkjsbOaTPvJMm+ M7psBQjcutosAA3KslfsaQDWZNvayngqMHYC3OwU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from ilial (unknown [185.23.60.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilialin@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 249A1602BC; Mon, 21 May 2018 12:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526907438; bh=mLS2y70Z39NLY4fSKFu9WRrLJTfOntxByVWRue4EDtQ=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=Ybsk0w6TBUNPq40TH0e5csxO0OhHUG5EssZ001QpZMLxhbgInFOELppvxKSn0ifRY IJERnLT2eD4LayJWTldqA7p4PigQXVFVF+xyblW2fGVmgNroYis+BY5Kg1gXyLXJLG wR68w7NmeTf+p7i2MF+t5px1jfjF1IPDFFxyXuBA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 249A1602BC Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilialin@codeaurora.org From: To: "'Sudeep Holla'" , , , , , , , , , , , , , , Cc: , , , , , , , , , , References: <1526555955-29960-11-git-send-email-ilialin@codeaurora.org> <1526729701-8589-1-git-send-email-ilialin@codeaurora.org> <153cc316-dcb5-972f-5a2f-c91fe0f6348b@arm.com> In-Reply-To: <153cc316-dcb5-972f-5a2f-c91fe0f6348b@arm.com> Subject: RE: [PATCH] cpufreq: Add Kryo CPU scaling driver Date: Mon, 21 May 2018 15:57:10 +0300 Message-ID: <000f01d3f103$3ff78ba0$bfe6a2e0$@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQF4oTaoNxz6XIk2qh8MCLQUCquwggJzguYXAj6kKpSkyzIqQA== Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Sudeep Holla > Sent: Monday, May 21, 2018 15:50 > To: Ilia Lin ; mturquette@baylibre.com; > sboyd@kernel.org; robh@kernel.org; mark.rutland@arm.com; > viresh.kumar@linaro.org; nm@ti.com; lgirdwood@gmail.com; > broonie@kernel.org; andy.gross@linaro.org; david.brown@linaro.org; > catalin.marinas@arm.com; will.deacon@arm.com; rjw@rjwysocki.net; = linux- > clk@vger.kernel.org > Cc: Sudeep Holla ; devicetree@vger.kernel.org; > linux-kernel@vger.kernel.org; linux-pm@vger.kernel.org; linux-arm- > msm@vger.kernel.org; linux-soc@vger.kernel.org; linux-arm- > kernel@lists.infradead.org; rnayak@codeaurora.org; > amit.kucheria@linaro.org; nicolas.dechesne@linaro.org; > celster@codeaurora.org; tfinkel@codeaurora.org > Subject: Re: [PATCH] cpufreq: Add Kryo CPU scaling driver >=20 >=20 >=20 > On 19/05/18 12:35, Ilia Lin wrote: > > In Certain QCOM SoCs like apq8096 and msm8996 that have KRYO > > processors, the CPU frequency subset and voltage value of each OPP > > varies based on the silicon variant in use. Qualcomm Process Voltage > > Scaling Tables defines the voltage and frequency value based on the > > msm-id in SMEM and speedbin blown in the efuse combination. > > The qcom-cpufreq-kryo driver reads the msm-id and efuse value from = the > > SoC to provide the OPP framework with required information. > > This is used to determine the voltage and frequency value for each = OPP > > of > > operating-points-v2 table when it is parsed by the OPP framework. > > > > Signed-off-by: Ilia Lin > > Acked-by: Viresh Kumar > > --- > > drivers/cpufreq/Kconfig.arm | 10 +++ > > drivers/cpufreq/Makefile | 1 + > > drivers/cpufreq/cpufreq-dt-platdev.c | 3 + > > drivers/cpufreq/qcom-cpufreq-kryo.c | 164 > > +++++++++++++++++++++++++++++++++++ > > 4 files changed, 178 insertions(+) > > create mode 100644 drivers/cpufreq/qcom-cpufreq-kryo.c > > >=20 > [..] >=20 > > + > > +/* > > + * In Certain QCOM SoCs like apq8096 and msm8996 that have KRYO > > +processors, > > + * the CPU frequency subset and voltage value of each OPP varies > > + * based on the silicon variant in use. Qualcomm Process Voltage > > +Scaling Tables > > + * defines the voltage and frequency value based on the msm-id in > > +SMEM > > + * and speedbin blown in the efuse combination. > > + * The qcom-cpufreq-kryo driver reads the msm-id and efuse value = from > > +the SoC > > + * to provide the OPP framework with required information. > > + * This is used to determine the voltage and frequency value for = each > > +OPP of > > + * operating-points-v2 table when it is parsed by the OPP = framework. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#define MSM_ID_SMEM 137 > > +#define SILVER_LEAD 0 > > +#define GOLD_LEAD 2 > > + >=20 > So I gather form other emails, that these are physical cpu number(not = even > unique identifier like MPIDR). Will this work on parts or platforms = that need > to boot in GOLD LEAD cpus. The driver is for Kryo CPU, which (and AFAIK all multicore MSMs) always = boots on the CPU0. >=20 > [...] >=20 > > + > > +static int __init qcom_cpufreq_kryo_driver_init(void) > > +{ > > + struct device *cpu_dev_silver, *cpu_dev_gold; > > + struct opp_table *opp_silver, *opp_gold; > > + enum _msm8996_version msm8996_version; > > + struct nvmem_cell *speedbin_nvmem; > > + struct platform_device *pdev; > > + struct device_node *np; > > + u8 *speedbin; > > + u32 versions; > > + size_t len; > > + int ret; > > + > > + cpu_dev_silver =3D get_cpu_device(SILVER_LEAD); > > + if (IS_ERR_OR_NULL(cpu_dev_silver)) > > + return PTR_ERR(cpu_dev_silver); > > + > > + cpu_dev_gold =3D get_cpu_device(SILVER_LEAD); >=20 > s/SILVER/GOLD/ ? Yes, you are right. This is already fixed in the respin. >=20 > -- > Regards, > Sudeep