All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock
@ 2015-01-21 10:03 Emil Medve
  2015-01-21 10:03 ` [PATCH v2 01/10] clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT Emil Medve
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

Based on clk-next from git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git

v2:	Rebased as several prerequisite patches (including a file rename) got
	applied upstream

Emil Medve (9):
  clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT
  clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
  clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT
  clk: qoriq: Fix checkpatch type OOM_MESSAGE
  clk: qoriq: Make local symbol 'static'
  clk: qoriq: Replace kzalloc() with kmalloc()
  clk: qoriq: Use pr_fmt()
  powerpc/corenet: Enable CLK_QORIQ
  clk: qoriq: Add support for the platform PLL

Igal Liberman (1):
  clk: qoriq: Add support for the FMan clock

 arch/powerpc/configs/corenet32_smp_defconfig |   1 +
 arch/powerpc/configs/corenet64_smp_defconfig |   1 +
 drivers/clk/clk-qoriq.c                      | 378 +++++++++++++++++++++++++--
 3 files changed, 357 insertions(+), 23 deletions(-)

-- 
2.2.1

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

* [PATCH v2 01/10] clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-01-21 10:03 ` [PATCH v2 02/10] clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY Emil Medve
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       rc = of_property_read_string_index(np, "clock-output-names",
+                       0, &clk_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+               pr_err("Could not register clock provider for node:%s\n",
+                        np->name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+               rc = of_property_read_string_index(np, "clock-output-names",
+                               i, &clk_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+               pr_err("Could not register clk provider for node:%s\n",
+                        np->name);

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 drivers/clk/clk-qoriq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index f9b7eb4..90ff685 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -121,7 +121,7 @@ static void __init core_mux_init(struct device_node *np)
 		cmux_clk->flags = CLKSEL_ADJUST;
 
 	rc = of_property_read_string_index(np, "clock-output-names",
-			0, &clk_name);
+					   0, &clk_name);
 	if (rc) {
 		pr_err("%s: read clock names error\n", np->name);
 		goto err_clk;
@@ -143,7 +143,7 @@ static void __init core_mux_init(struct device_node *np)
 	rc = of_clk_add_provider(np, of_clk_src_simple_get, clk);
 	if (rc) {
 		pr_err("Could not register clock provider for node:%s\n",
-			 np->name);
+		       np->name);
 		goto err_clk;
 	}
 	goto err_name;
@@ -206,7 +206,7 @@ static void __init core_pll_init(struct device_node *np)
 
 	for (i = 0; i < count; i++) {
 		rc = of_property_read_string_index(np, "clock-output-names",
-				i, &clk_name);
+						   i, &clk_name);
 		if (rc) {
 			pr_err("%s: could not get clock names\n", np->name);
 			goto err_cell;
@@ -238,7 +238,7 @@ static void __init core_pll_init(struct device_node *np)
 	rc = of_clk_add_provider(np, of_clk_src_onecell_get, onecell_data);
 	if (rc) {
 		pr_err("Could not register clk provider for node:%s\n",
-			 np->name);
+		       np->name);
 		goto err_cell;
 	}
 
-- 
2.2.1

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

* [PATCH v2 02/10] clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
  2015-01-21 10:03 ` [PATCH v2 01/10] clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-01-21 10:03 ` [PATCH v2 03/10] clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT Emil Medve
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply
+       subclks = kzalloc(sizeof(struct clk *) * count, GFP_KERNEL);

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 drivers/clk/clk-qoriq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 90ff685..475ce1c 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -85,7 +85,7 @@ static void __init core_mux_init(struct device_node *np)
 		pr_err("%s: get clock count error\n", np->name);
 		return;
 	}
-	parent_names = kzalloc((sizeof(char *) * count), GFP_KERNEL);
+	parent_names = kcalloc(count, sizeof(char *), GFP_KERNEL);
 	if (!parent_names) {
 		pr_err("%s: could not allocate parent_names\n", __func__);
 		return;
@@ -192,7 +192,7 @@ static void __init core_pll_init(struct device_node *np)
 		goto err_map;
 	}
 
-	subclks = kzalloc(sizeof(struct clk *) * count, GFP_KERNEL);
+	subclks = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
 	if (!subclks) {
 		pr_err("%s: could not allocate subclks\n", __func__);
 		goto err_map;
-- 
2.2.1

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

* [PATCH v2 03/10] clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
  2015-01-21 10:03 ` [PATCH v2 01/10] clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT Emil Medve
  2015-01-21 10:03 ` [PATCH v2 02/10] clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-01-21 10:03 ` [PATCH v2 04/10] clk: qoriq: Fix checkpatch type OOM_MESSAGE Emil Medve
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*cmux_clk)...) over kzalloc(sizeof(struct cmux_clk)...)
+       cmux_clk = kzalloc(sizeof(struct cmux_clk), GFP_KERNEL);

CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*onecell_data)...) over kzalloc(sizeof(struct clk_onecell_data)...)
+       onecell_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 drivers/clk/clk-qoriq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 475ce1c..a1cd137 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -94,7 +94,7 @@ static void __init core_mux_init(struct device_node *np)
 	for (i = 0; i < count; i++)
 		parent_names[i] = of_clk_get_parent_name(np, i);
 
-	cmux_clk = kzalloc(sizeof(struct cmux_clk), GFP_KERNEL);
+	cmux_clk = kzalloc(sizeof(*cmux_clk), GFP_KERNEL);
 	if (!cmux_clk) {
 		pr_err("%s: could not allocate cmux_clk\n", __func__);
 		goto err_name;
@@ -198,7 +198,7 @@ static void __init core_pll_init(struct device_node *np)
 		goto err_map;
 	}
 
-	onecell_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
+	onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
 	if (!onecell_data) {
 		pr_err("%s: could not allocate onecell_data\n", __func__);
 		goto err_clks;
-- 
2.2.1

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

* [PATCH v2 04/10] clk: qoriq: Fix checkpatch type OOM_MESSAGE
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
                   ` (2 preceding siblings ...)
  2015-01-21 10:03 ` [PATCH v2 03/10] clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-01-21 10:03 ` [PATCH v2 05/10] clk: qoriq: Make local symbol 'static' Emil Medve
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+       if (!parent_names) {
+               pr_err("%s: could not allocate parent_names\n", __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+       if (!cmux_clk) {
+               pr_err("%s: could not allocate cmux_clk\n", __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+       if (!subclks) {
+               pr_err("%s: could not allocate subclks\n", __func__);

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+       if (!onecell_data) {
+               pr_err("%s: could not allocate onecell_data\n", __func__);

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 drivers/clk/clk-qoriq.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index a1cd137..e25dea9 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -86,19 +86,16 @@ static void __init core_mux_init(struct device_node *np)
 		return;
 	}
 	parent_names = kcalloc(count, sizeof(char *), GFP_KERNEL);
-	if (!parent_names) {
-		pr_err("%s: could not allocate parent_names\n", __func__);
+	if (!parent_names)
 		return;
-	}
 
 	for (i = 0; i < count; i++)
 		parent_names[i] = of_clk_get_parent_name(np, i);
 
 	cmux_clk = kzalloc(sizeof(*cmux_clk), GFP_KERNEL);
-	if (!cmux_clk) {
-		pr_err("%s: could not allocate cmux_clk\n", __func__);
+	if (!cmux_clk)
 		goto err_name;
-	}
+
 	cmux_clk->reg = of_iomap(np, 0);
 	if (!cmux_clk->reg) {
 		pr_err("%s: could not map register\n", __func__);
@@ -193,16 +190,12 @@ static void __init core_pll_init(struct device_node *np)
 	}
 
 	subclks = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
-	if (!subclks) {
-		pr_err("%s: could not allocate subclks\n", __func__);
+	if (!subclks)
 		goto err_map;
-	}
 
 	onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
-	if (!onecell_data) {
-		pr_err("%s: could not allocate onecell_data\n", __func__);
+	if (!onecell_data)
 		goto err_clks;
-	}
 
 	for (i = 0; i < count; i++) {
 		rc = of_property_read_string_index(np, "clock-output-names",
-- 
2.2.1

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

* [PATCH v2 05/10] clk: qoriq: Make local symbol 'static'
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
                   ` (3 preceding siblings ...)
  2015-01-21 10:03 ` [PATCH v2 04/10] clk: qoriq: Fix checkpatch type OOM_MESSAGE Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-01-21 10:03 ` [PATCH v2 06/10] clk: qoriq: Replace kzalloc() with kmalloc() Emil Medve
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

drivers/clk/clk-qoriq.c:59:22: warning: symbol 'cmux_ops' was not declared. Should it be static?

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 drivers/clk/clk-qoriq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index e25dea9..07936a3 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -56,7 +56,7 @@ static u8 cmux_get_parent(struct clk_hw *hw)
 	return clksel;
 }
 
-const struct clk_ops cmux_ops = {
+static const struct clk_ops cmux_ops = {
 	.get_parent = cmux_get_parent,
 	.set_parent = cmux_set_parent,
 };
-- 
2.2.1

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

* [PATCH v2 06/10] clk: qoriq: Replace kzalloc() with kmalloc()
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
                   ` (4 preceding siblings ...)
  2015-01-21 10:03 ` [PATCH v2 05/10] clk: qoriq: Make local symbol 'static' Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-01-21 10:03 ` [PATCH v2 07/10] clk: qoriq: Use pr_fmt() Emil Medve
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

Where the memset() is not necessary

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 drivers/clk/clk-qoriq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 07936a3..4b44825 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -193,7 +193,7 @@ static void __init core_pll_init(struct device_node *np)
 	if (!subclks)
 		goto err_map;
 
-	onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
+	onecell_data = kmalloc(sizeof(*onecell_data), GFP_KERNEL);
 	if (!onecell_data)
 		goto err_clks;
 
-- 
2.2.1

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

* [PATCH v2 07/10] clk: qoriq: Use pr_fmt()
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
                   ` (5 preceding siblings ...)
  2015-01-21 10:03 ` [PATCH v2 06/10] clk: qoriq: Replace kzalloc() with kmalloc() Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-01-21 10:03 ` [PATCH v2 08/10] powerpc/corenet: Enable CLK_QORIQ Emil Medve
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

Currently a mix of clk-qoriq/qoriq-clk and no prefix is used

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 drivers/clk/clk-qoriq.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 4b44825..07bdfc5 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -7,6 +7,9 @@
  *
  * clock driver for Freescale QorIQ SoCs.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/clk-provider.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
@@ -163,7 +166,7 @@ static void __init core_pll_init(struct device_node *np)
 
 	base = of_iomap(np, 0);
 	if (!base) {
-		pr_err("clk-qoriq: iomap error\n");
+		pr_err("iomap error\n");
 		return;
 	}
 
@@ -253,7 +256,7 @@ static void __init sysclk_init(struct device_node *node)
 	u32 rate;
 
 	if (!np) {
-		pr_err("qoriq-clk: could not get parent node\n");
+		pr_err("could not get parent node\n");
 		return;
 	}
 
-- 
2.2.1

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

* [PATCH v2 08/10] powerpc/corenet: Enable CLK_QORIQ
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
                   ` (6 preceding siblings ...)
  2015-01-21 10:03 ` [PATCH v2 07/10] clk: qoriq: Use pr_fmt() Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-02-04  2:54   ` Yuantian Tang
  2015-01-21 10:03 ` [PATCH v2 09/10] clk: qoriq: Add support for the platform PLL Emil Medve
  2015-01-28 18:15 ` [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Mike Turquette
  9 siblings, 1 reply; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

Change-Id: I1a80ad7b9f6854791bd270b746f93a91439155a6
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 arch/powerpc/configs/corenet32_smp_defconfig | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig
index 611efe9..cce62e9 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -147,6 +147,7 @@ CONFIG_STAGING=y
 CONFIG_MEMORY=y
 CONFIG_VIRT_DRIVERS=y
 CONFIG_FSL_HV_MANAGER=y
+CONFIG_CLK_QORIQ=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig
index be24a18..c9e8057 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -117,6 +117,7 @@ CONFIG_DMADEVICES=y
 CONFIG_FSL_DMA=y
 CONFIG_VIRT_DRIVERS=y
 CONFIG_FSL_HV_MANAGER=y
+CONFIG_CLK_QORIQ=y
 CONFIG_FSL_CORENET_CF=y
 CONFIG_MEMORY=y
 CONFIG_EXT2_FS=y
-- 
2.2.1

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

* [PATCH v2 09/10] clk: qoriq: Add support for the platform PLL
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
                   ` (7 preceding siblings ...)
  2015-01-21 10:03 ` [PATCH v2 08/10] powerpc/corenet: Enable CLK_QORIQ Emil Medve
@ 2015-01-21 10:03 ` Emil Medve
  2015-01-29  2:26   ` Yuantian Tang
  2015-01-28 18:15 ` [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Mike Turquette
  9 siblings, 1 reply; 15+ messages in thread
From: Emil Medve @ 2015-01-21 10:03 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, mturquette, haokexin, yuantian.tang; +Cc: Emil Medve

Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 drivers/clk/clk-qoriq.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 07bdfc5..cda90a9 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -271,9 +271,92 @@ static void __init sysclk_init(struct device_node *node)
 	if (!IS_ERR(clk))
 		of_clk_add_provider(np, of_clk_src_simple_get, clk);
 }
+
+static void __init pltfrm_pll_init(struct device_node *np)
+{
+	void __iomem *base;
+	uint32_t mult;
+	const char *parent_name, *clk_name;
+	int i, _errno;
+	struct clk_onecell_data *cod;
+
+	base = of_iomap(np, 0);
+	if (!base) {
+		pr_err("%s(): %s: of_iomap() failed\n", __func__, np->name);
+		return;
+	}
+
+	/* Get the multiple of PLL */
+	mult = ioread32be(base);
+
+	iounmap(base);
+
+	/* Check if this PLL is disabled */
+	if (mult & PLL_KILL) {
+		pr_debug("%s(): %s: Disabled\n", __func__, np->name);
+		return;
+	}
+	mult = (mult & GENMASK(6, 1)) >> 1;
+
+	parent_name = of_clk_get_parent_name(np, 0);
+	if (!parent_name) {
+		pr_err("%s(): %s: of_clk_get_parent_name() failed\n",
+		       __func__, np->name);
+		return;
+	}
+
+	i = of_property_count_strings(np, "clock-output-names");
+	if (i < 0) {
+		pr_err("%s(): %s: of_property_count_strings(clock-output-names) = %d\n",
+		       __func__, np->name, i);
+		return;
+	}
+
+	cod = kmalloc(sizeof(*cod) + i * sizeof(struct clk *), GFP_KERNEL);
+	if (!cod)
+		return;
+	cod->clks = (struct clk **)(cod + 1);
+	cod->clk_num = i;
+
+	for (i = 0; i < cod->clk_num; i++) {
+		_errno = of_property_read_string_index(np, "clock-output-names",
+						       i, &clk_name);
+		if (_errno < 0) {
+			pr_err("%s(): %s: of_property_read_string_index(clock-output-names) = %d\n",
+			       __func__, np->name, _errno);
+			goto return_clk_unregister;
+		}
+
+		cod->clks[i] = clk_register_fixed_factor(NULL, clk_name,
+					       parent_name, 0, mult, 1 + i);
+		if (IS_ERR(cod->clks[i])) {
+			pr_err("%s(): %s: clk_register_fixed_factor(%s) = %ld\n",
+			       __func__, np->name,
+			       clk_name, PTR_ERR(cod->clks[i]));
+			goto return_clk_unregister;
+		}
+	}
+
+	_errno = of_clk_add_provider(np, of_clk_src_onecell_get, cod);
+	if (_errno < 0) {
+		pr_err("%s(): %s: of_clk_add_provider() = %d\n",
+		       __func__, np->name, _errno);
+		goto return_clk_unregister;
+	}
+
+	return;
+
+return_clk_unregister:
+	while (--i >= 0)
+		clk_unregister(cod->clks[i]);
+	kfree(cod);
+}
+
 CLK_OF_DECLARE(qoriq_sysclk_1, "fsl,qoriq-sysclk-1.0", sysclk_init);
 CLK_OF_DECLARE(qoriq_sysclk_2, "fsl,qoriq-sysclk-2.0", sysclk_init);
 CLK_OF_DECLARE(qoriq_core_pll_1, "fsl,qoriq-core-pll-1.0", core_pll_init);
 CLK_OF_DECLARE(qoriq_core_pll_2, "fsl,qoriq-core-pll-2.0", core_pll_init);
 CLK_OF_DECLARE(qoriq_core_mux_1, "fsl,qoriq-core-mux-1.0", core_mux_init);
 CLK_OF_DECLARE(qoriq_core_mux_2, "fsl,qoriq-core-mux-2.0", core_mux_init);
+CLK_OF_DECLARE(qoriq_pltfrm_pll_1, "fsl,qoriq-platform-pll-1.0", pltfrm_pll_init);
+CLK_OF_DECLARE(qoriq_pltfrm_pll_2, "fsl,qoriq-platform-pll-2.0", pltfrm_pll_init);
-- 
2.2.1

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

* Re: [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock
  2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
                   ` (8 preceding siblings ...)
  2015-01-21 10:03 ` [PATCH v2 09/10] clk: qoriq: Add support for the platform PLL Emil Medve
@ 2015-01-28 18:15 ` Mike Turquette
  2015-01-28 21:48   ` Emil Medve
  9 siblings, 1 reply; 15+ messages in thread
From: Mike Turquette @ 2015-01-28 18:15 UTC (permalink / raw)
  To: Emil Medve, linuxppc-dev, scottwood, haokexin, yuantian.tang; +Cc: Emil Medve

Quoting Emil Medve (2015-01-21 02:03:22)
> Based on clk-next from git://git.kernel.org/pub/scm/linux/kernel/git/clk/=
linux.git
> =

> v2:     Rebased as several prerequisite patches (including a file rename)=
 got
>         applied upstream
> =

> Emil Medve (9):
>   clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT
>   clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
>   clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT
>   clk: qoriq: Fix checkpatch type OOM_MESSAGE
>   clk: qoriq: Make local symbol 'static'
>   clk: qoriq: Replace kzalloc() with kmalloc()
>   clk: qoriq: Use pr_fmt()

Patches 1-7 applied to clk-next towards 3.20. I'd prefer some
reviewed-by's from your peers at freescale for the clock driver
correctness.

Thanks,
Mike

>   powerpc/corenet: Enable CLK_QORIQ
>   clk: qoriq: Add support for the platform PLL
> =

> Igal Liberman (1):
>   clk: qoriq: Add support for the FMan clock
> =

>  arch/powerpc/configs/corenet32_smp_defconfig |   1 +
>  arch/powerpc/configs/corenet64_smp_defconfig |   1 +
>  drivers/clk/clk-qoriq.c                      | 378 +++++++++++++++++++++=
++++--
>  3 files changed, 357 insertions(+), 23 deletions(-)
> =

> -- =

> 2.2.1

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

* Re: [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock
  2015-01-28 18:15 ` [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Mike Turquette
@ 2015-01-28 21:48   ` Emil Medve
  2015-01-28 22:59     ` Scott Wood
  0 siblings, 1 reply; 15+ messages in thread
From: Emil Medve @ 2015-01-28 21:48 UTC (permalink / raw)
  To: Mike Turquette, linuxppc-dev, scottwood, haokexin, yuantian.tang

Hello Mike,


On 01/28/2015 12:15 PM, Mike Turquette wrote:
> Quoting Emil Medve (2015-01-21 02:03:22)
>> Based on clk-next from git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git
>>
>> v2:     Rebased as several prerequisite patches (including a file rename) got
>>         applied upstream
>>
>> Emil Medve (9):
>>   clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT
>>   clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
>>   clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT
>>   clk: qoriq: Fix checkpatch type OOM_MESSAGE
>>   clk: qoriq: Make local symbol 'static'
>>   clk: qoriq: Replace kzalloc() with kmalloc()
>>   clk: qoriq: Use pr_fmt()
> 
> Patches 1-7 applied to clk-next towards 3.20

Thank you

> I'd prefer some
> reviewed-by's from your peers at freescale for the clock driver
> correctness.

That's fair

>>   powerpc/corenet: Enable CLK_QORIQ

I was thinking Scott can pick this up

>>   clk: qoriq: Add support for the platform PLL

I'll get Yuan-Tian to review this

>> Igal Liberman (1):
>>   clk: qoriq: Add support for the FMan clock

Scott, I'd appreciate your help here


Cheers,


>>  arch/powerpc/configs/corenet32_smp_defconfig |   1 +
>>  arch/powerpc/configs/corenet64_smp_defconfig |   1 +
>>  drivers/clk/clk-qoriq.c                      | 378 +++++++++++++++++++++++++--
>>  3 files changed, 357 insertions(+), 23 deletions(-)
>>
>> -- 
>> 2.2.1

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

* Re: [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock
  2015-01-28 21:48   ` Emil Medve
@ 2015-01-28 22:59     ` Scott Wood
  0 siblings, 0 replies; 15+ messages in thread
From: Scott Wood @ 2015-01-28 22:59 UTC (permalink / raw)
  To: Emil Medve; +Cc: linuxppc-dev, haokexin, Mike Turquette, yuantian.tang

On Wed, 2015-01-28 at 15:48 -0600, Emil Medve wrote:
> Hello Mike,
> 
> 
> On 01/28/2015 12:15 PM, Mike Turquette wrote:
> > Quoting Emil Medve (2015-01-21 02:03:22)
> >> Based on clk-next from git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git
> >>
> >> v2:     Rebased as several prerequisite patches (including a file rename) got
> >>         applied upstream
> >>
> >> Emil Medve (9):
> >>   clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT
> >>   clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
> >>   clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT
> >>   clk: qoriq: Fix checkpatch type OOM_MESSAGE
> >>   clk: qoriq: Make local symbol 'static'
> >>   clk: qoriq: Replace kzalloc() with kmalloc()
> >>   clk: qoriq: Use pr_fmt()
> > 
> > Patches 1-7 applied to clk-next towards 3.20
> 
> Thank you
> 
> > I'd prefer some
> > reviewed-by's from your peers at freescale for the clock driver
> > correctness.
> 
> That's fair
> 
> >>   powerpc/corenet: Enable CLK_QORIQ
> 
> I was thinking Scott can pick this up

Not if the patch that introduces CLK_QORIQ goes in via another tree.

> >> Igal Liberman (1):
> >>   clk: qoriq: Add support for the FMan clock
> 
> Scott, I'd appreciate your help here

>From internal discussion I believe you have some comments of your own on
this patch...

-Scott

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

* RE: [PATCH v2 09/10] clk: qoriq: Add support for the platform PLL
  2015-01-21 10:03 ` [PATCH v2 09/10] clk: qoriq: Add support for the platform PLL Emil Medve
@ 2015-01-29  2:26   ` Yuantian Tang
  0 siblings, 0 replies; 15+ messages in thread
From: Yuantian Tang @ 2015-01-29  2:26 UTC (permalink / raw)
  To: Emilian Medve, linuxppc-dev, Scott Wood, mturquette, haokexin
  Cc: Emilian Medve

> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
> Sent: Wednesday, January 21, 2015 6:04 PM
> To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
> mturquette@linaro.org; haokexin@gmail.com; Tang Yuantian-B29983
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH v2 09/10] clk: qoriq: Add support for the platform PLL
>=20
> Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
> Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> ---
>  drivers/clk/clk-qoriq.c | 83
> +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 83 insertions(+)
>=20
> diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c index
> 07bdfc5..cda90a9 100644
> --- a/drivers/clk/clk-qoriq.c
> +++ b/drivers/clk/clk-qoriq.c
> @@ -271,9 +271,92 @@ static void __init sysclk_init(struct device_node
> *node)
>  	if (!IS_ERR(clk))
>  		of_clk_add_provider(np, of_clk_src_simple_get, clk);  }
> +
> +static void __init pltfrm_pll_init(struct device_node *np) {
> +	void __iomem *base;
> +	uint32_t mult;
> +	const char *parent_name, *clk_name;
> +	int i, _errno;
> +	struct clk_onecell_data *cod;
> +
> +	base =3D of_iomap(np, 0);
> +	if (!base) {
> +		pr_err("%s(): %s: of_iomap() failed\n", __func__, np->name);
> +		return;
> +	}
> +
> +	/* Get the multiple of PLL */
> +	mult =3D ioread32be(base);
> +
> +	iounmap(base);
> +
> +	/* Check if this PLL is disabled */
> +	if (mult & PLL_KILL) {
> +		pr_debug("%s(): %s: Disabled\n", __func__, np->name);
> +		return;
> +	}
> +	mult =3D (mult & GENMASK(6, 1)) >> 1;
> +
> +	parent_name =3D of_clk_get_parent_name(np, 0);
> +	if (!parent_name) {
> +		pr_err("%s(): %s: of_clk_get_parent_name() failed\n",
> +		       __func__, np->name);
> +		return;
> +	}
> +
> +	i =3D of_property_count_strings(np, "clock-output-names");
> +	if (i < 0) {
> +		pr_err("%s(): %s: of_property_count_strings(clock-output-
> names) =3D %d\n",
> +		       __func__, np->name, i);
> +		return;
> +	}
> +
> +	cod =3D kmalloc(sizeof(*cod) + i * sizeof(struct clk *), GFP_KERNEL);
> +	if (!cod)
> +		return;
> +	cod->clks =3D (struct clk **)(cod + 1);
> +	cod->clk_num =3D i;
> +
> +	for (i =3D 0; i < cod->clk_num; i++) {
> +		_errno =3D of_property_read_string_index(np, "clock-output-
> names",
> +						       i, &clk_name);
> +		if (_errno < 0) {
> +			pr_err("%s(): %s: of_property_read_string_index(clock-
> output-names) =3D %d\n",
> +			       __func__, np->name, _errno);
> +			goto return_clk_unregister;
> +		}
> +
> +		cod->clks[i] =3D clk_register_fixed_factor(NULL, clk_name,
> +					       parent_name, 0, mult, 1 + i);
> +		if (IS_ERR(cod->clks[i])) {
> +			pr_err("%s(): %s: clk_register_fixed_factor(%s) =3D
> %ld\n",
> +			       __func__, np->name,
> +			       clk_name, PTR_ERR(cod->clks[i]));
> +			goto return_clk_unregister;
> +		}
> +	}
> +
> +	_errno =3D of_clk_add_provider(np, of_clk_src_onecell_get, cod);
> +	if (_errno < 0) {
> +		pr_err("%s(): %s: of_clk_add_provider() =3D %d\n",
> +		       __func__, np->name, _errno);
> +		goto return_clk_unregister;
> +	}
> +
> +	return;
> +
> +return_clk_unregister:
> +	while (--i >=3D 0)
> +		clk_unregister(cod->clks[i]);
> +	kfree(cod);
> +}
> +
>  CLK_OF_DECLARE(qoriq_sysclk_1, "fsl,qoriq-sysclk-1.0", sysclk_init);
> CLK_OF_DECLARE(qoriq_sysclk_2, "fsl,qoriq-sysclk-2.0", sysclk_init);
> CLK_OF_DECLARE(qoriq_core_pll_1, "fsl,qoriq-core-pll-1.0",
> core_pll_init);  CLK_OF_DECLARE(qoriq_core_pll_2, "fsl,qoriq-core-pll-
> 2.0", core_pll_init);  CLK_OF_DECLARE(qoriq_core_mux_1, "fsl,qoriq-core-
> mux-1.0", core_mux_init);  CLK_OF_DECLARE(qoriq_core_mux_2, "fsl,qoriq-
> core-mux-2.0", core_mux_init);
> +CLK_OF_DECLARE(qoriq_pltfrm_pll_1, "fsl,qoriq-platform-pll-1.0",
> +pltfrm_pll_init); CLK_OF_DECLARE(qoriq_pltfrm_pll_2,
> +"fsl,qoriq-platform-pll-2.0", pltfrm_pll_init);
> --
> 2.2.1

Acked-by: Tang Yuantian <Yuantian.Tang@freescale.com>

Regards,
Yuantian

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

* RE: [PATCH v2 08/10] powerpc/corenet: Enable CLK_QORIQ
  2015-01-21 10:03 ` [PATCH v2 08/10] powerpc/corenet: Enable CLK_QORIQ Emil Medve
@ 2015-02-04  2:54   ` Yuantian Tang
  0 siblings, 0 replies; 15+ messages in thread
From: Yuantian Tang @ 2015-02-04  2:54 UTC (permalink / raw)
  To: Emilian Medve, linuxppc-dev, Scott Wood, mturquette, haokexin
  Cc: Emilian Medve

> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
> Sent: Wednesday, January 21, 2015 6:04 PM
> To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
> mturquette@linaro.org; haokexin@gmail.com; Tang Yuantian-B29983
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH v2 08/10] powerpc/corenet: Enable CLK_QORIQ
>=20
> Change-Id: I1a80ad7b9f6854791bd270b746f93a91439155a6
> Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> ---
>  arch/powerpc/configs/corenet32_smp_defconfig | 1 +
> arch/powerpc/configs/corenet64_smp_defconfig | 1 +
>  2 files changed, 2 insertions(+)
>=20
> diff --git a/arch/powerpc/configs/corenet32_smp_defconfig
> b/arch/powerpc/configs/corenet32_smp_defconfig
> index 611efe9..cce62e9 100644
> --- a/arch/powerpc/configs/corenet32_smp_defconfig
> +++ b/arch/powerpc/configs/corenet32_smp_defconfig
> @@ -147,6 +147,7 @@ CONFIG_STAGING=3Dy
>  CONFIG_MEMORY=3Dy
>  CONFIG_VIRT_DRIVERS=3Dy
>  CONFIG_FSL_HV_MANAGER=3Dy
> +CONFIG_CLK_QORIQ=3Dy
>  CONFIG_EXT2_FS=3Dy
>  CONFIG_EXT3_FS=3Dy
>  # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set diff --git
> a/arch/powerpc/configs/corenet64_smp_defconfig
> b/arch/powerpc/configs/corenet64_smp_defconfig
> index be24a18..c9e8057 100644
> --- a/arch/powerpc/configs/corenet64_smp_defconfig
> +++ b/arch/powerpc/configs/corenet64_smp_defconfig
> @@ -117,6 +117,7 @@ CONFIG_DMADEVICES=3Dy
>  CONFIG_FSL_DMA=3Dy
>  CONFIG_VIRT_DRIVERS=3Dy
>  CONFIG_FSL_HV_MANAGER=3Dy
> +CONFIG_CLK_QORIQ=3Dy
>  CONFIG_FSL_CORENET_CF=3Dy
>  CONFIG_MEMORY=3Dy
>  CONFIG_EXT2_FS=3Dy
> --
> 2.2.1

Acked-by: Tang Yuantian <Yuantian.Tang@freescale.com>

Regards,
Yuantian

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

end of thread, other threads:[~2015-02-04  2:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-21 10:03 [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Emil Medve
2015-01-21 10:03 ` [PATCH v2 01/10] clk: qoriq: Fix checkpatch type PARENTHESIS_ALIGNMENT Emil Medve
2015-01-21 10:03 ` [PATCH v2 02/10] clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY Emil Medve
2015-01-21 10:03 ` [PATCH v2 03/10] clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT Emil Medve
2015-01-21 10:03 ` [PATCH v2 04/10] clk: qoriq: Fix checkpatch type OOM_MESSAGE Emil Medve
2015-01-21 10:03 ` [PATCH v2 05/10] clk: qoriq: Make local symbol 'static' Emil Medve
2015-01-21 10:03 ` [PATCH v2 06/10] clk: qoriq: Replace kzalloc() with kmalloc() Emil Medve
2015-01-21 10:03 ` [PATCH v2 07/10] clk: qoriq: Use pr_fmt() Emil Medve
2015-01-21 10:03 ` [PATCH v2 08/10] powerpc/corenet: Enable CLK_QORIQ Emil Medve
2015-02-04  2:54   ` Yuantian Tang
2015-01-21 10:03 ` [PATCH v2 09/10] clk: qoriq: Add support for the platform PLL Emil Medve
2015-01-29  2:26   ` Yuantian Tang
2015-01-28 18:15 ` [PATCH v2 00/10] clk: qoriq: Add support for the FMan clock Mike Turquette
2015-01-28 21:48   ` Emil Medve
2015-01-28 22:59     ` Scott Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.