summaryrefslogtreecommitdiff
path: root/include/timer.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-09-30 09:21:43 -0400
committerTom Rini <trini@konsulko.com>2020-09-30 09:21:43 -0400
commit01114adfc1e0bf3cf5e2f3da858bb2c8e9810c1c (patch)
tree64ab9c9d1c2a5f3cc96b4c0fef1990cb73c1b356 /include/timer.h
parent527fad0b2484bf1dd4c443c4c8f4384aa256938f (diff)
parent924de3216e9efdf1cdc71b8632099213aac03f2c (diff)
Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-riscv into next
- Disable CMD_IRQ for RISC-V. - Update sipeed/maix doc - Obtain reg of SiFive RAM via dev_read_addr_index() instead of regmap API. - Cleans up RISC-V timer drivers and converts them to DM. - Correctly handle IPIs already pending upon prior stage bootloader (on the K210)
Diffstat (limited to 'include/timer.h')
-rw-r--r--include/timer.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/timer.h b/include/timer.h
index a49b500ce35..8b9fa51c53d 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -15,6 +15,21 @@
*/
int dm_timer_init(void);
+/**
+ * timer_timebase_fallback() - Helper for timers using timebase fallback
+ * @dev: A timer partially-probed timer device
+ *
+ * This is a helper function designed for timers which need to fall back on the
+ * cpu's timebase. This function is designed to be called during the driver's
+ * probe(). If there is a clocks or clock-frequency property in the timer's
+ * binding, then it will be used. Otherwise, the timebase of the current cpu
+ * will be used. This is initialized by the cpu driver, and usually gotten from
+ * ``/cpus/timebase-frequency`` or ``/cpus/cpu@X/timebase-frequency``.
+ *
+ * Return: 0 if OK, or negative error code on failure
+ */
+int timer_timebase_fallback(struct udevice *dev);
+
/*
* timer_conv_64 - convert 32-bit counter value to 64-bit
*