misc: ele_api: Add Voltage change start and finish APIs

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@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Ye Li
2026-01-08 19:06:56 +08:00
committed by Fabio Estevam
parent ab24985b8c
commit e77d6948f5
2 changed files with 54 additions and 0 deletions

View File

@@ -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;
}