aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-netx/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-netx/time.c')
-rw-r--r--arch/arm/mach-netx/time.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c
index 3177c7a40930..5fb2a590ec17 100644
--- a/arch/arm/mach-netx/time.c
+++ b/arch/arm/mach-netx/time.c
@@ -28,6 +28,9 @@
28#include <asm/mach/time.h> 28#include <asm/mach/time.h>
29#include <mach/netx-regs.h> 29#include <mach/netx-regs.h>
30 30
31#define NETX_CLOCK_FREQ 100000000
32#define NETX_LATCH DIV_ROUND_CLOSEST(NETX_CLOCK_FREQ, HZ)
33
31#define TIMER_CLOCKEVENT 0 34#define TIMER_CLOCKEVENT 0
32#define TIMER_CLOCKSOURCE 1 35#define TIMER_CLOCKSOURCE 1
33 36
@@ -41,7 +44,7 @@ static void netx_set_mode(enum clock_event_mode mode,
41 44
42 switch (mode) { 45 switch (mode) {
43 case CLOCK_EVT_MODE_PERIODIC: 46 case CLOCK_EVT_MODE_PERIODIC:
44 writel(LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 47 writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT));
45 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN | 48 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN |
46 NETX_GPIO_COUNTER_CTRL_IRQ_EN | 49 NETX_GPIO_COUNTER_CTRL_IRQ_EN |
47 NETX_GPIO_COUNTER_CTRL_RUN; 50 NETX_GPIO_COUNTER_CTRL_RUN;
@@ -114,7 +117,7 @@ void __init netx_timer_init(void)
114 /* Reset the timer value to zero */ 117 /* Reset the timer value to zero */
115 writel(0, NETX_GPIO_COUNTER_CURRENT(0)); 118 writel(0, NETX_GPIO_COUNTER_CURRENT(0));
116 119
117 writel(LATCH, NETX_GPIO_COUNTER_MAX(0)); 120 writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(0));
118 121
119 /* acknowledge interrupt */ 122 /* acknowledge interrupt */
120 writel(COUNTER_BIT(0), NETX_GPIO_IRQ); 123 writel(COUNTER_BIT(0), NETX_GPIO_IRQ);
@@ -137,11 +140,11 @@ void __init netx_timer_init(void)
137 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); 140 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE));
138 141
139 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), 142 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE),
140 "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); 143 "netx_timer", NETX_CLOCK_FREQ, 200, 32, clocksource_mmio_readl_up);
141 144
142 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. 145 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine.
143 * Adding some safety ... */ 146 * Adding some safety ... */
144 netx_clockevent.cpumask = cpumask_of(0); 147 netx_clockevent.cpumask = cpumask_of(0);
145 clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE, 148 clockevents_config_and_register(&netx_clockevent, NETX_CLOCK_FREQ,
146 0xa00, 0xfffffffe); 149 0xa00, 0xfffffffe);
147} 150}