zephyr/drivers/timer
Jaron Kelleher d63651dd01 riscv machine timer: Timer functions on long running platforms
When debugging on a long running platform, the MCU may get reset by
the debugger with an ndmreset toggle. Since there is no requirement
that this resets anything in particular on the platform, the CLINT
registers may not get reset. When this occurs with an mtime register
value that is larger than 32 bits the riscv machine timer will
continuously interrupt the system when the mtime register exceeds 32
bits in value. This is because the last_count value is used to update
the mtimecmp register, and its value is initialized to zero. Its
first update is with a 32-bit value, which loses information when the
mtime register exceeds 32 bits.

The proposed solution is to set the last_count value to the current
value in the mtime register when the timer is initialized. Since the
timer is fired at intervals that are less than 32 bits in value, the
next update of last_count will remain valid, and the system will
function as expected.

Signed-off-by: Jaron Kelleher <jkelleher@fb.com>
2020-03-04 23:08:49 +02:00
..
altera_avalon_timer_hal.c kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
apic_timer.c drivers: apic_timer: fix include of system_timer.h 2019-06-27 10:51:32 -07:00
arcv2_timer0.c drivers: timer: fix the bug for SMP 2019-11-13 12:04:18 -08:00
arm_arch_timer.c drivers: timer: Add per-core ARM architected timer 2020-02-01 08:08:43 -05:00
cc13x2_cc26x2_rtc_timer.c drivers/timer: Clamp after tick adjustment, not before 2019-11-27 18:43:53 +01:00
CMakeLists.txt drivers: timer: Add per-core ARM architected timer 2020-02-01 08:08:43 -05:00
cortex_m_systick.c arch: arm: Move ARM code to AArch32 sub-directory 2019-12-20 11:40:59 -05:00
hpet.c drivers/timer: Clamp after tick adjustment, not before 2019-11-27 18:43:53 +01:00
Kconfig drivers: timer: Add per-core ARM architected timer 2020-02-01 08:08:43 -05:00
Kconfig.stm32_lptim kconfig: Fix up newly-introduced copy-pasted headers 2019-11-19 15:25:08 -05:00
legacy_api.h kernel: kconfig: Fix broken references to TICKLESS_KERNEL 2020-01-25 08:14:55 -05:00
litex_timer.c kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
loapic_timer.c drivers: loapic_timer: simplify TSC read 2020-02-06 23:07:37 -05:00
mchp_xec_rtos_timer.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
native_posix_timer.c native_posix: timer: Improve arch_busy_wait() doc 2020-02-07 11:48:41 +01:00
nrf_rtc_timer.c kernel: kconfig: Fix broken references to TICKLESS_KERNEL 2020-01-25 08:14:55 -05:00
riscv_machine_timer.c riscv machine timer: Timer functions on long running platforms 2020-03-04 23:08:49 +02:00
rv32m1_lptmr_timer.c drivers: timer: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC 2019-07-24 15:10:02 +02:00
sam0_rtc_timer.c timer: sam0_rtc_timer: Add support for SAME54 2019-12-21 11:15:52 -05:00
stm32_lptim_timer.c driver: timer: st_stm32: add lptimer management to stm32xx series 2019-11-08 10:04:21 -06:00
sys_clock_init.c include: move system timer headers to include/drivers/timer/ 2019-06-25 15:27:00 -04:00
xlnx_psttc_timer.c kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
xtensa_sys_timer.c drivers/timer: Clamp after tick adjustment, not before 2019-11-27 18:43:53 +01:00