[PATCH 7/7] ARM: vexpress: add smp_twd clock

Rob Herring robherring2 at gmail.com
Wed Jan 12 18:32:03 EST 2011


From: Rob Herring <rob.herring at calxeda.com>

Add smp_twd clock and call twd_timer_init to enable using it.

Signed-off-by: Rob Herring <rob.herring at calxeda.com>
---
 arch/arm/mach-vexpress/ct-ca9x4.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index db4614c..62d5a2d 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -53,9 +53,6 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {
 
 static void __init ct_ca9x4_map_io(void)
 {
-#ifdef CONFIG_LOCAL_TIMERS
-	twd_base = MMIO_P2V(A9_MPCORE_TWD);
-#endif
 	v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
 }
 
@@ -183,10 +180,17 @@ static struct clk osc1_clk = {
 	.rate	= 24000000,
 };
 
+static struct clk twd_clk = {
+	.rate	= 200000000,
+};
+
 static struct clk_lookup lookups[] = {
 	{	/* CLCD */
 		.dev_id		= "ct:clcd",
 		.clk		= &osc1_clk,
+	}, {	/* TWD */
+		.dev_id		= "smp_twd",
+		.clk		= &twd_clk,
 	},
 };
 
@@ -194,6 +198,10 @@ static void __init ct_ca9x4_init_early(void)
 {
 	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 	v2m_init_early();
+
+#ifdef CONFIG_LOCAL_TIMERS
+	twd_timer_init(MMIO_P2V(A9_MPCORE_TWD));
+#endif
 }
 
 static struct resource pmu_resources[] = {
-- 
1.7.1




More information about the linux-arm-kernel mailing list