diff options
Diffstat (limited to 'include/soc/imx8/sc/svc/timer/api.h')
-rw-r--r-- | include/soc/imx8/sc/svc/timer/api.h | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/include/soc/imx8/sc/svc/timer/api.h b/include/soc/imx8/sc/svc/timer/api.h index a38afc3d1db5..6c80ceaf53f6 100644 --- a/include/soc/imx8/sc/svc/timer/api.h +++ b/include/soc/imx8/sc/svc/timer/api.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 Freescale Semiconductor, Inc. - * Copyright 2017-2018 NXP + * Copyright 2017-2019 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -32,18 +32,18 @@ * @name Defines for type widths */ /*@{*/ -#define SC_TIMER_ACTION_W 3U /* Width of sc_timer_wdog_action_t */ +#define SC_TIMER_ACTION_W 3U /* Width of sc_timer_wdog_action_t */ /*@}*/ /*! * @name Defines for sc_timer_wdog_action_t */ /*@{*/ -#define SC_TIMER_WDOG_ACTION_PARTITION 0U /* Reset partition */ -#define SC_TIMER_WDOG_ACTION_WARM 1U /* Warm reset system */ -#define SC_TIMER_WDOG_ACTION_COLD 2U /* Cold reset system */ -#define SC_TIMER_WDOG_ACTION_BOARD 3U /* Reset board */ -#define SC_TIMER_WDOG_ACTION_IRQ 4U /* Only generate IRQs */ +#define SC_TIMER_WDOG_ACTION_PARTITION 0U /* Reset partition */ +#define SC_TIMER_WDOG_ACTION_WARM 1U /* Warm reset system */ +#define SC_TIMER_WDOG_ACTION_COLD 2U /* Cold reset system */ +#define SC_TIMER_WDOG_ACTION_BOARD 3U /* Reset board */ +#define SC_TIMER_WDOG_ACTION_IRQ 4U /* Only generate IRQs */ /*@}*/ /* Types */ @@ -76,7 +76,8 @@ typedef uint32_t sc_timer_wdog_time_t; * @return Returns an error code (SC_ERR_NONE = success, SC_ERR_LOCKED * = locked). */ -sc_err_t sc_timer_set_wdog_timeout(sc_ipc_t ipc, sc_timer_wdog_time_t timeout); +sc_err_t sc_timer_set_wdog_timeout(sc_ipc_t ipc, + sc_timer_wdog_time_t timeout); /*! * This function sets the watchdog pre-timeout in milliseconds. If not @@ -93,7 +94,7 @@ sc_err_t sc_timer_set_wdog_timeout(sc_ipc_t ipc, sc_timer_wdog_time_t timeout); * @return Returns an error code (SC_ERR_NONE = success). */ sc_err_t sc_timer_set_wdog_pre_timeout(sc_ipc_t ipc, - sc_timer_wdog_time_t pre_timeout); + sc_timer_wdog_time_t pre_timeout); /*! * This function starts the watchdog. @@ -141,9 +142,8 @@ sc_err_t sc_timer_ping_wdog(sc_ipc_t ipc); * @return Returns an error code (SC_ERR_NONE = success). */ sc_err_t sc_timer_get_wdog_status(sc_ipc_t ipc, - sc_timer_wdog_time_t *timeout, - sc_timer_wdog_time_t *max_timeout, - sc_timer_wdog_time_t *remaining_time); + sc_timer_wdog_time_t *timeout, sc_timer_wdog_time_t *max_timeout, + sc_timer_wdog_time_t *remaining_time); /*! * This function gets the status of the watchdog of a partition. All @@ -158,10 +158,8 @@ sc_err_t sc_timer_get_wdog_status(sc_ipc_t ipc, * * @return Returns an error code (SC_ERR_NONE = success). */ -sc_err_t sc_timer_pt_get_wdog_status(sc_ipc_t ipc, sc_rm_pt_t pt, - sc_bool_t *enb, - sc_timer_wdog_time_t *timeout, - sc_timer_wdog_time_t *remaining_time); +sc_err_t sc_timer_pt_get_wdog_status(sc_ipc_t ipc, sc_rm_pt_t pt, sc_bool_t *enb, + sc_timer_wdog_time_t *timeout, sc_timer_wdog_time_t *remaining_time); /*! * This function configures the action to be taken when a watchdog @@ -181,7 +179,7 @@ sc_err_t sc_timer_pt_get_wdog_status(sc_ipc_t ipc, sc_rm_pt_t pt, * - SC_ERR_LOCKED if the watchdog is locked */ sc_err_t sc_timer_set_wdog_action(sc_ipc_t ipc, - sc_rm_pt_t pt, sc_timer_wdog_action_t action); + sc_rm_pt_t pt, sc_timer_wdog_action_t action); /* @} */ @@ -210,8 +208,7 @@ sc_err_t sc_timer_set_wdog_action(sc_ipc_t ipc, * - SC_ERR_NOACCESS if caller's partition cannot access SC_R_SYSTEM */ sc_err_t sc_timer_set_rtc_time(sc_ipc_t ipc, uint16_t year, uint8_t mon, - uint8_t day, uint8_t hour, uint8_t min, - uint8_t sec); + uint8_t day, uint8_t hour, uint8_t min, uint8_t sec); /*! * This function gets the RTC time. @@ -227,8 +224,7 @@ sc_err_t sc_timer_set_rtc_time(sc_ipc_t ipc, uint16_t year, uint8_t mon, * @return Returns an error code (SC_ERR_NONE = success). */ sc_err_t sc_timer_get_rtc_time(sc_ipc_t ipc, uint16_t *year, uint8_t *mon, - uint8_t *day, uint8_t *hour, uint8_t *min, - uint8_t *sec); + uint8_t *day, uint8_t *hour, uint8_t *min, uint8_t *sec); /*! * This function gets the RTC time in seconds since 1/1/1970. @@ -251,7 +247,8 @@ sc_err_t sc_timer_get_rtc_sec1970(sc_ipc_t ipc, uint32_t *sec); * @param[in] min minute (0-59) * @param[in] sec second (0-59) * - * Note this alarm setting clears when the alarm is triggered. + * Note this alarm setting clears when the alarm is triggered. This is an + * absolute time. * * @return Returns an error code (SC_ERR_NONE = success). * @@ -259,8 +256,7 @@ sc_err_t sc_timer_get_rtc_sec1970(sc_ipc_t ipc, uint32_t *sec); * - SC_ERR_PARM if invalid time/date parameters */ sc_err_t sc_timer_set_rtc_alarm(sc_ipc_t ipc, uint16_t year, uint8_t mon, - uint8_t day, uint8_t hour, uint8_t min, - uint8_t sec); + uint8_t day, uint8_t hour, uint8_t min, uint8_t sec); /*! * This function sets the RTC alarm (periodic mode). @@ -270,6 +266,8 @@ sc_err_t sc_timer_set_rtc_alarm(sc_ipc_t ipc, uint16_t year, uint8_t mon, * * @return Returns an error code (SC_ERR_NONE = success). * + * Note this is a relative time. + * * Return errors: * - SC_ERR_PARM if invalid time/date parameters */ @@ -318,7 +316,8 @@ sc_err_t sc_timer_set_rtc_calb(sc_ipc_t ipc, int8_t count); * @param[in] ipc IPC handle * @param[in] ticks number of 8MHz cycles * - * Note this alarm setting clears when the alarm is triggered. + * Note the \a ticks parameter is an absolute time. This alarm + * setting clears when the alarm is triggered. * * @return Returns an error code (SC_ERR_NONE = success). * @@ -333,12 +332,15 @@ sc_err_t sc_timer_set_sysctr_alarm(sc_ipc_t ipc, uint64_t ticks); * @param[in] ipc IPC handle * @param[in] ticks number of 8MHz cycles * + * Note the \a ticks parameter is a relative time. + * * @return Returns an error code (SC_ERR_NONE = success). * * Return errors: * - SC_ERR_PARM if invalid time/date parameters */ -sc_err_t sc_timer_set_sysctr_periodic_alarm(sc_ipc_t ipc, uint64_t ticks); +sc_err_t sc_timer_set_sysctr_periodic_alarm(sc_ipc_t ipc, + uint64_t ticks); /*! * This function cancels the SYSCTR alarm. @@ -356,6 +358,7 @@ sc_err_t sc_timer_cancel_sysctr_alarm(sc_ipc_t ipc); /* @} */ -#endif /* SC_TIMER_API_H */ +#endif /* SC_TIMER_API_H */ /**@}*/ + |