mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] ARM: i.MX: ele: remove unnecessary argument
Date: Fri,  1 Mar 2024 12:19:15 +0100	[thread overview]
Message-ID: <20240301111915.2439646-1-s.hauer@pengutronix.de> (raw)

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@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




             reply	other threads:[~2024-03-01 11:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 11:19 Sascha Hauer [this message]
2024-03-04  9:47 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240301111915.2439646-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox