Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] Enable ipq5210 in cpufreq/qcom-nvmem driver
@ 2026-07-01  8:46 Varadarajan Narayanan
  2026-07-01  8:46 ` [PATCH 1/2] dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ5210 Varadarajan Narayanan
  2026-07-01  8:46 ` [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support Varadarajan Narayanan
  0 siblings, 2 replies; 6+ messages in thread
From: Varadarajan Narayanan @ 2026-07-01  8:46 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Ilia Lin, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, linux-kernel, linux-arm-msm, devicetree,
	Varadarajan Narayanan

Document IPQ5210 compatible for Qcom nvmem cpufreq driver.
Add speed bin identification and match data for ipq5210.

Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
---
Varadarajan Narayanan (2):
      dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ5210
      cpufreq: qcom-nvmem: Add IPQ5210 support

 Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml | 1 +
 drivers/cpufreq/cpufreq-dt-platdev.c                              | 1 +
 drivers/cpufreq/qcom-cpufreq-nvmem.c                              | 8 ++++++++
 3 files changed, 10 insertions(+)
---
base-commit: 533704f3c28c3f5f9e2542aa3a6a326c32e6f5c0
change-id: 20260625-cpufreq-4e017fc09de5

Best regards,
-- 
Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ5210
  2026-07-01  8:46 [PATCH 0/2] Enable ipq5210 in cpufreq/qcom-nvmem driver Varadarajan Narayanan
@ 2026-07-01  8:46 ` Varadarajan Narayanan
  2026-07-01  8:46 ` [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support Varadarajan Narayanan
  1 sibling, 0 replies; 6+ messages in thread
From: Varadarajan Narayanan @ 2026-07-01  8:46 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Ilia Lin, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, linux-kernel, linux-arm-msm, devicetree,
	Varadarajan Narayanan

Document IPQ5210 compatible for Qcom NVMEM CPUFreq driver.

Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
---
 Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml
index 547265b8b118..2f5dbb59034c 100644
--- a/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml
+++ b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml
@@ -27,6 +27,7 @@ select:
         enum:
           - qcom,apq8064
           - qcom,apq8096
+          - qcom,ipq5210
           - qcom,ipq5332
           - qcom,ipq6018
           - qcom,ipq8064

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support
  2026-07-01  8:46 [PATCH 0/2] Enable ipq5210 in cpufreq/qcom-nvmem driver Varadarajan Narayanan
  2026-07-01  8:46 ` [PATCH 1/2] dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ5210 Varadarajan Narayanan
@ 2026-07-01  8:46 ` Varadarajan Narayanan
  2026-07-01  8:56   ` sashiko-bot
  2026-07-01  9:36   ` Konrad Dybcio
  1 sibling, 2 replies; 6+ messages in thread
From: Varadarajan Narayanan @ 2026-07-01  8:46 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Ilia Lin, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, linux-kernel, linux-arm-msm, devicetree,
	Varadarajan Narayanan

IPQ5210 SoCs expose CPU frequency limits through an eFuse speed bin, and
the valid CPU OPPs depend on the SoC variant.

Add IPQ5210 support to the Qualcomm NVMEM cpufreq driver so the supported
OPPs can be selected at runtime using the eFuse value and the opp-
supported-hw OPP property. Also block the generic cpufreq-dt platform
device for IPQ5210 so the NVMEM-based driver is used.

Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
---
 drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
 drivers/cpufreq/qcom-cpufreq-nvmem.c | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index ff1204c666b1..284eece9e230 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -200,6 +200,7 @@ static const struct of_device_id blocklist[] __initconst = {
 	{ .compatible = "ti,am62l3", },
 	{ .compatible = "ti,am62p5", },
 
+	{ .compatible = "qcom,ipq5210", },
 	{ .compatible = "qcom,ipq5332", },
 	{ .compatible = "qcom,ipq5424", },
 	{ .compatible = "qcom,ipq6018", },
diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
index e6d28d162442..b2aeda7c564a 100644
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
@@ -200,6 +200,13 @@ static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev,
 	case QCOM_ID_IPQ9574:
 		drv->versions = 1 << (unsigned int)(*speedbin);
 		break;
+	case QCOM_ID_IPQ5200:
+	case QCOM_ID_IPQ5210:
+	case QCOM_ID_QCF2200:
+	case QCOM_ID_QCF3200:
+	case QCOM_ID_QCF3210:
+		drv->versions = (*speedbin != 0xcd) ? BIT(0) : BIT(1);
+		break;
 	case QCOM_ID_IPQ5424:
 	case QCOM_ID_IPQ5404:
 		drv->versions = (*speedbin == 0x3b) ? BIT(1) : BIT(0);
@@ -618,6 +625,7 @@ static const struct of_device_id qcom_cpufreq_match_list[] __initconst __maybe_u
 	{ .compatible = "qcom,msm8909", .data = &match_data_msm8909 },
 	{ .compatible = "qcom,msm8996", .data = &match_data_kryo },
 	{ .compatible = "qcom,qcs404", .data = &match_data_qcs404 },
+	{ .compatible = "qcom,ipq5210", .data = &match_data_kryo },
 	{ .compatible = "qcom,ipq5332", .data = &match_data_kryo },
 	{ .compatible = "qcom,ipq5424", .data = &match_data_kryo },
 	{ .compatible = "qcom,ipq6018", .data = &match_data_ipq6018 },

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support
  2026-07-01  8:46 ` [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support Varadarajan Narayanan
@ 2026-07-01  8:56   ` sashiko-bot
  2026-07-01  9:36   ` Konrad Dybcio
  1 sibling, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-07-01  8:56 UTC (permalink / raw)
  To: Varadarajan Narayanan; +Cc: robh, conor+dt, devicetree

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the function `qcom_cpufreq_kryo_name_version()` triggers a kernel `BUG()` panic when the SMEM SoC ID is not recognized, rather than gracefully failing.
--

commit efa443e3ef471a943647c359a1a0b9da9950bda0
Author: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>

cpufreq: qcom-nvmem: Add IPQ5210 support

IPQ5210 SoCs expose CPU frequency limits through an eFuse speed bin, and
the valid CPU OPPs depend on the SoC variant. This patch adds IPQ5210
support to the Qualcomm NVMEM cpufreq driver and blocks the generic
cpufreq-dt platform device.

[ ... ]

> diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
> index e6d28d162442a..b2aeda7c564a9 100644
> --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
> +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
> @@ -200,6 +200,13 @@ static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev,
>  	case QCOM_ID_IPQ9574:
>  		drv->versions = 1 << (unsigned int)(*speedbin);
>  		break;
> +	case QCOM_ID_IPQ5200:
> +	case QCOM_ID_IPQ5210:
> +	case QCOM_ID_QCF2200:
> +	case QCOM_ID_QCF3200:
> +	case QCOM_ID_QCF3210:
> +		drv->versions = (*speedbin != 0xcd) ? BIT(0) : BIT(1);
> +		break;

[Severity: High]
This is a pre-existing issue, but should the default case for this switch
statement continue to use BUG() when an unhandled msm_id is encountered?

If a device tree successfully matches the driver, but the SMEM SoC ID
returned by qcom_smem_get_soc_id() is unexpected (such as from a mismatched
device tree, firmware issue, or prototype hardware),
qcom_cpufreq_kryo_name_version() will hit the default case:

        default:
                BUG();
                break;

Would it be safer to return an error code like -ENODEV here instead of
triggering an immediate kernel panic during device probe?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260701-cpufreq-v1-0-98656ad20ff3@oss.qualcomm.com?part=2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support
  2026-07-01  8:46 ` [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support Varadarajan Narayanan
  2026-07-01  8:56   ` sashiko-bot
@ 2026-07-01  9:36   ` Konrad Dybcio
  2026-07-02  5:04     ` Viresh Kumar
  1 sibling, 1 reply; 6+ messages in thread
From: Konrad Dybcio @ 2026-07-01  9:36 UTC (permalink / raw)
  To: Varadarajan Narayanan, Rafael J. Wysocki, Viresh Kumar, Ilia Lin,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, linux-kernel, linux-arm-msm, devicetree

On 7/1/26 10:46 AM, Varadarajan Narayanan wrote:
> IPQ5210 SoCs expose CPU frequency limits through an eFuse speed bin, and
> the valid CPU OPPs depend on the SoC variant.
> 
> Add IPQ5210 support to the Qualcomm NVMEM cpufreq driver so the supported
> OPPs can be selected at runtime using the eFuse value and the opp-
> supported-hw OPP property. Also block the generic cpufreq-dt platform
> device for IPQ5210 so the NVMEM-based driver is used.
> 
> Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
> ---
>  drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
>  drivers/cpufreq/qcom-cpufreq-nvmem.c | 8 ++++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
> index ff1204c666b1..284eece9e230 100644
> --- a/drivers/cpufreq/cpufreq-dt-platdev.c
> +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
> @@ -200,6 +200,7 @@ static const struct of_device_id blocklist[] __initconst = {
>  	{ .compatible = "ti,am62l3", },
>  	{ .compatible = "ti,am62p5", },
>  
> +	{ .compatible = "qcom,ipq5210", },
>  	{ .compatible = "qcom,ipq5332", },
>  	{ .compatible = "qcom,ipq5424", },
>  	{ .compatible = "qcom,ipq6018", },
> diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
> index e6d28d162442..b2aeda7c564a 100644
> --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
> +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
> @@ -200,6 +200,13 @@ static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev,
>  	case QCOM_ID_IPQ9574:
>  		drv->versions = 1 << (unsigned int)(*speedbin);
>  		break;
> +	case QCOM_ID_IPQ5200:
> +	case QCOM_ID_IPQ5210:
> +	case QCOM_ID_QCF2200:
> +	case QCOM_ID_QCF3200:
> +	case QCOM_ID_QCF3210:
> +		drv->versions = (*speedbin != 0xcd) ? BIT(0) : BIT(1);

nit: checking for == is easier to read

anyway

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support
  2026-07-01  9:36   ` Konrad Dybcio
@ 2026-07-02  5:04     ` Viresh Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Viresh Kumar @ 2026-07-02  5:04 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Varadarajan Narayanan, Rafael J. Wysocki, Ilia Lin, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-pm, linux-kernel,
	linux-arm-msm, devicetree

On 01-07-26, 11:36, Konrad Dybcio wrote:
> nit: checking for == is easier to read
> 
> anyway
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Applied 2/2 with this:

diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
index b2aeda7c564a..efa766e98d86 100644
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
@@ -205,7 +205,7 @@ static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev,
        case QCOM_ID_QCF2200:
        case QCOM_ID_QCF3200:
        case QCOM_ID_QCF3210:
-               drv->versions = (*speedbin != 0xcd) ? BIT(0) : BIT(1);
+               drv->versions = (*speedbin == 0xcd) ? BIT(1) : BIT(0);
                break;
        case QCOM_ID_IPQ5424:
        case QCOM_ID_IPQ5404:


-- 
viresh

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-02  5:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01  8:46 [PATCH 0/2] Enable ipq5210 in cpufreq/qcom-nvmem driver Varadarajan Narayanan
2026-07-01  8:46 ` [PATCH 1/2] dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ5210 Varadarajan Narayanan
2026-07-01  8:46 ` [PATCH 2/2] cpufreq: qcom-nvmem: Add IPQ5210 support Varadarajan Narayanan
2026-07-01  8:56   ` sashiko-bot
2026-07-01  9:36   ` Konrad Dybcio
2026-07-02  5:04     ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox