diff options
| -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 | ||||
| -rw-r--r-- | arch/arm/plat-omap/Kconfig | 8 | ||||
| -rw-r--r-- | arch/arm/plat-omap/counter_32k.c | 5 | ||||
| -rw-r--r-- | arch/arm/plat-omap/include/plat/common.h | 1 |
7 files changed, 47 insertions, 33 deletions
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 8d2f2daba0c..e0a028161dd 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 6ee19504845..ba6009f2767 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 a39a15e4f3f..b03f34d55d8 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 20cfbcc6c60..13d7b8f145b 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 | }; | ||
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 18fe3cb195d..b6333ae3f92 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
| @@ -144,12 +144,9 @@ config OMAP_IOMMU_DEBUG | |||
| 144 | config OMAP_IOMMU_IVA2 | 144 | config OMAP_IOMMU_IVA2 |
| 145 | bool | 145 | bool |
| 146 | 146 | ||
| 147 | choice | ||
| 148 | prompt "System timer" | ||
| 149 | default OMAP_32K_TIMER if !ARCH_OMAP15XX | ||
| 150 | |||
| 151 | config OMAP_MPU_TIMER | 147 | config OMAP_MPU_TIMER |
| 152 | bool "Use mpu timer" | 148 | bool "Use mpu timer" |
| 149 | depends on ARCH_OMAP1 | ||
| 153 | help | 150 | help |
| 154 | Select this option if you want to use the OMAP mpu timer. This | 151 | Select this option if you want to use the OMAP mpu timer. This |
| 155 | timer provides more intra-tick resolution than the 32KHz timer, | 152 | timer provides more intra-tick resolution than the 32KHz timer, |
| @@ -158,6 +155,7 @@ config OMAP_MPU_TIMER | |||
| 158 | config OMAP_32K_TIMER | 155 | config OMAP_32K_TIMER |
| 159 | bool "Use 32KHz timer" | 156 | bool "Use 32KHz timer" |
| 160 | depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS | 157 | depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS |
| 158 | default y if (ARCH_OMAP16XX || ARCH_OMAP2PLUS) | ||
| 161 | help | 159 | help |
| 162 | Select this option if you want to enable the OMAP 32KHz timer. | 160 | Select this option if you want to enable the OMAP 32KHz timer. |
| 163 | This timer saves power compared to the OMAP_MPU_TIMER, and has | 161 | This timer saves power compared to the OMAP_MPU_TIMER, and has |
| @@ -165,8 +163,6 @@ config OMAP_32K_TIMER | |||
| 165 | intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is | 163 | intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is |
| 166 | currently only available for OMAP16XX, 24XX, 34XX and OMAP4. | 164 | currently only available for OMAP16XX, 24XX, 34XX and OMAP4. |
| 167 | 165 | ||
| 168 | endchoice | ||
| 169 | |||
| 170 | config OMAP3_L2_AUX_SECURE_SAVE_RESTORE | 166 | config OMAP3_L2_AUX_SECURE_SAVE_RESTORE |
| 171 | bool "OMAP3 HS/EMU save and restore for L2 AUX control register" | 167 | bool "OMAP3 HS/EMU save and restore for L2 AUX control register" |
| 172 | depends on ARCH_OMAP3 && PM | 168 | depends on ARCH_OMAP3 && PM |
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c index 0367998ff68..5d7b08b5a13 100644 --- a/arch/arm/plat-omap/counter_32k.c +++ b/arch/arm/plat-omap/counter_32k.c | |||
| @@ -36,8 +36,6 @@ | |||
| 36 | 36 | ||
| 37 | #define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 | 37 | #define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 |
| 38 | 38 | ||
| 39 | #if !(defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP15XX)) | ||
| 40 | |||
| 41 | #include <linux/clocksource.h> | 39 | #include <linux/clocksource.h> |
| 42 | 40 | ||
| 43 | /* | 41 | /* |
| @@ -195,6 +193,3 @@ int __init omap_init_clocksource_32k(void) | |||
| 195 | } | 193 | } |
| 196 | return 0; | 194 | return 0; |
| 197 | } | 195 | } |
| 198 | |||
| 199 | #endif /* !(defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP15XX)) */ | ||
| 200 | |||
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h index 84c707f713b..ef683e01701 100644 --- a/arch/arm/plat-omap/include/plat/common.h +++ b/arch/arm/plat-omap/include/plat/common.h | |||
| @@ -35,6 +35,7 @@ struct sys_timer; | |||
| 35 | 35 | ||
| 36 | extern void omap_map_common_io(void); | 36 | extern void omap_map_common_io(void); |
| 37 | extern struct sys_timer omap_timer; | 37 | extern struct sys_timer omap_timer; |
| 38 | extern bool omap_32k_timer_init(void); | ||
| 38 | extern int __init omap_init_clocksource_32k(void); | 39 | extern int __init omap_init_clocksource_32k(void); |
| 39 | 40 | ||
| 40 | extern void omap_reserve(void); | 41 | extern void omap_reserve(void); |
