Commit 6d9db39c authored by pbrook's avatar pbrook
Browse files

MCF5208 timer fix.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2926 c046a42c-6fe2-441c-8c8c-71466251a162
parent d315c888
......@@ -62,9 +62,9 @@ static void m5208_timer_write(m5208_timer_state *s, int offset,
prescale = 1 << ((s->pcsr & PCSR_PRE_MASK) >> PCSR_PRE_SHIFT);
ptimer_set_freq(s->timer, (SYS_FREQ / 2) / prescale);
if (s->pcsr & PCSR_RLD)
limit = 0xffff;
else
limit = s->pmr;
else
limit = 0xffff;
ptimer_set_limit(s->timer, limit, 0);
if (s->pcsr & PCSR_EN)
......@@ -73,9 +73,12 @@ static void m5208_timer_write(m5208_timer_state *s, int offset,
case 2:
s->pmr = value;
s->pcsr &= ~PCSR_PIF;
if (s->pcsr & PCSR_RLD)
value = 0xffff;
ptimer_set_limit(s->timer, value, s->pcsr & PCSR_OVW);
if ((s->pcsr & PCSR_RLD) == 0) {
if (s->pcsr & PCSR_OVW)
ptimer_set_count(s->timer, value);
} else {
ptimer_set_limit(s->timer, value, s->pcsr & PCSR_OVW);
}
break;
case 4:
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment