[PATCH] ARM: i.MX: ele: remove unnecessary argument

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 1 03:19:15 PST 2024


The get_response argument to imx9_s3mua_call() is always set to true by
the callers. It must be like that because in the ELE API Reference Guide
every call into the ELE has a response. Drop the unnecessary argument.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/mach-imx/ele.c | 34 ++++++++++++++++------------------
 include/mach/imx/ele.h  |  2 +-
 2 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-imx/ele.c b/arch/arm/mach-imx/ele.c
index 18161428c6..ab3958cbd3 100644
--- a/arch/arm/mach-imx/ele.c
+++ b/arch/arm/mach-imx/ele.c
@@ -116,7 +116,7 @@ static int mu_write(void __iomem *base, struct ele_msg *msg)
 	return 0;
 }
 
-static int imx9_s3mua_call(struct ele_msg *msg, bool get_response)
+static int imx9_s3mua_call(struct ele_msg *msg)
 {
 	void __iomem *s3mua = IOMEM(MX9_S3MUA_BASE_ADDR);
 	u32 result;
@@ -126,11 +126,9 @@ static int imx9_s3mua_call(struct ele_msg *msg, bool get_response)
 	if (ret)
 		return ret;
 
-	if (get_response) {
-		ret = mu_read(s3mua, msg);
-		if (ret)
-			return ret;
-	}
+	ret = mu_read(s3mua, msg);
+	if (ret)
+		return ret;
 
 	result = msg->data[0];
 	if ((result & 0xff) == 0xd6)
@@ -139,9 +137,9 @@ static int imx9_s3mua_call(struct ele_msg *msg, bool get_response)
 	return -EIO;
 }
 
-int ele_call(struct ele_msg *msg, bool get_response)
+int ele_call(struct ele_msg *msg)
 {
-	return imx9_s3mua_call(msg, get_response);
+	return imx9_s3mua_call(msg);
 }
 
 int ele_get_info(struct ele_get_info_data *info)
@@ -159,7 +157,7 @@ int ele_get_info(struct ele_get_info_data *info)
 	};
 	int ret;
 
-	ret = ele_call(&msg, true);
+	ret = ele_call(&msg);
 	if (ret)
 		pr_err("Could not get ELE info: ret %d, response 0x%x\n",
 			ret, msg.data[0]);
@@ -201,7 +199,7 @@ int imx93_ele_load_fw(void *bl33)
 	/* Actual address of the container header */
 	msg.data[2] = lower_32_bits((unsigned long)firmware);
 
-	ret = ele_call(&msg, true);
+	ret = ele_call(&msg);
 	if (ret)
 		pr_err("Could not start ELE firmware: ret %d, response 0x%x\n",
 			ret, msg.data[0]);
@@ -220,7 +218,7 @@ int ele_read_common_fuse(u16 fuse_id, u32 *fuse_word, u32 *response)
 	msg.command = ELE_READ_FUSE_REQ;
 	msg.data[0] = fuse_id;
 
-	ret = imx9_s3mua_call(&msg, true);
+	ret = imx9_s3mua_call(&msg);
 
 	if (response)
 		*response = msg.data[0];
@@ -243,7 +241,7 @@ int ele_read_shadow_fuse(u16 fuse_id, u32 *fuse_word, u32 *response)
 	msg.command = ELE_READ_SHADOW_REQ;
 	msg.data[0] = fuse_id;
 
-	ret = imx9_s3mua_call(&msg, true);
+	ret = imx9_s3mua_call(&msg);
 
 	if (response)
 		*response = msg.data[0];
@@ -281,7 +279,7 @@ int ele_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response)
 
 	msg.data[1] = fuse_val;
 
-	ret = imx9_s3mua_call(&msg, true);
+	ret = imx9_s3mua_call(&msg);
 
 	if (response)
 		*response = msg.data[0];
@@ -312,7 +310,7 @@ int ele_forward_lifecycle(enum ele_lifecycle lc, u32 *response)
 	msg.command = ELE_FWD_LIFECYCLE_UP_REQ;
 	msg.data[0] = lc;
 
-	ret = imx9_s3mua_call(&msg, true);
+	ret = imx9_s3mua_call(&msg);
 
 	if (response)
 		*response = msg.data[0];
@@ -342,7 +340,7 @@ int ele_authenticate_container(unsigned long addr, u32 *response)
 	msg.data[0] = upper_32_bits(addr);
 	msg.data[1] = lower_32_bits(addr);
 
-	ret = imx9_s3mua_call(&msg, true);
+	ret = imx9_s3mua_call(&msg);
 
 	if (response)
 		*response = msg.data[0];
@@ -369,7 +367,7 @@ int ele_release_container(u32 *response)
 	msg.size = 1;
 	msg.command = ELE_RELEASE_CONTAINER_REQ;
 
-	ret = imx9_s3mua_call(&msg, true);
+	ret = imx9_s3mua_call(&msg);
 
 	if (response)
 		*response = msg.data[0];
@@ -404,7 +402,7 @@ int ele_release_rdc(u8 core_id, u8 xrdc, u32 *response)
 		return -EINVAL;
 	}
 
-	ret = ele_call(&msg, true);
+	ret = ele_call(&msg);
 	if (ret)
 		pr_err("%s: ret %d, core id %u, response 0x%x\n",
 			__func__, ret, core_id, msg.data[0]);
@@ -571,7 +569,7 @@ static int ahab_get_events(u32 *events)
 	msg.size = 1;
 	msg.command = ELE_GET_EVENTS_REQ;
 
-	ret = imx9_s3mua_call(&msg, true);
+	ret = imx9_s3mua_call(&msg);
 	if (ret) {
 		pr_err("%s: ret %d, response 0x%x\n", __func__, ret, msg.data[0]);
 
diff --git a/include/mach/imx/ele.h b/include/mach/imx/ele.h
index 018e8345aa..0c863f6cb3 100644
--- a/include/mach/imx/ele.h
+++ b/include/mach/imx/ele.h
@@ -146,7 +146,7 @@ enum ele_lifecycle {
 
 #define ELE_INFO_SOC_REV	GENMASK(31, 24)
 
-int ele_call(struct ele_msg *msg, bool get_response);
+int ele_call(struct ele_msg *msg);
 
 int ele_read_common_fuse(u16 fuse_id, u32 *fuse_word, u32 *response);
 int ele_release_rdc(u8 core_id, u8 xrdc, u32 *response);
-- 
2.39.2




More information about the barebox mailing list