public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types
@ 2012-11-16  4:47 gerg
  2012-11-16  4:47 ` [PATCH 01/12] m68knommu: add clock creation support macro for other ColdFire CPUs gerg
                   ` (13 more replies)
  0 siblings, 14 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev


The current Coldfire clock code only really supports those ColdFire CPU types
that have the more advanced enable/disable clock hardware support. If we
generalize our clock code we can support all types, even those with simpler
fixed clock trees.

This results in much cleaner and consistent clock support. And it means that
we can in the future use the clock API in our timers and throughout the other
ColdFire p[eripheraps, instead of hard coded clock definitions.

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

* [PATCH 01/12] m68knommu: add clock creation support macro for other ColdFire CPUs
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  6:30   ` Geert Uytterhoeven
  2012-11-16  4:47 ` [PATCH 02/12] m68knommu: add clock definitions for 5206 ColdFire CPU types gerg
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

The clock support code for ColdFire CPUs currently supports those that
have the clock control register PPMCR. Expose the struct clk for all CPU
types and add a definition for all other ColdFire CPU types.

With this we will be able to define simple clock trees for all ColdFire
CPU types, even though will not be able to be enabled or disabled. They
will be able to report the clock rate.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/include/asm/mcfclk.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/arch/m68k/include/asm/mcfclk.h b/arch/m68k/include/asm/mcfclk.h
index b676a02..ea4791e 100644
--- a/arch/m68k/include/asm/mcfclk.h
+++ b/arch/m68k/include/asm/mcfclk.h
@@ -8,7 +8,6 @@
 
 struct clk;
 
-#ifdef MCFPM_PPMCR0
 struct clk_ops {
 	void (*enable)(struct clk *);
 	void (*disable)(struct clk *);
@@ -23,6 +22,8 @@ struct clk {
 };
 
 extern struct clk *mcf_clks[];
+
+#ifdef MCFPM_PPMCR0
 extern struct clk_ops clk_ops0;
 #ifdef MCFPM_PPMCR1
 extern struct clk_ops clk_ops1;
@@ -38,6 +39,12 @@ static struct clk __clk_##clk_bank##_##clk_slot = { \
 
 void __clk_init_enabled(struct clk *);
 void __clk_init_disabled(struct clk *);
+#else
+#define DEFINE_CLK(clk_ref, clk_name, clk_rate) \
+        static struct clk clk_##clk_ref = { \
+                .name = clk_name, \
+                .rate = clk_rate, \
+        }
 #endif /* MCFPM_PPMCR0 */
 
 #endif /* mcfclk_h */
-- 
1.7.0.4

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

* [PATCH 02/12] m68knommu: add clock definitions for 5206 ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
  2012-11-16  4:47 ` [PATCH 01/12] m68knommu: add clock creation support macro for other ColdFire CPUs gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 03/12] m68knommu: add clock definitions for 523x " gerg
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 5206 ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m5206.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m5206.c b/arch/m68k/platform/coldfire/m5206.c
index 6bfbeeb..0e55f44 100644
--- a/arch/m68k/platform/coldfire/m5206.c
+++ b/arch/m68k/platform/coldfire/m5206.c
@@ -16,6 +16,26 @@
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
+#include <asm/mcfclk.h>
+
+/***************************************************************************/
+
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr0, "mcftmr.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr1, "mcftmr.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcftmr0,
+	&clk_mcftmr1,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	NULL
+};
 
 /***************************************************************************/
 
-- 
1.7.0.4

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

* [PATCH 03/12] m68knommu: add clock definitions for 523x ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
  2012-11-16  4:47 ` [PATCH 01/12] m68knommu: add clock creation support macro for other ColdFire CPUs gerg
  2012-11-16  4:47 ` [PATCH 02/12] m68knommu: add clock definitions for 5206 ColdFire CPU types gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 04/12] m68knommu: add clock definitions for 5249 " gerg
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 523x ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m523x.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m523x.c b/arch/m68k/platform/coldfire/m523x.c
index ff37fe9..2b10e9f 100644
--- a/arch/m68k/platform/coldfire/m523x.c
+++ b/arch/m68k/platform/coldfire/m523x.c
@@ -19,6 +19,34 @@
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
+#include <asm/mcfclk.h>
+
+/***************************************************************************/
+
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcfpit0, "mcfpit.0", MCF_CLK);
+DEFINE_CLK(mcfpit1, "mcfpit.1", MCF_CLK);
+DEFINE_CLK(mcfpit2, "mcfpit.2", MCF_CLK);
+DEFINE_CLK(mcfpit3, "mcfpit.3", MCF_CLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart2, "mcfuart.2", MCF_BUSCLK);
+DEFINE_CLK(fec0, "fec.0", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcfpit0,
+	&clk_mcfpit1,
+	&clk_mcfpit2,
+	&clk_mcfpit3,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	&clk_mcfuart2,
+	&clk_fec0,
+	NULL
+};
 
 /***************************************************************************/
 
-- 
1.7.0.4

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

* [PATCH 04/12] m68knommu: add clock definitions for 5249 ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (2 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 03/12] m68knommu: add clock definitions for 523x " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 05/12] m68knommu: add clock definitions for 525x " gerg
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 5249 ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m5249.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m5249.c b/arch/m68k/platform/coldfire/m5249.c
index 23b19cb..193245e 100644
--- a/arch/m68k/platform/coldfire/m5249.c
+++ b/arch/m68k/platform/coldfire/m5249.c
@@ -16,6 +16,26 @@
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
+#include <asm/mcfclk.h>
+
+/***************************************************************************/
+
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr0, "mcftmr.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr1, "mcftmr.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcftmr0,
+	&clk_mcftmr1,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	NULL
+};
 
 /***************************************************************************/
 
-- 
1.7.0.4

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

* [PATCH 05/12] m68knommu: add clock definitions for 525x ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (3 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 04/12] m68knommu: add clock definitions for 5249 " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 06/12] m68knommu: add clock definitions for 5272 " gerg
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 525x ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m525x.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m525x.c b/arch/m68k/platform/coldfire/m525x.c
index fce8f8a..5b9f657 100644
--- a/arch/m68k/platform/coldfire/m525x.c
+++ b/arch/m68k/platform/coldfire/m525x.c
@@ -16,6 +16,26 @@
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
+#include <asm/mcfclk.h>
+
+/***************************************************************************/
+
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr0, "mcftmr.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr1, "mcftmr.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcftmr0,
+	&clk_mcftmr1,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	NULL
+};
 
 /***************************************************************************/
 
-- 
1.7.0.4

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

* [PATCH 06/12] m68knommu: add clock definitions for 5272 ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (4 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 05/12] m68knommu: add clock definitions for 525x " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 07/12] m68knommu: add clock definitions for 527x " gerg
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 5272 ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m5272.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m5272.c b/arch/m68k/platform/coldfire/m5272.c
index 45b246d..a8c5856 100644
--- a/arch/m68k/platform/coldfire/m5272.c
+++ b/arch/m68k/platform/coldfire/m5272.c
@@ -19,6 +19,7 @@
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
 #include <asm/mcfuart.h>
+#include <asm/mcfclk.h>
 
 /***************************************************************************/
 
@@ -30,6 +31,31 @@ unsigned char ledbank = 0xff;
 
 /***************************************************************************/
 
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr0, "mcftmr.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr1, "mcftmr.1", MCF_BUSCLK);
+DEFINE_CLK(mcftmr2, "mcftmr.2", MCF_BUSCLK);
+DEFINE_CLK(mcftmr3, "mcftmr.3", MCF_BUSCLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+DEFINE_CLK(fec0, "fec.0", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcftmr0,
+	&clk_mcftmr1,
+	&clk_mcftmr2,
+	&clk_mcftmr3,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	&clk_fec0,
+	NULL
+};
+
+/***************************************************************************/
+
 static void __init m5272_uarts_init(void)
 {
 	u32 v;
-- 
1.7.0.4

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

* [PATCH 07/12] m68knommu: add clock definitions for 527x ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (5 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 06/12] m68knommu: add clock definitions for 5272 " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 08/12] m68knommu: add clock definitions for 528x " gerg
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 527x ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m527x.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m527x.c b/arch/m68k/platform/coldfire/m527x.c
index 1431ba0..6fbfe90 100644
--- a/arch/m68k/platform/coldfire/m527x.c
+++ b/arch/m68k/platform/coldfire/m527x.c
@@ -20,6 +20,36 @@
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
 #include <asm/mcfuart.h>
+#include <asm/mcfclk.h>
+
+/***************************************************************************/
+
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcfpit0, "mcfpit.0", MCF_CLK);
+DEFINE_CLK(mcfpit1, "mcfpit.1", MCF_CLK);
+DEFINE_CLK(mcfpit2, "mcfpit.2", MCF_CLK);
+DEFINE_CLK(mcfpit3, "mcfpit.3", MCF_CLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart2, "mcfuart.2", MCF_BUSCLK);
+DEFINE_CLK(fec0, "fec.0", MCF_BUSCLK);
+DEFINE_CLK(fec1, "fec.1", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcfpit0,
+	&clk_mcfpit1,
+	&clk_mcfpit2,
+	&clk_mcfpit3,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	&clk_mcfuart2,
+	&clk_fec0,
+	&clk_fec1,
+	NULL
+};
 
 /***************************************************************************/
 
-- 
1.7.0.4

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

* [PATCH 08/12] m68knommu: add clock definitions for 528x ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (6 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 07/12] m68knommu: add clock definitions for 527x " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 09/12] m68knommu: add clock definitions for 5307 " gerg
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 528x ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m528x.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m528x.c b/arch/m68k/platform/coldfire/m528x.c
index f9f7e6a..83b7dad 100644
--- a/arch/m68k/platform/coldfire/m528x.c
+++ b/arch/m68k/platform/coldfire/m528x.c
@@ -21,6 +21,34 @@
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
 #include <asm/mcfuart.h>
+#include <asm/mcfclk.h>
+
+/***************************************************************************/
+
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcfpit0, "mcfpit.0", MCF_CLK);
+DEFINE_CLK(mcfpit1, "mcfpit.1", MCF_CLK);
+DEFINE_CLK(mcfpit2, "mcfpit.2", MCF_CLK);
+DEFINE_CLK(mcfpit3, "mcfpit.3", MCF_CLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart2, "mcfuart.2", MCF_BUSCLK);
+DEFINE_CLK(fec0, "fec.0", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcfpit0,
+	&clk_mcfpit1,
+	&clk_mcfpit2,
+	&clk_mcfpit3,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	&clk_mcfuart2,
+	&clk_fec0,
+	NULL
+};
 
 /***************************************************************************/
 
-- 
1.7.0.4

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

* [PATCH 09/12] m68knommu: add clock definitions for 5307 ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (7 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 08/12] m68knommu: add clock definitions for 528x " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 10/12] m68knommu: add clock definitions for 5407 " gerg
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 5307 ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m5307.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m5307.c b/arch/m68k/platform/coldfire/m5307.c
index a568d28..8874353 100644
--- a/arch/m68k/platform/coldfire/m5307.c
+++ b/arch/m68k/platform/coldfire/m5307.c
@@ -17,6 +17,7 @@
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
 #include <asm/mcfwdebug.h>
+#include <asm/mcfclk.h>
 
 /***************************************************************************/
 
@@ -28,6 +29,25 @@ unsigned char ledbank = 0xff;
 
 /***************************************************************************/
 
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr0, "mcftmr.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr1, "mcftmr.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcftmr0,
+	&clk_mcftmr1,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	NULL
+};
+
+/***************************************************************************/
+
 void __init config_BSP(char *commandp, int size)
 {
 #if defined(CONFIG_NETtel) || \
-- 
1.7.0.4

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

* [PATCH 10/12] m68knommu: add clock definitions for 5407 ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (8 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 09/12] m68knommu: add clock definitions for 5307 " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 11/12] m68knommu: add clock definitions for 54xx " gerg
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 5407 ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m5407.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m5407.c b/arch/m68k/platform/coldfire/m5407.c
index bb6c746..2fb3cdb 100644
--- a/arch/m68k/platform/coldfire/m5407.c
+++ b/arch/m68k/platform/coldfire/m5407.c
@@ -16,6 +16,26 @@
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
+#include <asm/mcfclk.h>
+
+/***************************************************************************/
+
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr0, "mcftmr.0", MCF_BUSCLK);
+DEFINE_CLK(mcftmr1, "mcftmr.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcftmr0,
+	&clk_mcftmr1,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	NULL
+};
 
 /***************************************************************************/
 
-- 
1.7.0.4

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

* [PATCH 11/12] m68knommu: add clock definitions for 54xx ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (9 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 10/12] m68knommu: add clock definitions for 5407 " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  4:47 ` [PATCH 12/12] m68knommu: modify clock code so it can be used by all " gerg
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

Add a base set of clocks for the 54xx ColdFire CPU types.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/m54xx.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/platform/coldfire/m54xx.c b/arch/m68k/platform/coldfire/m54xx.c
index b587bf3..952da53 100644
--- a/arch/m68k/platform/coldfire/m54xx.c
+++ b/arch/m68k/platform/coldfire/m54xx.c
@@ -14,19 +14,45 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/mm.h>
+#include <linux/clk.h>
 #include <linux/bootmem.h>
 #include <asm/pgalloc.h>
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
 #include <asm/m54xxsim.h>
 #include <asm/mcfuart.h>
+#include <asm/mcfclk.h>
 #include <asm/m54xxgpt.h>
+#include <asm/mcfclk.h>
 #ifdef CONFIG_MMU
 #include <asm/mmu_context.h>
 #endif
 
 /***************************************************************************/
 
+DEFINE_CLK(pll, "pll.0", MCF_CLK);
+DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
+DEFINE_CLK(mcfslt0, "mcfslt.0", MCF_BUSCLK);
+DEFINE_CLK(mcfslt1, "mcfslt.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart0, "mcfuart.0", MCF_BUSCLK);
+DEFINE_CLK(mcfuart1, "mcfuart.1", MCF_BUSCLK);
+DEFINE_CLK(mcfuart2, "mcfuart.2", MCF_BUSCLK);
+DEFINE_CLK(mcfuart3, "mcfuart.3", MCF_BUSCLK);
+
+struct clk *mcf_clks[] = {
+	&clk_pll,
+	&clk_sys,
+	&clk_mcfslt0,
+	&clk_mcfslt1,
+	&clk_mcfuart0,
+	&clk_mcfuart1,
+	&clk_mcfuart2,
+	&clk_mcfuart3,
+	NULL
+};
+
+/***************************************************************************/
+
 static void __init m54xx_uarts_init(void)
 {
 	/* enable io pins */
-- 
1.7.0.4

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

* [PATCH 12/12] m68knommu: modify clock code so it can be used by all ColdFire CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (10 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 11/12] m68knommu: add clock definitions for 54xx " gerg
@ 2012-11-16  4:47 ` gerg
  2012-11-16  6:28 ` [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all " Geert Uytterhoeven
  2012-11-26 15:34 ` [uClinux-dev] " Thomas Petazzoni
  13 siblings, 0 replies; 18+ messages in thread
From: gerg @ 2012-11-16  4:47 UTC (permalink / raw)
  To: linux-m68k, uclinux-dev; +Cc: Greg Ungerer

From: Greg Ungerer <gerg@uclinux.org>

The existing clk.c code for ColdFire CPUs has one set of functions to
support those CPU types that have selectable clocks (those with a PPMCR
register), and a duplicate simpler set for those with static clocks.

Modify the clk.c code so there is just one set of support functions. All
CPU types now define a list of clocks (in "struct clk"s), so we only need
a single set of clock functions.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/clk.c |  100 ++++++++++++++-----------------------
 1 files changed, 38 insertions(+), 62 deletions(-)

diff --git a/arch/m68k/platform/coldfire/clk.c b/arch/m68k/platform/coldfire/clk.c
index 9cd13b4..fddfdcc 100644
--- a/arch/m68k/platform/coldfire/clk.c
+++ b/arch/m68k/platform/coldfire/clk.c
@@ -19,37 +19,58 @@
 #include <asm/mcfsim.h>
 #include <asm/mcfclk.h>
 
-/***************************************************************************/
-#ifndef MCFPM_PPMCR0
-struct clk *clk_get(struct device *dev, const char *id)
+static DEFINE_SPINLOCK(clk_lock);
+
+#ifdef MCFPM_PPMCR0
+/*
+ *	For more advanced ColdFire parts that have clocks that can be enabled
+ *	we supply enable/disable functions. These must properly define their
+ *	clocks in their platform specific code.
+ */
+void __clk_init_enabled(struct clk *clk)
 {
-	return NULL;
+	clk->enabled = 1;
+	clk->clk_ops->enable(clk);
 }
-EXPORT_SYMBOL(clk_get);
 
-int clk_enable(struct clk *clk)
+void __clk_init_disabled(struct clk *clk)
 {
-	return 0;
+	clk->enabled = 0;
+	clk->clk_ops->disable(clk);
 }
-EXPORT_SYMBOL(clk_enable);
 
-void clk_disable(struct clk *clk)
+static void __clk_enable0(struct clk *clk)
 {
+	__raw_writeb(clk->slot, MCFPM_PPMCR0);
 }
-EXPORT_SYMBOL(clk_disable);
 
-void clk_put(struct clk *clk)
+static void __clk_disable0(struct clk *clk)
+{
+	__raw_writeb(clk->slot, MCFPM_PPMSR0);
+}
+
+struct clk_ops clk_ops0 = {
+	.enable		= __clk_enable0,
+	.disable	= __clk_disable0,
+};
+
+#ifdef MCFPM_PPMCR1
+static void __clk_enable1(struct clk *clk)
 {
+	__raw_writeb(clk->slot, MCFPM_PPMCR1);
 }
-EXPORT_SYMBOL(clk_put);
 
-unsigned long clk_get_rate(struct clk *clk)
+static void __clk_disable1(struct clk *clk)
 {
-	return MCF_CLK;
+	__raw_writeb(clk->slot, MCFPM_PPMSR1);
 }
-EXPORT_SYMBOL(clk_get_rate);
-#else
-static DEFINE_SPINLOCK(clk_lock);
+
+struct clk_ops clk_ops1 = {
+	.enable		= __clk_enable1,
+	.disable	= __clk_disable1,
+};
+#endif /* MCFPM_PPMCR1 */
+#endif /* MCFPM_PPMCR0 */
 
 struct clk *clk_get(struct device *dev, const char *id)
 {
@@ -101,48 +122,3 @@ unsigned long clk_get_rate(struct clk *clk)
 EXPORT_SYMBOL(clk_get_rate);
 
 /***************************************************************************/
-
-void __clk_init_enabled(struct clk *clk)
-{
-	clk->enabled = 1;
-	clk->clk_ops->enable(clk);
-}
-
-void __clk_init_disabled(struct clk *clk)
-{
-	clk->enabled = 0;
-	clk->clk_ops->disable(clk);
-}
-
-static void __clk_enable0(struct clk *clk)
-{
-	__raw_writeb(clk->slot, MCFPM_PPMCR0);
-}
-
-static void __clk_disable0(struct clk *clk)
-{
-	__raw_writeb(clk->slot, MCFPM_PPMSR0);
-}
-
-struct clk_ops clk_ops0 = {
-	.enable		= __clk_enable0,
-	.disable	= __clk_disable0,
-};
-
-#ifdef MCFPM_PPMCR1
-static void __clk_enable1(struct clk *clk)
-{
-	__raw_writeb(clk->slot, MCFPM_PPMCR1);
-}
-
-static void __clk_disable1(struct clk *clk)
-{
-	__raw_writeb(clk->slot, MCFPM_PPMSR1);
-}
-
-struct clk_ops clk_ops1 = {
-	.enable		= __clk_enable1,
-	.disable	= __clk_disable1,
-};
-#endif /* MCFPM_PPMCR1 */
-#endif /* MCFPM_PPMCR0 */
-- 
1.7.0.4

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

* Re: [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (11 preceding siblings ...)
  2012-11-16  4:47 ` [PATCH 12/12] m68knommu: modify clock code so it can be used by all " gerg
@ 2012-11-16  6:28 ` Geert Uytterhoeven
  2012-11-16  9:09   ` Greg Ungerer
  2012-11-26 15:34 ` [uClinux-dev] " Thomas Petazzoni
  13 siblings, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2012-11-16  6:28 UTC (permalink / raw)
  To: gerg; +Cc: linux-m68k, uclinux-dev

On Fri, Nov 16, 2012 at 5:47 AM,  <gerg@snapgear.com> wrote:
> ColdFire p[eripheraps, instead of hard coded clock definitions.

peripherals

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

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

* Re: [PATCH 01/12] m68knommu: add clock creation support macro for other ColdFire CPUs
  2012-11-16  4:47 ` [PATCH 01/12] m68knommu: add clock creation support macro for other ColdFire CPUs gerg
@ 2012-11-16  6:30   ` Geert Uytterhoeven
  0 siblings, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2012-11-16  6:30 UTC (permalink / raw)
  To: gerg; +Cc: linux-m68k, uclinux-dev, Greg Ungerer

On Fri, Nov 16, 2012 at 5:47 AM,  <gerg@snapgear.com> wrote:
> With this we will be able to define simple clock trees for all ColdFire
> CPU types, even though will not be able to be enabled or disabled. They
                         ^ they

> will be able to report the clock rate.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types
  2012-11-16  6:28 ` [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all " Geert Uytterhoeven
@ 2012-11-16  9:09   ` Greg Ungerer
  0 siblings, 0 replies; 18+ messages in thread
From: Greg Ungerer @ 2012-11-16  9:09 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, uclinux-dev

Hi Geert,

On 11/16/2012 04:28 PM, Geert Uytterhoeven wrote:
> On Fri, Nov 16, 2012 at 5:47 AM,  <gerg@snapgear.com> wrote:
>> ColdFire p[eripheraps, instead of hard coded clock definitions.
>
> peripherals

Thanks for the fixups. All applied.

Regards
Greg


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close,                            FAX:         +61 7 3891 3630
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

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

* Re: [uClinux-dev] [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types
  2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
                   ` (12 preceding siblings ...)
  2012-11-16  6:28 ` [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all " Geert Uytterhoeven
@ 2012-11-26 15:34 ` Thomas Petazzoni
  2012-11-26 22:49   ` Greg Ungerer
  13 siblings, 1 reply; 18+ messages in thread
From: Thomas Petazzoni @ 2012-11-26 15:34 UTC (permalink / raw)
  To: uClinux development list; +Cc: gerg, linux-m68k

Hello,

On Fri, 16 Nov 2012 14:47:24 +1000, gerg@snapgear.com wrote:

> The current Coldfire clock code only really supports those ColdFire
> CPU types that have the more advanced enable/disable clock hardware
> support. If we generalize our clock code we can support all types,
> even those with simpler fixed clock trees.
> 
> This results in much cleaner and consistent clock support. And it
> means that we can in the future use the clock API in our timers and
> throughout the other ColdFire p[eripheraps, instead of hard coded
> clock definitions.

Have you considered instead using the generic clock framework that is
now in drivers/clk/ ?

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types
  2012-11-26 15:34 ` [uClinux-dev] " Thomas Petazzoni
@ 2012-11-26 22:49   ` Greg Ungerer
  0 siblings, 0 replies; 18+ messages in thread
From: Greg Ungerer @ 2012-11-26 22:49 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: linux-m68k, uClinux development list

Hi Thomas,

On 11/27/2012 01:34 AM, Thomas Petazzoni wrote:
> On Fri, 16 Nov 2012 14:47:24 +1000, gerg@snapgear.com wrote:
>> The current Coldfire clock code only really supports those ColdFire
>> CPU types that have the more advanced enable/disable clock hardware
>> support. If we generalize our clock code we can support all types,
>> even those with simpler fixed clock trees.
>>
>> This results in much cleaner and consistent clock support. And it
>> means that we can in the future use the clock API in our timers and
>> throughout the other ColdFire p[eripheraps, instead of hard coded
>> clock definitions.
>
> Have you considered instead using the generic clock framework that is
> now in drivers/clk/ ?

I have, and that is what I plan to do next. This set of patches
was intended to clean up (and generalize) what we currently have.
It doesn't really change the current ColdFire clocking code in
any way, just makes it work consistently across all CPU types.

Regards
Greg


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close,                            FAX:         +61 7 3891 3630
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

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

end of thread, other threads:[~2012-11-26 22:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-16  4:47 [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all CPU types gerg
2012-11-16  4:47 ` [PATCH 01/12] m68knommu: add clock creation support macro for other ColdFire CPUs gerg
2012-11-16  6:30   ` Geert Uytterhoeven
2012-11-16  4:47 ` [PATCH 02/12] m68knommu: add clock definitions for 5206 ColdFire CPU types gerg
2012-11-16  4:47 ` [PATCH 03/12] m68knommu: add clock definitions for 523x " gerg
2012-11-16  4:47 ` [PATCH 04/12] m68knommu: add clock definitions for 5249 " gerg
2012-11-16  4:47 ` [PATCH 05/12] m68knommu: add clock definitions for 525x " gerg
2012-11-16  4:47 ` [PATCH 06/12] m68knommu: add clock definitions for 5272 " gerg
2012-11-16  4:47 ` [PATCH 07/12] m68knommu: add clock definitions for 527x " gerg
2012-11-16  4:47 ` [PATCH 08/12] m68knommu: add clock definitions for 528x " gerg
2012-11-16  4:47 ` [PATCH 09/12] m68knommu: add clock definitions for 5307 " gerg
2012-11-16  4:47 ` [PATCH 10/12] m68knommu: add clock definitions for 5407 " gerg
2012-11-16  4:47 ` [PATCH 11/12] m68knommu: add clock definitions for 54xx " gerg
2012-11-16  4:47 ` [PATCH 12/12] m68knommu: modify clock code so it can be used by all " gerg
2012-11-16  6:28 ` [PATCH 00/12] m68knommu: generalize the ColdFire clock support for all " Geert Uytterhoeven
2012-11-16  9:09   ` Greg Ungerer
2012-11-26 15:34 ` [uClinux-dev] " Thomas Petazzoni
2012-11-26 22:49   ` Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox