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>
Subject: [PATCH V1 1/9] firmware: xilinx: Add IOCTL support for the AIE run time operations
Date: Wed, 2 Jul 2025 08:56:22 -0700 [thread overview]
Message-ID: <20250702155630.1737227-2-gregory.williams@amd.com> (raw)
In-Reply-To: <20250702155630.1737227-1-gregory.williams@amd.com>
From: Ronak Jain <ronak.jain@amd.com>
Add IOCTL support for the AIE run time operations listed below
- Column Reset
- Shim Reset
- Enabling of column clock buffer
- Zeroisation of Program and data memories
- Disabling of column clock buffer
- Enabling AXI-MM error event
- Set L2 controller NPI INTR
Signed-off-by: Ronak Jain <ronak.jain@amd.com>
---
drivers/firmware/xilinx/zynqmp.c | 20 +++++++++++++++++++
include/linux/firmware/xlnx-zynqmp.h | 30 ++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index 7356e860e65c..d9fdfd232d11 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1039,6 +1039,26 @@ int zynqmp_pm_set_boot_health_status(u32 value)
return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 3, 0, IOCTL_SET_BOOT_HEALTH_STATUS, value);
}
+/**
+ * zynqmp_pm_aie_operation - AI engine run time operations
+ * @node: AI engine node id
+ * @start_col: Starting column of AI partition
+ * @num_col: Number of column in AI partition
+ * @operation: ORed value of operations
+ *
+ * Return: Returns status, either success or error+reason
+ */
+int zynqmp_pm_aie_operation(u32 node, u16 start_col, u16 num_col, u32 operation)
+{
+ u32 partition;
+
+ partition = num_col;
+ partition = ((partition << 16U) | start_col);
+ return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, node, IOCTL_AIE_OPS,
+ partition, operation);
+}
+EXPORT_SYMBOL_GPL(zynqmp_pm_aie_operation);
+
/**
* zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release)
* @reset: Reset to be configured
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
index 6d4dbc196b93..1d30366f741b 100644
--- a/include/linux/firmware/xlnx-zynqmp.h
+++ b/include/linux/firmware/xlnx-zynqmp.h
@@ -136,6 +136,16 @@
#define SD_ITAPDLY 0xFF180314
#define SD_OTAPDLYSEL 0xFF180318
+/**
+ * XPM_VERSAL_EVENT_ERROR_MASK_AIE_CR: Error event mask for ME Correctable Error.
+ */
+#define XPM_VERSAL_EVENT_ERROR_MASK_AIE_CR BIT(16)
+
+/**
+ * XPM_VERSAL_EVENT_ERROR_MASK_AIE_NCR: Error event mask for ME Non-Correctable Error.
+ */
+#define XPM_VERSAL_EVENT_ERROR_MASK_AIE_NCR BIT(17)
+
/**
* XPM_EVENT_ERROR_MASK_DDRMC_CR: Error event mask for DDRMC MC Correctable ECC Error.
*/
@@ -155,6 +165,17 @@ enum pm_module_id {
TF_A_MODULE_ID = 0xa,
};
+/* AIE Operation */
+#define XILINX_AIE_OPS_COL_RST BIT(0)
+#define XILINX_AIE_OPS_SHIM_RST BIT(1)
+#define XILINX_AIE_OPS_ENB_COL_CLK_BUFF BIT(2)
+#define XILINX_AIE_OPS_ZEROISATION BIT(3)
+#define XILINX_AIE_OPS_DIS_COL_CLK_BUFF BIT(4)
+#define XILINX_AIE_OPS_ENB_AXI_MM_ERR_EVENT BIT(5)
+#define XILINX_AIE_OPS_SET_L2_CTRL_NPI_INTR BIT(6)
+#define XILINX_AIE_OPS_DATA_MEM_ZEROIZATION BIT(8U)
+#define XILINX_AIE_OPS_MEM_TILE_ZEROIZATION BIT(9U)
+
enum pm_api_cb_id {
PM_INIT_SUSPEND_CB = 30,
PM_ACKNOWLEDGE_CB = 31,
@@ -244,6 +265,8 @@ enum pm_ioctl_id {
/* Dynamic SD/GEM configuration */
IOCTL_SET_SD_CONFIG = 30,
IOCTL_SET_GEM_CONFIG = 31,
+ /* AIE/AIEML Operations */
+ IOCTL_AIE_OPS = 33,
/* IOCTL to get default/current QoS */
IOCTL_GET_QOS = 34,
};
@@ -633,6 +656,7 @@ int zynqmp_pm_set_tcm_config(u32 node_id, enum rpu_tcm_comb tcm_mode);
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);
#else
static inline int zynqmp_pm_get_api_version(u32 *version)
{
@@ -951,6 +975,12 @@ static inline int zynqmp_pm_set_gem_config(u32 node,
return -ENODEV;
}
+static inline int zynqmp_pm_aie_operation(u32 node, u16 start_col,
+ u16 num_col, u32 operation)
+{
+ return -ENODEV;
+}
+
#endif
#endif /* __FIRMWARE_ZYNQMP_H__ */
--
2.34.1
next prev parent reply other threads:[~2025-07-02 15:56 UTC|newest]
Thread overview: 22+ 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 ` Gregory Williams [this message]
2025-07-03 6:50 ` [PATCH V1 1/9] firmware: xilinx: Add IOCTL support for the AIE run time operations Krzysztof Kozlowski
2025-07-10 18:34 ` Williams, Gregory
2025-07-10 18:49 ` Williams, Gregory
2025-07-02 15:56 ` [PATCH V1 2/9] firmware: xilinx: Add IOCTL support to query QoS Gregory Williams
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-2-gregory.williams@amd.com \
--to=gregory.williams@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.