summaryrefslogtreecommitdiff
path: root/plat/imx/common/imx_sip_handler.c
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2019-01-18 10:27:48 +0800
committerAnson Huang <Anson.Huang@nxp.com>2019-01-18 11:23:00 +0800
commitdbfa45e8163336daa2b1b8a76fcc74976a6aa6d7 (patch)
tree63e00eb4ae1a782e9894ad5bffcc25ddc04a7aef /plat/imx/common/imx_sip_handler.c
parent936840f143ca6eba09a78367afe047136c33a4ee (diff)
imx: add i.MX8 SoCs OTP SIP(silicon provider) service support
For NXP's i.MX8 SoCs with system controller inside, OTP is maintained by SCFW, Linux needs to call SMC to trap to TF-A for OTP read/write etc. operations by calling SCFW API. This patch adds OTP SIP service support. Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Diffstat (limited to 'plat/imx/common/imx_sip_handler.c')
-rw-r--r--plat/imx/common/imx_sip_handler.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/plat/imx/common/imx_sip_handler.c b/plat/imx/common/imx_sip_handler.c
index 2e50cf30..a096a060 100644
--- a/plat/imx/common/imx_sip_handler.c
+++ b/plat/imx/common/imx_sip_handler.c
@@ -102,3 +102,29 @@ int imx_wakeup_src_handler(uint32_t smc_fid,
return SMC_OK;
}
+
+int imx_otp_handler(uint32_t smc_fid,
+ void *handle,
+ u_register_t x1,
+ u_register_t x2)
+{
+ int ret;
+ uint32_t fuse;
+
+ switch (smc_fid) {
+ case IMX_SIP_OTP_READ:
+ ret = sc_misc_otp_fuse_read(ipc_handle, x1, &fuse);
+ SMC_RET2(handle, ret, fuse);
+ break;
+ case IMX_SIP_OTP_WRITE:
+ ret = sc_misc_otp_fuse_write(ipc_handle, x1, x2);
+ SMC_RET1(handle, ret);
+ break;
+ default:
+ ret = SMC_UNK;
+ SMC_RET1(handle, ret);
+ break;
+ }
+
+ return ret;
+}