linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] AP807 clocks support
@ 2019-08-05 10:03 Miquel Raynal
  2019-08-05 10:03 ` [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible Miquel Raynal
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

Hello,

This is the first batch of changes (out of three) to support the brand
new Marvell CN9130 SoCs which are made of one AP807 and one CP115.

This clock series applies on top of Gregory's "AP806 CPU clocks" [1].

[1] https://patchwork.kernel.org/cover/11038577/

Thanks,
Miquèl


Ben Peled (3):
  clk: mvebu: ap80x-cpu: add AP807 CPU clock support
  clk: mvebu: ap806: Prepare the introduction of AP807 clock support
  clk: mvebu: ap80x: add AP807 clock support

Christine Gharzuzi (1):
  clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock

Miquel Raynal (3):
  dt-bindings: ap80x: Document AP807 CPU clock compatible
  dt-bindings: ap806: Document AP807 clock compatible
  clk: mvebu: ap806: be more explicit on what SaR is

Omri Itach (1):
  clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver

 .../arm/marvell/ap806-system-controller.txt   |  17 +-
 drivers/clk/mvebu/ap-cpu-clk.c                | 139 ++++++++++++---
 drivers/clk/mvebu/ap806-system-controller.c   | 162 ++++++++++++++----
 3 files changed, 253 insertions(+), 65 deletions(-)

-- 
2.20.1


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

* [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
@ 2019-08-05 10:03 ` Miquel Raynal
  2019-08-21 18:51   ` Rob Herring
  2019-09-18  5:08   ` Stephen Boyd
  2019-08-05 10:03 ` [PATCH 2/8] dt-bindings: ap806: Document AP807 " Miquel Raynal
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

Add AP807 CPU clock compatible to the bindings.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 .../bindings/arm/marvell/ap806-system-controller.txt     | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt b/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
index 4f21c1024073..59b6b992fbc9 100644
--- a/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
+++ b/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
@@ -147,11 +147,14 @@ ap_syscon1: system-controller@6f8000 {
 Cluster clocks:
 ---------------
 
-Device Tree Clock bindings for cluster clock of AP806 Marvell. Each
-cluster contain up to 2 CPUs running at the same frequency.
+Device Tree Clock bindings for cluster clock of Marvell
+AP806/AP807. Each cluster contain up to 2 CPUs running at the same
+frequency.
 
 Required properties:
-- compatible: must be  "marvell,ap806-cpu-clock";
+ - compatible: must be one of:
+   * "marvell,ap806-cpu-clock"
+   * "marvell,ap807-cpu-clock"
 - #clock-cells : should be set to 1.
 
 - clocks : shall be the input parent clock(s) phandle for the clock
-- 
2.20.1


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

* [PATCH 2/8] dt-bindings: ap806: Document AP807 clock compatible
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
  2019-08-05 10:03 ` [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible Miquel Raynal
@ 2019-08-05 10:03 ` Miquel Raynal
  2019-08-21 18:51   ` Rob Herring
  2019-09-18  5:08   ` Stephen Boyd
  2019-08-05 10:03 ` [PATCH 3/8] clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock Miquel Raynal
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

Add AP807 clock compatible to the bindings.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 .../bindings/arm/marvell/ap806-system-controller.txt      | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt b/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
index 59b6b992fbc9..26410fbb85be 100644
--- a/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
+++ b/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
@@ -18,8 +18,8 @@ Clocks:
 -------
 
 
-The Device Tree node representing the AP806 system controller provides
-a number of clocks:
+The Device Tree node representing the AP806/AP807 system controller
+provides a number of clocks:
 
  - 0: reference clock of CPU cluster 0
  - 1: reference clock of CPU cluster 1
@@ -28,7 +28,9 @@ a number of clocks:
 
 Required properties:
 
- - compatible: must be: "marvell,ap806-clock"
+ - compatible: must be one of:
+   * "marvell,ap806-clock"
+   * "marvell,ap807-clock"
  - #clock-cells: must be set to 1
 
 Pinctrl:
-- 
2.20.1


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

* [PATCH 3/8] clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
  2019-08-05 10:03 ` [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible Miquel Raynal
  2019-08-05 10:03 ` [PATCH 2/8] dt-bindings: ap806: Document AP807 " Miquel Raynal
@ 2019-08-05 10:03 ` Miquel Raynal
  2019-09-18  5:08   ` Stephen Boyd
  2019-08-05 10:03 ` [PATCH 4/8] clk: mvebu: ap80x-cpu: add AP807 CPU clock support Miquel Raynal
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Christine Gharzuzi, Miquel Raynal

From: Christine Gharzuzi <chrisg@marvell.com>

This patch allows same flow to be executed on chips with different
register mappings like AP806 and, in the future, AP807.

Note: this patch has no functional effect, and only prepares the
driver for additional chips to be supported by retrieving the right
device data depenging on the compatible property.

Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/clk/mvebu/ap-cpu-clk.c | 82 +++++++++++++++++++++++++---------
 1 file changed, 62 insertions(+), 20 deletions(-)

diff --git a/drivers/clk/mvebu/ap-cpu-clk.c b/drivers/clk/mvebu/ap-cpu-clk.c
index e4cecb456884..784104f6793b 100644
--- a/drivers/clk/mvebu/ap-cpu-clk.c
+++ b/drivers/clk/mvebu/ap-cpu-clk.c
@@ -15,6 +15,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include "armada_ap_cp_helper.h"
@@ -29,6 +30,26 @@
 
 #define APN806_MAX_DIVIDER		32
 
+/**
+ * struct cpu_dfs_regs: CPU DFS register mapping
+ * @divider_reg: full integer ratio from PLL frequency to CPU clock frequency
+ * @force_reg: request to force new ratio regardless of relation to other clocks
+ * @ratio_reg: central request to switch ratios
+ */
+struct cpu_dfs_regs {
+	unsigned int divider_reg;
+	unsigned int force_reg;
+	unsigned int ratio_reg;
+	unsigned int ratio_state_reg;
+	unsigned int divider_mask;
+	unsigned int cluster_offset;
+	unsigned int force_mask;
+	int divider_offset;
+	int ratio_offset;
+	int ratio_state_offset;
+	int ratio_state_cluster_offset;
+};
+
 /* AP806 CPU DFS register mapping*/
 #define AP806_CA72MP2_0_PLL_CR_0_REG_OFFSET		0x278
 #define AP806_CA72MP2_0_PLL_CR_1_REG_OFFSET		0x280
@@ -43,6 +64,7 @@
 #define AP806_PLL_CR_0_CPU_CLK_RELOAD_FORCE_MASK \
 			(0x1 << AP806_PLL_CR_0_CPU_CLK_RELOAD_FORCE_OFFSET)
 #define AP806_PLL_CR_0_CPU_CLK_RELOAD_RATIO_OFFSET	16
+#define AP806_CA72MP2_0_PLL_RATIO_STABLE_OFFSET	0
 #define AP806_CA72MP2_0_PLL_RATIO_STATE			11
 
 #define STATUS_POLL_PERIOD_US		1
@@ -50,6 +72,20 @@
 
 #define to_ap_cpu_clk(_hw) container_of(_hw, struct ap_cpu_clk, hw)
 
+static const struct cpu_dfs_regs ap806_dfs_regs = {
+	.divider_reg = AP806_CA72MP2_0_PLL_CR_0_REG_OFFSET,
+	.force_reg = AP806_CA72MP2_0_PLL_CR_1_REG_OFFSET,
+	.ratio_reg = AP806_CA72MP2_0_PLL_CR_2_REG_OFFSET,
+	.ratio_state_reg = AP806_CA72MP2_0_PLL_SR_REG_OFFSET,
+	.divider_mask = AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_MASK,
+	.cluster_offset = AP806_CA72MP2_0_PLL_CR_CLUSTER_OFFSET,
+	.force_mask = AP806_PLL_CR_0_CPU_CLK_RELOAD_FORCE_MASK,
+	.divider_offset = AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_OFFSET,
+	.ratio_offset = AP806_PLL_CR_0_CPU_CLK_RELOAD_RATIO_OFFSET,
+	.ratio_state_offset = AP806_CA72MP2_0_PLL_RATIO_STABLE_OFFSET,
+	.ratio_state_cluster_offset = AP806_CA72MP2_0_PLL_RATIO_STABLE_OFFSET,
+};
+
 /*
  * struct ap806_clk: CPU cluster clock controller instance
  * @cluster: Cluster clock controller index
@@ -64,6 +100,7 @@ struct ap_cpu_clk {
 	struct device *dev;
 	struct clk_hw hw;
 	struct regmap *pll_cr_base;
+	const struct cpu_dfs_regs *pll_regs;
 };
 
 static unsigned long ap_cpu_clk_recalc_rate(struct clk_hw *hw,
@@ -73,11 +110,11 @@ static unsigned long ap_cpu_clk_recalc_rate(struct clk_hw *hw,
 	unsigned int cpu_clkdiv_reg;
 	int cpu_clkdiv_ratio;
 
-	cpu_clkdiv_reg = AP806_CA72MP2_0_PLL_CR_0_REG_OFFSET +
-		(clk->cluster * AP806_CA72MP2_0_PLL_CR_CLUSTER_OFFSET);
+	cpu_clkdiv_reg = clk->pll_regs->divider_reg +
+		(clk->cluster * clk->pll_regs->cluster_offset);
 	regmap_read(clk->pll_cr_base, cpu_clkdiv_reg, &cpu_clkdiv_ratio);
-	cpu_clkdiv_ratio &= AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_MASK;
-	cpu_clkdiv_ratio >>= AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_OFFSET;
+	cpu_clkdiv_ratio &= clk->pll_regs->divider_mask;
+	cpu_clkdiv_ratio >>= clk->pll_regs->divider_offset;
 
 	return parent_rate / cpu_clkdiv_ratio;
 }
@@ -89,35 +126,36 @@ static int ap_cpu_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 	int ret, reg, divider = parent_rate / rate;
 	unsigned int cpu_clkdiv_reg, cpu_force_reg, cpu_ratio_reg, stable_bit;
 
-	cpu_clkdiv_reg = AP806_CA72MP2_0_PLL_CR_0_REG_OFFSET +
-		(clk->cluster * AP806_CA72MP2_0_PLL_CR_CLUSTER_OFFSET);
-	cpu_force_reg = AP806_CA72MP2_0_PLL_CR_1_REG_OFFSET +
-		(clk->cluster * AP806_CA72MP2_0_PLL_CR_CLUSTER_OFFSET);
-	cpu_ratio_reg = AP806_CA72MP2_0_PLL_CR_2_REG_OFFSET +
-		(clk->cluster * AP806_CA72MP2_0_PLL_CR_CLUSTER_OFFSET);
+	cpu_clkdiv_reg = clk->pll_regs->divider_reg +
+		(clk->cluster * clk->pll_regs->cluster_offset);
+	cpu_force_reg = clk->pll_regs->force_reg +
+		(clk->cluster * clk->pll_regs->cluster_offset);
+	cpu_ratio_reg = clk->pll_regs->ratio_reg +
+		(clk->cluster * clk->pll_regs->cluster_offset);
 
 	regmap_update_bits(clk->pll_cr_base, cpu_clkdiv_reg,
-			   AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_MASK, divider);
+			   clk->pll_regs->divider_mask, divider);
 
 	regmap_update_bits(clk->pll_cr_base, cpu_force_reg,
-			   AP806_PLL_CR_0_CPU_CLK_RELOAD_FORCE_MASK,
-			   AP806_PLL_CR_0_CPU_CLK_RELOAD_FORCE_MASK);
+			   clk->pll_regs->force_mask,
+			   clk->pll_regs->force_mask);
 
 	regmap_update_bits(clk->pll_cr_base, cpu_ratio_reg,
-			   BIT(AP806_PLL_CR_0_CPU_CLK_RELOAD_RATIO_OFFSET),
-			   BIT(AP806_PLL_CR_0_CPU_CLK_RELOAD_RATIO_OFFSET));
-
-	stable_bit = BIT(clk->cluster * AP806_CA72MP2_0_PLL_RATIO_STATE),
+			   BIT(clk->pll_regs->ratio_offset),
+			   BIT(clk->pll_regs->ratio_offset));
 
+	stable_bit = BIT(clk->pll_regs->ratio_state_offset +
+			 clk->cluster *
+			 clk->pll_regs->ratio_state_cluster_offset),
 	ret = regmap_read_poll_timeout(clk->pll_cr_base,
-				       AP806_CA72MP2_0_PLL_SR_REG_OFFSET, reg,
+				       clk->pll_regs->ratio_state_reg, reg,
 				       reg & stable_bit, STATUS_POLL_PERIOD_US,
 				       STATUS_POLL_TIMEOUT_US);
 	if (ret)
 		return ret;
 
 	regmap_update_bits(clk->pll_cr_base, cpu_ratio_reg,
-			   BIT(AP806_PLL_CR_0_CPU_CLK_RELOAD_RATIO_OFFSET), 0);
+			   BIT(clk->pll_regs->ratio_offset), 0);
 
 	return 0;
 }
@@ -222,6 +260,7 @@ static int ap_cpu_clock_probe(struct platform_device *pdev)
 		ap_cpu_clk[cluster_index].pll_cr_base = regmap;
 		ap_cpu_clk[cluster_index].hw.init = &init;
 		ap_cpu_clk[cluster_index].dev = dev;
+		ap_cpu_clk[cluster_index].pll_regs = of_device_get_match_data(&pdev->dev);
 
 		init.name = ap_cpu_clk[cluster_index].clk_name;
 		init.ops = &ap_cpu_clk_ops;
@@ -244,7 +283,10 @@ static int ap_cpu_clock_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id ap_cpu_clock_of_match[] = {
-	{ .compatible = "marvell,ap806-cpu-clock", },
+	{
+		.compatible = "marvell,ap806-cpu-clock",
+		.data = &ap806_dfs_regs,
+	},
 	{ }
 };
 
-- 
2.20.1


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

* [PATCH 4/8] clk: mvebu: ap80x-cpu: add AP807 CPU clock support
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
                   ` (2 preceding siblings ...)
  2019-08-05 10:03 ` [PATCH 3/8] clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock Miquel Raynal
@ 2019-08-05 10:03 ` Miquel Raynal
  2019-09-18  5:08   ` Stephen Boyd
  2019-08-05 10:03 ` [PATCH 5/8] clk: mvebu: ap806: be more explicit on what SaR is Miquel Raynal
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Ben Peled, Miquel Raynal

From: Ben Peled <bpeled@marvell.com>

Enhance the ap-cpu-clk driver to support both AP806 and AP807 CPU
clocks.

Signed-off-by: Ben Peled <bpeled@marvell.com>
[<miquel.raynal@bootlin.com>: use device data instead of conditions on
the compatible]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/clk/mvebu/ap-cpu-clk.c | 59 ++++++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mvebu/ap-cpu-clk.c b/drivers/clk/mvebu/ap-cpu-clk.c
index 784104f6793b..af5e5acad370 100644
--- a/drivers/clk/mvebu/ap-cpu-clk.c
+++ b/drivers/clk/mvebu/ap-cpu-clk.c
@@ -45,6 +45,7 @@ struct cpu_dfs_regs {
 	unsigned int cluster_offset;
 	unsigned int force_mask;
 	int divider_offset;
+	int divider_ratio;
 	int ratio_offset;
 	int ratio_state_offset;
 	int ratio_state_cluster_offset;
@@ -58,6 +59,7 @@ struct cpu_dfs_regs {
 
 #define AP806_CA72MP2_0_PLL_CR_CLUSTER_OFFSET		0x14
 #define AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_OFFSET		0
+#define AP806_PLL_CR_CPU_CLK_DIV_RATIO			0
 #define AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_MASK \
 			(0x3f << AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_OFFSET)
 #define AP806_PLL_CR_0_CPU_CLK_RELOAD_FORCE_OFFSET	24
@@ -81,11 +83,47 @@ static const struct cpu_dfs_regs ap806_dfs_regs = {
 	.cluster_offset = AP806_CA72MP2_0_PLL_CR_CLUSTER_OFFSET,
 	.force_mask = AP806_PLL_CR_0_CPU_CLK_RELOAD_FORCE_MASK,
 	.divider_offset = AP806_PLL_CR_0_CPU_CLK_DIV_RATIO_OFFSET,
+	.divider_ratio = AP806_PLL_CR_CPU_CLK_DIV_RATIO,
 	.ratio_offset = AP806_PLL_CR_0_CPU_CLK_RELOAD_RATIO_OFFSET,
 	.ratio_state_offset = AP806_CA72MP2_0_PLL_RATIO_STABLE_OFFSET,
 	.ratio_state_cluster_offset = AP806_CA72MP2_0_PLL_RATIO_STABLE_OFFSET,
 };
 
+/* AP807 CPU DFS register mapping */
+#define AP807_DEVICE_GENERAL_CONTROL_10_REG_OFFSET		0x278
+#define AP807_DEVICE_GENERAL_CONTROL_11_REG_OFFSET		0x27c
+#define AP807_DEVICE_GENERAL_STATUS_6_REG_OFFSET		0xc98
+#define AP807_CA72MP2_0_PLL_CR_CLUSTER_OFFSET			0x8
+#define AP807_PLL_CR_0_CPU_CLK_DIV_RATIO_OFFSET			18
+#define AP807_PLL_CR_0_CPU_CLK_DIV_RATIO_MASK \
+		(0x3f << AP807_PLL_CR_0_CPU_CLK_DIV_RATIO_OFFSET)
+#define AP807_PLL_CR_1_CPU_CLK_DIV_RATIO_OFFSET			12
+#define AP807_PLL_CR_1_CPU_CLK_DIV_RATIO_MASK \
+		(0x3f << AP807_PLL_CR_1_CPU_CLK_DIV_RATIO_OFFSET)
+#define AP807_PLL_CR_CPU_CLK_DIV_RATIO				3
+#define AP807_PLL_CR_0_CPU_CLK_RELOAD_FORCE_OFFSET		0
+#define AP807_PLL_CR_0_CPU_CLK_RELOAD_FORCE_MASK \
+		(0x3 << AP807_PLL_CR_0_CPU_CLK_RELOAD_FORCE_OFFSET)
+#define AP807_PLL_CR_0_CPU_CLK_RELOAD_RATIO_OFFSET		6
+#define	AP807_CA72MP2_0_PLL_CLKDIV_RATIO_STABLE_OFFSET		20
+#define AP807_CA72MP2_0_PLL_CLKDIV_RATIO_STABLE_CLUSTER_OFFSET	3
+
+static const struct cpu_dfs_regs ap807_dfs_regs = {
+	.divider_reg = AP807_DEVICE_GENERAL_CONTROL_10_REG_OFFSET,
+	.force_reg = AP807_DEVICE_GENERAL_CONTROL_11_REG_OFFSET,
+	.ratio_reg = AP807_DEVICE_GENERAL_CONTROL_11_REG_OFFSET,
+	.ratio_state_reg = AP807_DEVICE_GENERAL_STATUS_6_REG_OFFSET,
+	.divider_mask = AP807_PLL_CR_0_CPU_CLK_DIV_RATIO_MASK,
+	.cluster_offset = AP807_CA72MP2_0_PLL_CR_CLUSTER_OFFSET,
+	.force_mask = AP807_PLL_CR_0_CPU_CLK_RELOAD_FORCE_MASK,
+	.divider_offset = AP807_PLL_CR_0_CPU_CLK_DIV_RATIO_OFFSET,
+	.divider_ratio = AP807_PLL_CR_CPU_CLK_DIV_RATIO,
+	.ratio_offset = AP807_PLL_CR_0_CPU_CLK_RELOAD_RATIO_OFFSET,
+	.ratio_state_offset = AP807_CA72MP2_0_PLL_CLKDIV_RATIO_STABLE_OFFSET,
+	.ratio_state_cluster_offset =
+		AP807_CA72MP2_0_PLL_CLKDIV_RATIO_STABLE_CLUSTER_OFFSET
+};
+
 /*
  * struct ap806_clk: CPU cluster clock controller instance
  * @cluster: Cluster clock controller index
@@ -133,8 +171,21 @@ static int ap_cpu_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 	cpu_ratio_reg = clk->pll_regs->ratio_reg +
 		(clk->cluster * clk->pll_regs->cluster_offset);
 
-	regmap_update_bits(clk->pll_cr_base, cpu_clkdiv_reg,
-			   clk->pll_regs->divider_mask, divider);
+	regmap_read(clk->pll_cr_base, cpu_clkdiv_reg, &reg);
+	reg &= ~(clk->pll_regs->divider_mask);
+	reg |= (divider << clk->pll_regs->divider_offset);
+
+	/*
+	 * AP807 CPU divider has two channels with ratio 1:3 and divider_ratio
+	 * is 1. Otherwise, in the case of the AP806, divider_ratio is 0.
+	 */
+	if (clk->pll_regs->divider_ratio) {
+		reg &= ~(AP807_PLL_CR_1_CPU_CLK_DIV_RATIO_MASK);
+		reg |= ((divider * clk->pll_regs->divider_ratio) <<
+				AP807_PLL_CR_1_CPU_CLK_DIV_RATIO_OFFSET);
+	}
+	regmap_write(clk->pll_cr_base, cpu_clkdiv_reg, reg);
+
 
 	regmap_update_bits(clk->pll_cr_base, cpu_force_reg,
 			   clk->pll_regs->force_mask,
@@ -287,6 +338,10 @@ static const struct of_device_id ap_cpu_clock_of_match[] = {
 		.compatible = "marvell,ap806-cpu-clock",
 		.data = &ap806_dfs_regs,
 	},
+	{
+		.compatible = "marvell,ap807-cpu-clock",
+		.data = &ap807_dfs_regs,
+	},
 	{ }
 };
 
-- 
2.20.1


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

* [PATCH 5/8] clk: mvebu: ap806: be more explicit on what SaR is
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
                   ` (3 preceding siblings ...)
  2019-08-05 10:03 ` [PATCH 4/8] clk: mvebu: ap80x-cpu: add AP807 CPU clock support Miquel Raynal
@ 2019-08-05 10:03 ` Miquel Raynal
  2019-09-18  5:08   ` Stephen Boyd
  2019-08-05 10:03 ` [PATCH 6/8] clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver Miquel Raynal
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

"SaR" means Sample at Reset. DIP switches can be changed on the board,
their states at reset time is available through a register read.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/clk/mvebu/ap806-system-controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c
index 73ba8fd7860f..2cf874f01394 100644
--- a/drivers/clk/mvebu/ap806-system-controller.c
+++ b/drivers/clk/mvebu/ap806-system-controller.c
@@ -89,7 +89,7 @@ static int ap806_syscon_common_probe(struct platform_device *pdev,
 		cpuclk_freq = 600;
 		break;
 	default:
-		dev_err(dev, "invalid SAR value\n");
+		dev_err(dev, "invalid Sample at Reset value\n");
 		return -EINVAL;
 	}
 
-- 
2.20.1


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

* [PATCH 6/8] clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
                   ` (4 preceding siblings ...)
  2019-08-05 10:03 ` [PATCH 5/8] clk: mvebu: ap806: be more explicit on what SaR is Miquel Raynal
@ 2019-08-05 10:03 ` Miquel Raynal
  2019-09-18  5:08   ` Stephen Boyd
  2019-08-05 10:03 ` [PATCH 7/8] clk: mvebu: ap806: Prepare the introduction of AP807 clock support Miquel Raynal
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Omri Itach, Miquel Raynal

From: Omri Itach <omrii@marvell.com>

Add dynamic AP-DCLK clock (hclk) to system controller driver. AP-DCLK
is half the rate of DDR clock, so its derrived from Sample At Reset
configuration. The clock frequency is required for AP806 AXI monitor
profiling feature.

Signed-off-by: Omri Itach <omrii@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/clk/mvebu/ap806-system-controller.c | 48 ++++++++++++++++++++-
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c
index 2cf874f01394..bc43adff02e0 100644
--- a/drivers/clk/mvebu/ap806-system-controller.c
+++ b/drivers/clk/mvebu/ap806-system-controller.c
@@ -21,7 +21,7 @@
 #define AP806_SAR_REG			0x400
 #define AP806_SAR_CLKFREQ_MODE_MASK	0x1f
 
-#define AP806_CLK_NUM			5
+#define AP806_CLK_NUM			6
 
 static struct clk *ap806_clks[AP806_CLK_NUM];
 
@@ -33,7 +33,7 @@ static struct clk_onecell_data ap806_clk_data = {
 static int ap806_syscon_common_probe(struct platform_device *pdev,
 				     struct device_node *syscon_node)
 {
-	unsigned int freq_mode, cpuclk_freq;
+	unsigned int freq_mode, cpuclk_freq, dclk_freq;
 	const char *name, *fixedclk_name;
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
@@ -93,8 +93,42 @@ static int ap806_syscon_common_probe(struct platform_device *pdev,
 		return -EINVAL;
 	}
 
+	/* Get DCLK frequency (DCLK = DDR_CLK / 2) */
+	switch (freq_mode) {
+	case 0x0:
+	case 0x6:
+		/* DDR_CLK = 1200Mhz */
+		dclk_freq = 600;
+		break;
+	case 0x1:
+	case 0x7:
+	case 0xD:
+		/* DDR_CLK = 1050Mhz */
+		dclk_freq = 525;
+		break;
+	case 0x13:
+	case 0x17:
+		/* DDR_CLK = 650Mhz */
+		dclk_freq = 325;
+		break;
+	case 0x4:
+	case 0x14:
+	case 0x19:
+	case 0x1A:
+	case 0x1B:
+	case 0x1C:
+	case 0x1D:
+		/* DDR_CLK = 800Mhz */
+		dclk_freq = 400;
+		break;
+	default:
+		dclk_freq = 0;
+		dev_err(dev, "invalid Sample at Reset value\n");
+	}
+
 	/* Convert to hertz */
 	cpuclk_freq *= 1000 * 1000;
+	dclk_freq *= 1000 * 1000;
 
 	/* CPU clocks depend on the Sample At Reset configuration */
 	name = ap_cp_unique_name(dev, syscon_node, "pll-cluster-0");
@@ -141,6 +175,14 @@ static int ap806_syscon_common_probe(struct platform_device *pdev,
 		goto fail4;
 	}
 
+	/* AP-DCLK(HCLK) Clock is DDR clock divided by 2 */
+	name = ap_cp_unique_name(dev, syscon_node, "ap-dclk");
+	ap806_clks[5] = clk_register_fixed_rate(dev, name, NULL, 0, dclk_freq);
+	if (IS_ERR(ap806_clks[5])) {
+		ret = PTR_ERR(ap806_clks[5]);
+		goto fail5;
+	}
+
 	ret = of_clk_add_provider(np, of_clk_src_onecell_get, &ap806_clk_data);
 	if (ret)
 		goto fail_clk_add;
@@ -148,6 +190,8 @@ static int ap806_syscon_common_probe(struct platform_device *pdev,
 	return 0;
 
 fail_clk_add:
+	clk_unregister_fixed_factor(ap806_clks[5]);
+fail5:
 	clk_unregister_fixed_factor(ap806_clks[4]);
 fail4:
 	clk_unregister_fixed_factor(ap806_clks[3]);
-- 
2.20.1


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

* [PATCH 7/8] clk: mvebu: ap806: Prepare the introduction of AP807 clock support
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
                   ` (5 preceding siblings ...)
  2019-08-05 10:03 ` [PATCH 6/8] clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver Miquel Raynal
@ 2019-08-05 10:03 ` Miquel Raynal
  2019-09-18  5:08   ` Stephen Boyd
  2019-08-05 10:03 ` [PATCH 8/8] clk: mvebu: ap80x: add " Miquel Raynal
  2019-09-18  5:07 ` [PATCH 0/8] AP807 clocks support Stephen Boyd
  8 siblings, 1 reply; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Ben Peled, Miquel Raynal

From: Ben Peled <bpeled@marvell.com>

Factor out the code that is only useful to AP806 so it will be easier
to support AP807. No functional changes.

Signed-off-by: Ben Peled <bpeled@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/clk/mvebu/ap806-system-controller.c | 146 +++++++++++---------
 1 file changed, 80 insertions(+), 66 deletions(-)

diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c
index bc43adff02e0..c64e2cc4a3ba 100644
--- a/drivers/clk/mvebu/ap806-system-controller.c
+++ b/drivers/clk/mvebu/ap806-system-controller.c
@@ -30,6 +30,78 @@ static struct clk_onecell_data ap806_clk_data = {
 	.clk_num = AP806_CLK_NUM,
 };
 
+static int ap806_get_sar_clocks(unsigned int freq_mode,
+				unsigned int *cpuclk_freq,
+				unsigned int *dclk_freq)
+{
+	switch (freq_mode) {
+	case 0x0:
+		*cpuclk_freq = 2000;
+		*dclk_freq = 600;
+		break;
+	case 0x1:
+		*cpuclk_freq = 2000;
+		*dclk_freq = 525;
+		break;
+	case 0x6:
+		*cpuclk_freq = 1800;
+		*dclk_freq = 600;
+		break;
+	case 0x7:
+		*cpuclk_freq = 1800;
+		*dclk_freq = 525;
+		break;
+	case 0x4:
+		*cpuclk_freq = 1600;
+		*dclk_freq = 400;
+		break;
+	case 0xB:
+		*cpuclk_freq = 1600;
+		*dclk_freq = 450;
+		break;
+	case 0xD:
+		*cpuclk_freq = 1600;
+		*dclk_freq = 525;
+		break;
+	case 0x1a:
+		*cpuclk_freq = 1400;
+		*dclk_freq = 400;
+		break;
+	case 0x14:
+		*cpuclk_freq = 1300;
+		*dclk_freq = 400;
+		break;
+	case 0x17:
+		*cpuclk_freq = 1300;
+		*dclk_freq = 325;
+		break;
+	case 0x19:
+		*cpuclk_freq = 1200;
+		*dclk_freq = 400;
+		break;
+	case 0x13:
+		*cpuclk_freq = 1000;
+		*dclk_freq = 325;
+		break;
+	case 0x1d:
+		*cpuclk_freq = 1000;
+		*dclk_freq = 400;
+		break;
+	case 0x1c:
+		*cpuclk_freq = 800;
+		*dclk_freq = 400;
+		break;
+	case 0x1b:
+		*cpuclk_freq = 600;
+		*dclk_freq = 400;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static int ap806_syscon_common_probe(struct platform_device *pdev,
 				     struct device_node *syscon_node)
 {
@@ -54,76 +126,18 @@ static int ap806_syscon_common_probe(struct platform_device *pdev,
 	}
 
 	freq_mode = reg & AP806_SAR_CLKFREQ_MODE_MASK;
-	switch (freq_mode) {
-	case 0x0:
-	case 0x1:
-		cpuclk_freq = 2000;
-		break;
-	case 0x6:
-	case 0x7:
-		cpuclk_freq = 1800;
-		break;
-	case 0x4:
-	case 0xB:
-	case 0xD:
-		cpuclk_freq = 1600;
-		break;
-	case 0x1a:
-		cpuclk_freq = 1400;
-		break;
-	case 0x14:
-	case 0x17:
-		cpuclk_freq = 1300;
-		break;
-	case 0x19:
-		cpuclk_freq = 1200;
-		break;
-	case 0x13:
-	case 0x1d:
-		cpuclk_freq = 1000;
-		break;
-	case 0x1c:
-		cpuclk_freq = 800;
-		break;
-	case 0x1b:
-		cpuclk_freq = 600;
-		break;
-	default:
-		dev_err(dev, "invalid Sample at Reset value\n");
+
+	if (of_device_is_compatible(pdev->dev.of_node,
+				    "marvell,ap806-clock")) {
+		ret = ap806_get_sar_clocks(freq_mode, &cpuclk_freq, &dclk_freq);
+	} else {
+		dev_err(dev, "compatible not supported\n");
 		return -EINVAL;
 	}
 
-	/* Get DCLK frequency (DCLK = DDR_CLK / 2) */
-	switch (freq_mode) {
-	case 0x0:
-	case 0x6:
-		/* DDR_CLK = 1200Mhz */
-		dclk_freq = 600;
-		break;
-	case 0x1:
-	case 0x7:
-	case 0xD:
-		/* DDR_CLK = 1050Mhz */
-		dclk_freq = 525;
-		break;
-	case 0x13:
-	case 0x17:
-		/* DDR_CLK = 650Mhz */
-		dclk_freq = 325;
-		break;
-	case 0x4:
-	case 0x14:
-	case 0x19:
-	case 0x1A:
-	case 0x1B:
-	case 0x1C:
-	case 0x1D:
-		/* DDR_CLK = 800Mhz */
-		dclk_freq = 400;
-		break;
-	default:
-		dclk_freq = 0;
+	if (ret) {
 		dev_err(dev, "invalid Sample at Reset value\n");
+		return ret;
 	}
 
 	/* Convert to hertz */
-- 
2.20.1


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

* [PATCH 8/8] clk: mvebu: ap80x: add AP807 clock support
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
                   ` (6 preceding siblings ...)
  2019-08-05 10:03 ` [PATCH 7/8] clk: mvebu: ap806: Prepare the introduction of AP807 clock support Miquel Raynal
@ 2019-08-05 10:03 ` Miquel Raynal
  2019-09-18  5:08   ` Stephen Boyd
  2019-09-18  5:07 ` [PATCH 0/8] AP807 clocks support Stephen Boyd
  8 siblings, 1 reply; 21+ messages in thread
From: Miquel Raynal @ 2019-08-05 10:03 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Michael Turquette, Stephen Boyd
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Ben Peled, Miquel Raynal

From: Ben Peled <bpeled@marvell.com>

Add driver support for AP807 clock.

Signed-off-by: Ben Peled <bpeled@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/clk/mvebu/ap806-system-controller.c | 28 +++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c
index c64e2cc4a3ba..948bd1e71aea 100644
--- a/drivers/clk/mvebu/ap806-system-controller.c
+++ b/drivers/clk/mvebu/ap806-system-controller.c
@@ -102,6 +102,30 @@ static int ap806_get_sar_clocks(unsigned int freq_mode,
 	return 0;
 }
 
+static int ap807_get_sar_clocks(unsigned int freq_mode,
+				unsigned int *cpuclk_freq,
+				unsigned int *dclk_freq)
+{
+	switch (freq_mode) {
+	case 0x0:
+		*cpuclk_freq = 2000;
+		*dclk_freq = 1200;
+		break;
+	case 0x6:
+		*cpuclk_freq = 2200;
+		*dclk_freq = 1200;
+		break;
+	case 0xD:
+		*cpuclk_freq = 1600;
+		*dclk_freq = 1200;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static int ap806_syscon_common_probe(struct platform_device *pdev,
 				     struct device_node *syscon_node)
 {
@@ -130,6 +154,9 @@ static int ap806_syscon_common_probe(struct platform_device *pdev,
 	if (of_device_is_compatible(pdev->dev.of_node,
 				    "marvell,ap806-clock")) {
 		ret = ap806_get_sar_clocks(freq_mode, &cpuclk_freq, &dclk_freq);
+	} else if (of_device_is_compatible(pdev->dev.of_node,
+					   "marvell,ap807-clock")) {
+		ret = ap807_get_sar_clocks(freq_mode, &cpuclk_freq, &dclk_freq);
 	} else {
 		dev_err(dev, "compatible not supported\n");
 		return -EINVAL;
@@ -252,6 +279,7 @@ builtin_platform_driver(ap806_syscon_legacy_driver);
 
 static const struct of_device_id ap806_clock_of_match[] = {
 	{ .compatible = "marvell,ap806-clock", },
+	{ .compatible = "marvell,ap807-clock", },
 	{ }
 };
 
-- 
2.20.1


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

* Re: [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible
  2019-08-05 10:03 ` [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible Miquel Raynal
@ 2019-08-21 18:51   ` Rob Herring
  2019-09-18  5:08   ` Stephen Boyd
  1 sibling, 0 replies; 21+ messages in thread
From: Rob Herring @ 2019-08-21 18:51 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

On Mon,  5 Aug 2019 12:03:03 +0200, Miquel Raynal wrote:
> Add AP807 CPU clock compatible to the bindings.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  .../bindings/arm/marvell/ap806-system-controller.txt     | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 2/8] dt-bindings: ap806: Document AP807 clock compatible
  2019-08-05 10:03 ` [PATCH 2/8] dt-bindings: ap806: Document AP807 " Miquel Raynal
@ 2019-08-21 18:51   ` Rob Herring
  2019-09-18  5:08   ` Stephen Boyd
  1 sibling, 0 replies; 21+ messages in thread
From: Rob Herring @ 2019-08-21 18:51 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

On Mon,  5 Aug 2019 12:03:04 +0200, Miquel Raynal wrote:
> Add AP807 clock compatible to the bindings.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  .../bindings/arm/marvell/ap806-system-controller.txt      | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 0/8] AP807 clocks support
  2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
                   ` (7 preceding siblings ...)
  2019-08-05 10:03 ` [PATCH 8/8] clk: mvebu: ap80x: add " Miquel Raynal
@ 2019-09-18  5:07 ` Stephen Boyd
  2019-09-20  8:01   ` Miquel Raynal
  8 siblings, 1 reply; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:07 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:02)
> Hello,
> 
> This is the first batch of changes (out of three) to support the brand
> new Marvell CN9130 SoCs which are made of one AP807 and one CP115.
> 
> This clock series applies on top of Gregory's "AP806 CPU clocks" [1].
> 
> [1] https://patchwork.kernel.org/cover/11038577/

Ugh I found this series stashed away and never merged to clk-next.


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

* Re: [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible
  2019-08-05 10:03 ` [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible Miquel Raynal
  2019-08-21 18:51   ` Rob Herring
@ 2019-09-18  5:08   ` Stephen Boyd
  1 sibling, 0 replies; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:08 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:03)
> Add AP807 CPU clock compatible to the bindings.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to clk-next


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

* Re: [PATCH 2/8] dt-bindings: ap806: Document AP807 clock compatible
  2019-08-05 10:03 ` [PATCH 2/8] dt-bindings: ap806: Document AP807 " Miquel Raynal
  2019-08-21 18:51   ` Rob Herring
@ 2019-09-18  5:08   ` Stephen Boyd
  1 sibling, 0 replies; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:08 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:04)
> Add AP807 clock compatible to the bindings.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to clk-next


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

* Re: [PATCH 3/8] clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock
  2019-08-05 10:03 ` [PATCH 3/8] clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock Miquel Raynal
@ 2019-09-18  5:08   ` Stephen Boyd
  0 siblings, 0 replies; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:08 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Christine Gharzuzi, Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:05)
> From: Christine Gharzuzi <chrisg@marvell.com>
> 
> This patch allows same flow to be executed on chips with different
> register mappings like AP806 and, in the future, AP807.
> 
> Note: this patch has no functional effect, and only prepares the
> driver for additional chips to be supported by retrieving the right
> device data depenging on the compatible property.
> 
> Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to clk-next


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

* Re: [PATCH 4/8] clk: mvebu: ap80x-cpu: add AP807 CPU clock support
  2019-08-05 10:03 ` [PATCH 4/8] clk: mvebu: ap80x-cpu: add AP807 CPU clock support Miquel Raynal
@ 2019-09-18  5:08   ` Stephen Boyd
  0 siblings, 0 replies; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:08 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Ben Peled, Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:06)
> From: Ben Peled <bpeled@marvell.com>
> 
> Enhance the ap-cpu-clk driver to support both AP806 and AP807 CPU
> clocks.
> 
> Signed-off-by: Ben Peled <bpeled@marvell.com>
> [<miquel.raynal@bootlin.com>: use device data instead of conditions on
> the compatible]
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to clk-next


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

* Re: [PATCH 5/8] clk: mvebu: ap806: be more explicit on what SaR is
  2019-08-05 10:03 ` [PATCH 5/8] clk: mvebu: ap806: be more explicit on what SaR is Miquel Raynal
@ 2019-09-18  5:08   ` Stephen Boyd
  0 siblings, 0 replies; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:08 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:07)
> "SaR" means Sample at Reset. DIP switches can be changed on the board,
> their states at reset time is available through a register read.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to clk-next


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

* Re: [PATCH 6/8] clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver
  2019-08-05 10:03 ` [PATCH 6/8] clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver Miquel Raynal
@ 2019-09-18  5:08   ` Stephen Boyd
  0 siblings, 0 replies; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:08 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Omri Itach, Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:08)
> From: Omri Itach <omrii@marvell.com>
> 
> Add dynamic AP-DCLK clock (hclk) to system controller driver. AP-DCLK
> is half the rate of DDR clock, so its derrived from Sample At Reset
> configuration. The clock frequency is required for AP806 AXI monitor
> profiling feature.
> 
> Signed-off-by: Omri Itach <omrii@marvell.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to clk-next


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

* Re: [PATCH 7/8] clk: mvebu: ap806: Prepare the introduction of AP807 clock support
  2019-08-05 10:03 ` [PATCH 7/8] clk: mvebu: ap806: Prepare the introduction of AP807 clock support Miquel Raynal
@ 2019-09-18  5:08   ` Stephen Boyd
  0 siblings, 0 replies; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:08 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Ben Peled, Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:09)
> From: Ben Peled <bpeled@marvell.com>
> 
> Factor out the code that is only useful to AP806 so it will be easier
> to support AP807. No functional changes.
> 
> Signed-off-by: Ben Peled <bpeled@marvell.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to clk-next


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

* Re: [PATCH 8/8] clk: mvebu: ap80x: add AP807 clock support
  2019-08-05 10:03 ` [PATCH 8/8] clk: mvebu: ap80x: add " Miquel Raynal
@ 2019-09-18  5:08   ` Stephen Boyd
  0 siblings, 0 replies; 21+ messages in thread
From: Stephen Boyd @ 2019-09-18  5:08 UTC (permalink / raw)
  To: Mark Rutland, Michael Turquette, Miquel Raynal, Rob Herring
  Cc: devicetree, linux-clk, Thomas Petazzoni, Gregory Clement,
	Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Grzegorz Jaszczyk, Marcin Wojtas, Stefan Chulski, Yan Markman,
	Ben Peled, Miquel Raynal

Quoting Miquel Raynal (2019-08-05 03:03:10)
> From: Ben Peled <bpeled@marvell.com>
> 
> Add driver support for AP807 clock.
> 
> Signed-off-by: Ben Peled <bpeled@marvell.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Applied to clk-next


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

* Re: [PATCH 0/8] AP807 clocks support
  2019-09-18  5:07 ` [PATCH 0/8] AP807 clocks support Stephen Boyd
@ 2019-09-20  8:01   ` Miquel Raynal
  0 siblings, 0 replies; 21+ messages in thread
From: Miquel Raynal @ 2019-09-20  8:01 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Mark Rutland, Michael Turquette, Rob Herring, devicetree,
	linux-clk, Thomas Petazzoni, Gregory Clement, Antoine Tenart,
	Maxime Chevallier, Nadav Haklai, Grzegorz Jaszczyk,
	Marcin Wojtas, Stefan Chulski, Yan Markman

Hi Stephen,

Stephen Boyd <sboyd@kernel.org> wrote on Tue, 17 Sep 2019 22:07:19
-0700:

> Quoting Miquel Raynal (2019-08-05 03:03:02)
> > Hello,
> > 
> > This is the first batch of changes (out of three) to support the brand
> > new Marvell CN9130 SoCs which are made of one AP807 and one CP115.
> > 
> > This clock series applies on top of Gregory's "AP806 CPU clocks" [1].
> > 
> > [1] https://patchwork.kernel.org/cover/11038577/  
> 
> Ugh I found this series stashed away and never merged to clk-next.
> 

No problem, thanks for merging it!


Cheers,
Miquèl

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

end of thread, other threads:[~2019-09-20  8:01 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 10:03 [PATCH 0/8] AP807 clocks support Miquel Raynal
2019-08-05 10:03 ` [PATCH 1/8] dt-bindings: ap80x: Document AP807 CPU clock compatible Miquel Raynal
2019-08-21 18:51   ` Rob Herring
2019-09-18  5:08   ` Stephen Boyd
2019-08-05 10:03 ` [PATCH 2/8] dt-bindings: ap806: Document AP807 " Miquel Raynal
2019-08-21 18:51   ` Rob Herring
2019-09-18  5:08   ` Stephen Boyd
2019-08-05 10:03 ` [PATCH 3/8] clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock Miquel Raynal
2019-09-18  5:08   ` Stephen Boyd
2019-08-05 10:03 ` [PATCH 4/8] clk: mvebu: ap80x-cpu: add AP807 CPU clock support Miquel Raynal
2019-09-18  5:08   ` Stephen Boyd
2019-08-05 10:03 ` [PATCH 5/8] clk: mvebu: ap806: be more explicit on what SaR is Miquel Raynal
2019-09-18  5:08   ` Stephen Boyd
2019-08-05 10:03 ` [PATCH 6/8] clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver Miquel Raynal
2019-09-18  5:08   ` Stephen Boyd
2019-08-05 10:03 ` [PATCH 7/8] clk: mvebu: ap806: Prepare the introduction of AP807 clock support Miquel Raynal
2019-09-18  5:08   ` Stephen Boyd
2019-08-05 10:03 ` [PATCH 8/8] clk: mvebu: ap80x: add " Miquel Raynal
2019-09-18  5:08   ` Stephen Boyd
2019-09-18  5:07 ` [PATCH 0/8] AP807 clocks support Stephen Boyd
2019-09-20  8:01   ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).