Commit ec1f64b420c7a5c6dc6435fa98735b694720e26c

Authored by Ye Li
1 parent 873587f1c0

MLK-25291-1 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>
(cherry picked from commit 1ac96bde4920fa3e2a3bb4a79b342ca4f5adb4a5)

Showing 2 changed files with 11 additions and 1 deletions Side-by-side Diff

arch/arm/include/asm/arch-imx/cpu.h
... ... @@ -68,6 +68,7 @@
68 68 #define CHIP_REV_1_5 0x15
69 69 #define CHIP_REV_2_0 0x20
70 70 #define CHIP_REV_2_1 0x21
  71 +#define CHIP_REV_2_2 0x22
71 72 #define CHIP_REV_2_5 0x25
72 73 #define CHIP_REV_3_0 0x30
73 74  
arch/arm/mach-imx/imx8m/soc.c
... ... @@ -404,7 +404,16 @@
404 404 * 0xff0055aa is magic number for B1.
405 405 */
406 406 if (readl((void __iomem *)(OCOTP_BASE_ADDR + 0x40)) == 0xff0055aa) {
407   - reg = CHIP_REV_2_1;
  407 + /*
  408 + * B2 uses same DIGPROG and OCOTP_READ_FUSE_DATA value with B1,
  409 + * so have to check ROM to distinguish them
  410 + */
  411 + rom_version = readl((void __iomem *)ROM_VERSION_B0);
  412 + rom_version &= 0xff;
  413 + if (rom_version == CHIP_REV_2_2)
  414 + reg = CHIP_REV_2_2;
  415 + else
  416 + reg = CHIP_REV_2_1;
408 417 } else {
409 418 rom_version =
410 419 readl((void __iomem *)ROM_VERSION_A0);