Message ID | 4A31280E.3020601@juno.dti.ne.jp (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Fri, Jun 12, 2009 at 12:51 AM, Shin-ichiro KAWASAKI<kawasaki@juno.dti.ne.jp> wrote: > Here's the patch which suggests TMU driver modification. > > It does, > - Sets maximum value 0xffffffff to TCOR instead of zero. I agree with this change, but I have not tested it yet. > Â Then after one shot interrupt, next count down runs > Â for a while (around seconds?) > - Stops the timer in the one shot interrupt handler. > Â Then next count down does not reach to zero. I think disabling the interrupt should be enough, isn't that done with TCR already? > This patch assumes that while TMU counting down from 0xffffffff, > the interrupt handler finishes the task to stop the timer. > > I confirmed that the timer warnings from qemu-sh disappear > with this patch. Â No test is done with real hardware. > > I'm not familiar with linux clock framework. > Any comments are welcome. Is the TCOR change by itself enough to make QEMU happy? I hope so. Thanks for your help! / magnus -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Which micro processor you are talking about? H8SX Family? Regards Alle 14:06, giovedì 18 giugno 2009, Magnus Damm ha scritto: > On Fri, Jun 12, 2009 at 12:51 AM, Shin-ichiro > > KAWASAKI<kawasaki@juno.dti.ne.jp> wrote: > > Here's the patch which suggests TMU driver modification. > > > > It does, > > - Sets maximum value 0xffffffff to TCOR instead of zero. > > I agree with this change, but I have not tested it yet. > > >  Then after one shot interrupt, next count down runs > >  for a while (around seconds?) > > - Stops the timer in the one shot interrupt handler. > >  Then next count down does not reach to zero. > > I think disabling the interrupt should be enough, isn't that done with > TCR already? > > > This patch assumes that while TMU counting down from 0xffffffff, > > the interrupt handler finishes the task to stop the timer. > > > > I confirmed that the timer warnings from qemu-sh disappear > > with this patch.  No test is done with real hardware. > > > > I'm not familiar with linux clock framework. > > Any comments are welcome. > > Is the TCOR change by itself enough to make QEMU happy? I hope so. > > Thanks for your help! > > / magnus > -- > To unsubscribe from this list: send the line "unsubscribe linux-sh" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Jun 18, 2009 at 9:45 PM, Fabio
Giovagnini<fabio.giovagnini@aurion-tech.com> wrote:
> Which micro processor you are talking about? H8SX Family?
This is about the R2D-plus emulation (sh775x) in QEMU.
The sh_tmu driver should work with most 32-bit TMU channels, so this
change affects a wide range of processors. Look for TMU in your
datasheet!
/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index d6ea439..7bb0bd3 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c @@ -158,7 +158,7 @@ static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, if (periodic) sh_tmu_write(p, TCOR, delta); else - sh_tmu_write(p, TCOR, 0); + sh_tmu_write(p, TCOR, 0xffffffff); sh_tmu_write(p, TCNT, delta); @@ -171,9 +171,10 @@ static irqreturn_t sh_tmu_interrupt(int irq, void *dev_id) struct sh_tmu_priv *p = dev_id; /* disable or acknowledge interrupt */ - if (p->ced.mode == CLOCK_EVT_MODE_ONESHOT) + if (p->ced.mode == CLOCK_EVT_MODE_ONESHOT) { + sh_tmu_start_stop_ch(p, 0); sh_tmu_write(p, TCR, 0x0000); - else + } else sh_tmu_write(p, TCR, 0x0020); /* notify clockevent layer */