Skip to contentSkip to conversation

clk: pxa: add pxa3xx clock driver

PATCH New Robert Jarzmik 4 participants 10 messages Jan 6, 2015 – Jan 30, 2015

Subsystems (4)
lore
Share & tools
lore

Robert Jarzmik

author maintainer
#0 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

Move pxa25x clock drivers from arch/arm/mach-pxa to driver/clk. In the move :
- convert to new clock framework legacy clocks
- provide clocks as before for platform data based boards
- provide clocks through devicetree with clk-pxa-dt

---
 drivers/clk/pxa/Makefile     |   1 +
 drivers/clk/pxa/clk-pxa3xx.c | 364 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 365 insertions(+)
 create mode 100644 drivers/clk/pxa/clk-pxa3xx.c
drivers/clk/pxa/Makefile +1 -0
index 38e9153..38e37bf 100644
@@ -1,3 +1,4 @@
 obj-y				+= clk-pxa.o
 obj-$(CONFIG_PXA25x)		+= clk-pxa25x.o
 obj-$(CONFIG_PXA27x)		+= clk-pxa27x.o
+obj-$(CONFIG_PXA3xx)		+= clk-pxa3xx.o
drivers/clk/pxa/clk-pxa3xx.c new file +364 -0

364 lines not on this page · raw message

Signature · 1 line
2.1.0
author maintainer
#1 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

Hi Daniel,

I'd need a test to see if the pxa3xx clocks are actually working. I prepared a tree in here :
git fetch https://github.com/rjarzmik/linux work/clocks-pxa

Could you make a run, and if it works for you, send me a copy of /sys/kernel/debug/clk/clk_summary please ?

I'm really curious if suspend/resume is working, as I "forgot" to include the CKENA/CKENB save/restore code.

Cheers.

--
Robert

author maintainer
#2 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

Quoted 11 lines · Robert Jarzmik

Hi Daniel,

I'd need a test to see if the pxa3xx clocks are actually working. I prepared a tree in here :
git fetch https://github.com/rjarzmik/linux work/clocks-pxa

Could you make a run, and if it works for you, send me a copy of /sys/kernel/debug/clk/clk_summary please ?

I'm really curious if suspend/resume is working, as I "forgot" to include the CKENA/CKENB save/restore code.

Hi Marek, Ezequiel and Daniel,

Would any one of you give a try to this tree (3.18-rc1 based) ? I'd like to have some testing before breaking all the pxa3xx platforms.

Cheers.

Signature · 1 line
Robert
maintainer
#3 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

In reply to Robert Jarzmik

Hi Robert,

Quoted 3 lines · Robert Jarzmik

I'd need a test to see if the pxa3xx clocks are actually working. I prepared a tree in here :
git fetch https://github.com/rjarzmik/linux work/clocks-pxa

Very sorry for the long delay on this. I finally got around to give this a try, and at a glance, things look fine.

However, I noticed a number of regressions in the PXA3xx area which I will investigate on later this week, one of which causing the system to crash on suspend. But that seems unrelated to the clocking patches, so I'd say they're good to go in the next merge window.

Will get back once I figured out the other issues that I'm seeing.

Thanks for working on this,
Daniel

author maintainer
#4 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

Quoted 9 lines · Daniel Mack

Hi Robert,

Quoted 3 lines · Robert Jarzmik

I'd need a test to see if the pxa3xx clocks are actually working. I prepared a tree in here :
git fetch https://github.com/rjarzmik/linux work/clocks-pxa

Very sorry for the long delay on this. I finally got around to give this a try, and at a glance, things look fine.

Good.

Quoted 6 lines

However, I noticed a number of regressions in the PXA3xx area which I will investigate on later this week, one of which causing the system to crash on suspend. But that seems unrelated to the clocking patches, so I'd say they're good to go in the next merge window.

Will get back once I figured out the other issues that I'm seeing.

Very well. Good hunt.

Cheers.

Signature · 1 line
Robert
#5 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

Quoted 2 lines · Robert Jarzmik
Quoted 1 line · Daniel Mack

Hi Robert,

Hi all,

sorry for the late reply. I'll not be able to dig into anything until Feb. the 5th. Feel free to ask questions, but I won't be able to hack on hardware much. Sorry

[...]

Best regards,
Marek Vasut

author maintainer
#6 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

In reply to Robert Jarzmik
Quoted 7 lines · Robert Jarzmik

Move pxa25x clock drivers from arch/arm/mach-pxa to driver/clk. In the move :
- convert to new clock framework legacy clocks
- provide clocks as before for platform data based boards
- provide clocks through devicetree with clk-pxa-dt

Hi Mike,

Would there be a change for this to land in 3.20 (only patch 1/2) ?

Of course it won't be activated, as my intention is to use 3.21 as my vehicle to swap pxa25x, pxa27x and pxa3xx to common clock framework though pxa tree.

FWIW, this was tested on the zylonite board so far.

Cheers.

--
Robert

#7 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

Quoting Robert Jarzmik (2015-01-26 15:06:45)

Quoted 10 lines
Quoted 7 lines · Robert Jarzmik

Move pxa25x clock drivers from arch/arm/mach-pxa to driver/clk. In the move :
- convert to new clock framework legacy clocks
- provide clocks as before for platform data based boards
- provide clocks through devicetree with clk-pxa-dt

Quoted 8 lines

Hi Mike,

Would there be a change for this to land in 3.20 (only patch 1/2) ?

Of course it won't be activated, as my intention is to use 3.21 as my vehicle to swap pxa25x, pxa27x and pxa3xx to common clock framework though pxa tree.

FWIW, this was tested on the zylonite board so far.

Applied patch #1 to clk-next for 3.20.

Regards,
Mike

Quoted 5 lines

Cheers.

--
Robert

author maintainer
#8 lore raw

PATCH 1/2 clk: pxa: add pxa3xx clock driver

Quoted 3 lines · Mike Turquette
Quoted 1 line

FWIW, this was tested on the zylonite board so far.

Applied patch #1 to clk-next for 3.20.

Thanks Mike.

Cheers.

Signature · 1 line
Robert
author maintainer
#9 lore raw

PATCH 2/2 arm: pxa: switch pxa3xx to clock framework

In reply to Robert Jarzmik

The pxa3xx clocks being now in place in the clock framework, remove now useless clock code. All clock handling is now in driver/clk/pxa.

---
 arch/arm/Kconfig            |  2 +-
 arch/arm/mach-pxa/Makefile  |  2 +-
 arch/arm/mach-pxa/generic.c |  2 ++
 arch/arm/mach-pxa/generic.h |  1 +
 arch/arm/mach-pxa/pxa300.c  | 19 +--------------
 arch/arm/mach-pxa/pxa320.c  |  9 -------
 arch/arm/mach-pxa/pxa3xx.c  | 59 ---------------------------------------------
 7 files changed, 6 insertions(+), 88 deletions(-)
arch/arm/Kconfig +1 -1
index 466ebc2..5afd70b 100644
@@ -611,7 +611,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/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/pxa300.c +1 -18
index 17cbc0c..a8af7cb 100644
@@ -84,32 +84,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 -9
index 6dc99d4..395c12a 100644
@@ -78,20 +78,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

Signature · 1 line
2.1.0