mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 2/3] ARM: i.MX8MQ: Read only ROM version major
Date: Mon, 11 Feb 2019 18:27:48 -0800	[thread overview]
Message-ID: <20190212022749.18301-2-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20190212022749.18301-1-andrew.smirnov@gmail.com>

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.smirnov@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	other threads:[~2019-02-12  2:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12  2:27 [PATCH 1/3] ARM: i.MX8MQ: Invert the logic in imx8mq_cpu_revision() Andrey Smirnov
2019-02-12  2:27 ` Andrey Smirnov [this message]
2019-02-12  2:27 ` [PATCH 3/3] ARM: i.MX8MQ: Add corner case for Rev 2.1 silicon Andrey Smirnov
2019-02-12 20:38 ` [PATCH 1/3] ARM: i.MX8MQ: Invert the logic in imx8mq_cpu_revision() Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190212022749.18301-2-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox