summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2018-11-06 21:12:39 -0800
committerYe Li <ye.li@nxp.com>2018-11-06 21:44:31 -0800
commitde14e88698b9ae9b0a9ac674f16d65b3ceb4ccc2 (patch)
treec37fa0b621606ee241336f2ad87924cc01bb4a4f /arch/arm
parent9a897099ed6ecfe33006210565cabc48e531852a (diff)
MLK-20228 mx7ulp: Read chip ID from SIM register
Since from B0 TO, there is a Mirror of JTAG ID register added in SIM. We can read the part revision from this register. Update codes to use this register. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-imx/mx7ulp/soc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c
index 10b2e189781..e07242302bc 100644
--- a/arch/arm/mach-imx/mx7ulp/soc.c
+++ b/arch/arm/mach-imx/mx7ulp/soc.c
@@ -33,7 +33,22 @@ u32 get_cpu_rev(void)
uint32_t rom_version;
rom_version = readl((void __iomem *)ROM_VERSION_ADDR);
- return (MXC_CPU_MX7ULP << 12) | (rom_version & 0xFF);
+ rom_version &= 0xFF;
+ if (rom_version == CHIP_REV_1_0) {
+ return (MXC_CPU_MX7ULP << 12) | (rom_version);
+ } else {
+ /* Check the "Mirror of JTAG ID" SIM register since RevB */
+ uint32_t id;
+ id = readl(SIM0_RBASE + 0x8c);
+ id = (id >> 28) & 0xFF;
+
+ /* Revision Number ULP1 Version
+ * 0000 A0
+ * 0001 B0
+ * 0010 B1
+ */
+ return (MXC_CPU_MX7ULP << 12) | (CHIP_REV_2_0 + (id - 1));
+ }
}
#ifdef CONFIG_REVISION_TAG