[PATCH 11/13] misc: ele_api: Add Voltage change start and finish APIs
Peng Fan (OSS)
peng.fan at oss.nxp.com
Thu Jan 8 12:06:56 CET 2026
From: Ye Li <ye.li at nxp.com>
On GDET enabled part, need to call voltage change start and finish
APIs when adjust the voltage more than 100mv. Otherwise GDET will be
triggered and system is reset
Reviewed-by: Peng Fan <peng.fan at nxp.com>
Signed-off-by: Ye Li <ye.li at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
arch/arm/include/asm/mach-imx/ele_api.h | 4 +++
drivers/misc/imx_ele/ele_api.c | 50 +++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
diff --git a/arch/arm/include/asm/mach-imx/ele_api.h b/arch/arm/include/asm/mach-imx/ele_api.h
index 64b243dcaaa..4e1afc42bd8 100644
--- a/arch/arm/include/asm/mach-imx/ele_api.h
+++ b/arch/arm/include/asm/mach-imx/ele_api.h
@@ -14,6 +14,8 @@
#define ELE_PING_REQ (0x01)
#define ELE_FW_AUTH_REQ (0x02)
#define ELE_RESTART_RST_TIMER_REQ (0x04)
+#define ELE_VOLT_CHANGE_START_REQ (0x12)
+#define ELE_VOLT_CHANGE_FINISH_REQ (0x13)
#define ELE_DUMP_DEBUG_BUFFER_REQ (0x21)
#define ELE_OEM_CNTN_AUTH_REQ (0x87)
#define ELE_VERIFY_IMAGE_REQ (0x88)
@@ -160,4 +162,6 @@ int ele_return_lifecycle_update(ulong signed_msg_blk, u32 *response);
int ele_start_rng(void);
int ele_write_shadow_fuse(u32 fuse_id, u32 fuse_val, u32 *response);
int ele_read_shadow_fuse(u32 fuse_id, u32 *fuse_val, u32 *response);
+int ele_volt_change_start_req(void);
+int ele_volt_change_finish_req(void);
#endif
diff --git a/drivers/misc/imx_ele/ele_api.c b/drivers/misc/imx_ele/ele_api.c
index 661f70cf870..e7aee0fcef1 100644
--- a/drivers/misc/imx_ele/ele_api.c
+++ b/drivers/misc/imx_ele/ele_api.c
@@ -794,3 +794,53 @@ int ele_generate_dek_blob(u32 key_id, u32 src_paddr, u32 dst_paddr, u32 max_outp
return ret;
}
+
+int ele_volt_change_start_req(void)
+{
+ 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 = 1;
+ msg.command = ELE_VOLT_CHANGE_START_REQ;
+
+ 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_volt_change_finish_req(void)
+{
+ 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 = 1;
+ msg.command = ELE_VOLT_CHANGE_FINISH_REQ;
+
+ 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;
+}
--
2.51.0
More information about the U-Boot
mailing list