u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
To: <u-boot@lists.denx.de>
Cc: <adrian.fiergolski@fastree3d.com>, <jh80.chung@samsung.com>,
	<sven@svenpeter.dev>, <kettenis@openbsd.org>, <sjg@chromium.org>,
	<git@xilinx.com>, <git@amd.com>,
	Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Subject: [PATCH 1/5] firmware: zynqmp: Change prototype of zynqmp_pmufw_load_config_object()
Date: Fri, 15 Jul 2022 15:09:20 +0530	[thread overview]
Message-ID: <1657877964-16742-2-git-send-email-ashok.reddy.soma@xilinx.com> (raw)
In-Reply-To: <1657877964-16742-1-git-send-email-ashok.reddy.soma@xilinx.com>

zynqmp_pmufw_load_config_object() has some error cases and it is better
to return those errors. Change prototype of this function to return
errors.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
---

 drivers/firmware/firmware-zynqmp.c | 8 +++++---
 include/zynqmp_firmware.h          | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
index 0f0d2b07c0..34d9b47003 100644
--- a/drivers/firmware/firmware-zynqmp.c
+++ b/drivers/firmware/firmware-zynqmp.c
@@ -210,7 +210,7 @@ int zynqmp_pm_is_function_supported(const u32 api_id, const u32 id)
  * @cfg_obj: Pointer to the configuration object
  * @size:    Size of @cfg_obj in bytes
  */
-void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
+int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
 {
 	int err;
 	u32 ret_payload[PAYLOAD_ARG_CNT];
@@ -224,12 +224,12 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
 				0, ret_payload);
 	if (err == XST_PM_NO_ACCESS) {
 		printf("PMUFW no permission to change config object\n");
-		return;
+		return -EACCES;
 	}
 
 	if (err == XST_PM_ALREADY_CONFIGURED) {
 		debug("PMUFW Node is already configured\n");
-		return;
+		return -ENODEV;
 	}
 
 	if (err)
@@ -240,6 +240,8 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
 
 	if ((err || ret_payload[0]) && IS_ENABLED(CONFIG_SPL_BUILD))
 		panic("PMUFW config object loading failed in EL3\n");
+
+	return 0;
 }
 
 static int zynqmp_power_probe(struct udevice *dev)
diff --git a/include/zynqmp_firmware.h b/include/zynqmp_firmware.h
index 6c4fd9a6c5..1c22a62207 100644
--- a/include/zynqmp_firmware.h
+++ b/include/zynqmp_firmware.h
@@ -449,7 +449,7 @@ enum pm_gem_config_type {
 unsigned int zynqmp_firmware_version(void);
 int zynqmp_pmufw_node(u32 id);
 int zynqmp_pmufw_config_close(void);
-void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size);
+int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size);
 int xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
 		      u32 arg3, u32 *ret_payload);
 int zynqmp_pm_set_sd_config(u32 node, enum pm_sd_config_type config, u32 value);
-- 
2.17.1


  reply	other threads:[~2022-07-15  9:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  9:39 [PATCH 0/5] Enable power domain driver in ZynqMP and Versal Ashok Reddy Soma
2022-07-15  9:39 ` Ashok Reddy Soma [this message]
2022-07-15  9:39 ` [PATCH 2/5] firmware: zynqmp: Load config overlay for core0 to pmufw Ashok Reddy Soma
2022-07-15 16:13   ` Stefan Herbrechtsmeier
2022-07-15 16:34     ` Michal Simek
2022-07-16 11:17       ` Stefan Herbrechtsmeier
2022-07-19  4:44         ` Soma, Ashok Reddy
2022-07-20 16:02           ` Stefan Herbrechtsmeier
2022-07-21 11:53             ` Soma, Ashok Reddy
2022-07-15  9:39 ` [PATCH 3/5] arm64: zynqmp: Enable power domain driver Ashok Reddy Soma
2022-07-15  9:39 ` [PATCH 4/5] mailbox: zynqmp: Move struct zynqmp_ipi_msg from sys_proto.h Ashok Reddy Soma
2022-07-15  9:39 ` [PATCH 5/5] arm64: versal: Enable power domain driver and its dependencies Ashok Reddy Soma

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=1657877964-16742-2-git-send-email-ashok.reddy.soma@xilinx.com \
    --to=ashok.reddy.soma@xilinx.com \
    --cc=adrian.fiergolski@fastree3d.com \
    --cc=git@amd.com \
    --cc=git@xilinx.com \
    --cc=jh80.chung@samsung.com \
    --cc=kettenis@openbsd.org \
    --cc=sjg@chromium.org \
    --cc=sven@svenpeter.dev \
    --cc=u-boot@lists.denx.de \
    /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;
as well as URLs for NNTP newsgroup(s).