mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
ARM: stm32f7: fix prescaler calculation of timer
As the timer 2 is on APB1 bus, the maximum of clock frequency of APB1 timer clock is half of SYSCLK. Then to calculate the timer prescaler for timer 2 which need to be divided by 2. Signed-off-by: Bo Shen <voice.shen@gmail.com> Reviewed-by: Vikas Manocha <vikas.manocha@st.com>
This commit is contained in:
parent
af609e3764
commit
72dee54b4e
1 changed files with 1 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ int timer_init(void)
|
|||
/* Stop the timer */
|
||||
writel(readl(&gpt1_regs_ptr->cr1) & ~GPT_CR1_CEN, &gpt1_regs_ptr->cr1);
|
||||
|
||||
writel((CONFIG_SYS_CLK_FREQ/CONFIG_SYS_HZ_CLOCK) - 1,
|
||||
writel((CONFIG_SYS_CLK_FREQ / 2 / CONFIG_SYS_HZ_CLOCK) - 1,
|
||||
&gpt1_regs_ptr->psc);
|
||||
|
||||
/* Configure timer for auto-reload */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue