[PATCH v1] misc: imx_ele: add ELE release aux API

alice.guo at oss.nxp.com alice.guo at oss.nxp.com
Sun Oct 6 02:19:19 CEST 2024


From: Peng Fan <peng.fan at nxp.com>

Add release AUX core ELE API which is used to replace RTC enable
on iMX95 to release TROUT.

Signed-off-by: Peng Fan <peng.fan at nxp.com>
Signed-off-by: Alice Guo <alice.guo at nxp.com>
Reviewed-by: Ye Li <ye.li at nxp.com>
---
 arch/arm/include/asm/mach-imx/ele_api.h |  7 +++++++
 drivers/misc/imx_ele/ele_api.c          | 26 +++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/arch/arm/include/asm/mach-imx/ele_api.h b/arch/arm/include/asm/mach-imx/ele_api.h
index d4ac567e7e..7bb9d15b7e 100644
--- a/arch/arm/include/asm/mach-imx/ele_api.h
+++ b/arch/arm/include/asm/mach-imx/ele_api.h
@@ -38,6 +38,7 @@
 #define ELE_ENABLE_APC_REQ (0xD2)
 #define ELE_ENABLE_RTC_REQ (0xD3)
 #define ELE_DEEP_POWER_DOWN_REQ (0xD4)
+#define ELE_ENABLE_AUX_REQ (0xD4)
 #define ELE_STOP_RST_TIMER_REQ (0xD5)
 #define ELE_WRITE_FUSE_REQ (0xD6)
 #define ELE_RELEASE_CAAM_REQ (0xD7)
@@ -113,6 +114,12 @@
 #define ELE_SUCCESS_IND (0xD6)
 #define ELE_FAILURE_IND (0x29)
 
+enum ELE_AUX_ID {
+	ELE_RTC = 0x1,
+	ELE_APC = 0x2,
+	ELE_CM7 = 0xb
+};
+
 #define ELE_MAX_MSG          255U
 
 struct ele_msg {
diff --git a/drivers/misc/imx_ele/ele_api.c b/drivers/misc/imx_ele/ele_api.c
index b753419f01..4a40f2ed00 100644
--- a/drivers/misc/imx_ele/ele_api.c
+++ b/drivers/misc/imx_ele/ele_api.c
@@ -459,6 +459,32 @@ int ele_release_m33_trout(void)
 	return ret;
 }
 
+int ele_enable_aux(enum ELE_AUX_ID id)
+{
+	struct udevice *dev = gd->arch.ele_dev;
+	int size = sizeof(struct ele_msg);
+	struct ele_msg msg;
+	int ret;
+
+	if (!dev) {
+		printf("ele dev is not initialized\n");
+		return -ENODEV;
+	}
+
+	msg.version = ELE_VERSION;
+	msg.tag = ELE_CMD_TAG;
+	msg.size = 2;
+	msg.command = ELE_ENABLE_AUX_REQ;
+	msg.data[0] = id;
+
+	ret = misc_call(dev, false, &msg, size, &msg, size);
+	if (ret)
+		printf("Error: %s: ret %d, response 0x%x\n",
+		       __func__, ret, msg.data[0]);
+
+	return ret;
+}
+
 int ele_get_events(u32 *events, u32 *events_cnt, u32 *response)
 {
 	struct udevice *dev = gd->arch.ele_dev;
-- 
2.34.1



More information about the U-Boot mailing list