[PATCH 4/6] misc: sentinel: s400_api: Use new command request definitions
Ye Li
ye.li at nxp.com
Mon Jan 30 11:39:53 CET 2023
Remove legacy command definitions, change to use new ELE_xxx command
request.
Signed-off-by: Ye Li <ye.li at nxp.com>
Reviewed-by: Peng Fan <peng.fan at nxp.com>
---
arch/arm/include/asm/mach-imx/s400_api.h | 15 ---------------
arch/arm/mach-imx/imx8ulp/rdc.c | 2 +-
arch/arm/mach-imx/imx9/trdc.c | 2 +-
drivers/misc/sentinel/s400_api.c | 28 ++++++++++++++--------------
4 files changed, 16 insertions(+), 31 deletions(-)
diff --git a/arch/arm/include/asm/mach-imx/s400_api.h b/arch/arm/include/asm/mach-imx/s400_api.h
index c87a7c1..5582ff1 100644
--- a/arch/arm/include/asm/mach-imx/s400_api.h
+++ b/arch/arm/include/asm/mach-imx/s400_api.h
@@ -109,21 +109,6 @@
#define ELE_SUCCESS_IND (0xD6)
#define ELE_FAILURE_IND (0x29)
-#define AHAB_LOG_CID 0x21
-#define AHAB_AUTH_OEM_CTNR_CID 0x87
-#define AHAB_VERIFY_IMG_CID 0x88
-#define AHAB_RELEASE_CTNR_CID 0x89
-#define AHAB_WRITE_SECURE_FUSE_REQ_CID 0x91
-#define AHAB_FWD_LIFECYCLE_UP_REQ_CID 0x95
-#define AHAB_READ_FUSE_REQ_CID 0x97
-#define AHAB_GET_FW_VERSION_CID 0x9D
-#define AHAB_GET_EVENTS_REQ_CID 0xA2
-#define AHAB_RELEASE_RDC_REQ_CID 0xC4
-#define AHAB_GET_FW_STATUS_CID 0xC5
-#define AHAB_WRITE_FUSE_REQ_CID 0xD6
-#define AHAB_CAAM_RELEASE_CID 0xD7
-#define AHAB_GET_INFO_CID 0xDA
-
#define S400_MAX_MSG 255U
struct sentinel_msg {
diff --git a/arch/arm/mach-imx/imx8ulp/rdc.c b/arch/arm/mach-imx/imx8ulp/rdc.c
index 56df111..50b097b 100644
--- a/arch/arm/mach-imx/imx8ulp/rdc.c
+++ b/arch/arm/mach-imx/imx8ulp/rdc.c
@@ -210,7 +210,7 @@ int release_rdc(enum rdc_type type)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 2;
- msg.command = AHAB_RELEASE_RDC_REQ_CID;
+ msg.command = ELE_RELEASE_RDC_REQ;
msg.data[0] = (rdc_id << 8) | 0x2; /* A35 XRDC */
mu_hal_init(s_mu_base);
diff --git a/arch/arm/mach-imx/imx9/trdc.c b/arch/arm/mach-imx/imx9/trdc.c
index 3f37ce7..e05c704 100644
--- a/arch/arm/mach-imx/imx9/trdc.c
+++ b/arch/arm/mach-imx/imx9/trdc.c
@@ -339,7 +339,7 @@ int release_rdc(u8 xrdc)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 2;
- msg.command = AHAB_RELEASE_RDC_REQ_CID;
+ msg.command = ELE_RELEASE_RDC_REQ;
msg.data[0] = (rdc_id << 8) | 0x2; /* A55 */
mu_hal_init(s_mu_base);
diff --git a/drivers/misc/sentinel/s400_api.c b/drivers/misc/sentinel/s400_api.c
index c6b4ef5..6c0d0b3 100644
--- a/drivers/misc/sentinel/s400_api.c
+++ b/drivers/misc/sentinel/s400_api.c
@@ -29,7 +29,7 @@ int ahab_release_rdc(u8 core_id, u8 xrdc, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 2;
- msg.command = AHAB_RELEASE_RDC_REQ_CID;
+ msg.command = ELE_RELEASE_RDC_REQ;
switch (xrdc) {
case 0:
msg.data[0] = (0x74 << 8) | core_id;
@@ -74,7 +74,7 @@ int ahab_auth_oem_ctnr(ulong ctnr_addr, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 3;
- msg.command = AHAB_AUTH_OEM_CTNR_CID;
+ msg.command = ELE_OEM_CNTN_AUTH_REQ;
msg.data[0] = upper_32_bits(ctnr_addr);
msg.data[1] = lower_32_bits(ctnr_addr);
@@ -104,7 +104,7 @@ int ahab_release_container(u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 1;
- msg.command = AHAB_RELEASE_CTNR_CID;
+ msg.command = ELE_RELEASE_CONTAINER_REQ;
ret = misc_call(dev, false, &msg, size, &msg, size);
if (ret)
@@ -132,7 +132,7 @@ int ahab_verify_image(u32 img_id, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 2;
- msg.command = AHAB_VERIFY_IMG_CID;
+ msg.command = ELE_VERIFY_IMAGE_REQ;
msg.data[0] = 1 << img_id;
ret = misc_call(dev, false, &msg, size, &msg, size);
@@ -161,7 +161,7 @@ int ahab_forward_lifecycle(u16 life_cycle, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 2;
- msg.command = AHAB_FWD_LIFECYCLE_UP_REQ_CID;
+ msg.command = ELE_FWD_LIFECYCLE_UP_REQ;
msg.data[0] = life_cycle;
ret = misc_call(dev, false, &msg, size, &msg, size);
@@ -201,7 +201,7 @@ int ahab_read_common_fuse(u16 fuse_id, u32 *fuse_words, u32 fuse_num, u32 *respo
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 2;
- msg.command = AHAB_READ_FUSE_REQ_CID;
+ msg.command = ELE_READ_FUSE_REQ;
msg.data[0] = fuse_id;
ret = misc_call(dev, false, &msg, size, &msg, size);
@@ -238,7 +238,7 @@ int ahab_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 3;
- msg.command = AHAB_WRITE_FUSE_REQ_CID;
+ msg.command = ELE_WRITE_FUSE_REQ;
msg.data[0] = (32 << 16) | (fuse_id << 5);
if (lock)
msg.data[0] |= (1 << 31);
@@ -271,7 +271,7 @@ int ahab_release_caam(u32 core_did, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 2;
- msg.command = AHAB_CAAM_RELEASE_CID;
+ msg.command = ELE_RELEASE_CAAM_REQ;
msg.data[0] = core_did;
ret = misc_call(dev, false, &msg, size, &msg, size);
@@ -310,7 +310,7 @@ int ahab_get_fw_version(u32 *fw_version, u32 *sha1, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 1;
- msg.command = AHAB_GET_FW_VERSION_CID;
+ msg.command = ELE_GET_FW_VERSION_REQ;
ret = misc_call(dev, false, &msg, size, &msg, size);
if (ret)
@@ -341,7 +341,7 @@ int ahab_dump_buffer(u32 *buffer, u32 buffer_length)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 1;
- msg.command = AHAB_LOG_CID;
+ msg.command = ELE_DUMP_DEBUG_BUFFER_REQ;
ret = misc_call(dev, false, &msg, size, &msg, size);
if (ret) {
@@ -375,7 +375,7 @@ int ahab_get_info(struct sentinel_get_info_data *info, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 4;
- msg.command = AHAB_GET_INFO_CID;
+ msg.command = ELE_GET_INFO_REQ;
msg.data[0] = upper_32_bits((ulong)info);
msg.data[1] = lower_32_bits((ulong)info);
msg.data[2] = sizeof(struct sentinel_get_info_data);
@@ -406,7 +406,7 @@ int ahab_get_fw_status(u32 *status, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 1;
- msg.command = AHAB_GET_FW_STATUS_CID;
+ msg.command = ELE_GET_FW_STATUS_REQ;
ret = misc_call(dev, false, &msg, size, &msg, size);
if (ret)
@@ -436,7 +436,7 @@ int ahab_release_m33_trout(void)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 1;
- msg.command = 0xd3;
+ msg.command = ELE_ENABLE_RTC_REQ;
ret = misc_call(dev, false, &msg, size, &msg, size);
if (ret)
@@ -467,7 +467,7 @@ int ahab_get_events(u32 *events, u32 *events_cnt, u32 *response)
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 1;
- msg.command = AHAB_GET_EVENTS_REQ_CID;
+ msg.command = ELE_GET_EVENTS_REQ;
ret = misc_call(dev, false, &msg, size, &msg, size);
if (ret)
--
2.7.4
More information about the U-Boot
mailing list