mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gregory Williams <gregory.williams@amd.com>
To: <ogabbay@kernel.org>, <michal.simek@amd.com>, <robh@kernel.org>
Cc: Ronak Jain <ronak.jain@amd.com>,
	<dri-devel@lists.freedesktop.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <gregory.williams@amd.com>,
	Amanda Baze <amanda.baze@amd.com>
Subject: [PATCH V1 2/9] firmware: xilinx: Add IOCTL support to query QoS
Date: Wed, 2 Jul 2025 08:56:23 -0700	[thread overview]
Message-ID: <20250702155630.1737227-3-gregory.williams@amd.com> (raw)
In-Reply-To: <20250702155630.1737227-1-gregory.williams@amd.com>

From: Ronak Jain <ronak.jain@amd.com>

Add support to query the QoS value on a device by using the PM IOCTL
EEMI API.

The caller only passes the node ID of the given device node and IOCTL
API will return the default QoS value as well as the current QoS
value.

Signed-off-by: Ronak Jain <ronak.jain@amd.com>
Signed-off-by: Amanda Baze <amanda.baze@amd.com>
---
 drivers/firmware/xilinx/zynqmp.c     | 26 ++++++++++++++++++++++++++
 include/linux/firmware/xlnx-zynqmp.h |  6 ++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index d9fdfd232d11..52dae076d2cb 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1636,6 +1636,32 @@ int zynqmp_pm_get_feature_config(enum pm_feature_config_id id,
 	return zynqmp_pm_invoke_fn(PM_IOCTL, payload, 3, 0, IOCTL_GET_FEATURE_CONFIG, id);
 }
 
+/**
+ * zynqmp_pm_get_qos - PM call to query default and current QoS of the node
+ * @node:      Node Id of the device
+ * @def_qos:   Default QoS value
+ * @qos:       Current QoS value
+ *
+ * Return:     Returns 0 on success and the default and current QoS registers in
+ *             @def_qos and @qos or error value on failure
+ */
+int zynqmp_pm_get_qos(u32 node, u32 *const def_qos, u32 *const qos)
+{
+	u32 ret_payload[PAYLOAD_ARG_CNT];
+	int ret;
+
+	if (!def_qos || !qos)
+		return -EINVAL;
+
+	ret = zynqmp_pm_invoke_fn(PM_IOCTL, ret_payload, 2, node, IOCTL_GET_QOS);
+
+	*def_qos = ret_payload[1];
+	*qos = ret_payload[2];
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(zynqmp_pm_get_qos);
+
 /**
  * zynqmp_pm_set_sd_config - PM call to set value of SD config registers
  * @node:	SD node ID
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
index 1d30366f741b..b2ca960d3bbe 100644
--- a/include/linux/firmware/xlnx-zynqmp.h
+++ b/include/linux/firmware/xlnx-zynqmp.h
@@ -657,6 +657,7 @@ 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);
 int zynqmp_pm_aie_operation(u32 node, u16 start_col, u16 num_col, u32 operation);
+int zynqmp_pm_get_qos(u32 node, u32 *const def_qos, u32 *const qos);
 #else
 static inline int zynqmp_pm_get_api_version(u32 *version)
 {
@@ -981,6 +982,11 @@ static inline int zynqmp_pm_aie_operation(u32 node, u16 start_col,
 	return -ENODEV;
 }
 
+static inline int zynqmp_pm_get_qos(u32 node, u32 *const def_qos, u32 *const qos)
+{
+	return -ENODEV;
+}
+
 #endif
 
 #endif /* __FIRMWARE_ZYNQMP_H__ */
-- 
2.34.1


  parent reply	other threads:[~2025-07-02 15:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02 15:56 [PATCH V1 0/9] AMD AI Engine device driver for Versal Gregory Williams
2025-07-02 15:56 ` [PATCH V1 1/9] firmware: xilinx: Add IOCTL support for the AIE run time operations Gregory Williams
2025-07-03  6:50   ` Krzysztof Kozlowski
2025-07-10 18:49     ` Williams, Gregory
2025-07-02 15:56 ` Gregory Williams [this message]
2025-07-02 15:56 ` [PATCH V1 3/9] dt-bindings: power: Add AMD Versal power domain bindings Gregory Williams
2025-07-03  6:43   ` Krzysztof Kozlowski
2025-07-10 18:53     ` Williams, Gregory
2025-07-10 21:34       ` Krzysztof Kozlowski
2025-07-02 15:56 ` [PATCH V1 4/9] dt-bindings: soc: xilinx: Add AI engine DT binding Gregory Williams
2025-07-03  6:48   ` Krzysztof Kozlowski
2025-07-10 19:03     ` Williams, Gregory
2025-07-10 21:38       ` Krzysztof Kozlowski
2025-07-11 18:33         ` Williams, Gregory
2025-07-12  7:33           ` Krzysztof Kozlowski
2025-07-14 14:51             ` Williams, Gregory
2025-07-02 15:56 ` [PATCH V1 5/9] accel: amd-ai-engine: Add AMD AI Engine device driver Gregory Williams
2025-07-02 15:56 ` [PATCH V1 6/9] accel: amd-ai-engine: Add support to enable/disable clocks and change clock frequency Gregory Williams
2025-07-02 15:56 ` [PATCH V1 7/9] accel: amd-ai-engine: Add support for AIEML devices Gregory Williams
2025-07-02 15:56 ` [PATCH V1 8/9] accel: amd-ai-engine: Create tile memory information Gregory Williams
2025-07-02 15:56 ` [PATCH V1 9/9] accel: amd-ai-engine: Adds AI Engine reset operations Gregory Williams

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=20250702155630.1737227-3-gregory.williams@amd.com \
    --to=gregory.williams@amd.com \
    --cc=amanda.baze@amd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=ogabbay@kernel.org \
    --cc=robh@kernel.org \
    --cc=ronak.jain@amd.com \
    /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

all inboxes | Powered by JetHome®