In order to handle counter overflows use 64 bit values for counter.
Also load the initial value during probe.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
{
struct omap_timer_priv *priv = dev_get_priv(dev);
- *count = readl(&priv->regs->tcrr);
+ *count = timer_conv_64(readl(&priv->regs->tcrr));
return 0;
}
/* start the counter ticking up, reload value on overflow */
writel(0, &priv->regs->tldr);
+ writel(0, &priv->regs->tcrr);
/* enable timer */
writel((CONFIG_SYS_PTV << 2) | TCLR_PRE_EN | TCLR_AUTO_RELOAD |
TCLR_START, &priv->regs->tclr);