Commit 9dba7a4d authored by Ye Li's avatar Ye Li
Browse files

MLK-19433-2 imx8mq: Get chip rev for B1 revision



The mscale B1 uses OCOTP_HW_OCOTP_READ_FUSE_DATA register for chip id.
It returns a magic number 0xff0055aa.
Update get_cpu_rev to support this way, also enable OCOTP clock to allow
access OCOTP register.
Signed-off-by: default avatarYe Li <ye.li@nxp.com>
(cherry picked from commit 866631c2140b9352c6f74ec36d1a51fea40c0445)
parent b7d9a006
...@@ -659,6 +659,7 @@ int clock_init() ...@@ -659,6 +659,7 @@ int clock_init()
clock_enable(CCGR_WDOG3, 1); clock_enable(CCGR_WDOG3, 1);
clock_enable(CCGR_TSENSOR, 1); clock_enable(CCGR_TSENSOR, 1);
clock_enable(CCGR_OCOTP, 1);
return 0; return 0;
}; };
......
...@@ -229,14 +229,20 @@ u32 get_cpu_rev(void) ...@@ -229,14 +229,20 @@ u32 get_cpu_rev(void)
/* iMX8MQ */ /* iMX8MQ */
if (reg == 0x10) { if (reg == 0x10) {
/* For B0 chip, the DIGPROG is not updated, still TO1.0. /* For B0 chip, the DIGPROG is not updated, still TO1.0.
* we have to check ROM version further * we have to check ROM version or OCOTP_READ_FUSE_DATA
*/ */
uint32_t rom_version; if (readl((void __iomem *)(OCOTP_BASE_ADDR + 0x40))
rom_version = readl((void __iomem *)0x800); == 0xff0055aa) {
if (rom_version != 0x10) { /* 0xff0055aa is magic number for B1 */
rom_version = readl((void __iomem *)0x83c); reg = 0x21;
if (rom_version >= 0x20) } else {
reg = 0x20; uint32_t rom_version;
rom_version = readl((void __iomem *)0x800);
if (rom_version != 0x10) {
rom_version = readl((void __iomem *)0x83c);
if (rom_version == 0x20)
reg = 0x20;
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment