diff options
author | Mathieu Othacehe | 2024-03-21 08:19:53 +0100 |
---|---|---|
committer | Fabio Estevam | 2024-03-24 13:36:00 -0300 |
commit | 6bb745844c2aeaa7d7a1c0d1178b5b83d8b4c9ca (patch) | |
tree | a6e472d7e618ccfac496b8ca4b3dd1b779b5ece5 /drivers/misc | |
parent | c20e449225b07392faf402f20efeff3f21def76a (diff) |
imx: ele_ahab: Add ahab_commit command support
This message is used to commit into the fuses any new SRK revocation and
FW version information that have been found into the NXP (ELE FW) and
OEM containers.
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/imx_ele/ele_api.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/misc/imx_ele/ele_api.c b/drivers/misc/imx_ele/ele_api.c index 0c017734a49..e0ec22c7abf 100644 --- a/drivers/misc/imx_ele/ele_api.c +++ b/drivers/misc/imx_ele/ele_api.c @@ -528,6 +528,38 @@ int ele_start_rng(void) return ret; } +int ele_commit(u16 fuse_id, u32 *response, u32 *info_type) +{ + struct udevice *dev = gd->arch.ele_dev; + int size = sizeof(struct ele_msg); + struct ele_msg msg; + int ret = 0; + + if (!dev) { + printf("ele dev is not initialized\n"); + return -ENODEV; + } + + msg.version = ELE_VERSION; + msg.tag = ELE_CMD_TAG; + msg.size = 2; + msg.command = ELE_COMMIT_REQ; + msg.data[0] = fuse_id; + + ret = misc_call(dev, false, &msg, size, &msg, size); + if (ret) + printf("Error: %s: ret %d, fuse_id 0x%x, response 0x%x\n", + __func__, ret, fuse_id, msg.data[0]); + + if (response) + *response = msg.data[0]; + + if (info_type) + *info_type = msg.data[1]; + + return ret; +} + int ele_write_secure_fuse(ulong signed_msg_blk, u32 *response) { struct udevice *dev = gd->arch.ele_dev; |