Skip to contentSkip to conversation

Add cpufreq support for Armada 8K

PATCH Applied Gregory CLEMENT 2 participants 5 messages Jan 18, 2019 – Jan 23, 2019

Subsystems (2)
lore
Share & tools
lore

Gregory CLEMENT

author maintainer
#0 lore raw

v5 cover Add cpufreq support for Armada 8K

Hi,

this is the fifth version of a the series adding the cpufreq support for the Marvell Armada 8K SoCs.

Gregory

Changelog:
v4 -> v5:

- Rebased onto v5.0-rc1

- Rewrite the clk_get part in armada_8k_get_sharing_cpus()

- Reverse the call function order in armada_8k_cpufreq_exit()

v3 -> v4:

- Remove most of the global variable and use the private data of the platfrom device to store the freq_tables struct.

- Remove the clk pointer of the freq_table struct which is no more needed with the new way to register the opp

- Check the get_cpu_device() return.

- Balance the clk_get() calls.

- No more use the devm_ function.

- Base the registration of the opp on the cpu mask updated after each iteration to find the shared cpus.

- Base the free on the NULL or 0 value of the freq_table struct members, it allows to remove the global index.

v2 -> v3

- Make the driver really modular (modprobe;modprobe -r;modprobe; is working)

- Don't use anymore 100MHz as minimal frequency, but only max frequency/4

- Fix remaining warning reported by checkpatch

- Rework the registering of the opp

v1 -> v2:

- Fix typos in MAINTAINERS (reported by Baruch Siach) and in armada-8k-cpufreq.c (reported by Thomas Petazzoni)

- Fix indentation in Kconfig.arm (reported by Thomas Petazzoni)

- Use const for opps_div (reported by Thomas Petazzoni)

- Fix memory leak of opps_array (reported by Thomas Petazzoni)

Gregory CLEMENT (2):
MAINTAINERS: add new entries for Armada 8K cpufreq driver
cpufreq: ap806: add cpufreq driver for Armada 8K

 MAINTAINERS                         |   1 +
 drivers/cpufreq/Kconfig.arm         |  11 ++
 drivers/cpufreq/Makefile            |   1 +
 drivers/cpufreq/armada-8k-cpufreq.c | 203 ++++++++++++++++++++++++++++
 4 files changed, 216 insertions(+)
 create mode 100644 drivers/cpufreq/armada-8k-cpufreq.c
Signature · 1 line
2.20.1
author maintainer
#1 lore raw

PATCH v5 1/2 MAINTAINERS: add new entries for Armada 8K cpufreq driver

This new driver belongs to the mvebu family, update the MAINTAINER file to document it.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 32d444476a90..4a3d62a83e35 100644
@@ -1737,6 +1737,7 @@ F:	arch/arm/configs/mvebu_*_defconfig
 F:	arch/arm/mach-mvebu/
 F:	arch/arm64/boot/dts/marvell/armada*
 F:	drivers/cpufreq/armada-37xx-cpufreq.c
+F:	drivers/cpufreq/armada-8k-cpufreq.c
 F:	drivers/cpufreq/mvebu-cpufreq.c
 F:	drivers/irqchip/irq-armada-370-xp.c
 F:	drivers/irqchip/irq-mvebu-*
Signature · 1 line
2.20.1
author maintainer
#2 lore raw

PATCH v5 2/2 cpufreq: ap806: add cpufreq driver for Armada 8K

In reply to Gregory CLEMENT

Add cpufreq driver for Marvell AP-806 found on Aramda 8K. The AP-806 has DFS (Dynamic Frequency Scaling) with coupled clock domain for two clusters, so this driver will directly use generic cpufreq-dt driver as backend.

Based on the work of Omri Itach <[email protected]>.

---
 drivers/cpufreq/Kconfig.arm         |  11 ++
 drivers/cpufreq/Makefile            |   1 +
 drivers/cpufreq/armada-8k-cpufreq.c | 203 ++++++++++++++++++++++++++++
 3 files changed, 215 insertions(+)
 create mode 100644 drivers/cpufreq/armada-8k-cpufreq.c
drivers/cpufreq/Kconfig.arm +11 -0
index 688f10227793..10bc5c798d17 100644
@@ -25,6 +25,17 @@ config ARM_ARMADA_37XX_CPUFREQ
 	  This adds the CPUFreq driver support for Marvell Armada 37xx SoCs.
 	  The Armada 37xx PMU supports 4 frequency and VDD levels.
 
+config ARM_ARMADA_8K_CPUFREQ
+	tristate "Armada 8K CPUFreq driver"
+	depends on ARCH_MVEBU && CPUFREQ_DT
+	help
+	  This enables the CPUFreq driver support for Marvell
+	  Armada8k SOCs.
+	  Armada8K device has the AP806 which supports scaling
+	  to any full integer divider.
+
+	  If in doubt, say N.
+
 # big LITTLE core layer and glue drivers
 config ARM_BIG_LITTLE_CPUFREQ
 	tristate "Generic ARM big LITTLE CPUfreq driver"
drivers/cpufreq/Makefile +1 -0
index 08c071be2491..689b26c6f949 100644
@@ -50,6 +50,7 @@ obj-$(CONFIG_X86_SFI_CPUFREQ)		+= sfi-cpufreq.o
 obj-$(CONFIG_ARM_BIG_LITTLE_CPUFREQ)	+= arm_big_little.o
 
 obj-$(CONFIG_ARM_ARMADA_37XX_CPUFREQ)	+= armada-37xx-cpufreq.o
+obj-$(CONFIG_ARM_ARMADA_8K_CPUFREQ)	+= armada-8k-cpufreq.o
 obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ)	+= brcmstb-avs-cpufreq.o
 obj-$(CONFIG_ACPI_CPPC_CPUFREQ)		+= cppc_cpufreq.o
 obj-$(CONFIG_ARCH_DAVINCI)		+= davinci-cpufreq.o
drivers/cpufreq/armada-8k-cpufreq.c new file +203 -0

203 lines not on this page · raw message

Signature · 1 line
2.20.1
author maintainer
#3 lore raw

PATCH v5 2/2 cpufreq: ap806: add cpufreq driver for Armada 8K

Add cpufreq driver for Marvell AP-806 found on Aramda 8K. The AP-806 has DFS (Dynamic Frequency Scaling) with coupled clock domain for two clusters, so this driver will directly use generic cpufreq-dt driver as backend.

Based on the work of Omri Itach <[email protected]>.

---
Hi,

This one is the correct version, in the previous one the change were not merged.

Sorry for the noise,

Gregory

 drivers/cpufreq/Kconfig.arm         |  11 ++
 drivers/cpufreq/Makefile            |   1 +
 drivers/cpufreq/armada-8k-cpufreq.c | 204 ++++++++++++++++++++++++++++
 3 files changed, 216 insertions(+)
 create mode 100644 drivers/cpufreq/armada-8k-cpufreq.c
drivers/cpufreq/Kconfig.arm +11 -0
index 688f10227793..10bc5c798d17 100644
@@ -25,6 +25,17 @@ config ARM_ARMADA_37XX_CPUFREQ
 	  This adds the CPUFreq driver support for Marvell Armada 37xx SoCs.
 	  The Armada 37xx PMU supports 4 frequency and VDD levels.
 
+config ARM_ARMADA_8K_CPUFREQ
+	tristate "Armada 8K CPUFreq driver"
+	depends on ARCH_MVEBU && CPUFREQ_DT
+	help
+	  This enables the CPUFreq driver support for Marvell
+	  Armada8k SOCs.
+	  Armada8K device has the AP806 which supports scaling
+	  to any full integer divider.
+
+	  If in doubt, say N.
+
 # big LITTLE core layer and glue drivers
 config ARM_BIG_LITTLE_CPUFREQ
 	tristate "Generic ARM big LITTLE CPUfreq driver"
drivers/cpufreq/Makefile +1 -0
index 08c071be2491..689b26c6f949 100644
@@ -50,6 +50,7 @@ obj-$(CONFIG_X86_SFI_CPUFREQ)		+= sfi-cpufreq.o
 obj-$(CONFIG_ARM_BIG_LITTLE_CPUFREQ)	+= arm_big_little.o
 
 obj-$(CONFIG_ARM_ARMADA_37XX_CPUFREQ)	+= armada-37xx-cpufreq.o
+obj-$(CONFIG_ARM_ARMADA_8K_CPUFREQ)	+= armada-8k-cpufreq.o
 obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ)	+= brcmstb-avs-cpufreq.o
 obj-$(CONFIG_ACPI_CPPC_CPUFREQ)		+= cppc_cpufreq.o
 obj-$(CONFIG_ARCH_DAVINCI)		+= davinci-cpufreq.o
drivers/cpufreq/armada-8k-cpufreq.c new file +204 -0

204 lines not on this page · raw message

Signature · 1 line
2.20.1
maintainer Applied
#4 lore raw
In reply to Gregory CLEMENT
Quoted 4 lines · Gregory CLEMENT

Hi,

this is the fifth version of a the series adding the cpufreq support for the Marvell Armada 8K SoCs.

Applied. Thanks.

Signature · 1 line
viresh