Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp263632imm; Mon, 21 May 2018 05:50:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpgsoBz5jkkSoYtZFXgNl0aTvAEBRJRETNbx1xTPAwR2i3hUDC8Ts0mvA33xQOgP3gyoD4z X-Received: by 2002:a63:8dca:: with SMTP id z193-v6mr15597585pgd.418.1526907043002; Mon, 21 May 2018 05:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526907042; cv=none; d=google.com; s=arc-20160816; b=FaSIzMB0YpYBRWW0oG7RSAz+8gWZawuYaAZlnqziDLqMI1TW8drEagtKfAkaRCsQ0d TAicMkCYNyhloixYZjEEh6OmonA7W1TPGRSmdvNqlWNGSRD0TaFGRmexcznQOZ5Fb8UT rohVp704zOCupPifVafJYmwkHzB/xOKyMrOikrz1yLZ1X78GDxFP2mZl6v8z6e6+7fP+ NR+kBOvfvEeVusCHtUgiq4EgzSmY86o51jSrsqdZHzZ6M96C5nd/kfiSvjKq4tn3v3/Z TTHbNjZEvtFt1dnY1nMFEoV0AeJGMy4UHtz3mpfcDJ9yJZ0c+8VojPXIMFhVUeWe9XwO QSQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:cc :arc-authentication-results; bh=5ALN8xHCDewUmP/Xk16JjOvcI+V+CwjohbRXGBBkEps=; b=tW4WGtd4jv6xO3Iox17LofmUlrqa06xCCqnm49q2StHO8/ZQtru572z13FR+Y1O4W2 WP/pwdcRZNXyPFP0wGIvoSIt1hlVzoTsaqJj5WqRwDlTG1Eq2q4+y6YiMY4oNRmjnXFW ibdVQgVH0IBsjhvoxPKXGffDREo0FgMmmaVM7vrRw4SWVXTNS5lFthm432rd8EVER4Wl wctXBFjGagnrR/Ru9BLp2gQxDLPIvLPwADLJRGRDHr9uK6ZilU3VnXSUWKTMzaQpfRQf iTUFLzLYzs/4zBhycKLJz4FYj+LqSVH0MB2jQivp/p1lVkE9zhVF7XnZiaARF2Z6GxdI 02vw== ARC-Authentication-Results: i=1; mx.google.com; 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 m79-v6si13909001pfi.236.2018.05.21.05.50.28; Mon, 21 May 2018 05:50:42 -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; 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 S1751727AbeEUMuP (ORCPT + 99 others); Mon, 21 May 2018 08:50:15 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49100 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbeEUMuI (ORCPT ); Mon, 21 May 2018 08:50:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4736380D; Mon, 21 May 2018 05:50:07 -0700 (PDT) Received: from [10.1.210.28] (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D91183F577; Mon, 21 May 2018 05:50:02 -0700 (PDT) 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 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 References: <1526555955-29960-11-git-send-email-ilialin@codeaurora.org> <1526729701-8589-1-git-send-email-ilialin@codeaurora.org> From: Sudeep Holla Organization: ARM Message-ID: <153cc316-dcb5-972f-5a2f-c91fe0f6348b@arm.com> Date: Mon, 21 May 2018 13:50:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1526729701-8589-1-git-send-email-ilialin@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > [..] > + > +/* > + * 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 > + 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. [...] > + > +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 = get_cpu_device(SILVER_LEAD); > + if (IS_ERR_OR_NULL(cpu_dev_silver)) > + return PTR_ERR(cpu_dev_silver); > + > + cpu_dev_gold = get_cpu_device(SILVER_LEAD); s/SILVER/GOLD/ ? -- Regards, Sudeep