summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGaurav Jain <gaurav.jain@nxp.com>2022-05-11 11:37:55 +0300
committerStefano Babic <sbabic@denx.de>2022-05-20 13:36:47 +0300
commitcad77280c31f6736e93bf18060080fee50cc9ee3 (patch)
tree02a3d7321105a0b4ae78a373419b5cea89183584 /drivers
parentcda8f87349594a1df9cc8616e25944173c9d0a0c (diff)
downloadu-boot-cad77280c31f6736e93bf18060080fee50cc9ee3.tar.xz
i.MX8ULP: add display_ele_fw_version api
implement get f/w version api. print ele f/w version in spl. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/imx8ulp/s400_api.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/misc/imx8ulp/s400_api.c b/drivers/misc/imx8ulp/s400_api.c
index 3ffdeb2ad2..87f5880ccb 100644
--- a/drivers/misc/imx8ulp/s400_api.c
+++ b/drivers/misc/imx8ulp/s400_api.c
@@ -272,6 +272,47 @@ int ahab_release_caam(u32 core_did, u32 *response)
return ret;
}
+int ahab_get_fw_version(u32 *fw_version, u32 *sha1, 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;
+ }
+
+ if (!fw_version) {
+ printf("Invalid parameters for f/w version read\n");
+ return -EINVAL;
+ }
+
+ if (!sha1) {
+ printf("Invalid parameters for commit sha1\n");
+ return -EINVAL;
+ }
+
+ msg.version = AHAB_VERSION;
+ msg.tag = AHAB_CMD_TAG;
+ msg.size = 1;
+ msg.command = AHAB_GET_FW_VERSION_CID;
+
+ 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];
+
+ *fw_version = msg.data[1];
+ *sha1 = msg.data[2];
+
+ return ret;
+}
+
int ahab_dump_buffer(u32 *buffer, u32 buffer_length)
{
struct udevice *dev = gd->arch.s400_dev;