aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp/time.c
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2009-12-04 09:41:28 -0500
committerEric Miao <eric.y.miao@gmail.com>2010-03-01 18:40:55 -0500
commit2f7e8faef5a50efaa1c173e99bdaa29e0129bb99 (patch)
treec73ae01004e110a87b7cf6cae686b9c142e2a63b /arch/arm/mach-mmp/time.c
parent978da5bcdb33f6e030fa3304662e2455a018f1b0 (diff)
[ARM] mmp: add support for Marvell MMP2
Marvell MMP2 (aka ARMADA610) is a SoC based on PJ4 core. It's ARMv6 compatible. Support basic interrupt handler and timer, and basic support for MMP2 based FLINT platform. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-mmp/time.c')
-rw-r--r--arch/arm/mach-mmp/time.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index a8400bb891e7..cf75694e9687 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -30,7 +30,10 @@
30 30
31#include <mach/addr-map.h> 31#include <mach/addr-map.h>
32#include <mach/regs-timers.h> 32#include <mach/regs-timers.h>
33#include <mach/regs-apbc.h>
33#include <mach/irqs.h> 34#include <mach/irqs.h>
35#include <mach/cputype.h>
36#include <asm/mach/time.h>
34 37
35#include "clock.h" 38#include "clock.h"
36 39
@@ -158,7 +161,7 @@ static void __init timer_config(void)
158 161
159 __raw_writel(cer & ~0x1, TIMERS_VIRT_BASE + TMR_CER); /* disable */ 162 __raw_writel(cer & ~0x1, TIMERS_VIRT_BASE + TMR_CER); /* disable */
160 163
161 ccr &= TMR_CCR_CS_0(0x3); 164 ccr &= (cpu_is_mmp2()) ? TMR_CCR_CS_0(0) : TMR_CCR_CS_0(3);
162 __raw_writel(ccr, TIMERS_VIRT_BASE + TMR_CCR); 165 __raw_writel(ccr, TIMERS_VIRT_BASE + TMR_CCR);
163 166
164 /* free-running mode */ 167 /* free-running mode */
@@ -197,3 +200,24 @@ void __init timer_init(int irq)
197 clocksource_register(&cksrc); 200 clocksource_register(&cksrc);
198 clockevents_register_device(&ckevt); 201 clockevents_register_device(&ckevt);
199} 202}
203
204static void __init mmp2_timer_init(void)
205{
206 unsigned long clk_rst;
207
208 __raw_writel(APBC_APBCLK | APBC_RST, APBC_MMP2_TIMERS);
209
210 /*
211 * enable bus/functional clock, enable 6.5MHz (divider 4),
212 * release reset
213 */
214 clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1);
215 __raw_writel(clk_rst, APBC_MMP2_TIMERS);
216
217 timer_init(IRQ_MMP2_TIMER1);
218}
219
220struct sys_timer mmp2_timer = {
221 .init = mmp2_timer_init,
222};
223