[RFC PATCH 02/10] firmware: zynqmp: move zynqmp_pm_request_node API

Tanmay Shah tanmay.shah at amd.com
Tue Jul 25 16:06:42 CEST 2023


Requesting node to firmware can be used by multiple drivers.
Move this API to firmware driver from power driver so others
can use the same interface.

Signed-off-by: Tanmay Shah <tanmay.shah at amd.com>
---
 drivers/firmware/firmware-zynqmp.c         |  7 +++++++
 drivers/power/domain/zynqmp-power-domain.c |  7 -------
 include/zynqmp_firmware.h                  | 14 ++++++++------
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
index ab4c4f1a69..0897992405 100644
--- a/drivers/firmware/firmware-zynqmp.c
+++ b/drivers/firmware/firmware-zynqmp.c
@@ -195,6 +195,13 @@ int zynqmp_pm_set_sd_config(u32 node, enum pm_sd_config_type config, u32 value)
 	return ret;
 }
 
+int zynqmp_pm_request_node(const u32 node, const u32 capabilities,
+			   const u32 qos, const enum zynqmp_pm_request_ack ack)
+{
+	return xilinx_pm_request(PM_REQUEST_NODE, node, capabilities,
+				 qos, ack, NULL);
+}
+
 int zynqmp_pm_is_function_supported(const u32 api_id, const u32 id)
 {
 	int ret;
diff --git a/drivers/power/domain/zynqmp-power-domain.c b/drivers/power/domain/zynqmp-power-domain.c
index 5ee9e020fb..d385dc5530 100644
--- a/drivers/power/domain/zynqmp-power-domain.c
+++ b/drivers/power/domain/zynqmp-power-domain.c
@@ -14,13 +14,6 @@
 
 #include <zynqmp_firmware.h>
 
-static int zynqmp_pm_request_node(const u32 node, const u32 capabilities,
-				  const u32 qos, const enum zynqmp_pm_request_ack ack)
-{
-	return xilinx_pm_request(PM_REQUEST_NODE, node, capabilities,
-				   qos, ack, NULL);
-}
-
 static int zynqmp_power_domain_request(struct power_domain *power_domain)
 {
 	int ret = 0;
diff --git a/include/zynqmp_firmware.h b/include/zynqmp_firmware.h
index 18a87d2749..ce086f48d4 100644
--- a/include/zynqmp_firmware.h
+++ b/include/zynqmp_firmware.h
@@ -444,12 +444,20 @@ enum pm_gem_config_type {
  */
 #define PAYLOAD_ARG_CNT	5U
 
+enum zynqmp_pm_request_ack {
+	ZYNQMP_PM_REQUEST_ACK_NO = 1,
+	ZYNQMP_PM_REQUEST_ACK_BLOCKING = 2,
+	ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING = 3,
+};
+
 unsigned int zynqmp_firmware_version(void);
 int zynqmp_pmufw_node(u32 id);
 int zynqmp_pmufw_config_close(void);
 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_request_node(const u32 node, const u32 capabilities,
+			   const u32 qos, enum zynqmp_pm_request_ack ack);
 int zynqmp_pm_set_sd_config(u32 node, enum pm_sd_config_type config, u32 value);
 int zynqmp_pm_set_gem_config(u32 node, enum pm_gem_config_type config,
 			     u32 value);
@@ -474,12 +482,6 @@ int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value);
 #define PM_CONFIG_IPI_PSU_CORTEXR5_0_MASK	0x00000100
 #define PM_CONFIG_IPI_PSU_CORTEXR5_1_MASK	0x00000200
 
-enum zynqmp_pm_request_ack {
-	ZYNQMP_PM_REQUEST_ACK_NO = 1,
-	ZYNQMP_PM_REQUEST_ACK_BLOCKING = 2,
-	ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING = 3,
-};
-
 /* Node capabilities */
 #define ZYNQMP_PM_CAPABILITY_ACCESS	0x1U
 #define ZYNQMP_PM_CAPABILITY_CONTEXT	0x2U
-- 
2.25.1



More information about the U-Boot mailing list