MCF5208 timer fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2926 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
d315c8886b
commit
6d9db39cd9
11
hw/mcf5208.c
11
hw/mcf5208.c
|
@ -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);
|
prescale = 1 << ((s->pcsr & PCSR_PRE_MASK) >> PCSR_PRE_SHIFT);
|
||||||
ptimer_set_freq(s->timer, (SYS_FREQ / 2) / prescale);
|
ptimer_set_freq(s->timer, (SYS_FREQ / 2) / prescale);
|
||||||
if (s->pcsr & PCSR_RLD)
|
if (s->pcsr & PCSR_RLD)
|
||||||
limit = 0xffff;
|
|
||||||
else
|
|
||||||
limit = s->pmr;
|
limit = s->pmr;
|
||||||
|
else
|
||||||
|
limit = 0xffff;
|
||||||
ptimer_set_limit(s->timer, limit, 0);
|
ptimer_set_limit(s->timer, limit, 0);
|
||||||
|
|
||||||
if (s->pcsr & PCSR_EN)
|
if (s->pcsr & PCSR_EN)
|
||||||
|
@ -73,9 +73,12 @@ static void m5208_timer_write(m5208_timer_state *s, int offset,
|
||||||
case 2:
|
case 2:
|
||||||
s->pmr = value;
|
s->pmr = value;
|
||||||
s->pcsr &= ~PCSR_PIF;
|
s->pcsr &= ~PCSR_PIF;
|
||||||
if (s->pcsr & PCSR_RLD)
|
if ((s->pcsr & PCSR_RLD) == 0) {
|
||||||
value = 0xffff;
|
if (s->pcsr & PCSR_OVW)
|
||||||
|
ptimer_set_count(s->timer, value);
|
||||||
|
} else {
|
||||||
ptimer_set_limit(s->timer, value, s->pcsr & PCSR_OVW);
|
ptimer_set_limit(s->timer, value, s->pcsr & PCSR_OVW);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue