提交 cb31eaa4 编写于 作者: D Daniel Hellstrom 提交者: Francois Retief

sparc: leon3: Clear all unused GPTIMER registers.

Signed-off-by: NDaniel Hellstrom <daniel@gaisler.com>
上级 574be25e
......@@ -90,7 +90,7 @@ int arch_cpu_init(void)
int cpu_init_r(void)
{
ambapp_apbdev apbdev;
int index, cpu;
int index, cpu, ntimers, i;
ambapp_dev_gptimer *timer = NULL;
unsigned int bus_freq;
......@@ -135,6 +135,14 @@ int cpu_init_r(void)
timer->scalar = timer->scalar_reload =
(((bus_freq / 1000) + 500) / 1000) - 1;
/* Clear All Timers */
ntimers = timer->config & 0x7;
for (i = 0; i < ntimers; i++) {
timer->e[i].ctrl = GPTIMER_CTRL_IP;
timer->e[i].rld = 0;
timer->e[i].ctrl = GPTIMER_CTRL_LD;
}
index++;
}
if (!gptimer) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册