Skip to content

Commit

Permalink
drivers: timer: Disable prescalar for TI DM Timer
Browse files Browse the repository at this point in the history
The timer count calculations are done with the assumption that the
prescalar is disabled. When using u-boot's SPL as an early boot stage,
the omap timer driver enables the prescalar leaving this driver to
calculate incorrect counts. So explicitly disable the prescalar to match
the driver expectation.

Signed-off-by: Abe Kohandel <[email protected]>
  • Loading branch information
ekohandel authored and nashif committed Nov 27, 2024
1 parent db290a6 commit 5d5407e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/timer/ti_dmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ static int sys_clock_driver_init(void)

IRQ_CONNECT(TIMER_IRQ_NUM, TIMER_IRQ_PRIO, ti_dmtimer_isr, NULL, TIMER_IRQ_FLAGS);

/* Disable prescalar */
TI_DM_TIMER_WRITE(0, TCLR, PRE);

/* Select autoreload mode */
TI_DM_TIMER_WRITE(1, TCLR, AR);

Expand Down

0 comments on commit 5d5407e

Please sign in to comment.