Skip to contentSkip to conversation

mx6: Distinguish mx6dual from mx6quad

PATCH Superseded Fabio Estevam 2 participants 2 messages Jan 14, 2014 – Jan 16, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 mx6: Distinguish mx6dual from mx6quad

From: Fabio Estevam <[email protected]>

Currently when we boot a mx6dual U-boot reports that it is a mx6quad.

Report it as MX6D instead:

CPU: Freescale i.MX6D rev1.2 at 792 MHz

---
 arch/arm/cpu/armv7/mx6/soc.c              | 14 +++++++++++---
 arch/arm/imx-common/cpu.c                 |  2 ++
 arch/arm/include/asm/arch-mx6/sys_proto.h |  1 +
 3 files changed, 14 insertions(+), 3 deletions(-)
arch/arm/cpu/armv7/mx6/soc.c +11 -3
index 009a644..a6fb6ab 100644
@@ -43,14 +43,19 @@ u32 get_cpu_rev(void)
 
 	if (type != MXC_CPU_MX6SL) {
 		reg = readl(&anatop->digprog);
+		struct scu_regs *scu = (struct scu_regs *)SCU_BASE_ADDR;
+		u32 cfg = readl(&scu->config) & 3;
 		type = ((reg >> 16) & 0xff);
 		if (type == MXC_CPU_MX6DL) {
-			struct scu_regs *scu = (struct scu_regs *)SCU_BASE_ADDR;
-			u32 cfg = readl(&scu->config) & 3;
-
 			if (!cfg)
 				type = MXC_CPU_MX6SOLO;
 		}
+
+		if (type == MXC_CPU_MX6Q) {
+			if (cfg == 1)
+				type = MXC_CPU_MX6D;
+		}
+
 	}
 	reg &= 0xff;		/* mx6 silicon revision */
 	return (type << 12) | (reg + 0x10);
@@ -64,6 +69,9 @@ u32 __weak get_board_rev(void)
 	if (type == MXC_CPU_MX6SOLO)
 		cpurev = (MXC_CPU_MX6DL) << 12 | (cpurev & 0xFFF);
 
+	if (type == MXC_CPU_MX6D)
+		cpurev = (MXC_CPU_MX6Q) << 12 | (cpurev & 0xFFF);
+
 	return cpurev;
 }
 #endif
arch/arm/imx-common/cpu.c +2 -0
index 9231649..a77c4de 100644
@@ -106,6 +106,8 @@ const char *get_imx_type(u32 imxtype)
 	switch (imxtype) {
 	case MXC_CPU_MX6Q:
 		return "6Q";	/* Quad-core version of the mx6 */
+	case MXC_CPU_MX6D:
+		return "6D";	/* Dual-core version of the mx6 */
 	case MXC_CPU_MX6DL:
 		return "6DL";	/* Dual Lite version of the mx6 */
 	case MXC_CPU_MX6SOLO:
arch/arm/include/asm/arch-mx6/sys_proto.h +1 -0
index 17125a6..eda779e 100644
@@ -16,6 +16,7 @@
 #define MXC_CPU_MX6DL		0x61
 #define MXC_CPU_MX6SOLO		0x62
 #define MXC_CPU_MX6Q		0x63
+#define MXC_CPU_MX6D		0x64
 
 #define is_soc_rev(rev)	((get_cpu_rev() & 0xFF) - rev)
 u32 get_cpu_rev(void);
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 mx6: Distinguish mx6dual from mx6quad

Hello Fabio,

Quoted 11 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Currently when we boot a mx6dual U-boot reports that it is a mx6quad.

Report it as MX6D instead:

CPU: Freescale i.MX6D rev1.2 at 792 MHz

I have spot a build error using this patch and the fix is below:

(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx5/sys_proto.h
index 9949ad1..7dacc4c 100644

arch/arm/include/asm/arch-mx5/sys_proto.h +1 -0
@@ -14,6 +14,7 @@
 #define MXC_CPU_MX6DL          0x61
 #define MXC_CPU_MX6SOLO                0x62
 #define MXC_CPU_MX6Q           0x63
+#define MXC_CPU_MX6D           0x64
 
 #define is_soc_rev(rev)        ((get_cpu_rev() & 0xFF) - rev)
 u32 get_cpu_rev(void);

To reproduce the error, please use:

./MAKEALL -- mx51evk

Regards,

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750