summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
authorJingchang Lu <b35083@freescale.com>2012-08-07 15:14:15 +0800
committerJustin Waters <justin.waters@timesys.com>2012-09-12 16:50:04 -0400
commit0403e7a68819f629b9a9cc1fd32de8ae01494924 (patch)
tree5772b50b772c43d644c29032c1d7a41a58d2665f /arch/arm/plat-mxc
parent823f71fa53d6c73fae9eca9a1199807f742d51ce (diff)
ENGR00219461:Fix high resolution timer support Faraday
Signed-off-by: Jingchang Lu <b35083@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r--arch/arm/plat-mxc/pit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/arm/plat-mxc/pit.c b/arch/arm/plat-mxc/pit.c
index 1d13a2817bbb..ba71bda51c06 100644
--- a/arch/arm/plat-mxc/pit.c
+++ b/arch/arm/plat-mxc/pit.c
@@ -20,7 +20,6 @@
*/
#include <asm/sched_clock.h>
-static unsigned long pit_cnt;
#define PITMCR 0x00
#define PITLTMR64H 0xE0
@@ -57,6 +56,7 @@ static unsigned long pit_cnt;
#include <asm/mach/time.h>
#include <mach/common.h>
+static cycle_t pit_cnt;
static struct clock_event_device clockevent_pit;
static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
@@ -105,7 +105,7 @@ static int __init pit_clocksource_init(struct clk *timer_clk)
init_sched_clock(&cd, mvf_update_sched_clock, 32, c);
return clocksource_mmio_init(timer_base + PITOFFSET + PITCVAL, "pit",
- c, 0, 32,
+ c, 200, 32,
pit_read_clk/*clocksource_mmio_readl_down*/);
}
@@ -191,8 +191,8 @@ static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
static cycle_t pit_read_clk(struct clocksource *cs)
{
unsigned long flags;
- u32 cycles;
- u16 pcntr;
+ cycle_t cycles;
+ u32 pcntr;
local_irq_save(flags);
pcntr = __raw_readl(timer_base + PITOFFSET + PITCVAL);
@@ -211,7 +211,7 @@ static struct irqaction pit_timer_irq = {
static struct clock_event_device clockevent_pit = {
.name = "pit",
- .features = CLOCK_EVT_FEAT_PERIODIC,
+ .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
.shift = 32,
.set_mode = pit_set_mode,
.set_next_event = pit_set_next_event,
@@ -246,6 +246,7 @@ void __init pit_timer_init(struct clk *timer_clk, void __iomem *base, int irq)
*/
__raw_writel(0x0, timer_base + PITMCR);
+ __raw_writel(0, timer_base + PITOFFSET + PITTCTRL);
__raw_writel(0xffffffff, timer_base + PITOFFSET + PITLDVAL);
__raw_writel(PITTCTRL_TEN, timer_base + PITOFFSET + PITTCTRL);