summaryrefslogtreecommitdiff
path: root/plat/imx/common
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2019-05-10 13:07:41 +0300
committerLeonard Crestez <leonard.crestez@nxp.com>2019-05-20 11:24:54 +0300
commit72196cbb669bf3fe9b28091889e8fc7fbf2a2556 (patch)
treee6f3105e9618281f3e5be1ebda19c0a987a0bc1e /plat/imx/common
parentd8b11091b6f9032c16fdc54218ceda10d21e3355 (diff)
plat: imx8mq: Implement IMX_SIP_GET_SOC_INFO
The manual documents that 0x3036006c should contains the soc revision for imx8mq but this always reports A0. Work around this by parsing the ROM header and checking if OCOTP register 0x40 is stuck at 0xff0055aa. Determining this inside TF-A makes life easier for OS, see for example this linux discussion: https://lkml.org/lkml/2019/5/3/465 The soc revision can also be useful inside TF-A itself, for example for the non-upstream DDR DVFS "busfreq" feature is affected by 8mq erratas. The clock for OCOTP block can be disabled by OS so only initialize soc revision once at boot time. Change-Id: I9ca3f27840229ce8a28b53870e44da29f63c73aa Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Diffstat (limited to 'plat/imx/common')
-rw-r--r--plat/imx/common/imx_sip_svc.c5
-rw-r--r--plat/imx/common/include/imx_sip_svc.h7
2 files changed, 12 insertions, 0 deletions
diff --git a/plat/imx/common/imx_sip_svc.c b/plat/imx/common/imx_sip_svc.c
index c27fbf2e..45d18eff 100644
--- a/plat/imx/common/imx_sip_svc.c
+++ b/plat/imx/common/imx_sip_svc.c
@@ -26,6 +26,11 @@ static uintptr_t imx_sip_handler(unsigned int smc_fid,
u_register_t flags)
{
switch (smc_fid) {
+#if defined(PLAT_imx8mq)
+ case IMX_SIP_GET_SOC_INFO:
+ SMC_RET1(handle, imx_soc_info_handler(smc_fid, x1, x2, x3));
+ break;
+#endif
#if (defined(PLAT_IMX8QM) || defined(PLAT_IMX8QX))
case IMX_SIP_SRTC:
return imx_srtc_handler(smc_fid, handle, x1, x2, x3, x4);
diff --git a/plat/imx/common/include/imx_sip_svc.h b/plat/imx/common/include/imx_sip_svc.h
index afe62d4a..f532840d 100644
--- a/plat/imx/common/include/imx_sip_svc.h
+++ b/plat/imx/common/include/imx_sip_svc.h
@@ -17,6 +17,8 @@
#define IMX_SIP_BUILDINFO 0xC2000003
#define IMX_SIP_BUILDINFO_GET_COMMITHASH 0x00
+#define IMX_SIP_GET_SOC_INFO 0xC2000006
+
#define IMX_SIP_WAKEUP_SRC 0xC2000009
#define IMX_SIP_WAKEUP_SRC_SCU 0x1
#define IMX_SIP_WAKEUP_SRC_IRQSTEER 0x2
@@ -26,6 +28,11 @@
#define IMX_SIP_MISC_SET_TEMP 0xC200000C
+#if defined(PLAT_imx8mq)
+int imx_soc_info_handler(uint32_t smc_fid, u_register_t x1,
+ u_register_t x2, u_register_t x3);
+#endif
+
#if (defined(PLAT_IMX8QM) || defined(PLAT_IMX8QX))
int imx_cpufreq_handler(uint32_t smc_fid, u_register_t x1,
u_register_t x2, u_register_t x3);