aboutsummaryrefslogtreecommitdiffstats
path: root/src/config/config_timer.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-10-28 13:48:11 +0000
committerMichael Brown <mcb30@ipxe.org>2024-10-28 13:55:36 +0000
commitcd54e7c844e2148b46c960d72ed853f8f75bf400 (patch)
tree4cf62782e85314f142695eb4792cb756d5f35a07 /src/config/config_timer.c
parentb0a8eabbf4d32d789686c32809750f95986dc7cb (diff)
downloadipxe-cd54e7c844e2148b46c960d72ed853f8f75bf400.tar.gz
[riscv] Add support for RDTIME as a timer source
The Zicntr extension defines an unprivileged wall-clock time CSR that roughly matches the behaviour of an invariant TSC on x86. The nominal frequency of this timer may be read from the "timebase-frequency" property of the CPU node in the device tree. Add a timer source using RDTIME to provide implementations of udelay() and currticks(), modelled on the existing RDTSC-based timer for x86. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/config/config_timer.c')
-rw-r--r--src/config/config_timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config/config_timer.c b/src/config/config_timer.c
index d53c39939..a4fe69b00 100644
--- a/src/config/config_timer.c
+++ b/src/config/config_timer.c
@@ -49,3 +49,6 @@ REQUIRE_OBJECT ( linux_timer );
#ifdef TIMER_ACPI
REQUIRE_OBJECT ( acpi_timer );
#endif
+#ifdef TIMER_ZICNTR
+REQUIRE_OBJECT ( zicntr );
+#endif