diff options
Diffstat (limited to 'arch/arm/mach-netx')
-rw-r--r-- | arch/arm/mach-netx/include/mach/timex.h | 20 | ||||
-rw-r--r-- | arch/arm/mach-netx/time.c | 11 |
2 files changed, 7 insertions, 24 deletions
diff --git a/arch/arm/mach-netx/include/mach/timex.h b/arch/arm/mach-netx/include/mach/timex.h deleted file mode 100644 index 1120dd0ba393..000000000000 --- a/arch/arm/mach-netx/include/mach/timex.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-netx/include/mach/timex.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 | ||
8 | * as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #define CLOCK_TICK_RATE 100000000 | ||
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 | } |