提交 0e256833 编写于 作者: G Guenter Roeck 提交者: Peter Maydell

hw/timer/cmsdk-apb-timer: Correctly identify and set one-shot mode

The CMSDK APB timer is currently always configured as periodic timer.
This results in the following messages when trying to boot Linux.

Timer with delta zero, disabling

If the timer limit set with the RELOAD command is 0, the timer
needs to be enabled as one-shot timer.
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Tested-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 6583080e
......@@ -119,7 +119,7 @@ static void cmsdk_apb_timer_write(void *opaque, hwaddr offset, uint64_t value,
}
s->ctrl = value & 0xf;
if (s->ctrl & R_CTRL_EN_MASK) {
ptimer_run(s->timer, 0);
ptimer_run(s->timer, ptimer_get_limit(s->timer) == 0);
} else {
ptimer_stop(s->timer);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册