Commit 308ca269 authored by Peng Fan's avatar Peng Fan Committed by Troy Kisky

imx8m: imx8mq: get chip rev for B1 revision

The i.MX8MQ B1 uses OCOTP_HW_OCOTP_READ_FUSE_DATA register for chip id.
It returns a magic number 0xff0055aa. update get_cpu_rev to support it,
and enable ocotp clock to access ocotp.
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
parent 5c7054b8
......@@ -854,6 +854,7 @@ int clock_init(void)
init_wdog_clk();
clock_enable(CCGR_TSENSOR, 1);
clock_enable(CCGR_OCOTP, 1);
return 0;
}
......
......@@ -190,20 +190,21 @@ u32 get_cpu_rev(void)
} else {
if (reg == CHIP_REV_1_0) {
/*
* For B0 chip, the DIGPROG is not updated, still TO1.0.
* we have to check ROM version further
* For B0 chip, the DIGPROG is not updated,
* it is still TO1.0. we have to check ROM
* version or OCOTP_READ_FUSE_DATA.
* 0xff0055aa is magic number for B1.
*/
if (readl((void __iomem *)(OCOTP_BASE_ADDR + 0x40))
== 0xff0055aa) {
/* 0xff0055aa is magic number for B1 */
reg = 0x21;
if (readl((void __iomem *)(OCOTP_BASE_ADDR + 0x40)) == 0xff0055aa) {
reg = CHIP_REV_2_1;
} else {
#define ROM_VERSION_A0 0x800
#define ROM_VERSION_B0 0x83C
rom_version = readl((void __iomem *)ROM_VERSION_A0);
rom_version =
readl((void __iomem *)ROM_VERSION_A0);
if (rom_version != CHIP_REV_1_0) {
rom_version = readl((void __iomem *)ROM_VERSION_B0);
if (rom_version >= CHIP_REV_2_0)
if (rom_version == CHIP_REV_2_0)
reg = CHIP_REV_2_0;
}
}
......
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