summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-11-13 21:20:43 -0800
committerStefano Babic <sbabic@denx.de>2020-05-01 13:46:22 +0200
commit73d769d8afb936cd99873cfb2fef2ef04e02a13d (patch)
tree646b62e3e43f8dc71d6e66f562cc4fd6e3de1ea7 /drivers/misc
parentf959594db28b9a11baec576c117d7bc5de403908 (diff)
downloadu-boot-73d769d8afb936cd99873cfb2fef2ef04e02a13d.tar.gz
imx8: Update SCFW API to version 1.5
Sync the latest SCFW API with below commit 6dcd0242ae7a53ac ("SCF-105: Revert accidental change") to add interfaces for PM resource reset and read/write SNVS security violation and tamper DGO registers. Reviewed-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/imx8/scu_api.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c
index c1e54fc4bc..227bc52873 100644
--- a/drivers/misc/imx8/scu_api.c
+++ b/drivers/misc/imx8/scu_api.c
@@ -174,6 +174,28 @@ sc_bool_t sc_pm_is_partition_started(sc_ipc_t ipc, sc_rm_pt_t pt)
return !!result;
}
+int sc_pm_resource_reset(sc_ipc_t ipc, sc_rsrc_t resource)
+{
+ struct udevice *dev = gd->arch.scu_dev;
+ int size = sizeof(struct sc_rpc_msg_s);
+ struct sc_rpc_msg_s msg;
+ int ret;
+
+ RPC_VER(&msg) = SC_RPC_VERSION;
+ RPC_SIZE(&msg) = 2U;
+ RPC_SVC(&msg) = (u8)(SC_RPC_SVC_PM);
+ RPC_FUNC(&msg) = (u8)(PM_FUNC_RESOURCE_RESET);
+
+ RPC_U16(&msg, 0U) = (u16)(resource);
+
+ ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+ if (ret)
+ printf("%s: resource:%d res:%d\n",
+ __func__, resource, RPC_R8(&msg));
+
+ return ret;
+}
+
/* PAD */
int sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, u32 val)
{
@@ -1028,3 +1050,31 @@ int sc_seco_get_mp_sign(sc_ipc_t ipc, sc_faddr_t msg_addr,
return ret;
}
+
+int sc_seco_secvio_dgo_config(sc_ipc_t ipc, uint8_t id, uint8_t access,
+ u32 *data)
+{
+ struct udevice *dev = gd->arch.scu_dev;
+ struct sc_rpc_msg_s msg;
+ int size = sizeof(struct sc_rpc_msg_s);
+ int ret;
+
+ RPC_VER(&msg) = SC_RPC_VERSION;
+ RPC_SIZE(&msg) = 3U;
+ RPC_SVC(&msg) = (u8)(SC_RPC_SVC_SECO);
+ RPC_FUNC(&msg) = (u8)(SECO_FUNC_SECVIO_DGO_CONFIG);
+
+ RPC_U32(&msg, 0U) = (u32)(*data);
+ RPC_U8(&msg, 4U) = (u8)(id);
+ RPC_U8(&msg, 5U) = (u8)(access);
+
+ ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size);
+ if (ret)
+ printf("%s, id:0x%x, access:%x, res:%d\n",
+ __func__, id, access, RPC_R8(&msg));
+
+ if (data)
+ *data = RPC_U32(&msg, 0U);
+
+ return ret;
+}