hw/arm/nrf51_soc: Set system_clock_scale
commitce4f70e81ed23c93ff39234672aff33114532640
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 27 Jul 2020 19:34:58 +0000 (27 20:34 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 3 Aug 2020 16:55:31 +0000 (3 17:55 +0100)
treec746d4681500e8d7f472c4823cee9c8242013c70
parent88a90e3de6ae99cbcfcc04c862c51f241fdf685f
hw/arm/nrf51_soc: Set system_clock_scale

The nrf51 SoC model wasn't setting the system_clock_scale
global.which meant that if guest code used the systick timer in "use
the processor clock" mode it would hang because time never advances.

Set the global to match the documented CPU clock speed for this SoC.

This SoC in fact doesn't have a SysTick timer (which is the only thing
currently that cares about the system_clock_scale), because it's
a configurable option in the Cortex-M0. However our Cortex-M0 and
thus our nrf51 and our micro:bit board do provide a SysTick, so
we ought to provide a functional one rather than a broken one.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200727193458.31250-1-peter.maydell@linaro.org
hw/arm/nrf51_soc.c