static inline void omap_mpu_timer_start(int nr, unsigned long load_val) { volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); timer->cntl = MPU_TIMER_CLOCK_ENABLE; udelay(1); timer->load_tim = load_val; udelay(1); timer->cntl = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_AR | MPU_TIMER_ST); }
static void __init omap_init_clocksource(unsigned long rate) { omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(1); static char err[] __initdata = KERN_ERR "%s: can't register clocksource!\n"; omap_mpu_timer_start(1, ~0, 1); init_sched_clock(&cd, mpu_update_sched_clock, 32, rate); if (clocksource_mmio_init(&timer->read_tim, "mpu_timer2", rate, 300, 32, clocksource_mmio_readl_down)) printk(err, "mpu_timer2"); }
static inline void omap_mpu_timer_start(int nr, unsigned long load_val, int autoreset) { volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); unsigned int timerflags = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST); if (autoreset) timerflags |= MPU_TIMER_AR; timer->cntl = MPU_TIMER_CLOCK_ENABLE; udelay(1); timer->load_tim = load_val; udelay(1); timer->cntl = timerflags; }
static inline void omap_mpu_timer_start(int nr, unsigned long load_val, int autoreset) { omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); unsigned int timerflags = MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST; if (autoreset) timerflags |= MPU_TIMER_AR; writel(MPU_TIMER_CLOCK_ENABLE, &timer->cntl); udelay(1); writel(load_val, &timer->load_tim); udelay(1); writel(timerflags, &timer->cntl); }
static inline void omap_mpu_remove_autoreset(int nr) { omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); writel(readl(&timer->cntl) & ~MPU_TIMER_AR, &timer->cntl); }
static inline unsigned long notrace omap_mpu_timer_read(int nr) { omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); return readl(&timer->read_tim); }
static inline void omap_mpu_timer_stop(int nr) { omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr); writel(readl(&timer->cntl) & ~MPU_TIMER_ST, &timer->cntl); }
static inline void omap_mpu_remove_autoreset(int nr) { volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); timer->cntl = timer->cntl & ~MPU_TIMER_AR; }
static inline unsigned long omap_mpu_timer_read(int nr) { volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); return timer->read_tim; }
static inline void omap_mpu_timer_stop(int nr) { volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); timer->cntl &= ~MPU_TIMER_ST; }