Don't read all 32-bits located at IMX8MQ_ROM_VERSION_*0 since that,
besides ROM version major in LSB, willl also contain minor components
which we don't account for in the following checks. Change the code to
only read LSB instead.

This is a port of a vendor U-Boot[1] commit
0377dc881a96b46d858643dfaa5f9ef0dd4acccc ("MLK-19465 imx8mq: Fix cpu
rev issue on B0.1 chip")

[1] https://source.codeaurora.org/external/imx/uboot-imx
Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com>
---
 arch/arm/mach-imx/include/mach/imx8mq.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/imx8mq.h 
b/arch/arm/mach-imx/include/mach/imx8mq.h
index 2a7cf9977..d69ec8145 100644
--- a/arch/arm/mach-imx/include/mach/imx8mq.h
+++ b/arch/arm/mach-imx/include/mach/imx8mq.h
@@ -30,9 +30,9 @@ static inline int imx8mq_cpu_revision(void)
         * For B0 chip, the DIGPROG is not updated, still TO1.0.
         * we have to check ROM version further
         */
-       rom_version = readl(IOMEM(IMX8MQ_ROM_VERSION_A0));
+       rom_version = readb(IOMEM(IMX8MQ_ROM_VERSION_A0));
        if (rom_version != IMX_CHIP_REV_1_0) {
-               rom_version = readl(IOMEM(IMX8MQ_ROM_VERSION_B0));
+               rom_version = readb(IOMEM(IMX8MQ_ROM_VERSION_B0));
                if (rom_version >= IMX_CHIP_REV_2_0)
                        revision = IMX_CHIP_REV_2_0;
        }
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to