diff options
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r-- | arch/arm/mach-omap1/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap1/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap1/time.c | 48 | ||||
-rw-r--r-- | arch/arm/mach-omap1/timer32k.c | 13 |
4 files changed, 44 insertions, 22 deletions
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 8d2f2daba0c0..e0a028161dde 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig | |||
@@ -9,6 +9,7 @@ config ARCH_OMAP730 | |||
9 | depends on ARCH_OMAP1 | 9 | depends on ARCH_OMAP1 |
10 | bool "OMAP730 Based System" | 10 | bool "OMAP730 Based System" |
11 | select CPU_ARM926T | 11 | select CPU_ARM926T |
12 | select OMAP_MPU_TIMER | ||
12 | select ARCH_OMAP_OTG | 13 | select ARCH_OMAP_OTG |
13 | 14 | ||
14 | config ARCH_OMAP850 | 15 | config ARCH_OMAP850 |
@@ -22,6 +23,7 @@ config ARCH_OMAP15XX | |||
22 | default y | 23 | default y |
23 | bool "OMAP15xx Based System" | 24 | bool "OMAP15xx Based System" |
24 | select CPU_ARM925T | 25 | select CPU_ARM925T |
26 | select OMAP_MPU_TIMER | ||
25 | 27 | ||
26 | config ARCH_OMAP16XX | 28 | config ARCH_OMAP16XX |
27 | depends on ARCH_OMAP1 | 29 | depends on ARCH_OMAP1 |
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index 6ee19504845f..ba6009f27677 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile | |||
@@ -3,12 +3,11 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o dma.o | 6 | obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o |
7 | obj-y += clock.o clock_data.o opp_data.o | 7 | obj-y += clock.o clock_data.o opp_data.o |
8 | 8 | ||
9 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o | 9 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o |
10 | 10 | ||
11 | obj-$(CONFIG_OMAP_MPU_TIMER) += time.o | ||
12 | obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o | 11 | obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o |
13 | 12 | ||
14 | # Power Management | 13 | # Power Management |
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index a39a15e4f3f9..b03f34d55d88 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -57,6 +57,8 @@ | |||
57 | 57 | ||
58 | #include <plat/common.h> | 58 | #include <plat/common.h> |
59 | 59 | ||
60 | #ifdef CONFIG_OMAP_MPU_TIMER | ||
61 | |||
60 | #define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE | 62 | #define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE |
61 | #define OMAP_MPU_TIMER_OFFSET 0x100 | 63 | #define OMAP_MPU_TIMER_OFFSET 0x100 |
62 | 64 | ||
@@ -236,12 +238,7 @@ static void __init omap_init_clocksource(unsigned long rate) | |||
236 | printk(err, clocksource_mpu.name); | 238 | printk(err, clocksource_mpu.name); |
237 | } | 239 | } |
238 | 240 | ||
239 | /* | 241 | static void __init omap_mpu_timer_init(void) |
240 | * --------------------------------------------------------------------------- | ||
241 | * Timer initialization | ||
242 | * --------------------------------------------------------------------------- | ||
243 | */ | ||
244 | static void __init omap_timer_init(void) | ||
245 | { | 242 | { |
246 | struct clk *ck_ref = clk_get(NULL, "ck_ref"); | 243 | struct clk *ck_ref = clk_get(NULL, "ck_ref"); |
247 | unsigned long rate; | 244 | unsigned long rate; |
@@ -256,13 +253,38 @@ static void __init omap_timer_init(void) | |||
256 | 253 | ||
257 | omap_init_mpu_timer(rate); | 254 | omap_init_mpu_timer(rate); |
258 | omap_init_clocksource(rate); | 255 | omap_init_clocksource(rate); |
259 | /* | 256 | } |
260 | * XXX Since this file seems to deal mostly with the MPU timer, | 257 | |
261 | * this doesn't seem like the correct place for the sync timer | 258 | #else |
262 | * clocksource init. | 259 | static inline void omap_mpu_timer_init(void) |
263 | */ | 260 | { |
264 | if (!cpu_is_omap7xx() && !cpu_is_omap15xx()) | 261 | pr_err("Bogus timer, should not happen\n"); |
265 | omap_init_clocksource_32k(); | 262 | } |
263 | #endif /* CONFIG_OMAP_MPU_TIMER */ | ||
264 | |||
265 | static inline int omap_32k_timer_usable(void) | ||
266 | { | ||
267 | int res = false; | ||
268 | |||
269 | if (cpu_is_omap730() || cpu_is_omap15xx()) | ||
270 | return res; | ||
271 | |||
272 | #ifdef CONFIG_OMAP_32K_TIMER | ||
273 | res = omap_32k_timer_init(); | ||
274 | #endif | ||
275 | |||
276 | return res; | ||
277 | } | ||
278 | |||
279 | /* | ||
280 | * --------------------------------------------------------------------------- | ||
281 | * Timer initialization | ||
282 | * --------------------------------------------------------------------------- | ||
283 | */ | ||
284 | static void __init omap_timer_init(void) | ||
285 | { | ||
286 | if (!omap_32k_timer_usable()) | ||
287 | omap_mpu_timer_init(); | ||
266 | } | 288 | } |
267 | 289 | ||
268 | struct sys_timer omap_timer = { | 290 | struct sys_timer omap_timer = { |
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c index 20cfbcc6c60c..13d7b8f145bd 100644 --- a/arch/arm/mach-omap1/timer32k.c +++ b/arch/arm/mach-omap1/timer32k.c | |||
@@ -52,10 +52,9 @@ | |||
52 | #include <asm/irq.h> | 52 | #include <asm/irq.h> |
53 | #include <asm/mach/irq.h> | 53 | #include <asm/mach/irq.h> |
54 | #include <asm/mach/time.h> | 54 | #include <asm/mach/time.h> |
55 | #include <plat/common.h> | ||
55 | #include <plat/dmtimer.h> | 56 | #include <plat/dmtimer.h> |
56 | 57 | ||
57 | struct sys_timer omap_timer; | ||
58 | |||
59 | /* | 58 | /* |
60 | * --------------------------------------------------------------------------- | 59 | * --------------------------------------------------------------------------- |
61 | * 32KHz OS timer | 60 | * 32KHz OS timer |
@@ -181,14 +180,14 @@ static __init void omap_init_32k_timer(void) | |||
181 | * Timer initialization | 180 | * Timer initialization |
182 | * --------------------------------------------------------------------------- | 181 | * --------------------------------------------------------------------------- |
183 | */ | 182 | */ |
184 | static void __init omap_timer_init(void) | 183 | bool __init omap_32k_timer_init(void) |
185 | { | 184 | { |
185 | omap_init_clocksource_32k(); | ||
186 | |||
186 | #ifdef CONFIG_OMAP_DM_TIMER | 187 | #ifdef CONFIG_OMAP_DM_TIMER |
187 | omap_dm_timer_init(); | 188 | omap_dm_timer_init(); |
188 | #endif | 189 | #endif |
189 | omap_init_32k_timer(); | 190 | omap_init_32k_timer(); |
190 | } | ||
191 | 191 | ||
192 | struct sys_timer omap_timer = { | 192 | return true; |
193 | .init = omap_timer_init, | 193 | } |
194 | }; | ||