aboutsummaryrefslogtreecommitdiff
path: root/include/drivers
diff options
context:
space:
mode:
authorMark Dykes <mardyk01@review.trustedfirmware.org>2020-06-01 18:07:10 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-06-01 18:07:10 +0000
commitec29ce67cfedc58e3679c6a05c46e54ce2910e19 (patch)
treed4d0eaf0ea9746a4c82a87703d05f3db8b4ff545 /include/drivers
parenteb609570f11ddf0eecb37fd4bd59a3e089df25c6 (diff)
parent45c70e68673b4fd39c301725e63c03d0846339c5 (diff)
downloadtrusted-firmware-a-ec29ce67cfedc58e3679c6a05c46e54ce2910e19.tar.gz
Merge "drivers: stm32_reset adapt interface to timeout argument" into integration
Diffstat (limited to 'include/drivers')
-rw-r--r--include/drivers/st/stm32mp_reset.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/include/drivers/st/stm32mp_reset.h b/include/drivers/st/stm32mp_reset.h
index 2da5adf440..84448050d7 100644
--- a/include/drivers/st/stm32mp_reset.h
+++ b/include/drivers/st/stm32mp_reset.h
@@ -9,7 +9,42 @@
#include <stdint.h>
-void stm32mp_reset_assert(uint32_t reset_id);
-void stm32mp_reset_deassert(uint32_t reset_id);
+/*
+ * Assert target reset, if @to_us non null, wait until reset is asserted
+ *
+ * @reset_id: Reset controller ID
+ * @to_us: Timeout in microsecond, or 0 if not waiting
+ * Return 0 on success and -ETIMEDOUT if waiting and timeout expired
+ */
+int stm32mp_reset_assert(uint32_t reset_id, unsigned int to_us);
+
+/*
+ * Enable reset control for target resource
+ *
+ * @reset_id: Reset controller ID
+ */
+static inline void stm32mp_reset_set(uint32_t reset_id)
+{
+ (void)stm32mp_reset_assert(reset_id, 0U);
+}
+
+/*
+ * Deassert target reset, if @to_us non null, wait until reset is deasserted
+ *
+ * @reset_id: Reset controller ID
+ * @to_us: Timeout in microsecond, or 0 if not waiting
+ * Return 0 on success and -ETIMEDOUT if waiting and timeout expired
+ */
+int stm32mp_reset_deassert(uint32_t reset_id, unsigned int to_us);
+
+/*
+ * Release reset control for target resource
+ *
+ * @reset_id: Reset controller ID
+ */
+static inline void stm32mp_reset_release(uint32_t reset_id)
+{
+ (void)stm32mp_reset_deassert(reset_id, 0U);
+}
#endif /* STM32MP_RESET_H */