[PATCH 3/3] ARM: i.MX8MQ: Add corner case for Rev 2.1 silicon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rev 2.1 of i.MX8MQ silicon needs a special check different from
predecessor. Add all of the neccessary code to do just that (based on
similar code in vendor U-Boot tree).

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 arch/arm/mach-imx/include/mach/imx8mq.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/mach-imx/include/mach/imx8mq.h b/arch/arm/mach-imx/include/mach/imx8mq.h
index d69ec8145..08dc06fdb 100644
--- a/arch/arm/mach-imx/include/mach/imx8mq.h
+++ b/arch/arm/mach-imx/include/mach/imx8mq.h
@@ -9,6 +9,8 @@
 
 #define IMX8MQ_ROM_VERSION_A0	0x800
 #define IMX8MQ_ROM_VERSION_B0	0x83C
+#define IMX8MQ_OCOTP_VERSION_B1 0x40
+#define IMX8MQ_OCOTP_VERSION_B1_MAGIC	0xff0055aa
 
 #define MX8MQ_ANATOP_DIGPROG	0x6c
 
@@ -20,12 +22,19 @@
 static inline int imx8mq_cpu_revision(void)
 {
 	void __iomem *anatop = IOMEM(MX8MQ_ANATOP_BASE_ADDR);
+	void __iomem *ocotp = IOMEM(MX8MQ_OCOTP_BASE_ADDR);
 	uint32_t revision = FIELD_GET(DIGPROG_MINOR,
 				      readl(anatop + MX8MQ_ANATOP_DIGPROG));
 	uint32_t rom_version;
 
 	if (revision != IMX_CHIP_REV_1_0)
 		return revision;
+	/*
+	 * For B1 chip we need to check OCOTP
+	 */
+	if (readl(ocotp + IMX8MQ_OCOTP_VERSION_B1) ==
+	    IMX8MQ_OCOTP_VERSION_B1_MAGIC)
+		return IMX_CHIP_REV_2_1;
 	/*
 	 * For B0 chip, the DIGPROG is not updated, still TO1.0.
 	 * we have to check ROM version further
-- 
2.20.1


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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux