From: Ye Li Date: Wed, 9 May 2018 05:37:22 +0000 (+0800) Subject: MLK-18243-11 arm: imx8m: get cpu chip id for i.MX8MM X-Git-Tag: rel_imx_4.19.35_1.1.0~718 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=9a5d0de7ebc11803802d1b6ac91524e71ab31e74;p=u-boot.git MLK-18243-11 arm: imx8m: get cpu chip id for i.MX8MM Using the cpu chip id in DIGPROG registers 0x824110 Signed-off-by: Ye Li Signed-off-by: Peng Fan (cherry picked from commit 330051b4fbcdda201b67a94e72345ec47bd85a96) (cherry picked from commit dcc51cc1fe69b0dcdc6a6e4f76743f927fe49b47) --- diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 68af92d4f1..7bac959d28 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -149,24 +149,31 @@ u32 get_cpu_rev(void) struct anamix_pll *ana_pll = (struct anamix_pll *)ANATOP_BASE_ADDR; u32 reg = readl(&ana_pll->digprog); u32 type = (reg >> 16) & 0xff; + u32 major_low = (reg >> 8) & 0xff; u32 rom_version; reg &= 0xff; - if (reg == CHIP_REV_1_0) { - /* - * For B0 chip, the DIGPROG is not updated, still TO1.0. - * we have to check ROM version further - */ - 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) - reg = CHIP_REV_2_0; + /* iMX8MM */ + if (major_low == 0x41) { + return ((type + 1) << 12) | reg; + } else { + /* iMX8MQ */ + if (reg == CHIP_REV_1_0) { + /* + * For B0 chip, the DIGPROG is not updated, still TO1.0. + * we have to check ROM version further + */ + 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) + reg = CHIP_REV_2_0; + } } - } - return (type << 12) | reg; + return (type << 12) | reg; + } } static void imx_set_wdog_powerdown(bool enable)