Skip to contentSkip to conversation

ARM: PRIMA2: convert to common clk and finish full clk tree

PATCH New Barry Song 3 participants 4 messages Aug 20, 2012 – Aug 24, 2012

Subsystems (3)
lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH v4 1/2 ARM: PRIMA2: convert to common clk and finish full clk tree

From: Binghua Duan <[email protected]>

Commit 02c981c07bc95ac1e only implements a little part of primaII clk tree due to common clk framework was not ready at that time.
This patch converts the old driver to common clk and finish the full clk tree.

---
-v4: fix a typo

 arch/arm/Kconfig              |    2 +-
 arch/arm/mach-prima2/clock.c  | 1189 ++++++++++++++++++++++++++++++++---------
 arch/arm/mach-prima2/prima2.c |    1 -
 arch/arm/mach-prima2/timer.c  |    8 +-
 4 files changed, 933 insertions(+), 267 deletions(-)
arch/arm/Kconfig +1 -1
index 6d6e18f..fb60148 100644
@@ -413,7 +413,7 @@ config ARCH_PRIMA2
 	select NO_IOPORT
 	select ARCH_REQUIRE_GPIOLIB
 	select GENERIC_CLOCKEVENTS
-	select CLKDEV_LOOKUP
+	select COMMON_CLK
 	select GENERIC_IRQ_CHIP
 	select MIGHT_HAVE_CACHE_L2X0
 	select PINCTRL
arch/arm/mach-prima2/clock.c +925 -264

1,388 lines not on this page · raw message

arch/arm/mach-prima2/prima2.c +0 -1
index 8f0429d..e9a17ae 100644
@@ -38,7 +38,6 @@ static const char *prima2cb_dt_match[] __initdata = {
 MACHINE_START(PRIMA2_EVB, "prima2cb")
 	/* Maintainer: Barry Song <[email protected]> */
 	.atag_offset	= 0x100,
-	.init_early     = sirfsoc_of_clk_init,
 	.map_io         = sirfsoc_map_lluart,
 	.init_irq	= sirfsoc_of_irq_init,
 	.timer		= &sirfsoc_timer,
arch/arm/mach-prima2/timer.c +7 -1
index f224107..d95bf25 100644
@@ -21,6 +21,8 @@
 #include <asm/sched_clock.h>
 #include <asm/mach/time.h>
 
+#include "common.h"
+
 #define SIRFSOC_TIMER_COUNTER_LO	0x0000
 #define SIRFSOC_TIMER_COUNTER_HI	0x0004
 #define SIRFSOC_TIMER_MATCH_0		0x0008
@@ -188,9 +190,13 @@ static void __init sirfsoc_clockevent_init(void)
 static void __init sirfsoc_timer_init(void)
 {
 	unsigned long rate;
+	struct clk *clk;
+
+	/* initialize clocking early, we want to set the OS timer */
+	sirfsoc_of_clk_init();
 
 	/* timer's input clock is io clock */
-	struct clk *clk = clk_get_sys("io", NULL);
+	clk = clk_get_sys("io", NULL);
 
 	BUG_ON(IS_ERR(clk));
 
Signature · 6 lines
1.7.0.4



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
author
#1 lore raw

PATCH v4 2/2 clk: prima2: move from arch/arm/mach to drivers/clk

From: Barry Song <[email protected]>

---
-v4: rename to clk-prima2 as we will have clk-marco or others

 arch/arm/mach-prima2/Makefile                      |    1 -
 drivers/clk/Makefile                               |    1 +
 .../clock.c => drivers/clk/clk-prima2.c            |    0
 3 files changed, 1 insertions(+), 1 deletions(-)
 rename arch/arm/mach-prima2/clock.c => drivers/clk/clk-prima2.c (100%)
arch/arm/mach-prima2/Makefile +0 -1
index 13dd160..841847d 100644
@@ -1,6 +1,5 @@
 obj-y := timer.o
 obj-y += irq.o
-obj-y += clock.o
 obj-y += rstc.o
 obj-y += prima2.o
 obj-y += rtciobrg.o
drivers/clk/Makefile +1 -0
index 5869ea3..d4c7253 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_ARCH_SOCFPGA)	+= socfpga/
 obj-$(CONFIG_PLAT_SPEAR)	+= spear/
 obj-$(CONFIG_ARCH_U300)		+= clk-u300.o
 obj-$(CONFIG_ARCH_INTEGRATOR)	+= versatile/
+obj-$(CONFIG_ARCH_PRIMA2)	+= clk-prima2.o
 
 # Chip specific
 obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
drivers/clk/clk-prima2.c renamed from arch/arm/mach-prima2/clock.c +0 -0
similarity index 100%
rename from arch/arm/mach-prima2/clock.c
rename to drivers/clk/clk-prima2.c
Signature · 6 lines
1.7.0.4



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
#2 lore raw

PATCH v4 1/2 ARM: PRIMA2: convert to common clk and finish full clk tree

In reply to Barry Song

Hi Mike,

can you pls merge these two patches as our discussion at:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/178760

our following many patches depend on these two.

-barry

2012/8/20 Barry Song <[email protected]>:

Quoted 11 lines

From: Binghua Duan <[email protected]>

Commit 02c981c07bc95ac1e only implements a little part of primaII clk tree due to common clk framework was not ready at that time.
This patch converts the old driver to common clk and finish the full clk tree.

---
-v4: fix a typo

#3 lore raw

PATCH v4 1/2 ARM: PRIMA2: convert to common clk and finish full clk tree

Quoting Barry Song (2012-08-21 02:44:02)

Quoted 8 lines

Hi Mike,

can you pls merge these two patches as our discussion at:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/178760

our following many patches depend on these two.

Done! Sorry about the long wait but I've been traveling for work and got sidetracked. I'm catching up on clk patches now and will push out my clk-next branch towards 3.7 this evening.

Regards,
Mike

Quoted 14 lines

-barry

2012/8/20 Barry Song <[email protected]>:

Quoted 11 lines

From: Binghua Duan <[email protected]>

Commit 02c981c07bc95ac1e only implements a little part of primaII clk tree due to common clk framework was not ready at that time.
This patch converts the old driver to common clk and finish the full clk tree.

---
-v4: fix a typo