Skip to contentSkip to conversation

Enable CPUFreq for STi stih418 SoC.

PATCH In review Alain Volmat 2 participants 5 messages Aug 31, 2020 – Sep 3, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Enable CPUFreq for STi stih418 SoC.

This serie enables cpufreq for the STi stih418 SoC.

Alain Volmat (3):
cpufreq: sti-cpufreq: add stih418 support
cpufreq: dt-platdev: Blacklist st,stih418 SoC
cpufreq: arm: Kconfig: add CPUFREQ_DT depend for STI CPUFREQ

 drivers/cpufreq/Kconfig.arm          | 2 +-
 drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
 drivers/cpufreq/sti-cpufreq.c        | 6 ++++--
 3 files changed, 6 insertions(+), 3 deletions(-)
#1 lore raw

PATCH 1/3 cpufreq: sti-cpufreq: add stih418 support

The STiH418 can be controlled the same way as STiH407 & STiH410 regarding cpufreq.

---
 drivers/cpufreq/sti-cpufreq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/cpufreq/sti-cpufreq.c +4 -2
index a5ad96d29adc..4ac6fb23792a 100644
@@ -141,7 +141,8 @@ static const struct reg_field sti_stih407_dvfs_regfields[DVFS_MAX_REGFIELDS] = {
 static const struct reg_field *sti_cpufreq_match(void)
 {
 	if (of_machine_is_compatible("st,stih407") ||
-	    of_machine_is_compatible("st,stih410"))
+	    of_machine_is_compatible("st,stih410") ||
+	    of_machine_is_compatible("st,stih418"))
 		return sti_stih407_dvfs_regfields;
 
 	return NULL;
@@ -258,7 +259,8 @@ static int sti_cpufreq_init(void)
 	int ret;
 
 	if ((!of_machine_is_compatible("st,stih407")) &&
-		(!of_machine_is_compatible("st,stih410")))
+		(!of_machine_is_compatible("st,stih410")) &&
+		(!of_machine_is_compatible("st,stih418")))
 		return -ENODEV;
 
 	ddata.cpu = get_cpu_device(0);
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/3 cpufreq: dt-platdev: Blacklist st,stih418 SoC

In reply to Alain Volmat

Add st,stih418 SoC in the blacklist since the cpufreq driver for this platform is already registering the driver.

---
 drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/cpufreq-dt-platdev.c +1 -0
index 7d01df7bfa6c..3776d960f405 100644
@@ -137,6 +137,7 @@ static const struct of_device_id blacklist[] __initconst = {
 
 	{ .compatible = "st,stih407", },
 	{ .compatible = "st,stih410", },
+	{ .compatible = "st,stih418", },
 
 	{ .compatible = "sigma,tango4", },
 
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/3 cpufreq: arm: Kconfig: add CPUFREQ_DT depend for STI CPUFREQ

In reply to Alain Volmat

The sti cpufreq driver is relying on the CPUFREQ_DT driver hence add the depends within the Kconfig.arm

---
 drivers/cpufreq/Kconfig.arm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/Kconfig.arm +1 -1
index cb72fb507d57..bf5830eb664f 100644
@@ -283,7 +283,7 @@ config ARM_SPEAR_CPUFREQ
 
 config ARM_STI_CPUFREQ
 	tristate "STi CPUFreq support"
-	depends on SOC_STIH407
+	depends on CPUFREQ_DT && SOC_STIH407
 	help
 	  This driver uses the generic OPP framework to match the running
 	  platform with a predefined set of suitable values.  If not provided
Signature · 1 line
2.17.1
maintainer
#4 lore raw
In reply to Alain Volmat
Quoted 2 lines · Alain Volmat

This serie enables cpufreq for the STi stih418 SoC.

Please cc the maintainers directly for patches. I almost missed these, just found during
random screening of the list.

Applied all.

--
viresh