Commit a1531c32 authored by Leonard Crestez's avatar Leonard Crestez

plat: imx8m: Pass SMC handle into dram_dvfs_handler

This allows returning multiple parameters.

No functional change intended.
Signed-off-by: default avatarLeonard Crestez <leonard.crestez@nxp.com>
Acked-by: default avatarJacky Bai <ping.bai@nxp.com>
parent 0c2ffb04
......@@ -36,8 +36,7 @@ uintptr_t imx_svc_smc_handler(uint32_t smc_fid,
switch (smc_fid) {
#if defined(PLAT_IMX8M) || defined(PLAT_IMX8MM) || defined(PLAT_IMX8MN)
case IMX_SIP_DDR_DVFS:
SMC_RET1(handle, dram_dvfs_handler(smc_fid, x1, x2, x3));
break;
return dram_dvfs_handler(smc_fid, handle, x1, x2, x3);
case FSL_SIP_GPC:
SMC_RET1(handle, imx_gpc_handler(smc_fid, x1, x2, x3));
break;
......
......@@ -10,8 +10,10 @@
#include <mmio.h>
#include <spinlock.h>
#include <smccc.h>
#include <smccc_helpers.h>
#include <imx_sip.h>
#include <interrupt_mgmt.h>
#include <std_svc.h>
static struct dram_info dram_info;
......@@ -255,6 +257,7 @@ void dram_exit_retention(void)
}
int dram_dvfs_handler(uint32_t smc_fid,
void *handle,
u_register_t x1,
u_register_t x2,
u_register_t x3)
......@@ -282,12 +285,13 @@ int dram_dvfs_handler(uint32_t smc_fid,
for (i = 0; i < 4; ++i)
if (!dram_info.timing_info->fsp_table[i])
break;
return i;
SMC_RET1(handle, i);
} else if (x1 == IMX_SIP_DDR_DVFS_GET_FREQ_INFO) {
if (x2 < 4)
return dram_info.timing_info->fsp_table[x2];
else
return -3;
if (x2 < 4) {
SMC_RET1(handle, dram_info.timing_info->fsp_table[x2]);
} else {
SMC_RET1(handle, -3);
}
} else if (x1 < 4) {
wait_ddrc_hwffc_done = true;
dsb();
......@@ -326,8 +330,8 @@ int dram_dvfs_handler(uint32_t smc_fid,
sev();
isb();
return 0;
SMC_RET1(handle, 0);
}
return SMC_UNK;
SMC_RET1(handle, SMC_UNK);
}
......@@ -97,8 +97,8 @@ int imx_hab_handler(uint32_t smc_fid, u_register_t x1,
u_register_t x2, u_register_t x3, u_register_t x4);
int imx_noc_handler(uint32_t smc_fid, u_register_t x1,
u_register_t x2, u_register_t x3);
int dram_dvfs_handler(uint32_t smc_fid, u_register_t x1,
u_register_t x2, u_register_t x3);
int dram_dvfs_handler(uint32_t smc_fid, void *handle,
u_register_t x1, u_register_t x2, u_register_t x3);
#endif
uint64_t imx_buildinfo_handler(uint32_t smc_fid, u_register_t x1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment