|
|
@@ -1,10 +1,11 @@
|
|
|
-From 11592aa862e67f4477dee7e94d5c8244d893de1b Mon Sep 17 00:00:00 2001
|
|
|
+From df75a00c60c6e58bc36e4c63e9d7f1910412b132 Mon Sep 17 00:00:00 2001
|
|
|
From: Robert Marko <[email protected]>
|
|
|
-Date: Sat, 31 Dec 2022 13:03:41 +0100
|
|
|
+Date: Fri, 13 Oct 2023 19:20:02 +0200
|
|
|
Subject: [PATCH] cpufreq: qcom-nvmem: add support for IPQ8074
|
|
|
|
|
|
-IPQ8074 comes in 2 families:
|
|
|
+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
|
|
|
@@ -14,14 +15,12 @@ IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device
|
|
|
will get created by NVMEM CPUFreq driver.
|
|
|
|
|
|
Signed-off-by: Robert Marko <[email protected]>
|
|
|
----
|
|
|
-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)
|
|
|
+Acked-by: Konrad Dybcio <[email protected]>
|
|
|
+Signed-off-by: Viresh Kumar <[email protected]>
|
|
|
---
|
|
|
drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
|
|
|
- drivers/cpufreq/qcom-cpufreq-nvmem.c | 43 ++++++++++++++++++++++++++++
|
|
|
- 2 files changed, 44 insertions(+)
|
|
|
+ drivers/cpufreq/qcom-cpufreq-nvmem.c | 48 ++++++++++++++++++++++++++++
|
|
|
+ 2 files changed, 49 insertions(+)
|
|
|
|
|
|
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
|
|
|
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
|
|
|
@@ -35,17 +34,19 @@ and restrict the speed to Acorn variant (1.4GHz)
|
|
|
{ .compatible = "qcom,msm8960", },
|
|
|
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
|
|
|
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
|
|
|
-@@ -31,6 +31,9 @@
|
|
|
+@@ -31,6 +31,11 @@
|
|
|
|
|
|
#include <dt-bindings/arm/qcom,ids.h>
|
|
|
|
|
|
-+#define IPQ8074_HAWKEYE_VERSION BIT(0)
|
|
|
-+#define IPQ8074_ACORN_VERSION BIT(1)
|
|
|
++enum ipq8074_versions {
|
|
|
++ IPQ8074_HAWKEYE_VERSION = 0,
|
|
|
++ IPQ8074_ACORN_VERSION,
|
|
|
++};
|
|
|
+
|
|
|
struct qcom_cpufreq_drv;
|
|
|
|
|
|
struct qcom_cpufreq_match_data {
|
|
|
-@@ -204,6 +207,41 @@ len_error:
|
|
|
+@@ -204,6 +209,44 @@ len_error:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
@@ -65,19 +66,22 @@ and restrict the speed to Acorn variant (1.4GHz)
|
|
|
+ switch (msm_id) {
|
|
|
+ case QCOM_ID_IPQ8070A:
|
|
|
+ case QCOM_ID_IPQ8071A:
|
|
|
-+ drv->versions = IPQ8074_ACORN_VERSION;
|
|
|
++ 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 = IPQ8074_HAWKEYE_VERSION;
|
|
|
++ 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 = IPQ8074_ACORN_VERSION;
|
|
|
++ drv->versions = BIT(IPQ8074_ACORN_VERSION);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
@@ -87,7 +91,7 @@ and restrict the speed to Acorn variant (1.4GHz)
|
|
|
static const struct qcom_cpufreq_match_data match_data_kryo = {
|
|
|
.get_version = qcom_cpufreq_kryo_name_version,
|
|
|
};
|
|
|
-@@ -218,6 +256,10 @@ static const struct qcom_cpufreq_match_d
|
|
|
+@@ -218,6 +261,10 @@ static const struct qcom_cpufreq_match_d
|
|
|
.genpd_names = qcs404_genpd_names,
|
|
|
};
|
|
|
|
|
|
@@ -98,7 +102,7 @@ and restrict the speed to Acorn variant (1.4GHz)
|
|
|
static int qcom_cpufreq_probe(struct platform_device *pdev)
|
|
|
{
|
|
|
struct qcom_cpufreq_drv *drv;
|
|
|
-@@ -363,6 +405,7 @@ static const struct of_device_id qcom_cp
|
|
|
+@@ -363,6 +410,7 @@ static const struct of_device_id qcom_cp
|
|
|
{ .compatible = "qcom,msm8996", .data = &match_data_kryo },
|
|
|
{ .compatible = "qcom,qcs404", .data = &match_data_qcs404 },
|
|
|
{ .compatible = "qcom,ipq8064", .data = &match_data_krait },
|