qemu-e2k/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.c
allwinner-a10-pit.c
altera_timer.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
arm_mptimer.c
arm_timer.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
armv7m_systick.c hw/timer/armv7m_systick: Rewrite to use ptimers 2020-10-27 11:15:31 +00:00
aspeed_timer.c
avr_timer16.c
bcm2835_systmr.c hw/timer/bcm2835: Support the timer COMPARE registers 2020-10-20 16:12:00 +01:00
cadence_ttc.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
cmsdk-apb-dualtimer.c
cmsdk-apb-timer.c
digic-timer.c
etraxfs_timer.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
exynos4210_mct.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
exynos4210_pwm.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
grlib_gptimer.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
hpet.c Pull request trivial patches 20200919 2020-09-22 15:42:23 +01:00
i8254_common.c
i8254.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
imx_epit.c
imx_gpt.c
Kconfig
lm32_timer.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
meson.build hw/timer: Add NPCM7xx Timer device model 2020-09-14 14:24:58 +01:00
milkymist-sysctl.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
mips_gictimer.c
mss-timer.c
npcm7xx_timer.c hw/timer: Adding watchdog for NPCM7XX Timer. 2020-10-27 11:10:01 +00:00
nrf51_timer.c
omap_gptimer.c
omap_synctimer.c
puv3_ost.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
pxa2xx_timer.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
renesas_cmt.c
renesas_tmr.c
sh_timer.c
slavio_timer.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
stm32f2xx_timer.c
trace-events hw/timer/bcm2835: Support the timer COMPARE registers 2020-10-20 16:12:00 +01:00
trace.h
xilinx_timer.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00