diff options
author | Anson Huang <Anson.Huang@nxp.com> | 2017-11-03 18:31:55 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:28:59 +0800 |
commit | 284c25bbd70acd81da229c622fa890b1f13bcd3e (patch) | |
tree | 49dc3e7e0a05604e9d136f279d11c75f890f31be | |
parent | cb54c607f0113b19526bfb0087b1f178872e977c (diff) |
MLK-16760 soc: imx: support i.MX8MQ new revision SoC
On i.MX8MQ, the new revision SoC does NOT update the
revision info in ANATOP_DIGPROG register, to support
dynamic SOC id/revision detection, only reading info
from ANATOP_DIGPROG is not working now, change to read
SOC id/revision from ATF which is in secure world.
The ATF will read the ANATOP_DIGPROG as well as ROM
version to decide the SOC revision.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
-rw-r--r-- | drivers/soc/imx/soc-imx8.c | 17 | ||||
-rw-r--r-- | include/soc/imx/fsl_sip.h | 3 |
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/soc/imx/soc-imx8.c b/drivers/soc/imx/soc-imx8.c index a25b3b16da46..1181874ce15f 100644 --- a/drivers/soc/imx/soc-imx8.c +++ b/drivers/soc/imx/soc-imx8.c @@ -30,8 +30,6 @@ #include <soc/imx/src.h> #include <soc/imx/fsl_sip.h> -#define ANADIG_DIGPROG 0x6c - struct imx8_soc_data { char *name; u32 (*soc_revision)(void); @@ -72,18 +70,15 @@ inline bool cpu_is_imx8mq(void) return imx8_soc_id == IMX_SOC_IMX8MQ; } -static u32 imx_init_revision_from_anatop(void) +static u32 imx_init_revision_from_atf(void) { - struct device_node *np; - void __iomem *anatop_base; + struct arm_smccc_res res; u32 digprog; u32 id, rev; - np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-anatop"); - anatop_base = of_iomap(np, 0); - WARN_ON(!anatop_base); - digprog = readl_relaxed(anatop_base + ANADIG_DIGPROG); - iounmap(anatop_base); + arm_smccc_smc(FSL_SIP_GET_SOC_INFO, 0, 0, + 0, 0, 0, 0, 0, &res); + digprog = res.a0; /* * Bit [23:16] is the silicon ID @@ -158,7 +153,7 @@ static u32 imx8qxp_soc_revision(void) static u32 imx8mq_soc_revision(void) { - return imx_init_revision_from_anatop(); + return imx_init_revision_from_atf(); } static struct imx8_soc_data imx8qm_soc_data = { diff --git a/include/soc/imx/fsl_sip.h b/include/soc/imx/fsl_sip.h index e4d02126e5f8..51d34629a75f 100644 --- a/include/soc/imx/fsl_sip.h +++ b/include/soc/imx/fsl_sip.h @@ -52,4 +52,7 @@ #define FSL_SIP_SRC 0xc2000005 #define FSL_SIP_SRC_M4_START 0x00 #define FSL_SIP_SRC_M4_STARTED 0x01 + +#define FSL_SIP_GET_SOC_INFO 0xc2000006 + #endif |