~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <asm/mach/time.h>
28
28
#include <asm/mach/irq.h>
29
29
 
 
30
/* Be able to sleep for atleast 4 seconds (usually more) */
 
31
#define APPTIMER_MIN_RANGE 4
 
32
 
30
33
/*
31
34
 * APP side special timer registers
32
35
 * This timer contains four timers which can fire an interrupt each.
306
309
 
307
310
/* Use general purpose timer 1 as clock event */
308
311
static struct clock_event_device clockevent_u300_1mhz = {
309
 
        .name           = "GPT1",
310
 
        .rating         = 300, /* Reasonably fast and accurate clock event */
311
 
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
312
 
        .set_next_event = u300_set_next_event,
313
 
        .set_mode       = u300_set_mode,
 
312
        .name           = "GPT1",
 
313
        .rating         = 300, /* Reasonably fast and accurate clock event */
 
314
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
 
315
        .set_next_event = u300_set_next_event,
 
316
        .set_mode       = u300_set_mode,
314
317
};
315
318
 
316
319
/* Clock event timer interrupt handler */
325
328
}
326
329
 
327
330
static struct irqaction u300_timer_irq = {
328
 
        .name           = "U300 Timer Tick",
329
 
        .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
330
 
        .handler        = u300_timer_interrupt,
 
331
        .name           = "U300 Timer Tick",
 
332
        .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
 
333
        .handler        = u300_timer_interrupt,
331
334
};
332
335
 
333
336
/*
410
413
                        "GPT2", rate, 300, 32, clocksource_mmio_readl_up))
411
414
                pr_err("timer: failed to initialize U300 clock source\n");
412
415
 
413
 
        /* Configure and register the clockevent */
414
 
        clockevents_config_and_register(&clockevent_u300_1mhz, rate,
415
 
                                        1, 0xffffffff);
416
 
 
 
416
        clockevents_calc_mult_shift(&clockevent_u300_1mhz,
 
417
                                    rate, APPTIMER_MIN_RANGE);
 
418
        /* 32bit counter, so 32bits delta is max */
 
419
        clockevent_u300_1mhz.max_delta_ns =
 
420
                clockevent_delta2ns(0xffffffff, &clockevent_u300_1mhz);
 
421
        /* This timer is slow enough to set for 1 cycle == 1 MHz */
 
422
        clockevent_u300_1mhz.min_delta_ns =
 
423
                clockevent_delta2ns(1, &clockevent_u300_1mhz);
 
424
        clockevent_u300_1mhz.cpumask = cpumask_of(0);
 
425
        clockevents_register_device(&clockevent_u300_1mhz);
417
426
        /*
418
427
         * TODO: init and register the rest of the timers too, they can be
419
428
         * used by hrtimers!