On 8/12/21 11:33 AM, Peter Maydell wrote:
> The stellaris-gptm timer currently uses system_clock_scale for one of
> its timer modes where the timer runs at the CPU clock rate. Make it
> use a Clock input instead.
>
> We don't try to make the timer handle changes in the clock frequency
> while the downcounter is running. This is not a change in behaviour
> from the previous system_clock_scale implementation -- we will pick
> up the new frequency only when the downcounter hits zero. Handling
> dynamic clock changes when the counter is running would require state
> that the current gptm implementation doesn't have.
>
> Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
> ---
> As noted in the comment, ideally we would convert the device to use
> ptimer for its downcounter, which supports frequency changes while
> the counter is running and would also allow reading the timer value.
> But I don't want to make and test that change to a minor timer device
> in a board model I wouldn't recommend anybody actually use; this
> series is long enough as it is...
> ---
> include/hw/timer/stellaris-gptm.h | 3 +++
> hw/arm/stellaris.c | 12 +++++++++---
> hw/timer/stellaris-gptm.c | 26 ++++++++++++++++++++++----
> 3 files changed, 34 insertions(+), 7 deletions(-)
>
Reviewed-by: Damien Hedde <damien.he...@greensocs.com>