Skip to content

Commit

Permalink
jz4740_timer: Mask the "half" timer interrupts in plat_time_init(). T…
Browse files Browse the repository at this point in the history
…his fixes a hang when booting on the Dingoo A320 in USB boot mode with the Rockbox USBtool.
  • Loading branch information
mthuurne committed May 27, 2010
1 parent 8765509 commit 08d2d24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/mips/jz4740/time.c
Expand Up @@ -136,8 +136,10 @@ void __init plat_time_init(void)

jz4740_timer_set_period(TIMER_CLOCKEVENT, jz4740_jiffies_per_tick);
jz4740_timer_irq_full_enable(TIMER_CLOCKEVENT);
jz4740_timer_irq_half_disable(TIMER_CLOCKEVENT);

jz4740_timer_irq_full_disable(TIMER_CLOCKSOURCE);
jz4740_timer_irq_half_disable(TIMER_CLOCKSOURCE);
jz4740_timer_set_period(TIMER_CLOCKSOURCE, 0xffff);

jz4740_timer_enable(TIMER_CLOCKEVENT);
Expand Down
11 changes: 11 additions & 0 deletions arch/mips/jz4740/timer.h
Expand Up @@ -122,6 +122,17 @@ static inline void jz4740_timer_irq_full_disable(unsigned int timer)
writel(JZ_TIMER_IRQ_FULL(timer), jz4740_timer_base + JZ_REG_TIMER_MASK_SET);
}

static inline void jz4740_timer_irq_half_enable(unsigned int timer)
{
writel(JZ_TIMER_IRQ_HALF(timer), jz4740_timer_base + JZ_REG_TIMER_FLAG_CLEAR);
writel(JZ_TIMER_IRQ_HALF(timer), jz4740_timer_base + JZ_REG_TIMER_MASK_CLEAR);
}

static inline void jz4740_timer_irq_half_disable(unsigned int timer)
{
writel(JZ_TIMER_IRQ_HALF(timer), jz4740_timer_base + JZ_REG_TIMER_MASK_SET);
}

static inline void jz4740_timer_set_ctrl(unsigned int timer, uint16_t ctrl)
{
writew(ctrl, jz4740_timer_base + JZ_REG_TIMER_CTRL(timer));
Expand Down

0 comments on commit 08d2d24

Please sign in to comment.