Message ID | 20231013172033.3549476-1-robimarko@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp2042626vqb; Fri, 13 Oct 2023 10:21:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2hBjSG+L2iAwaXtvCKsIC9rL4xsyJApM1YbnGKKcM+IhHsIjg6BHyPMMsfeuNQ/ZNvuIY X-Received: by 2002:a05:6a21:a588:b0:163:ab09:196d with SMTP id gd8-20020a056a21a58800b00163ab09196dmr35033557pzc.1.1697217663297; Fri, 13 Oct 2023 10:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697217663; cv=none; d=google.com; s=arc-20160816; b=ZKdlORQG/7epBcBfPP9q5YG+zkN8sqVumhZqMsTLSDh4kwnGm0DVpS8N9gfrI4nIAU MDIEKnVGLHCzL50qP2g89UbfSG79VaCbENz5RQxTVcjpBRqJBEykeRCqtHfPoHY13prw Bwgvjp74Ev6tuXh0tsvqYzzC23+OAra87N+J89MgUKbdSOZ/qKsoPDT0XN7W9hlfEB6n g6akduq5RX4q/TROpLav8n4JpKZWuFCXsGj1wUOTbherFbXIw1JfL2r9hgh5F+KYVqh3 iYijgbdvlHBo7rvTQ9aszOF2FQ7cbKRBazCaMp79ft2lgzOUxxREw+cSyHrniav5AXwq loiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Q8uXQkYNo3bGoskQXQpsae5HsE3SRZJlPG9uoRZ+Rcc=; fh=gxnbydTmc7ExuqziGwJ5nSJZrYi4fiYOGLaS3u+GFtU=; b=V1G9zkqawe3eGGw4dfv1dHVOQDtaMC/AEagiqK7FkEj9GajXydZrttgGpUyNLsE2m0 /IuzXRPc55jT23Q3Sj544qdRlJN+xfAGcDdPvAcmQzOtA/2Cap/vBCtIrBep0Cn7qHuO Ka7qe6/7aMTIOD0rMnr+nKy0SZI4qvtg98UGmVTICwUBb1uPpw6Uz07qDarXLhvLuQfh 7mbMwqXRiGAw5dofW0C4oaTfZ+wYIjCYj0W6giRc9TvhgN2M97VF+aKqYnO253DP/OsJ sHqYYM3c66qpEgctlEZLEHrHBR0pp/b4S6pTxLQEdHl3x7/1jJf8yR6VFLnf8BW1K5G+ pPpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mPB8E6Vj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 9-20020a170902c14900b001bdca6456c3si4698395plj.46.2023.10.13.10.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 10:21:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mPB8E6Vj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 228EC82F3056; Fri, 13 Oct 2023 10:21:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230328AbjJMRUm (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Fri, 13 Oct 2023 13:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjJMRUl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 13 Oct 2023 13:20:41 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D644A9; Fri, 13 Oct 2023 10:20:40 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-53e08e439c7so3661475a12.0; Fri, 13 Oct 2023 10:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697217638; x=1697822438; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Q8uXQkYNo3bGoskQXQpsae5HsE3SRZJlPG9uoRZ+Rcc=; b=mPB8E6Vj2P2mo8o9BZ8cqVZsAX3SHdtoLWw+1RBRR4D22dUE7CCBAXrgGpVoCOA6qw ZdCQ0S3B4nKW2Y90bw7rXx+GmVnEOtukBUSawfo0stKemp70/q0aYSq7PAMNevJRpJLj wLOA00jOMOyMOOtX0JH0lZwj4bu5Naj0xftekrb/g8UgKww8d1P7C2JaZMDlg1d7LZd9 4eQAkKq4NymlaxZCiYb5igP3kVTGcgeokbocq5vHIwJqhlh2UEvrO+fB27Jn4dDo5FMI 5zlnn50Fs5LU7zOw9VrwIrIWjDDOUPo8zGIPy/w/Xysnw8uWFbd0nagrK37vK+aSVCQ/ 7TLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697217638; x=1697822438; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Q8uXQkYNo3bGoskQXQpsae5HsE3SRZJlPG9uoRZ+Rcc=; b=EZoH7DHKkXmE2yoH1M7kMUc5La9YlyYWcPQIslaa6DkaZO4RbEp/GOUuVCIFF0AF/i vuOMPyiW13Pp7ZMJg0LrZRxoNj6aKH9yUILOmTKWdP71PGHjh826iWD9pMPASnYzw+Rn jGv9drsi+b0p7IsI8KsW2K+JeltcpEmSxs48ai1MyKdGmIjcZqbOdWB7SrITQ95k1tWa h5MlYqQCtP9ku40chLMID8C9oYQ+rLjgAzB73iBW4va8OBr6UAW/gSyBqk41dxn6YEX9 ZNtVUfJNqfBFdehaHI0A+gof5tEE5DdEeEF0apXSMgjGITJ2afAfJgUvzoyMonTnmuTU djOA== X-Gm-Message-State: AOJu0Yx5N1EmVXjRjoBL0whk7dGRtLNjaGzMLOOx8bmLnXbTgi7GPhm4 aj/LNgOiV+F8bfHQyZ3qUuM= X-Received: by 2002:a05:6402:42c5:b0:53e:1e7f:482f with SMTP id i5-20020a05640242c500b0053e1e7f482fmr5134815edc.3.1697217638057; Fri, 13 Oct 2023 10:20:38 -0700 (PDT) Received: from fedora.. (dh207-96-122.xnet.hr. [88.207.96.122]) by smtp.googlemail.com with ESMTPSA id a90-20020a509ee3000000b0053e589016a7sm653125edf.16.2023.10.13.10.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 10:20:37 -0700 (PDT) From: Robert Marko <robimarko@gmail.com> To: rafael@kernel.org, viresh.kumar@linaro.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, ilia.lin@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Robert Marko <robimarko@gmail.com> Subject: [PATCH v6] cpufreq: qcom-nvmem: add support for IPQ8074 Date: Fri, 13 Oct 2023 19:20:02 +0200 Message-ID: <20231013172033.3549476-1-robimarko@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 13 Oct 2023 10:21:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779661708550844502 X-GMAIL-MSGID: 1779661708550844502 |
Series |
[v6] cpufreq: qcom-nvmem: add support for IPQ8074
|
|
Commit Message
Robert Marko
Oct. 13, 2023, 5:20 p.m. UTC
IPQ8074 comes in 3 families: * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz * IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz So, in order to be able to share one OPP table lets add support for IPQ8074 family based of SMEM SoC ID-s as speedbin fuse is always 0 on IPQ8074. IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device will get created by NVMEM CPUFreq driver. Signed-off-by: Robert Marko <robimarko@gmail.com> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> --- Changes in v6: * Split IPQ8074 from the IPQ8064 as IPQ8064 has additional dependencies. Changes in v4: * Add support for IPQ8174 (Oak) family Changes in v3: * Use enum for SoC versions Changes in v2: * Print an error if SMEM ID is not part of the IPQ8074 family and restrict the speed to Acorn variant (1.4GHz) drivers/cpufreq/cpufreq-dt-platdev.c | 1 + drivers/cpufreq/qcom-cpufreq-nvmem.c | 48 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+)
Comments
On Fri, 13 Oct 2023 at 19:20, Robert Marko <robimarko@gmail.com> wrote: > > IPQ8074 comes in 3 families: > * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz > * IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz > * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz > > So, in order to be able to share one OPP table lets add support for IPQ8074 > family based of SMEM SoC ID-s as speedbin fuse is always 0 on IPQ8074. > > IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device > will get created by NVMEM CPUFreq driver. > > Signed-off-by: Robert Marko <robimarko@gmail.com> > Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > Changes in v6: > * Split IPQ8074 from the IPQ8064 as IPQ8064 has additional dependencies. I discussed this with Christian and we decided to split out IPQ8074 as it is much simpler than IPQ8064 and has no additional dependencies so it makes sense split it out. Regards, Robert > > Changes in v4: > * Add support for IPQ8174 (Oak) family > > Changes in v3: > * Use enum for SoC versions > > Changes in v2: > * Print an error if SMEM ID is not part of the IPQ8074 family > and restrict the speed to Acorn variant (1.4GHz) > > drivers/cpufreq/cpufreq-dt-platdev.c | 1 + > drivers/cpufreq/qcom-cpufreq-nvmem.c | 48 ++++++++++++++++++++++++++++ > 2 files changed, 49 insertions(+) > > diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c > index 0b3776f558db..675da7f36846 100644 > --- a/drivers/cpufreq/cpufreq-dt-platdev.c > +++ b/drivers/cpufreq/cpufreq-dt-platdev.c > @@ -181,6 +181,7 @@ static const struct of_device_id blocklist[] __initconst = { > { .compatible = "ti,am62p5", }, > > { .compatible = "qcom,ipq8064", }, > + { .compatible = "qcom,ipq8074", }, > { .compatible = "qcom,apq8064", }, > { .compatible = "qcom,msm8974", }, > { .compatible = "qcom,msm8960", }, > diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c > index 84d7033e5efe..3fa12648ceb6 100644 > --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c > +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c > @@ -30,6 +30,11 @@ > > #include <dt-bindings/arm/qcom,ids.h> > > +enum ipq8074_versions { > + IPQ8074_HAWKEYE_VERSION = 0, > + IPQ8074_ACORN_VERSION, > +}; > + > struct qcom_cpufreq_drv; > > struct qcom_cpufreq_match_data { > @@ -203,6 +208,44 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, > return ret; > } > > +static int qcom_cpufreq_ipq8074_name_version(struct device *cpu_dev, > + struct nvmem_cell *speedbin_nvmem, > + char **pvs_name, > + struct qcom_cpufreq_drv *drv) > +{ > + u32 msm_id; > + int ret; > + *pvs_name = NULL; > + > + ret = qcom_smem_get_soc_id(&msm_id); > + if (ret) > + return ret; > + > + switch (msm_id) { > + case QCOM_ID_IPQ8070A: > + case QCOM_ID_IPQ8071A: > + case QCOM_ID_IPQ8172: > + case QCOM_ID_IPQ8173: > + case QCOM_ID_IPQ8174: > + drv->versions = BIT(IPQ8074_ACORN_VERSION); > + break; > + case QCOM_ID_IPQ8072A: > + case QCOM_ID_IPQ8074A: > + case QCOM_ID_IPQ8076A: > + case QCOM_ID_IPQ8078A: > + drv->versions = BIT(IPQ8074_HAWKEYE_VERSION); > + break; > + default: > + dev_err(cpu_dev, > + "SoC ID %u is not part of IPQ8074 family, limiting to 1.4GHz!\n", > + msm_id); > + drv->versions = BIT(IPQ8074_ACORN_VERSION); > + break; > + } > + > + return 0; > +} > + > static const struct qcom_cpufreq_match_data match_data_kryo = { > .get_version = qcom_cpufreq_kryo_name_version, > }; > @@ -217,6 +260,10 @@ static const struct qcom_cpufreq_match_data match_data_qcs404 = { > .genpd_names = qcs404_genpd_names, > }; > > +static const struct qcom_cpufreq_match_data match_data_ipq8074 = { > + .get_version = qcom_cpufreq_ipq8074_name_version, > +}; > + > static int qcom_cpufreq_probe(struct platform_device *pdev) > { > struct qcom_cpufreq_drv *drv; > @@ -360,6 +407,7 @@ static const struct of_device_id qcom_cpufreq_match_list[] __initconst = { > { .compatible = "qcom,msm8996", .data = &match_data_kryo }, > { .compatible = "qcom,qcs404", .data = &match_data_qcs404 }, > { .compatible = "qcom,ipq8064", .data = &match_data_krait }, > + { .compatible = "qcom,ipq8074", .data = &match_data_ipq8074 }, > { .compatible = "qcom,apq8064", .data = &match_data_krait }, > { .compatible = "qcom,msm8974", .data = &match_data_krait }, > { .compatible = "qcom,msm8960", .data = &match_data_krait }, > -- > 2.41.0 >
On 13-10-23, 19:20, Robert Marko wrote: > IPQ8074 comes in 3 families: > * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz > * IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz > * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz > > So, in order to be able to share one OPP table lets add support for IPQ8074 > family based of SMEM SoC ID-s as speedbin fuse is always 0 on IPQ8074. > > IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device > will get created by NVMEM CPUFreq driver. > > Signed-off-by: Robert Marko <robimarko@gmail.com> > Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > Changes in v6: > * Split IPQ8074 from the IPQ8064 as IPQ8064 has additional dependencies. Applied. Thanks.
On 16-10-23, 09:02, Viresh Kumar wrote: > On 13-10-23, 19:20, Robert Marko wrote: > > IPQ8074 comes in 3 families: > > * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz > > * IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz > > * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz > > > > So, in order to be able to share one OPP table lets add support for IPQ8074 > > family based of SMEM SoC ID-s as speedbin fuse is always 0 on IPQ8074. > > > > IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device > > will get created by NVMEM CPUFreq driver. > > > > Signed-off-by: Robert Marko <robimarko@gmail.com> > > Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> > > --- > > Changes in v6: > > * Split IPQ8074 from the IPQ8064 as IPQ8064 has additional dependencies. > > Applied. Thanks. And it failed to build, please fix it. Dropped from my tree now.
On Mon, 16 Oct 2023 at 10:22, Viresh Kumar <viresh.kumar@linaro.org> wrote: > > On 16-10-23, 09:02, Viresh Kumar wrote: > > On 13-10-23, 19:20, Robert Marko wrote: > > > IPQ8074 comes in 3 families: > > > * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz > > > * IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz > > > * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz > > > > > > So, in order to be able to share one OPP table lets add support for IPQ8074 > > > family based of SMEM SoC ID-s as speedbin fuse is always 0 on IPQ8074. > > > > > > IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device > > > will get created by NVMEM CPUFreq driver. > > > > > > Signed-off-by: Robert Marko <robimarko@gmail.com> > > > Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> > > > --- > > > Changes in v6: > > > * Split IPQ8074 from the IPQ8064 as IPQ8064 has additional dependencies. > > > > Applied. Thanks. > > And it failed to build, please fix it. Dropped from my tree now. I am looking at the error and it should not happen as the ID-s have been in linux-next for a month now: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/dt-bindings/arm/qcom,ids.h?h=next-20231016&id=b8c889bef9797a58b8b5aad23875cc4d04b3efd3 They are also part of Bjorns 6.7 driver PR: https://lore.kernel.org/all/20231015204014.855672-1-andersson@kernel.org/T/ Regards, Robert > > -- > viresh
On Mon, 16 Oct 2023 at 11:29, Robert Marko <robimarko@gmail.com> wrote: > > On Mon, 16 Oct 2023 at 10:22, Viresh Kumar <viresh.kumar@linaro.org> wrote: > > > > On 16-10-23, 09:02, Viresh Kumar wrote: > > > On 13-10-23, 19:20, Robert Marko wrote: > > > > IPQ8074 comes in 3 families: > > > > * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz > > > > * IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz > > > > * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz > > > > > > > > So, in order to be able to share one OPP table lets add support for IPQ8074 > > > > family based of SMEM SoC ID-s as speedbin fuse is always 0 on IPQ8074. > > > > > > > > IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device > > > > will get created by NVMEM CPUFreq driver. > > > > > > > > Signed-off-by: Robert Marko <robimarko@gmail.com> > > > > Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> > > > > --- > > > > Changes in v6: > > > > * Split IPQ8074 from the IPQ8064 as IPQ8064 has additional dependencies. > > > > > > Applied. Thanks. > > > > And it failed to build, please fix it. Dropped from my tree now. > > I am looking at the error and it should not happen as the ID-s have > been in linux-next for a month now: > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/dt-bindings/arm/qcom,ids.h?h=next-20231016&id=b8c889bef9797a58b8b5aad23875cc4d04b3efd3 > > They are also part of Bjorns 6.7 driver PR: > https://lore.kernel.org/all/20231015204014.855672-1-andersson@kernel.org/T/ But Bjorn's tree isn't a part of the cpufreq tree. In such cases it is typical to ask first maintainer to create an immutable branch / tag, which can later be also merged into another tree without going into troubles of merging the whole tree of the irrelevant subsystem.
On Mon, 16 Oct 2023 at 10:36, Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote: > > On Mon, 16 Oct 2023 at 11:29, Robert Marko <robimarko@gmail.com> wrote: > > > > On Mon, 16 Oct 2023 at 10:22, Viresh Kumar <viresh.kumar@linaro.org> wrote: > > > > > > On 16-10-23, 09:02, Viresh Kumar wrote: > > > > On 13-10-23, 19:20, Robert Marko wrote: > > > > > IPQ8074 comes in 3 families: > > > > > * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz > > > > > * IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz > > > > > * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz > > > > > > > > > > So, in order to be able to share one OPP table lets add support for IPQ8074 > > > > > family based of SMEM SoC ID-s as speedbin fuse is always 0 on IPQ8074. > > > > > > > > > > IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device > > > > > will get created by NVMEM CPUFreq driver. > > > > > > > > > > Signed-off-by: Robert Marko <robimarko@gmail.com> > > > > > Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> > > > > > --- > > > > > Changes in v6: > > > > > * Split IPQ8074 from the IPQ8064 as IPQ8064 has additional dependencies. > > > > > > > > Applied. Thanks. > > > > > > And it failed to build, please fix it. Dropped from my tree now. > > > > I am looking at the error and it should not happen as the ID-s have > > been in linux-next for a month now: > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/dt-bindings/arm/qcom,ids.h?h=next-20231016&id=b8c889bef9797a58b8b5aad23875cc4d04b3efd3 > > > > They are also part of Bjorns 6.7 driver PR: > > https://lore.kernel.org/all/20231015204014.855672-1-andersson@kernel.org/T/ > > But Bjorn's tree isn't a part of the cpufreq tree. In such cases it is > typical to ask first maintainer to create an immutable branch / tag, > which can later be also merged into another tree without going into > troubles of merging the whole tree of the irrelevant subsystem. Ok, I understand now, the thing is that the ID-s were added for socinfo initially but recently I finally had somebody with access to the Oak HW so I added them to cpufreq as well. What can I do to help this get resolved? Regards, Robert > > > -- > With best wishes > Dmitry
On 16-10-23, 10:43, Robert Marko wrote: > Ok, I understand now, the thing is that the ID-s were added for > socinfo initially but recently > I finally had somebody with access to the Oak HW so I added them to > cpufreq as well. > > What can I do to help this get resolved? Rebased over Bjorn's commit (which he already sent in his Arm SoC pull request) and applied your patch again.
On Mon, 16 Oct 2023 at 12:31, Viresh Kumar <viresh.kumar@linaro.org> wrote: > > On 16-10-23, 10:43, Robert Marko wrote: > > Ok, I understand now, the thing is that the ID-s were added for > > socinfo initially but recently > > I finally had somebody with access to the Oak HW so I added them to > > cpufreq as well. > > > > What can I do to help this get resolved? > > Rebased over Bjorn's commit (which he already sent in his Arm SoC pull > request) and applied your patch again. Thank you for your understanding, I will watch out for possible cases like these in the future. Regards, Robert > > -- > viresh
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index 0b3776f558db..675da7f36846 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -181,6 +181,7 @@ static const struct of_device_id blocklist[] __initconst = { { .compatible = "ti,am62p5", }, { .compatible = "qcom,ipq8064", }, + { .compatible = "qcom,ipq8074", }, { .compatible = "qcom,apq8064", }, { .compatible = "qcom,msm8974", }, { .compatible = "qcom,msm8960", }, diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 84d7033e5efe..3fa12648ceb6 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -30,6 +30,11 @@ #include <dt-bindings/arm/qcom,ids.h> +enum ipq8074_versions { + IPQ8074_HAWKEYE_VERSION = 0, + IPQ8074_ACORN_VERSION, +}; + struct qcom_cpufreq_drv; struct qcom_cpufreq_match_data { @@ -203,6 +208,44 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, return ret; } +static int qcom_cpufreq_ipq8074_name_version(struct device *cpu_dev, + struct nvmem_cell *speedbin_nvmem, + char **pvs_name, + struct qcom_cpufreq_drv *drv) +{ + u32 msm_id; + int ret; + *pvs_name = NULL; + + ret = qcom_smem_get_soc_id(&msm_id); + if (ret) + return ret; + + switch (msm_id) { + case QCOM_ID_IPQ8070A: + case QCOM_ID_IPQ8071A: + case QCOM_ID_IPQ8172: + case QCOM_ID_IPQ8173: + case QCOM_ID_IPQ8174: + drv->versions = BIT(IPQ8074_ACORN_VERSION); + break; + case QCOM_ID_IPQ8072A: + case QCOM_ID_IPQ8074A: + case QCOM_ID_IPQ8076A: + case QCOM_ID_IPQ8078A: + drv->versions = BIT(IPQ8074_HAWKEYE_VERSION); + break; + default: + dev_err(cpu_dev, + "SoC ID %u is not part of IPQ8074 family, limiting to 1.4GHz!\n", + msm_id); + drv->versions = BIT(IPQ8074_ACORN_VERSION); + break; + } + + return 0; +} + static const struct qcom_cpufreq_match_data match_data_kryo = { .get_version = qcom_cpufreq_kryo_name_version, }; @@ -217,6 +260,10 @@ static const struct qcom_cpufreq_match_data match_data_qcs404 = { .genpd_names = qcs404_genpd_names, }; +static const struct qcom_cpufreq_match_data match_data_ipq8074 = { + .get_version = qcom_cpufreq_ipq8074_name_version, +}; + static int qcom_cpufreq_probe(struct platform_device *pdev) { struct qcom_cpufreq_drv *drv; @@ -360,6 +407,7 @@ static const struct of_device_id qcom_cpufreq_match_list[] __initconst = { { .compatible = "qcom,msm8996", .data = &match_data_kryo }, { .compatible = "qcom,qcs404", .data = &match_data_qcs404 }, { .compatible = "qcom,ipq8064", .data = &match_data_krait }, + { .compatible = "qcom,ipq8074", .data = &match_data_ipq8074 }, { .compatible = "qcom,apq8064", .data = &match_data_krait }, { .compatible = "qcom,msm8974", .data = &match_data_krait }, { .compatible = "qcom,msm8960", .data = &match_data_krait },