* [PATCH v2 0/3] ARM: add clock api to sp804 and smp_twd timers
@ 2010-10-02 14:34 Rob Herring
2010-10-02 14:34 ` [PATCH v2 1/3] ARM: move timer-sp.c from versatile to common Rob Herring
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Rob Herring @ 2010-10-02 14:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Rob Herring <rob.herring@smooth-stone.com>
Changes from v1:
Implement comments from Russell.
Use clk_get_sys to get twd clock.
Allow independent clocks for timer-sp clocksource and clockevent timers.
Rob Herring (3):
ARM: move timer-sp.c from versatile to common
ARM: timer-sp: support timer clock freq other than 1MHz
ARM: twd_smp: add clock api support
arch/arm/common/Makefile | 1 +
arch/arm/{plat-versatile => common}/timer-sp.c | 38 +++++++++++++++-------
arch/arm/include/asm/hardware/timer-sp.h | 2 +
arch/arm/include/asm/smp_twd.h | 1 +
arch/arm/kernel/smp_twd.c | 11 ++++++
arch/arm/mach-integrator/integrator_cp.c | 6 ++--
arch/arm/mach-realview/core.c | 6 ++--
arch/arm/mach-versatile/core.c | 6 ++--
arch/arm/mach-vexpress/ct-ca9x4.c | 6 ++--
arch/arm/mach-vexpress/v2m.c | 6 ++--
arch/arm/plat-versatile/Makefile | 1 -
arch/arm/plat-versatile/include/plat/timer-sp.h | 2 -
12 files changed, 56 insertions(+), 30 deletions(-)
rename arch/arm/{plat-versatile => common}/timer-sp.c (81%)
create mode 100644 arch/arm/include/asm/hardware/timer-sp.h
delete mode 100644 arch/arm/plat-versatile/include/plat/timer-sp.h
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/3] ARM: move timer-sp.c from versatile to common
2010-10-02 14:34 [PATCH v2 0/3] ARM: add clock api to sp804 and smp_twd timers Rob Herring
@ 2010-10-02 14:34 ` Rob Herring
2010-10-02 14:34 ` [PATCH v2 2/3] ARM: timer-sp: support timer clock freq other than 1MHz Rob Herring
2010-10-02 14:34 ` [PATCH v2 3/3] ARM: twd_smp: add clock api support Rob Herring
2 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2010-10-02 14:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Rob Herring <rob.herring@smooth-stone.com>
The timer-sp h/w used on versatile platforms can also be used for other
platforms, so move it to a common location.
Signed-off-by: Rob Herring <rob.herring@smooth-stone.com>
---
arch/arm/common/Makefile | 1 +
arch/arm/{plat-versatile => common}/timer-sp.c | 4 +---
.../plat => include/asm/hardware}/timer-sp.h | 0
arch/arm/mach-integrator/integrator_cp.c | 2 +-
arch/arm/mach-realview/core.c | 2 +-
arch/arm/mach-versatile/core.c | 2 +-
arch/arm/mach-vexpress/ct-ca9x4.c | 2 +-
arch/arm/mach-vexpress/v2m.c | 2 +-
arch/arm/plat-versatile/Makefile | 1 -
9 files changed, 7 insertions(+), 9 deletions(-)
rename arch/arm/{plat-versatile => common}/timer-sp.c (98%)
rename arch/arm/{plat-versatile/include/plat => include/asm/hardware}/timer-sp.h (100%)
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index e6e8664..e7521bc 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_ARCH_IXP2000) += uengine.o
obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
obj-$(CONFIG_COMMON_CLKDEV) += clkdev.o
+obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
diff --git a/arch/arm/plat-versatile/timer-sp.c b/arch/arm/common/timer-sp.c
similarity index 98%
rename from arch/arm/plat-versatile/timer-sp.c
rename to arch/arm/common/timer-sp.c
index fb0d1c2..4740313 100644
--- a/arch/arm/plat-versatile/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/plat-versatile/timer-sp.c
+ * linux/arch/arm/common/timer-sp.c
*
* Copyright (C) 1999 - 2003 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
@@ -26,8 +26,6 @@
#include <asm/hardware/arm_timer.h>
-#include <plat/timer-sp.h>
-
/*
* These timers are currently always setup to be clocked at 1MHz.
*/
diff --git a/arch/arm/plat-versatile/include/plat/timer-sp.h b/arch/arm/include/asm/hardware/timer-sp.h
similarity index 100%
rename from arch/arm/plat-versatile/include/plat/timer-sp.h
rename to arch/arm/include/asm/hardware/timer-sp.h
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 05db40e..6c432a0 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -41,7 +41,7 @@
#include <asm/mach/map.h>
#include <asm/mach/time.h>
-#include <plat/timer-sp.h>
+#include <asm/hardware/timer-sp.h>
#include "common.h"
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 2fa38df..121c6d6 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -50,7 +50,7 @@
#include <mach/clkdev.h>
#include <mach/platform.h>
#include <mach/irqs.h>
-#include <plat/timer-sp.h>
+#include <asm/hardware/timer-sp.h>
#include "core.h"
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index e38acb0..6b93bd6 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -49,7 +49,7 @@
#include <mach/clkdev.h>
#include <mach/hardware.h>
#include <mach/platform.h>
-#include <plat/timer-sp.h>
+#include <asm/hardware/timer-sp.h>
#include "core.h"
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index efb1270..685e6ee 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -21,7 +21,7 @@
#include <mach/clkdev.h>
#include <mach/ct-ca9x4.h>
-#include <plat/timer-sp.h>
+#include <asm/hardware/timer-sp.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 817f0ad..5bc853d 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -22,7 +22,7 @@
#include <mach/clkdev.h>
#include <mach/motherboard.h>
-#include <plat/timer-sp.h>
+#include <asm/hardware/timer-sp.h>
#include "core.h"
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile
index 5cf88e8..aaa571d 100644
--- a/arch/arm/plat-versatile/Makefile
+++ b/arch/arm/plat-versatile/Makefile
@@ -1,5 +1,4 @@
obj-y := clock.o
-obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
obj-$(CONFIG_ARCH_REALVIEW) += sched-clock.o
obj-$(CONFIG_ARCH_VERSATILE) += sched-clock.o
ifeq ($(CONFIG_LEDS_CLASS),y)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] ARM: timer-sp: support timer clock freq other than 1MHz
2010-10-02 14:34 [PATCH v2 0/3] ARM: add clock api to sp804 and smp_twd timers Rob Herring
2010-10-02 14:34 ` [PATCH v2 1/3] ARM: move timer-sp.c from versatile to common Rob Herring
@ 2010-10-02 14:34 ` Rob Herring
2010-12-21 13:44 ` Russell King - ARM Linux
2010-10-02 14:34 ` [PATCH v2 3/3] ARM: twd_smp: add clock api support Rob Herring
2 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2010-10-02 14:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Rob Herring <rob.herring@smooth-stone.com>
The timer-sp code is fixed to 1MHz timer clock. Add clock api
calls to get the timer clock frequency and support for independent
clock frequencies.
Rename timer names for clocksource and clockevent to timer-sp or
the clock connection ID string if provided.
Signed-off-by: Rob Herring <rob.herring@smooth-stone.com>
---
arch/arm/common/timer-sp.c | 34 ++++++++++++++++++++++--------
arch/arm/include/asm/hardware/timer-sp.h | 4 +-
arch/arm/mach-integrator/integrator_cp.c | 4 +-
arch/arm/mach-realview/core.c | 4 +-
arch/arm/mach-versatile/core.c | 4 +-
arch/arm/mach-vexpress/ct-ca9x4.c | 4 +-
arch/arm/mach-vexpress/v2m.c | 4 +-
7 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index 4740313..1062af7 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <linux/clk.h>
+#include <linux/err.h>
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
@@ -29,9 +31,9 @@
/*
* These timers are currently always setup to be clocked at 1MHz.
*/
-#define TIMER_FREQ_KHZ (1000)
-#define TIMER_RELOAD (TIMER_FREQ_KHZ * 1000 / HZ)
+#define TIMER_FREQ_HZ (1000000)
+static unsigned long sp804_clksrc_rate = TIMER_FREQ_HZ;
static void __iomem *clksrc_base;
static cycle_t sp804_read(struct clocksource *cs)
@@ -40,7 +42,6 @@ static cycle_t sp804_read(struct clocksource *cs)
}
static struct clocksource clocksource_sp804 = {
- .name = "timer3",
.rating = 200,
.read = sp804_read,
.mask = CLOCKSOURCE_MASK(32),
@@ -48,12 +49,19 @@ static struct clocksource clocksource_sp804 = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
-void __init sp804_clocksource_init(void __iomem *base)
+void __init sp804_clocksource_init(void __iomem *base, char *clk_id)
{
+ struct clk *clk;
struct clocksource *cs = &clocksource_sp804;
+ cs->name = clk_id ? clk_id : "timer-sp";
+
clksrc_base = base;
+ clk = clk_get_sys("sp804", clk_id);
+ if (!IS_ERR(clk))
+ sp804_clksrc_rate = clk_get_rate(clk);
+
/* setup timer 0 as free-running clocksource */
writel(0, clksrc_base + TIMER_CTRL);
writel(0xffffffff, clksrc_base + TIMER_LOAD);
@@ -61,11 +69,12 @@ void __init sp804_clocksource_init(void __iomem *base)
writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
clksrc_base + TIMER_CTRL);
- cs->mult = clocksource_khz2mult(TIMER_FREQ_KHZ, cs->shift);
+ cs->mult = clocksource_khz2mult(sp804_clksrc_rate / 1000, cs->shift);
clocksource_register(cs);
}
+static unsigned long sp804_clkevt_rate = TIMER_FREQ_HZ;
static void __iomem *clkevt_base;
/*
@@ -92,7 +101,7 @@ static void sp804_set_mode(enum clock_event_mode mode,
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
- writel(TIMER_RELOAD, clkevt_base + TIMER_LOAD);
+ writel(sp804_clkevt_rate / HZ, clkevt_base + TIMER_LOAD);
ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE;
break;
@@ -122,7 +131,6 @@ static int sp804_set_next_event(unsigned long next,
}
static struct clock_event_device sp804_clockevent = {
- .name = "timer0",
.shift = 32,
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
.set_mode = sp804_set_mode,
@@ -138,14 +146,22 @@ static struct irqaction sp804_timer_irq = {
.dev_id = &sp804_clockevent,
};
-void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq)
+void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq,
+ char *clk_id)
{
+ struct clk *clk;
struct clock_event_device *evt = &sp804_clockevent;
+ evt->name = clk_id ? clk_id : "timer-sp";
+
clkevt_base = base;
+ clk = clk_get_sys("sp804", clk_id);
+ if (!IS_ERR(clk))
+ sp804_clkevt_rate = clk_get_rate(clk);
+
evt->irq = timer_irq;
- evt->mult = div_sc(TIMER_FREQ_KHZ, NSEC_PER_MSEC, evt->shift);
+ evt->mult = div_sc(sp804_clkevt_rate / 1000, NSEC_PER_MSEC, evt->shift);
evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt);
evt->min_delta_ns = clockevent_delta2ns(0xf, evt);
diff --git a/arch/arm/include/asm/hardware/timer-sp.h b/arch/arm/include/asm/hardware/timer-sp.h
index 21e75e3..dc31cb0 100644
--- a/arch/arm/include/asm/hardware/timer-sp.h
+++ b/arch/arm/include/asm/hardware/timer-sp.h
@@ -1,2 +1,2 @@
-void sp804_clocksource_init(void __iomem *);
-void sp804_clockevents_init(void __iomem *, unsigned int);
+void sp804_clocksource_init(void __iomem *, char *);
+void sp804_clockevents_init(void __iomem *, unsigned int, char *);
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 6c432a0..0b1c14a 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -589,8 +589,8 @@ static void __init intcp_timer_init(void)
writel(0, TIMER1_VA_BASE + TIMER_CTRL);
writel(0, TIMER2_VA_BASE + TIMER_CTRL);
- sp804_clocksource_init(TIMER2_VA_BASE);
- sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1);
+ sp804_clocksource_init(TIMER2_VA_BASE, NULL);
+ sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, NULL);
}
static struct sys_timer cp_timer = {
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 121c6d6..6051224 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -690,8 +690,8 @@ void __init realview_timer_init(unsigned int timer_irq)
writel(0, timer2_va_base + TIMER_CTRL);
writel(0, timer3_va_base + TIMER_CTRL);
- sp804_clocksource_init(timer3_va_base);
- sp804_clockevents_init(timer0_va_base, timer_irq);
+ sp804_clocksource_init(timer3_va_base, NULL);
+ sp804_clockevents_init(timer0_va_base, timer_irq, NULL);
}
/*
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 6b93bd6..e4d6c01 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -920,8 +920,8 @@ static void __init versatile_timer_init(void)
writel(0, TIMER2_VA_BASE + TIMER_CTRL);
writel(0, TIMER3_VA_BASE + TIMER_CTRL);
- sp804_clocksource_init(TIMER3_VA_BASE);
- sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1);
+ sp804_clocksource_init(TIMER3_VA_BASE, NULL);
+ sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, NULL);
}
struct sys_timer versatile_timer = {
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 685e6ee..48185c2 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -73,8 +73,8 @@ static void ct_ca9x4_timer_init(void)
writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL);
writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL);
- sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1));
- sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0);
+ sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1), NULL);
+ sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0, NULL);
}
static struct sys_timer ct_ca9x4_timer = {
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 5bc853d..37ad2a5 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -53,8 +53,8 @@ static void v2m_timer_init(void)
writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
- sp804_clocksource_init(MMIO_P2V(V2M_TIMER1));
- sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0);
+ sp804_clocksource_init(MMIO_P2V(V2M_TIMER1), NULL);
+ sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0, NULL);
}
struct sys_timer v2m_timer = {
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] ARM: twd_smp: add clock api support
2010-10-02 14:34 [PATCH v2 0/3] ARM: add clock api to sp804 and smp_twd timers Rob Herring
2010-10-02 14:34 ` [PATCH v2 1/3] ARM: move timer-sp.c from versatile to common Rob Herring
2010-10-02 14:34 ` [PATCH v2 2/3] ARM: timer-sp: support timer clock freq other than 1MHz Rob Herring
@ 2010-10-02 14:34 ` Rob Herring
2010-12-21 13:45 ` Russell King - ARM Linux
2 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2010-10-02 14:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Rob Herring <rob.herring@smooth-stone.com>
The private timer freq is currently dynamically detected
using jiffies count to determine the rate. This method adds
a delay to boot-up, so use the clock api instead to get the
clock rate.
Signed-off-by: Rob Herring <rob.herring@smooth-stone.com>
---
arch/arm/include/asm/smp_twd.h | 1 +
arch/arm/kernel/smp_twd.c | 11 +++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index 634f357..99383d5 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -25,5 +25,6 @@ extern void __iomem *twd_base;
void twd_timer_stop(void);
int twd_timer_ack(void);
void twd_timer_setup(struct clock_event_device *);
+void twd_timer_init(void __iomem *base);
#endif
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..be0983c 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -8,6 +8,8 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+#include <linux/clk.h>
+#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/delay.h>
@@ -151,6 +153,15 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
clockevents_register_device(clk);
}
+void __init twd_timer_init(void __iomem *base)
+{
+ struct clk *clk = clk_get_sys("smp_twd", NULL);
+ if (!IS_ERR(clk))
+ twd_timer_rate = clk_get_rate(clk);
+
+ twd_base = base;
+}
+
#ifdef CONFIG_HOTPLUG_CPU
/*
* take a local timer down
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] ARM: timer-sp: support timer clock freq other than 1MHz
2010-10-02 14:34 ` [PATCH v2 2/3] ARM: timer-sp: support timer clock freq other than 1MHz Rob Herring
@ 2010-12-21 13:44 ` Russell King - ARM Linux
2010-12-21 14:14 ` Rob Herring
0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2010-12-21 13:44 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Oct 02, 2010 at 09:34:45AM -0500, Rob Herring wrote:
> From: Rob Herring <rob.herring@smooth-stone.com>
>
> The timer-sp code is fixed to 1MHz timer clock. Add clock api
> calls to get the timer clock frequency and support for independent
> clock frequencies.
>
> Rename timer names for clocksource and clockevent to timer-sp or
> the clock connection ID string if provided.
>
> Signed-off-by: Rob Herring <rob.herring@smooth-stone.com>
As mentioned in the previous few days on the mailing list, rather than
having this code half-heartedly use the clk API, I'd much rather we did
a proper conversion. That means having the clk API up and running
earlier than we currently do on the ARM platforms.
In order to allow this to happen, I've queued an addition to the mdesc
record which provides an early hook which can be used for this kind of
early platform initialization.
So, after the next merge window, could you have another look at this
please?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] ARM: twd_smp: add clock api support
2010-10-02 14:34 ` [PATCH v2 3/3] ARM: twd_smp: add clock api support Rob Herring
@ 2010-12-21 13:45 ` Russell King - ARM Linux
2011-01-12 21:28 ` Rob Herring
0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2010-12-21 13:45 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Oct 02, 2010 at 09:34:46AM -0500, Rob Herring wrote:
> From: Rob Herring <rob.herring@smooth-stone.com>
>
> The private timer freq is currently dynamically detected
> using jiffies count to determine the rate. This method adds
> a delay to boot-up, so use the clock api instead to get the
> clock rate.
More or less the same comments go for this as well as the timer-sp code.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] ARM: timer-sp: support timer clock freq other than 1MHz
2010-12-21 13:44 ` Russell King - ARM Linux
@ 2010-12-21 14:14 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2010-12-21 14:14 UTC (permalink / raw)
To: linux-arm-kernel
On 12/21/2010 07:44 AM, Russell King - ARM Linux wrote:
> On Sat, Oct 02, 2010 at 09:34:45AM -0500, Rob Herring wrote:
>> From: Rob Herring<rob.herring@smooth-stone.com>
>>
>> The timer-sp code is fixed to 1MHz timer clock. Add clock api
>> calls to get the timer clock frequency and support for independent
>> clock frequencies.
>>
>> Rename timer names for clocksource and clockevent to timer-sp or
>> the clock connection ID string if provided.
>>
>> Signed-off-by: Rob Herring<rob.herring@smooth-stone.com>
>
> As mentioned in the previous few days on the mailing list, rather than
> having this code half-heartedly use the clk API, I'd much rather we did
> a proper conversion. That means having the clk API up and running
> earlier than we currently do on the ARM platforms.
>
> In order to allow this to happen, I've queued an addition to the mdesc
> record which provides an early hook which can be used for this kind of
> early platform initialization.
>
> So, after the next merge window, could you have another look at this
> please?
Sure, no problem.
Rob
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] ARM: twd_smp: add clock api support
2010-12-21 13:45 ` Russell King - ARM Linux
@ 2011-01-12 21:28 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2011-01-12 21:28 UTC (permalink / raw)
To: linux-arm-kernel
Russell,
On 12/21/2010 07:45 AM, Russell King - ARM Linux wrote:
> On Sat, Oct 02, 2010 at 09:34:46AM -0500, Rob Herring wrote:
>> From: Rob Herring<rob.herring@smooth-stone.com>
>>
>> The private timer freq is currently dynamically detected
>> using jiffies count to determine the rate. This method adds
>> a delay to boot-up, so use the clock api instead to get the
>> clock rate.
> More or less the same comments go for this as well as the timer-sp code.
I've implemented your requested changes for timer-sp code. The problem
with doing the same thing with smp_twd timer is I don't know what the
frequency of the timer is on various platforms or an understanding of
what their clock trees look like to do a proper implementation of the
clocks. I could make calling twd_timer_init mandatory and replace direct
setting of twd_base, but it would still fall back to calculating the
rate if no clock found. These are the current users:
mach-omap2/timer-gp.c
mach-realview/realview_eb.c
mach-realview/realview_pb11mp.c
mach-realview/realview_pbx.c
mach-s5pv310/time.c
mach-shmobile/smp-sh73a0.c
mach-tegra/timer.c
mach-ux500/cpu.c
mach-vexpress/ct-ca9x4.c
Rob
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-01-12 21:28 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-02 14:34 [PATCH v2 0/3] ARM: add clock api to sp804 and smp_twd timers Rob Herring
2010-10-02 14:34 ` [PATCH v2 1/3] ARM: move timer-sp.c from versatile to common Rob Herring
2010-10-02 14:34 ` [PATCH v2 2/3] ARM: timer-sp: support timer clock freq other than 1MHz Rob Herring
2010-12-21 13:44 ` Russell King - ARM Linux
2010-12-21 14:14 ` Rob Herring
2010-10-02 14:34 ` [PATCH v2 3/3] ARM: twd_smp: add clock api support Rob Herring
2010-12-21 13:45 ` Russell King - ARM Linux
2011-01-12 21:28 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).