]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
iMX8MQ: Recognize the B2 revision
authorYe Li <ye.li@nxp.com>
Fri, 19 Mar 2021 07:57:16 +0000 (15:57 +0800)
committerStefano Babic <sbabic@denx.de>
Thu, 8 Apr 2021 07:18:29 +0000 (09:18 +0200)
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>
arch/arm/include/asm/arch-imx/cpu.h
arch/arm/mach-imx/imx8m/soc.c

index 28244d767189165d6cb1db422f952e5e9249b7ba..ef090eb2f2360af797d8b9e194349e7e77300f3e 100644 (file)
@@ -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
 
index f322488c00faa336c34f6bf214c6e47b6f51c5b9..f3b9f2ddd61f906ae503c21751580e704e76ade4 100644 (file)
@@ -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);