diff options
Diffstat (limited to 'plat/imx/common/imx_sip_handler.c')
-rw-r--r-- | plat/imx/common/imx_sip_handler.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plat/imx/common/imx_sip_handler.c b/plat/imx/common/imx_sip_handler.c index b2df9f95..2d8e5219 100644 --- a/plat/imx/common/imx_sip_handler.c +++ b/plat/imx/common/imx_sip_handler.c @@ -178,6 +178,23 @@ int imx_misc_set_temp_handler(uint32_t smc_fid, return sc_misc_set_temp(ipc_handle, x1, x2, x3, x4); } +int imx_get_cpu_rev(uint32_t *cpu_id, uint32_t *cpu_rev) +{ + uint32_t id; + sc_err_t err; + + if (!cpu_id || !cpu_rev) + return -1; + + err = sc_misc_get_control(ipc_handle, SC_R_SYSTEM, SC_C_ID, &id); + if (err != SC_ERR_NONE) + return err; + + *cpu_rev = (id >> 5) & 0xf; + *cpu_id = id & 0x1f; + + return 0; +} #endif /* defined(PLAT_imx8qm) || defined(PLAT_imx8qx) */ static uint64_t imx_get_commit_hash(u_register_t x2, |