Skip to contentSkip to conversation

Switch pxa architecture to clock framework

PATCH New Robert Jarzmik 1 participant 4 messages Feb 7, 2015 – Feb 23, 2015

Subsystems (3)
lore
Share & tools
lore

Robert Jarzmik

author maintainer
#0 lore raw

cover Switch pxa architecture to clock framework

This is it, everything looks ready for the leap of faith.

This serie removes all legacy clock code, and pxa25x, pxa27x and pxa3xx are migrated to clock framework. This serie was tested on lubbock (pxa250), mioa701 (pxa270) and zylonite (pxa310). I plan to test also cm-x300 and mainstone in the near future.

This has the potential to break many pxa boards. The more test it receives, the better. I'd like this to hit v3.21.

All this work is available here :
git fetch https://github.com/rjarzmik/linux.git work/clocks-pxa

Cheers.

--
Robert

Robert Jarzmik (2):
ARM: pxa: convert eseries to clock framework
ARM: pxa: Transition pxa25x, pxa27x, pxa3xx to clk framework

 arch/arm/Kconfig                 |   2 +-
 arch/arm/mach-pxa/Makefile       |   2 +-
 arch/arm/mach-pxa/clock-pxa2xx.c |  55 ----------
 arch/arm/mach-pxa/clock-pxa3xx.c | 212 ---------------------------------------
 arch/arm/mach-pxa/clock.c        |  86 ----------------
 arch/arm/mach-pxa/clock.h        |  80 ---------------
 arch/arm/mach-pxa/eseries.c      |  22 +---
 arch/arm/mach-pxa/generic.c      |   2 +
 arch/arm/mach-pxa/generic.h      |   1 +
 arch/arm/mach-pxa/lubbock.c      |   1 -
 arch/arm/mach-pxa/pxa25x.c       |   1 -
 arch/arm/mach-pxa/pxa300.c       |  20 +---
 arch/arm/mach-pxa/pxa320.c       |  10 --
 arch/arm/mach-pxa/pxa3xx.c       |  59 -----------
 arch/arm/mach-pxa/raumfeld.c     |   1 -
 arch/arm/mach-pxa/tosa.c         |   1 -
 16 files changed, 8 insertions(+), 547 deletions(-)
 delete mode 100644 arch/arm/mach-pxa/clock-pxa2xx.c
 delete mode 100644 arch/arm/mach-pxa/clock-pxa3xx.c
 delete mode 100644 arch/arm/mach-pxa/clock.c
 delete mode 100644 arch/arm/mach-pxa/clock.h
Signature · 1 line
2.1.0
author maintainer
#1 lore raw

PATCH 1/2 ARM: pxa: convert eseries to clock framework

As pxa architecture transitions to clock framework, the previously available INIT_CLKREG is no more. Use the fixed clock rate initializer to declare the "fake" CLK_CK32K in eseries.

---
 arch/arm/mach-pxa/eseries.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)
arch/arm/mach-pxa/eseries.c +2 -19
index d8fc9a3..9522265 100644
@@ -12,6 +12,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/clk-provider.h>
 #include <linux/gpio.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
@@ -125,27 +126,9 @@ struct resource eseries_tmio_resources[] = {
 };
 
 /* Some e-series hardware cannot control the 32K clock */
-static void clk_32k_dummy(struct clk *clk)
-{
-}
-
-static const struct clkops clk_32k_dummy_ops = {
-	.enable         = clk_32k_dummy,
-	.disable        = clk_32k_dummy,
-};
-
-static struct clk tmio_dummy_clk = {
-	.ops	= &clk_32k_dummy_ops,
-	.rate	= 32768,
-};
-
-static struct clk_lookup eseries_clkregs[] = {
-	INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"),
-};
-
 static void __init eseries_register_clks(void)
 {
-	clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
+	clk_register_fixed_rate(NULL, "CLK_CK32K", NULL, CLK_IS_ROOT, 32768);
 }
 
 #ifdef CONFIG_MACH_E330
Signature · 1 line
2.1.0
author maintainer
#2 lore raw

PATCH 2/2 ARM: pxa: Transition pxa25x, pxa27x, pxa3xx to clk framework

In reply to Robert Jarzmik

Transition the PXA25x, PXA27x and PXA3xx CPUs to the clock framework. This transition still enables legacy platforms to run without device tree as before, ie relying on platform data encoded in board specific files.

This is the last step of clock framework transition for pxa platforms. It was tested on lubbock (pxa25x), mioa701 (pxa27x) and zylonite (pxa3xx).

---
 arch/arm/Kconfig                 |   2 +-
 arch/arm/mach-pxa/Makefile       |   2 +-
 arch/arm/mach-pxa/clock-pxa2xx.c |  55 ----------
 arch/arm/mach-pxa/clock-pxa3xx.c | 212 ---------------------------------------
 arch/arm/mach-pxa/clock.c        |  86 ----------------
 arch/arm/mach-pxa/clock.h        |  80 ---------------
 arch/arm/mach-pxa/eseries.c      |   1 -
 arch/arm/mach-pxa/generic.c      |   2 +
 arch/arm/mach-pxa/generic.h      |   1 +
 arch/arm/mach-pxa/lubbock.c      |   1 -
 arch/arm/mach-pxa/pxa25x.c       |   1 -
 arch/arm/mach-pxa/pxa300.c       |  20 +---
 arch/arm/mach-pxa/pxa320.c       |  10 --
 arch/arm/mach-pxa/pxa3xx.c       |  59 -----------
 arch/arm/mach-pxa/raumfeld.c     |   1 -
 arch/arm/mach-pxa/tosa.c         |   1 -
 16 files changed, 6 insertions(+), 528 deletions(-)
 delete mode 100644 arch/arm/mach-pxa/clock-pxa2xx.c
 delete mode 100644 arch/arm/mach-pxa/clock-pxa3xx.c
 delete mode 100644 arch/arm/mach-pxa/clock.c
 delete mode 100644 arch/arm/mach-pxa/clock.h
arch/arm/Kconfig +1 -1
index 0eede73..bb358d2 100644
@@ -613,7 +613,7 @@ config ARCH_PXA
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_CPU_SUSPEND if PM
 	select AUTO_ZRELADDR
-	select COMMON_CLK if PXA27x || PXA25x
+	select COMMON_CLK
 	select CLKDEV_LOOKUP
 	select CLKSRC_MMIO
 	select CLKSRC_OF
arch/arm/mach-pxa/Makefile +1 -1
index 1566a27..4591c11 100644
@@ -11,7 +11,7 @@ obj-$(CONFIG_PM)		+= pm.o sleep.o standby.o
 # SoC-specific code
 obj-$(CONFIG_PXA25x)		+= mfp-pxa2xx.o pxa2xx.o pxa25x.o
 obj-$(CONFIG_PXA27x)		+= mfp-pxa2xx.o pxa2xx.o pxa27x.o
-obj-$(CONFIG_PXA3xx)		+= mfp-pxa3xx.o clock.o clock-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o
+obj-$(CONFIG_PXA3xx)		+= mfp-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o
 obj-$(CONFIG_CPU_PXA300)	+= pxa300.o
 obj-$(CONFIG_CPU_PXA320)	+= pxa320.o
 obj-$(CONFIG_CPU_PXA930)	+= pxa930.o
arch/arm/mach-pxa/clock-pxa2xx.c deleted +0 -55

55 lines not on this page · raw message

arch/arm/mach-pxa/clock-pxa3xx.c deleted +0 -212

212 lines not on this page · raw message

arch/arm/mach-pxa/clock.c deleted +0 -86

86 lines not on this page · raw message

arch/arm/mach-pxa/clock.h deleted +0 -80

80 lines not on this page · raw message

arch/arm/mach-pxa/eseries.c +0 -1
index 9522265..11863be 100644
@@ -40,7 +40,6 @@
 
 #include "devices.h"
 #include "generic.h"
-#include "clock.h"
 
 /* Only e800 has 128MB RAM */
 void __init eseries_fixup(struct tag *tags, char **cmdline)
arch/arm/mach-pxa/generic.c +2 -0
index d988c53..ec510ec 100644
@@ -67,6 +67,8 @@ void __init pxa_timer_init(void)
 		pxa25x_clocks_init();
 	if (cpu_is_pxa27x())
 		pxa27x_clocks_init();
+	if (cpu_is_pxa3xx())
+		pxa3xx_clocks_init();
 	pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
 			    get_clock_tick_rate());
 }
arch/arm/mach-pxa/generic.h +1 -0
index 149087c..0b1dbb5 100644
@@ -39,6 +39,7 @@ extern void __init pxa27x_init_irq(void);
 extern void __init pxa27x_map_io(void);
 
 #define pxa3xx_handle_irq ichp_handle_irq
+extern int __init pxa3xx_clocks_init(void);
 extern void __init pxa3xx_dt_init_irq(void);
 extern void __init pxa3xx_init_irq(void);
 extern void __init pxa3xx_map_io(void);
arch/arm/mach-pxa/lubbock.c +0 -1
index b742708..53b1d25 100644
@@ -56,7 +56,6 @@
 #include <mach/smemc.h>
 
 #include "generic.h"
-#include "clock.h"
 #include "devices.h"
 
 static unsigned long lubbock_pin_config[] __initdata = {
arch/arm/mach-pxa/pxa25x.c +0 -1
index 70e6d0e..23a90c6 100644
@@ -38,7 +38,6 @@
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 /*
  * Various clock factors driven by the CCCR register.
arch/arm/mach-pxa/pxa300.c +1 -19
index 17cbc0c..28c5b56 100644
@@ -22,7 +22,6 @@
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 static struct mfp_addr_map pxa300_mfp_addr_map[] __initdata = {
 
@@ -84,32 +83,15 @@ static struct mfp_addr_map pxa310_mfp_addr_map[] __initdata = {
 	MFP_ADDR_END,
 };
 
-static DEFINE_PXA3_CKEN(common_nand, NAND, 156000000, 0);
-static DEFINE_PXA3_CKEN(gcu, PXA300_GCU, 0, 0);
-
-static struct clk_lookup common_clkregs[] = {
-	INIT_CLKREG(&clk_common_nand, "pxa3xx-nand", NULL),
-	INIT_CLKREG(&clk_gcu, "pxa3xx-gcu", NULL),
-};
-
-static DEFINE_PXA3_CKEN(pxa310_mmc3, MMC3, 19500000, 0);
-
-static struct clk_lookup pxa310_clkregs[] = {
-	INIT_CLKREG(&clk_pxa310_mmc3, "pxa2xx-mci.2", NULL),
-};
-
 static int __init pxa300_init(void)
 {
 	if (cpu_is_pxa300() || cpu_is_pxa310()) {
 		mfp_init_base(io_p2v(MFPR_BASE));
 		mfp_init_addr(pxa300_mfp_addr_map);
-		clkdev_add_table(ARRAY_AND_SIZE(common_clkregs));
 	}
 
-	if (cpu_is_pxa310()) {
+	if (cpu_is_pxa310())
 		mfp_init_addr(pxa310_mfp_addr_map);
-		clkdev_add_table(ARRAY_AND_SIZE(pxa310_clkregs));
-	}
 
 	return 0;
 }
arch/arm/mach-pxa/pxa320.c +0 -10
index 6dc99d4..2f55bb4 100644
@@ -22,7 +22,6 @@
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 static struct mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
 
@@ -78,20 +77,11 @@ static struct mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
 	MFP_ADDR_END,
 };
 
-static DEFINE_PXA3_CKEN(pxa320_nand, NAND, 104000000, 0);
-static DEFINE_PXA3_CKEN(gcu, PXA320_GCU, 0, 0);
-
-static struct clk_lookup pxa320_clkregs[] = {
-	INIT_CLKREG(&clk_pxa320_nand, "pxa3xx-nand", NULL),
-	INIT_CLKREG(&clk_gcu, "pxa3xx-gcu", NULL),
-};
-
 static int __init pxa320_init(void)
 {
 	if (cpu_is_pxa320()) {
 		mfp_init_base(io_p2v(MFPR_BASE));
 		mfp_init_addr(pxa320_mfp_addr_map);
-		clkdev_add_table(ARRAY_AND_SIZE(pxa320_clkregs));
 	}
 
 	return 0;
arch/arm/mach-pxa/pxa3xx.c +0 -59

82 lines not on this page · raw message

arch/arm/mach-pxa/raumfeld.c +0 -1
index a762b23..2bc9a3f 100644
@@ -56,7 +56,6 @@
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 /* common GPIO	definitions */
 
arch/arm/mach-pxa/tosa.c +0 -1
index 7780d1fa..93bf4ef 100644
@@ -58,7 +58,6 @@
 #include <asm/mach/sharpsl_param.h>
 
 #include "generic.h"
-#include "clock.h"
 #include "devices.h"
 
 static unsigned long tosa_pin_config[] = {
Signature · 1 line
2.1.0
author maintainer
#3 lore raw

cover Switch pxa architecture to clock framework

In reply to Robert Jarzmik
Quoted 9 lines · Robert Jarzmik

This is it, everything looks ready for the leap of faith.

This serie removes all legacy clock code, and pxa25x, pxa27x and pxa3xx are migrated to clock framework. This serie was tested on lubbock (pxa250), mioa701 (pxa270) and zylonite (pxa310). I plan to test also cm-x300 and mainstone in the near future.

This has the potential to break many pxa boards. The more test it receives, the better. I'd like this to hit v3.21.

I'll tentatively queue that up in pxa/for-next, as cm-x300 is also up and running. If if the next 4 weeks the tests are still giving green lights, then 4.1 will be the leap of faith for clocks.

This will settle one of the milestones, ie. several platforms (pxa3xx and pxa27x) do work in both legacy and device-tree mode, with a subset of drivers.

The remaining parts I forsee are :
- dmaengine conversion
This is underway, but might take 1 or 2 cycles.
- pxafb driver device-tree support

Cheers.

--
Robert