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>
This commit is contained in:
Ye Li
2019-11-13 21:20:43 -08:00
committed by Stefano Babic
parent f959594db2
commit 73d769d8af
5 changed files with 126 additions and 21 deletions

View File

@@ -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;
}