aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2013-11-12 14:56:02 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2013-12-20 05:44:06 -0500
commit5e3e27637959155bf3b06f52c5fbe9e9b0ffbdfe (patch)
treea2198e45c72382457e0449b9f8bb69d0cb9e38bc /arch
parentdc2fc2270cba696bd1211124f43efd2d6476808c (diff)
ARM: netx: stop using mach/timex.h
mach/timex.h is the last remaining header that is unused for multiarch builds but necessary for singlearch builds. To allow to get rid of it for singlearch builds, too, drop its usage in netx arch code by substituting CLOCK_TICK_RATE and LATCH by a local cpp symbol. Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-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 6df42e643031..e2346013e227 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}