diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-msm/include/mach/msm_iomap-8x60.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-msm/timer.c | 23 |
2 files changed, 28 insertions, 2 deletions
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h index c9aa52d6350b..88df7ca96f2d 100644 --- a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h +++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h | |||
@@ -58,4 +58,11 @@ | |||
58 | #define MSM_SHARED_RAM_BASE IOMEM(0xF0100000) | 58 | #define MSM_SHARED_RAM_BASE IOMEM(0xF0100000) |
59 | #define MSM_SHARED_RAM_SIZE SZ_1M | 59 | #define MSM_SHARED_RAM_SIZE SZ_1M |
60 | 60 | ||
61 | #define MSM_TMR_BASE IOMEM(0xF0200000) | ||
62 | #define MSM_TMR_PHYS 0x02000000 | ||
63 | #define MSM_TMR_SIZE (SZ_1M) | ||
64 | |||
65 | #define MSM_GPT_BASE (MSM_TMR_BASE + 0x4) | ||
66 | #define MSM_DGT_BASE (MSM_TMR_BASE + 0x24) | ||
67 | |||
61 | #endif | 68 | #endif |
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index dec5ca622d7d..7689848ec680 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #ifndef MSM_DGT_BASE | 28 | #ifndef MSM_DGT_BASE |
29 | #define MSM_DGT_BASE (MSM_GPT_BASE + 0x10) | 29 | #define MSM_DGT_BASE (MSM_GPT_BASE + 0x10) |
30 | #endif | 30 | #endif |
31 | #define MSM_DGT_SHIFT (5) | ||
32 | 31 | ||
33 | #define TIMER_MATCH_VAL 0x0000 | 32 | #define TIMER_MATCH_VAL 0x0000 |
34 | #define TIMER_COUNT_VAL 0x0004 | 33 | #define TIMER_COUNT_VAL 0x0004 |
@@ -36,12 +35,28 @@ | |||
36 | #define TIMER_ENABLE_CLR_ON_MATCH_EN 2 | 35 | #define TIMER_ENABLE_CLR_ON_MATCH_EN 2 |
37 | #define TIMER_ENABLE_EN 1 | 36 | #define TIMER_ENABLE_EN 1 |
38 | #define TIMER_CLEAR 0x000C | 37 | #define TIMER_CLEAR 0x000C |
39 | 38 | #define DGT_CLK_CTL 0x0034 | |
39 | enum { | ||
40 | DGT_CLK_CTL_DIV_1 = 0, | ||
41 | DGT_CLK_CTL_DIV_2 = 1, | ||
42 | DGT_CLK_CTL_DIV_3 = 2, | ||
43 | DGT_CLK_CTL_DIV_4 = 3, | ||
44 | }; | ||
40 | #define CSR_PROTECTION 0x0020 | 45 | #define CSR_PROTECTION 0x0020 |
41 | #define CSR_PROTECTION_EN 1 | 46 | #define CSR_PROTECTION_EN 1 |
42 | 47 | ||
43 | #define GPT_HZ 32768 | 48 | #define GPT_HZ 32768 |
49 | |||
50 | #if defined(CONFIG_ARCH_QSD8X50) | ||
51 | #define DGT_HZ (19200000 / 4) /* 19.2 MHz / 4 by default */ | ||
52 | #define MSM_DGT_SHIFT (0) | ||
53 | #elif defined(CONFIG_ARCH_MSM7X30) || defined(CONFIG_ARCH_MSM8X60) | ||
54 | #define DGT_HZ (24576000 / 4) /* 24.576 MHz (LPXO) / 4 by default */ | ||
55 | #define MSM_DGT_SHIFT (0) | ||
56 | #else | ||
44 | #define DGT_HZ 19200000 /* 19.2 MHz or 600 KHz after shift */ | 57 | #define DGT_HZ 19200000 /* 19.2 MHz or 600 KHz after shift */ |
58 | #define MSM_DGT_SHIFT (5) | ||
59 | #endif | ||
45 | 60 | ||
46 | struct msm_clock { | 61 | struct msm_clock { |
47 | struct clock_event_device clockevent; | 62 | struct clock_event_device clockevent; |
@@ -170,6 +185,10 @@ static void __init msm_timer_init(void) | |||
170 | int i; | 185 | int i; |
171 | int res; | 186 | int res; |
172 | 187 | ||
188 | #ifdef CONFIG_ARCH_MSM8X60 | ||
189 | writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL); | ||
190 | #endif | ||
191 | |||
173 | for (i = 0; i < ARRAY_SIZE(msm_clocks); i++) { | 192 | for (i = 0; i < ARRAY_SIZE(msm_clocks); i++) { |
174 | struct msm_clock *clock = &msm_clocks[i]; | 193 | struct msm_clock *clock = &msm_clocks[i]; |
175 | struct clock_event_device *ce = &clock->clockevent; | 194 | struct clock_event_device *ce = &clock->clockevent; |