From: Gregory Williams <gregory.williams@amd.com>
To: Michal Simek <michal.simek@amd.com>
Cc: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>,
Naman Trivedi <naman.trivedimanojbhai@amd.com>,
Senthil Nathan Thangaraj <senthilnathan.thangaraj@amd.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 10/15] drivers: firmware: xilinx: Add IOCTL support for the AIE run time operations
Date: Wed, 18 Nov 2026 15:32:06 -0800 [thread overview]
Message-ID: <20261118233211.4121361-11-gregory.williams@amd.com> (raw)
In-Reply-To: <20261118233211.4121361-1-gregory.williams@amd.com>
From: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Add IOCTL support for the Versal 2 AIE run time operations listed as 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: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Co-developed-by: Gregory Williams <gregory.williams@amd.com>
Signed-off-by: Gregory Williams <gregory.williams@amd.com>
Signed-off-by: Naman Trivedi <naman.trivedimanojbhai@amd.com>
Signed-off-by: Senthil Nathan Thangaraj <senthilnathan.thangaraj@amd.com>
---
drivers/firmware/xilinx/zynqmp.c | 16 +++++++++
include/linux/firmware/xlnx-zynqmp.h | 52 ++++++++++++++++++++++++++++
2 files changed, 68 insertions(+)
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index a8c70e775ae3..995db401519c 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1268,6 +1268,22 @@ 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);
}
+/**
+ * versal2_pm_aie2ps_operation - AIE2PS run time operations
+ * @node: AI engine node id
+ * @size: Size of the DMA addr
+ * @addr_high: higher 32 bits of DMA addr
+ * @addr_low: lower 32 bits of DMA addr
+ *
+ * Return: Returns status, either success or error+reason
+ */
+int versal2_pm_aie2ps_operation(u32 node, u32 size, u32 addr_high, u32 addr_low)
+{
+ return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 5, node, IOCTL_AIE2PS_OPS,
+ size, addr_high, addr_low);
+}
+EXPORT_SYMBOL_GPL(versal2_pm_aie2ps_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 effa1a2445b3..042dcb164fc3 100644
--- a/include/linux/firmware/xlnx-zynqmp.h
+++ b/include/linux/firmware/xlnx-zynqmp.h
@@ -141,6 +141,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.
*/
@@ -166,6 +176,37 @@ enum pm_module_id {
TF_A_MODULE_ID = 0xa,
};
+/* AIE Operation */
+enum pm_aie_operations {
+ XILINX_AIE_OPS_MIN = 0U,
+ XILINX_AIE_OPS_COL_RST = 1U,
+ XILINX_AIE_OPS_SHIM_RST = 2U,
+ XILINX_AIE_OPS_UC_ZEROIZATION = 3U,
+ XILINX_AIE_OPS_ENB_COL_CLK_BUFF = 4U,
+ XILINX_AIE_OPS_HANDSHAKE = 5U,
+ XILINX_AIE_OPS_CLR_HW_ERR_STS = 6U,
+ XILINX_AIE_OPS_START_NUM_COL = 7U,
+ XILINX_AIE_OPS_ZEROISATION = 8U,
+ XILINX_AIE_OPS_AXIMM_ISOLATION = 9U,
+ XILINX_AIE_OPS_NMU_CONFIG = 10U,
+ XILINX_AIE_OPS_DIS_MEM_PRIV = 11U,
+ XILINX_AIE_OPS_DIS_MEM_INTERLEAVE = 12U,
+ XILINX_AIE_OPS_ENB_UC_DMA_PAUSE = 13U,
+ XILINX_AIE_OPS_ENB_NOC_DMA_PAUSE = 14U,
+ XILINX_AIE_OPS_SET_ECC_SCRUB_PERIOD = 15U,
+ XILINX_AIE_OPS_DIS_COL_CLK_BUFF = 16U,
+ XILINX_AIE_OPS_HW_ERR_INT = 17U,
+ XILINX_AIE_OPS_HW_ERR_MASK = 18U,
+ XILINX_AIE_OPS_ENB_MEM_PRIV = 19U,
+ XILINX_AIE_OPS_CTRL_PKT_TLAST_ERR = 20U,
+ XILINX_AIE_OPS_ENB_AXI_MM_ERR_EVENT = 32U, /* Backward compatibility for AIE1/AIE2 */
+ XILINX_AIE_OPS_SET_L2_CTRL_NPI_INTR = 64U, /* Backward compatibility for AIE1/AIE2 */
+ XILINX_AIE_OPS_PROG_MEM_ZEROIZATION = 128U, /* Backward compatibility for AIE1/AIE2 */
+ XILINX_AIE_OPS_DATA_MEM_ZEROIZATION = 256U, /* Backward compatibility for AIE1/AIE2 */
+ XILINX_AIE_OPS_MEM_TILE_ZEROIZATION = 512U, /* Backward compatibility for AIE1/AIE2 */
+ XILINX_AIE_OPS_MAX = 1023U, /* Backward compatibility for AIE1/AIE2 */
+};
+
enum pm_api_cb_id {
PM_INIT_SUSPEND_CB = 30,
PM_ACKNOWLEDGE_CB = 31,
@@ -257,8 +298,12 @@ 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,
+ /* AIE2PS Operations */
+ IOCTL_AIE2PS_OPS = 39,
};
enum pm_query_id {
@@ -659,6 +704,7 @@ int zynqmp_pm_stop_rpu(const u32 node);
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 versal2_pm_aie2ps_operation(u32 node, u32 size, u32 addr_high, u32 addr_low);
#else
static inline int zynqmp_pm_get_api_version(u32 *version)
{
@@ -996,6 +1042,12 @@ static inline int zynqmp_pm_set_gem_config(u32 node,
return -ENODEV;
}
+static inline int versal2_pm_aie2ps_operation(u32 node, u32 size, u32 addr_high,
+ u32 addr_low)
+{
+ return -ENODEV;
+}
+
#endif
#endif /* __FIRMWARE_ZYNQMP_H__ */
--
2.34.1
next prev parent reply other threads:[~2026-11-18 23:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 23:31 [PATCH 00/15] accel: Add AMD Versal AI Engine driver (with Versal Gen 2 firmware support) Gregory Williams
2026-11-18 23:31 ` [PATCH 01/15] firmware: xilinx: Separate TF-A checking Gregory Williams
2026-11-18 23:31 ` [PATCH 02/15] firmware: xilinx: Call va_start after pm feature check Gregory Williams
2026-11-18 23:31 ` [PATCH 03/15] firmware: xilinx: Add comments about number of arguments Gregory Williams
2026-11-18 23:32 ` [PATCH 04/15] firmware: xilinx: Use match data for ZynqMP/Versal Gregory Williams
2026-11-18 23:32 ` [PATCH 05/15] firmware: xilinx: Rename zynqmp_pm_invoke_fw_fn() Gregory Williams
2026-11-18 23:32 ` [PATCH 06/15] dt-bindings: firmware: xilinx: Add Versal Gen 2 compatible string Gregory Williams
2026-11-18 23:32 ` [PATCH 07/15] firmware: xilinx: Add support for Versal Gen 2 Gregory Williams
2026-11-18 23:32 ` [PATCH 08/15] dt-bindings: clock: versal: add Versal Gen 2 compatible string Gregory Williams
2026-11-18 23:32 ` [PATCH 09/15] clk: zynqmp: Add " Gregory Williams
2026-11-18 23:32 ` Gregory Williams [this message]
2026-11-18 23:32 ` [PATCH 11/15] dt-bindings: soc: xilinx: Add Versal AI Engine DT binding Gregory Williams
2026-11-18 23:32 ` [PATCH 12/15] accel/amd-ai-engine: Add AMD AI Engine device driver Gregory Williams
2026-11-18 23:32 ` [PATCH 13/15] accel/amd-ai-engine: Add pm ops for firmware calls Gregory Williams
2026-11-18 23:32 ` [PATCH 14/15] accel/amd-ai-engine: Add support to enable/disable tile clocks Gregory Williams
2026-11-18 23:32 ` [PATCH 15/15] accel/amd-ai-engine: Add 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=20261118233211.4121361-11-gregory.williams@amd.com \
--to=gregory.williams@amd.com \
--cc=abhyuday.godhasara@xilinx.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=naman.trivedimanojbhai@amd.com \
--cc=senthilnathan.thangaraj@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®