~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/arm/mach-msm/timer.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <linux/io.h>
24
24
 
25
25
#include <asm/mach/time.h>
 
26
#include <asm/hardware/gic.h>
 
27
 
26
28
#include <mach/msm_iomap.h>
27
29
#include <mach/cpu.h>
28
30
 
55
57
#if defined(CONFIG_ARCH_QSD8X50)
56
58
#define DGT_HZ (19200000 / 4) /* 19.2 MHz / 4 by default */
57
59
#define MSM_DGT_SHIFT (0)
58
 
#elif defined(CONFIG_ARCH_MSM7X30) || defined(CONFIG_ARCH_MSM8X60) || \
59
 
                                      defined(CONFIG_ARCH_MSM8960)
 
60
#elif defined(CONFIG_ARCH_MSM7X30)
60
61
#define DGT_HZ (24576000 / 4) /* 24.576 MHz (LPXO) / 4 by default */
61
62
#define MSM_DGT_SHIFT (0)
 
63
#elif defined(CONFIG_ARCH_MSM8X60) || defined(CONFIG_ARCH_MSM8960)
 
64
#define DGT_HZ (27000000 / 4) /* 27 MHz (PXO) / 4 by default */
 
65
#define MSM_DGT_SHIFT (0)
62
66
#else
63
67
#define DGT_HZ 19200000 /* 19.2 MHz or 600 KHz after shift */
64
68
#define MSM_DGT_SHIFT (5)
100
104
{
101
105
        struct msm_clock *clk = container_of(cs, struct msm_clock, clocksource);
102
106
 
103
 
        return readl(clk->global_counter);
 
107
        /*
 
108
         * Shift timer count down by a constant due to unreliable lower bits
 
109
         * on some targets.
 
110
         */
 
111
        return readl(clk->global_counter) >> clk->shift;
104
112
}
105
113
 
106
114
static struct msm_clock *clockevent_to_clock(struct clock_event_device *evt)
269
277
 
270
278
        /* Use existing clock_event for cpu 0 */
271
279
        if (!smp_processor_id())
272
 
                return;
 
280
                return 0;
273
281
 
274
282
        writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL);
275
283