mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-30 11:01:33 +00:00
dm: omap-timer: Use 64bit for counter values
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>
This commit is contained in:
parent
c76382ff7f
commit
3ee15a5180
1 changed files with 2 additions and 1 deletions
|
@ -51,7 +51,7 @@ static int omap_timer_get_count(struct udevice *dev, u64 *count)
|
||||||
{
|
{
|
||||||
struct omap_timer_priv *priv = dev_get_priv(dev);
|
struct omap_timer_priv *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
*count = readl(&priv->regs->tcrr);
|
*count = timer_conv_64(readl(&priv->regs->tcrr));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ static int omap_timer_probe(struct udevice *dev)
|
||||||
|
|
||||||
/* start the counter ticking up, reload value on overflow */
|
/* start the counter ticking up, reload value on overflow */
|
||||||
writel(0, &priv->regs->tldr);
|
writel(0, &priv->regs->tldr);
|
||||||
|
writel(0, &priv->regs->tcrr);
|
||||||
/* enable timer */
|
/* enable timer */
|
||||||
writel((CONFIG_SYS_PTV << 2) | TCLR_PRE_EN | TCLR_AUTO_RELOAD |
|
writel((CONFIG_SYS_PTV << 2) | TCLR_PRE_EN | TCLR_AUTO_RELOAD |
|
||||||
TCLR_START, &priv->regs->tclr);
|
TCLR_START, &priv->regs->tclr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue