aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2021-03-19 15:57:16 +0800
committerStefano Babic <sbabic@denx.de>2021-04-08 09:18:29 +0200
commitea2b26fb1280a1009e6a59872d5e61d83c06422a (patch)
treedaa5830d4efc3c12f897f3e2de7311e6d361f590
parent0d77b4522f061705e238b9116c9321ed9630b0b7 (diff)
downloadu-boot-ea2b26fb1280a1009e6a59872d5e61d83c06422a.zip
u-boot-ea2b26fb1280a1009e6a59872d5e61d83c06422a.tar.gz
u-boot-ea2b26fb1280a1009e6a59872d5e61d83c06422a.tar.bz2
iMX8MQ: Recognize the B2 revision
i.MX8MQ B2 is using same value in OCOTP_READ_FUSE_DATA like B1, so we have to check the ROM verision to distinguish the revision. As we have checked the B1 rev for sticky bits work around in secure boot. So it won't apply on B2. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--arch/arm/include/asm/arch-imx/cpu.h1
-rw-r--r--arch/arm/mach-imx/imx8m/soc.c11
2 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index 28244d7..ef090eb 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -65,6 +65,7 @@
#define CHIP_REV_1_5 0x15
#define CHIP_REV_2_0 0x20
#define CHIP_REV_2_1 0x21
+#define CHIP_REV_2_2 0x22
#define CHIP_REV_2_5 0x25
#define CHIP_REV_3_0 0x30
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index f322488..f3b9f2d 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -410,7 +410,16 @@ u32 get_cpu_rev(void)
* 0xff0055aa is magic number for B1.
*/
if (readl((void __iomem *)(OCOTP_BASE_ADDR + 0x40)) == 0xff0055aa) {
- reg = CHIP_REV_2_1;
+ /*
+ * B2 uses same DIGPROG and OCOTP_READ_FUSE_DATA value with B1,
+ * so have to check ROM to distinguish them
+ */
+ rom_version = readl((void __iomem *)ROM_VERSION_B0);
+ rom_version &= 0xff;
+ if (rom_version == CHIP_REV_2_2)
+ reg = CHIP_REV_2_2;
+ else
+ reg = CHIP_REV_2_1;
} else {
rom_version =
readl((void __iomem *)ROM_VERSION_A0);