Commit 330051b4 authored by Ye Li's avatar Ye Li Committed by Peng Fan

MLK-18243-11 arm: imx8m: get cpu chip id for i.MX8MM

Using the cpu chip id in DIGPROG registers 0x824110
Signed-off-by: 's avatarYe Li <ye.li@nxp.com>
Signed-off-by: 's avatarPeng Fan <peng.fan@nxp.com>
parent 2347541e
......@@ -215,23 +215,30 @@ u32 get_cpu_rev(void)
{
u32 reg = readl((void __iomem *)DIGPROG);
u32 type = (reg >> 16) & 0xff;
u32 major_low = (reg >> 8) & 0xff;
reg &= 0xff;
if (reg == 0x10) {
/* For B0 chip, the DIGPROG is not updated, still TO1.0.
* we have to check ROM version further
*/
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;
/* iMX8MM */
if (major_low == 0x41) {
return ((type + 1) << 12) | reg;
} else {
/* iMX8MQ */
if (reg == 0x10) {
/* For B0 chip, the DIGPROG is not updated, still TO1.0.
* we have to check ROM version further
*/
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;
}
}
}
return (type << 12) | reg;
return (type << 12) | reg;
}
}
void imx_set_wdog_powerdown(bool enable)
......
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