diff options
author | Clement Faure <clement.faure@nxp.com> | 2022-04-06 14:30:19 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2022-04-12 17:33:56 +0200 |
commit | a55ca506c969518e06eb8434f741eea2f5bfbe3e (patch) | |
tree | 49fde8ca89424bf2615b8be28accb9a56cde3aee | |
parent | 3524540e700a3efe595fc2d3cd0325be6f795399 (diff) | |
download | u-boot-a55ca506c969518e06eb8434f741eea2f5bfbe3e.zip u-boot-a55ca506c969518e06eb8434f741eea2f5bfbe3e.tar.gz u-boot-a55ca506c969518e06eb8434f741eea2f5bfbe3e.tar.bz2 |
misc: S400_API: add ahab_release_caam
Add ahab_release_caam() function to the S400 API.
Signed-off-by: Clement Faure <clement.faure@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r-- | arch/arm/include/asm/arch-imx8ulp/s400_api.h | 2 | ||||
-rw-r--r-- | drivers/misc/imx8ulp/s400_api.c | 29 |
2 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-imx8ulp/s400_api.h b/arch/arm/include/asm/arch-imx8ulp/s400_api.h index c848f0d..b788661 100644 --- a/arch/arm/include/asm/arch-imx8ulp/s400_api.h +++ b/arch/arm/include/asm/arch-imx8ulp/s400_api.h @@ -19,6 +19,7 @@ #define AHAB_READ_FUSE_REQ_CID 0x97 #define AHAB_RELEASE_RDC_REQ_CID 0xC4 #define AHAB_WRITE_FUSE_REQ_CID 0xD6 +#define AHAB_CAAM_RELEASE_CID 0xD7 #define S400_MAX_MSG 8U @@ -37,5 +38,6 @@ int ahab_verify_image(u32 img_id, u32 *response); int ahab_forward_lifecycle(u16 life_cycle, u32 *response); int ahab_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response); int ahab_read_common_fuse(u16 fuse_id, u32 *fuse_words, u32 fuse_num, u32 *response); +int ahab_release_caam(u32 core_did, u32 *response); #endif diff --git a/drivers/misc/imx8ulp/s400_api.c b/drivers/misc/imx8ulp/s400_api.c index d76a95f..dd5f9f2 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; +} |