From a55ca506c969518e06eb8434f741eea2f5bfbe3e Mon Sep 17 00:00:00 2001 From: Clement Faure Date: Wed, 6 Apr 2022 14:30:19 +0800 Subject: misc: S400_API: add ahab_release_caam Add ahab_release_caam() function to the S400 API. Signed-off-by: Clement Faure Signed-off-by: Peng Fan --- drivers/misc/imx8ulp/s400_api.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'drivers/misc/imx8ulp/s400_api.c') diff --git a/drivers/misc/imx8ulp/s400_api.c b/drivers/misc/imx8ulp/s400_api.c index d76a95febe7..dd5f9f25da5 100644 --- a/drivers/misc/imx8ulp/s400_api.c +++ b/drivers/misc/imx8ulp/s400_api.c @@ -242,3 +242,32 @@ int ahab_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response) return ret; } + +int ahab_release_caam(u32 core_did, u32 *response) +{ + struct udevice *dev = gd->arch.s400_dev; + int size = sizeof(struct imx8ulp_s400_msg); + struct imx8ulp_s400_msg msg; + int ret; + + if (!dev) { + printf("s400 dev is not initialized\n"); + return -ENODEV; + } + + msg.version = AHAB_VERSION; + msg.tag = AHAB_CMD_TAG; + msg.size = 2; + msg.command = AHAB_CAAM_RELEASE_CID; + msg.data[0] = core_did; + + ret = misc_call(dev, false, &msg, size, &msg, size); + if (ret) + printf("Error: %s: ret %d, response 0x%x\n", + __func__, ret, msg.data[0]); + + if (response) + *response = msg.data[0]; + + return ret; +} -- cgit v1.2.3