Skip to contentSkip to conversation

clk: clock driver for the Marvell Armada AP806

PATCH Superseded Thomas Petazzoni 3 participants 7 messages Mar 4, 2016 – Mar 16, 2016

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

v3 cover clk: clock driver for the Marvell Armada AP806

Michael, Stephen,

Here is a new version of the clock driver and its DT binding for the Marvell Armada AP806. As you will see, there is no longer any reference to the DFX Server and changes in the clock tree compared to the v2. This is due to the fact that the HW has changed from this point of view between the test chips and the final revision, and this new version aims at supporting only the final revision.

We therefore have a very simple DT binding, with one single node that covers the entire "system controller" registers, associated to one driver that provides the clocks. This system controller will later be used to support other features such as pin-muxing, but for now we only support the clocks aspects of it.

Please let me know if this approach works for you.

Note that this patch series is based on clk-net, because I wanted to avoid introducing a new use of CLK_IS_ROOT. To do this, I needed the patches currently in clk-next that remove the need for CLK_IS_ROOT.

Thanks!

Thomas

Thomas Petazzoni (3):
dt-bindings: arm: add DT binding for Marvell AP806 system controller
clk: unconditionally recurse into clk/mvebu/
clk: mvebu: new driver for Armada AP806 system controller

 .../arm/marvell/ap806-system-controller.txt        |  34 +++++++
 drivers/clk/Makefile                               |   2 +-
 drivers/clk/mvebu/Kconfig                          |   3 +
 drivers/clk/mvebu/Makefile                         |   1 +
 drivers/clk/mvebu/ap806-system-controller.c        | 106 +++++++++++++++++++++
 5 files changed, 145 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
 create mode 100644 drivers/clk/mvebu/ap806-system-controller.c
Signature · 1 line
2.6.4
#1 lore raw

PATCH v3 1/3 dt-bindings: arm: add DT binding for Marvell AP806 system controller

---
 .../arm/marvell/ap806-system-controller.txt        | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt new file +34 -0
new file mode 100644
index 0000000..5086b89
@@ -0,0 +1,34 @@
+Marvell Armada AP806 System Controller
+======================================
+
+The AP806 is one of the two core HW blocks of the Marvell Armada 7K/8K
+SoCs. It contains a system controller, which provides a number
+registers giving access to numerous features: clocks, pin-muxing and
+many other SoC configuration items. This DT binding allows to describe
+this system controller.
+
+The Device Tree node representing the AP806 system controller provides
+a number of clocks:
+
+ - 0: clock of CPU cluster 0
+ - 1: clock of CPU cluster 1
+ - 2: fixed PLL at 1200 Mhz
+ - 3: MSS clock, derived from the fixed PLL
+
+Required properties:
+
+ - compatible: must be:
+     "marvell,ap806-system-controller", "syscon"
+ - reg: register area of the AP806 system controller
+ - #clock-cells: must be set to 1
+ - clock-output-names: must be defined to:
+    "cpu-cluster-0", "cpu-cluster-1", "fixed", "mss"
+
+Example:
+
+	syscon: system-controller at 6f4000 {
+		compatible = "marvell,ap806-system-controller", "syscon";
+		#clock-cells = <1>;
+		clock-output-names = "cpu-cluster-0", "cpu-cluster-1", "fixed", "mss";
+		reg = <0x6f4000 0x1000>;
+	};
Signature · 1 line
2.6.4
maintainer
#2 lore raw

PATCH v3 1/3 dt-bindings: arm: add DT binding for Marvell AP806 system controller

Quoted 5 lines · Thomas Petazzoni
---
 .../arm/marvell/ap806-system-controller.txt        | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt

That was fun. ;)

#3 lore raw

PATCH v3 2/3 clk: unconditionally recurse into clk/mvebu/

In reply to Thomas Petazzoni

The drivers/clk/mvebu directory is only being built when CONFIG_PLAT_ORION=y. As we are going to support additional mvebu platforms in drivers/clk/mvebu, which don't have CONFIG_PLAT_ORION=y, we need to recurse into this directory regardless of the value of CONFIG_PLAT_ORION.

Since all files in drivers/clk/mvebu/ are already conditionally compiled depending on various Kconfig options, we can recurse unconditionally into drivers/clk/mvebu without any other change.

---
 drivers/clk/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/Makefile +1 -1
index 46869d69..f9ad66e 100644
@@ -61,7 +61,7 @@ obj-$(CONFIG_ARCH_MEDIATEK)		+= mediatek/
 ifeq ($(CONFIG_COMMON_CLK), y)
 obj-$(CONFIG_ARCH_MMP)			+= mmp/
 endif
-obj-$(CONFIG_PLAT_ORION)		+= mvebu/
+obj-y					+= mvebu/
 obj-$(CONFIG_ARCH_MESON)		+= meson/
 obj-$(CONFIG_ARCH_MXS)			+= mxs/
 obj-$(CONFIG_MACH_PISTACHIO)		+= pistachio/
Signature · 1 line
2.6.4
#4 lore raw

PATCH v3 3/3 clk: mvebu: new driver for Armada AP806 system controller

In reply to Thomas Petazzoni

The Armada AP806 system controller, amongst other things, provides a number of clocks for the platform: the CPU cluster clocks, whose frequencies are found by reading the Sample At Reset register, one fixed clock, and another clock derived from the fixed clock, which is the one used by most peripherals in AP806.

The AP806 is one of the two core HW blocks used in the Marvell 7K/8K SoCs.

---
 drivers/clk/mvebu/Kconfig                   |   3 +
 drivers/clk/mvebu/Makefile                  |   1 +
 drivers/clk/mvebu/ap806-system-controller.c | 106 ++++++++++++++++++++++++++++
 3 files changed, 110 insertions(+)
 create mode 100644 drivers/clk/mvebu/ap806-system-controller.c
drivers/clk/mvebu/Kconfig +3 -0
index eaee8f0..bf7ae00 100644
@@ -29,6 +29,9 @@ config ARMADA_XP_CLK
 	select MVEBU_CLK_COMMON
 	select MVEBU_CLK_CPU
 
+config ARMADA_AP806_SYSCON
+	bool
+
 config DOVE_CLK
 	bool
 	select MVEBU_CLK_COMMON
drivers/clk/mvebu/Makefile +1 -0
index 8866115..f4aa481 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_ARMADA_375_CLK)	+= armada-375.o
 obj-$(CONFIG_ARMADA_38X_CLK)	+= armada-38x.o
 obj-$(CONFIG_ARMADA_39X_CLK)	+= armada-39x.o
 obj-$(CONFIG_ARMADA_XP_CLK)	+= armada-xp.o
+obj-$(CONFIG_ARMADA_AP806_SYSCON) += ap806-system-controller.o
 obj-$(CONFIG_DOVE_CLK)		+= dove.o dove-divider.o
 obj-$(CONFIG_KIRKWOOD_CLK)	+= kirkwood.o
 obj-$(CONFIG_ORION_CLK)		+= orion.o
drivers/clk/mvebu/ap806-system-controller.c new file +106 -0

106 lines not on this page · raw message

Signature · 1 line
2.6.4
#5 lore raw

v3 cover clk: clock driver for the Marvell Armada AP806

In reply to Thomas Petazzoni

Hi Thomas,

Quoted 15 lines · Thomas Petazzoni

Michael, Stephen,

Here is a new version of the clock driver and its DT binding for the Marvell Armada AP806. As you will see, there is no longer any reference to the DFX Server and changes in the clock tree compared to the v2. This is due to the fact that the HW has changed from this point of view between the test chips and the final revision, and this new version aims at supporting only the final revision.

We therefore have a very simple DT binding, with one single node that covers the entire "system controller" registers, associated to one driver that provides the clocks. This system controller will later be used to support other features such as pin-muxing, but for now we only support the clocks aspects of it.

Quoted 7 lines

Please let me know if this approach works for you.

Note that this patch series is based on clk-net, because I wanted to avoid introducing a new use of CLK_IS_ROOT. To do this, I needed the patches currently in clk-next that remove the need for CLK_IS_ROOT.

Thanks!

The series is clean and small, I didn't see any problem with it, so for the whole series:

Thanks,

Gregory

Quoted 20 lines

Thomas

Thomas Petazzoni (3):
dt-bindings: arm: add DT binding for Marvell AP806 system controller
clk: unconditionally recurse into clk/mvebu/
clk: mvebu: new driver for Armada AP806 system controller

 .../arm/marvell/ap806-system-controller.txt        |  34 +++++++
 drivers/clk/Makefile                               |   2 +-
 drivers/clk/mvebu/Kconfig                          |   3 +
 drivers/clk/mvebu/Makefile                         |   1 +
 drivers/clk/mvebu/ap806-system-controller.c        | 106 +++++++++++++++++++++
 5 files changed, 145 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
 create mode 100644 drivers/clk/mvebu/ap806-system-controller.c
Signature · 1 line
2.6.4
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#6 lore raw

v3 cover clk: clock driver for the Marvell Armada AP806

In reply to Thomas Petazzoni

Michael, Stephen,

Quoted 8 lines · Thomas Petazzoni

Michael, Stephen,

Here is a new version of the clock driver and its DT binding for the Marvell Armada AP806. As you will see, there is no longer any reference to the DFX Server and changes in the clock tree compared to the v2. This is due to the fact that the HW has changed from this point of view between the test chips and the final revision, and this new version aims at supporting only the final revision.

This third version of the patch series has received the ACK from Rob as the DT binding maintainer, and from Gregory as the mvebu platform maintainer.

Do you have any other concern about this series, or can it be applied soon?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com