From 1590be095f897790676d9c22f5338cd4d06840be Mon Sep 17 00:00:00 2001 From: Anson Huang Date: Thu, 9 Aug 2018 10:06:30 +0800 Subject: imx8qm/imx8qxp: add misc set temp SIP support Add FSL_SIP_MISC_SET_TEMP support for setting thermal alarm function. Signed-off-by: Anson Huang --- plat/imx/common/include/fsl_sip.h | 1 + plat/imx/common/misc.c | 26 ++++++++++++++++++++++++++ plat/imx/common/sip_svc.c | 6 +++++- plat/imx/imx8qm/platform.mk | 1 + plat/imx/imx8qxp/platform.mk | 1 + 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 plat/imx/common/misc.c diff --git a/plat/imx/common/include/fsl_sip.h b/plat/imx/common/include/fsl_sip.h index 7246f8f7..ddf9c02c 100644 --- a/plat/imx/common/include/fsl_sip.h +++ b/plat/imx/common/include/fsl_sip.h @@ -63,5 +63,6 @@ #define FSL_SIP_OTP_READ 0xc200000A #define FSL_SIP_OTP_WRITE 0xc200000B +#define FSL_SIP_MISC_SET_TEMP 0xc200000c #endif diff --git a/plat/imx/common/misc.c b/plat/imx/common/misc.c new file mode 100644 index 00000000..be18673e --- /dev/null +++ b/plat/imx/common/misc.c @@ -0,0 +1,26 @@ +/* + * Copyright 2018 NXP + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern sc_ipc_t ipc_handle; + +int imx_misc_set_temp_handler(uint32_t smc_fid, + u_register_t x1, + u_register_t x2, + u_register_t x3, + u_register_t x4) +{ + return sc_misc_set_temp(ipc_handle, x1, x2, x3, x4); +} diff --git a/plat/imx/common/sip_svc.c b/plat/imx/common/sip_svc.c index 596da8c3..b8f918e9 100644 --- a/plat/imx/common/sip_svc.c +++ b/plat/imx/common/sip_svc.c @@ -27,6 +27,8 @@ extern int imx_soc_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, u extern int imx_hab_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, u_register_t x3, u_register_t x4); extern int imx_noc_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, u_register_t x3); extern int dram_dvfs_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, u_register_t x3); +extern int imx_misc_set_temp_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, + u_register_t x3, u_register_t x4); bool wakeup_src_irqsteer = false; @@ -102,7 +104,6 @@ int imx_wakeup_src_handler(uint32_t smc_fid, return ret; } - /* i.MX platform specific service SMC handler */ uintptr_t imx_svc_smc_handler(uint32_t smc_fid, u_register_t x1, @@ -153,6 +154,9 @@ uintptr_t imx_svc_smc_handler(uint32_t smc_fid, case FSL_SIP_OTP_READ: case FSL_SIP_OTP_WRITE: return imx_otp_handler(smc_fid, handle, x1, x2); + case FSL_SIP_MISC_SET_TEMP: + SMC_RET1(handle, imx_misc_set_temp_handler(smc_fid, x1, x2, x3, x4)); + break; #endif case FSL_SIP_BUILDINFO: SMC_RET1(handle, imx_buildinfo_handler(smc_fid, x1, x2, x3, x4)); diff --git a/plat/imx/imx8qm/platform.mk b/plat/imx/imx8qm/platform.mk index 7f8afb3b..a1fa341c 100644 --- a/plat/imx/imx8qm/platform.mk +++ b/plat/imx/imx8qm/platform.mk @@ -47,6 +47,7 @@ BL31_SOURCES += plat/imx/common/lpuart_console.S \ plat/imx/common/cpufreq.c \ plat/imx/common/scu_otp.c \ plat/imx/common/srtc.c \ + plat/imx/common/misc.c \ plat/imx/imx8qm/imx8qm_bl31_setup.c \ plat/imx/imx8qm/imx8qm_psci.c \ plat/imx/common/imx8_topology.c \ diff --git a/plat/imx/imx8qxp/platform.mk b/plat/imx/imx8qxp/platform.mk index bd75e745..baf2f3b9 100644 --- a/plat/imx/imx8qxp/platform.mk +++ b/plat/imx/imx8qxp/platform.mk @@ -46,6 +46,7 @@ BL31_SOURCES += plat/imx/common/lpuart_console.S \ plat/imx/common/cpufreq.c \ plat/imx/common/scu_otp.c \ plat/imx/common/srtc.c \ + plat/imx/common/misc.c \ plat/imx/imx8qxp/imx8qxp_bl31_setup.c \ plat/imx/imx8qxp/imx8qxp_psci.c \ plat/imx/common/imx8_topology.c \ -- cgit v1.2.3