misc: ele_api: Add support for XSPI SET GMID command
The XSPI SET GMID command is used to assign GMID ownership to the requester, allowing access to protected XSPI control registers. This API must be called in SPL if XSPI GMID-protected settings need to be modified. Otherwise, XSPI configuration depends on the previous GMID owner to provide the correct settings. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#define ELE_ATTEST_REQ (0xDB)
|
||||
#define ELE_RELEASE_PATCH_REQ (0xDC)
|
||||
#define ELE_OTP_SEQ_SWITH_REQ (0xDD)
|
||||
#define ELE_SET_GMID_REQ (0xE4)
|
||||
#define ELE_WRITE_SHADOW_REQ (0xF2)
|
||||
#define ELE_READ_SHADOW_REQ (0xF3)
|
||||
|
||||
@@ -162,6 +163,7 @@ int ele_return_lifecycle_update(ulong signed_msg_blk, u32 *response);
|
||||
int ele_start_rng(void);
|
||||
int ele_write_shadow_fuse(u32 fuse_id, u32 fuse_val, u32 *response);
|
||||
int ele_read_shadow_fuse(u32 fuse_id, u32 *fuse_val, u32 *response);
|
||||
int ele_set_gmid(u32 *response);
|
||||
int ele_volt_change_start_req(void);
|
||||
int ele_volt_change_finish_req(void);
|
||||
#endif
|
||||
|
||||
@@ -844,3 +844,31 @@ int ele_volt_change_finish_req(void)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ele_set_gmid(u32 *response)
|
||||
{
|
||||
struct udevice *dev = gd->arch.ele_dev;
|
||||
int size = sizeof(struct ele_msg);
|
||||
struct ele_msg msg = {};
|
||||
int ret;
|
||||
|
||||
if (!dev) {
|
||||
printf("ele dev is not initialized\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
msg.version = ELE_VERSION;
|
||||
msg.tag = ELE_CMD_TAG;
|
||||
msg.size = 1;
|
||||
msg.command = ELE_SET_GMID_REQ;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user