summaryrefslogtreecommitdiff
path: root/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/imx-common/sci/svc/timer/rpc_clnt.c')
-rw-r--r--arch/arm/imx-common/sci/svc/timer/rpc_clnt.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c b/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c
index 4815095587..2536330829 100644
--- a/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c
+++ b/arch/arm/imx-common/sci/svc/timer/rpc_clnt.c
@@ -361,5 +361,58 @@ sc_err_t sc_timer_set_rtc_calb(sc_ipc_t ipc, int8_t count)
return (sc_err_t) result;
}
+sc_err_t sc_timer_set_sysctr_alarm(sc_ipc_t ipc, uint64_t ticks)
+{
+ sc_rpc_msg_t msg;
+ uint8_t result;
+
+ RPC_VER(&msg) = SC_RPC_VERSION;
+ RPC_SVC(&msg) = (uint8_t) SC_RPC_SVC_TIMER;
+ RPC_FUNC(&msg) = (uint8_t) TIMER_FUNC_SET_SYSCTR_ALARM;
+ RPC_U32(&msg, 0U) = (uint32_t) (ticks >> 32U);
+ RPC_U32(&msg, 4U) = (uint32_t) ticks;
+ RPC_SIZE(&msg) = 3U;
+
+ sc_call_rpc(ipc, &msg, SC_FALSE);
+
+ result = RPC_R8(&msg);
+ return (sc_err_t) result;
+}
+
+sc_err_t sc_timer_set_sysctr_periodic_alarm(sc_ipc_t ipc,
+ uint64_t ticks)
+{
+ sc_rpc_msg_t msg;
+ uint8_t result;
+
+ RPC_VER(&msg) = SC_RPC_VERSION;
+ RPC_SVC(&msg) = (uint8_t) SC_RPC_SVC_TIMER;
+ RPC_FUNC(&msg) = (uint8_t) TIMER_FUNC_SET_SYSCTR_PERIODIC_ALARM;
+ RPC_U32(&msg, 0U) = (uint32_t) (ticks >> 32U);
+ RPC_U32(&msg, 4U) = (uint32_t) ticks;
+ RPC_SIZE(&msg) = 3U;
+
+ sc_call_rpc(ipc, &msg, SC_FALSE);
+
+ result = RPC_R8(&msg);
+ return (sc_err_t) result;
+}
+
+sc_err_t sc_timer_cancel_sysctr_alarm(sc_ipc_t ipc)
+{
+ sc_rpc_msg_t msg;
+ uint8_t result;
+
+ RPC_VER(&msg) = SC_RPC_VERSION;
+ RPC_SVC(&msg) = (uint8_t) SC_RPC_SVC_TIMER;
+ RPC_FUNC(&msg) = (uint8_t) TIMER_FUNC_CANCEL_SYSCTR_ALARM;
+ RPC_SIZE(&msg) = 1U;
+
+ sc_call_rpc(ipc, &msg, SC_FALSE);
+
+ result = RPC_R8(&msg);
+ return (sc_err_t) result;
+}
+
/**@}*/