xemu/include/hw/timer
Peter Maydell 32bd322a01 hw/timer/armv7m_systick: Rewrite to use ptimers
The armv7m systick timer is a 24-bit decrementing, wrap-on-zero,
clear-on-write counter. Our current implementation has various
bugs and dubious workarounds in it (for instance see
https://bugs.launchpad.net/qemu/+bug/1872237).

We have an implementation of a simple decrementing counter
and we put a lot of effort into making sure it handles the
interesting corner cases (like "spend a cycle at 0 before
reloading") -- ptimer.

Rewrite the systick timer to use a ptimer rather than
a raw QEMU timer.

Unfortunately this is a migration compatibility break,
which will affect all M-profile boards.

Among other bugs, this fixes
https://bugs.launchpad.net/qemu/+bug/1872237 :
now writes to SYST_CVR when the timer is enabled correctly
do nothing; when the timer is enabled via SYST_CSR.ENABLE,
the ptimer code will (because of POLICY_NO_IMMEDIATE_RELOAD)
arrange that after one timer tick the counter is reloaded
from SYST_RVR and then counts down from there, as the
architecture requires.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20201015151829.14656-3-peter.maydell@linaro.org
2020-10-27 11:15:31 +00:00
..
a9gtimer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
allwinner-a10-pit.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
arm_mptimer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
armv7m_systick.h hw/timer/armv7m_systick: Rewrite to use ptimers 2020-10-27 11:15:31 +00:00
aspeed_timer.h Use OBJECT_DECLARE_TYPE when possible 2020-09-18 14:12:32 -04:00
avr_timer16.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
bcm2835_systmr.h hw/timer/bcm2835: Support the timer COMPARE registers 2020-10-20 16:12:00 +01:00
cmsdk-apb-dualtimer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
cmsdk-apb-timer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
digic-timer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
hpet.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
i8254_internal.h i8254: Move PITCommonState/PITCommonClass typedefs to i8254.h 2020-08-27 14:04:54 -04:00
i8254.h Use OBJECT_DECLARE_TYPE when possible 2020-09-18 14:12:32 -04:00
imx_epit.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
imx_gpt.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
mips_gictimer.h hw/mips_gictimer: provide API for retrieving frequency 2017-02-21 22:24:58 +00:00
mss-timer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
npcm7xx_timer.h hw/timer: Adding watchdog for NPCM7XX Timer. 2020-10-27 11:10:01 +00:00
nrf51_timer.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
renesas_cmt.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
renesas_tmr.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
stm32f2xx_timer.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
tmu012.h hw/sh4: Extract timer definitions to 'hw/timer/tmu012.h' 2020-06-22 18:37:12 +02:00