]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mx6: soc: update get_cpu_rev and get_imx_type for mx6solo/sololite
authorTroy Kisky <troy.kisky@boundarydevices.com>
Tue, 23 Oct 2012 10:57:46 +0000 (10:57 +0000)
committerStefano Babic <sbabic@denx.de>
Sat, 10 Nov 2012 07:15:40 +0000 (08:15 +0100)
Previously, the same value was returned for both mx6dl and mx6solo.
Check number of processors to differeniate.
Also, a freescale patch says that sololite has its cpu/rev
stored at 0x280 instead of 0x260.
I don't have a sololite to verify.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
arch/arm/cpu/armv7/mx6/soc.c
arch/arm/imx-common/cpu.c
arch/arm/include/asm/arch-mx5/sys_proto.h
arch/arm/include/asm/arch-mx6/imx-regs.h
arch/arm/include/asm/arch-mx6/sys_proto.h

index bc65767e7d8d934105dcfa6bb2f5c92a71341fe9..a8aad5dd0a6c8548277021ebe8f6e159dbf31b9b 100644 (file)
 #include <asm/arch/sys_proto.h>
 #include <asm/imx-common/boot_mode.h>
 
+struct scu_regs {
+       u32     ctrl;
+       u32     config;
+       u32     status;
+       u32     invalidate;
+       u32     fpga_rev;
+};
+
 u32 get_cpu_rev(void)
 {
        struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
-       int reg = readl(&anatop->digprog);
-
-       /* Read mx6 variant: quad, dual or solo */
-       int system_rev = (reg >> 4) & 0xFF000;
-       /* Read mx6 silicon revision */
-       system_rev |= (reg & 0xFF) + 0x10;
-
-       return system_rev;
+       u32 reg = readl(&anatop->digprog_sololite);
+       u32 type = ((reg >> 16) & 0xff);
+
+       if (type != MXC_CPU_MX6SL) {
+               reg = readl(&anatop->digprog);
+               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;
+               }
+       }
+       reg &= 0xff;            /* mx6 silicon revision */
+       return (type << 12) | (reg + 0x10);
 }
 
 void init_aips(void)
index a10d12d97dcdc9739de53e66db9e15cfadbb54f2..102c254a45f1641d5c6b6218f40a5aab326e100f 100644 (file)
@@ -67,18 +67,20 @@ char *get_reset_cause(void)
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
 
-static const char *get_imx_type(u32 imxtype)
+const char *get_imx_type(u32 imxtype)
 {
        switch (imxtype) {
-       case 0x63:
+       case MXC_CPU_MX6Q:
                return "6Q";    /* Quad-core version of the mx6 */
-       case 0x61:
-               return "6DS";   /* Dual/Solo version of the mx6 */
-       case 0x60:
+       case MXC_CPU_MX6DL:
+               return "6DL";   /* Dual Lite version of the mx6 */
+       case MXC_CPU_MX6SOLO:
+               return "6SOLO"; /* Solo version of the mx6 */
+       case MXC_CPU_MX6SL:
                return "6SL";   /* Solo-Lite version of the mx6 */
-       case 0x51:
+       case MXC_CPU_MX51:
                return "51";
-       case 0x53:
+       case MXC_CPU_MX53:
                return "53";
        default:
                return "??";
index 7b5246eea67fe61b4fc6db6aefe34f3f41b59b96..4435be1ee9a055f3f876aa258e9e45ac156f8984 100644 (file)
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
 
-u32 get_cpu_rev(void);
+#define MXC_CPU_MX51           0x51
+#define MXC_CPU_MX53           0x53
+#define MXC_CPU_MX6SL          0x60
+#define MXC_CPU_MX6DL          0x61
+#define MXC_CPU_MX6SOLO                0x62
+#define MXC_CPU_MX6Q           0x63
+
 #define is_soc_rev(rev)        ((get_cpu_rev() & 0xFF) - rev)
+u32 get_cpu_rev(void);
 void sdelay(unsigned long);
 void set_chipselect_size(int const);
 
index 09ab010138b965950fb45679e84f5bad8ac36908..3eb0081ca8088ac913ba46d5f6cdb6e5d0d5b1c1 100644 (file)
@@ -564,6 +564,8 @@ struct anatop_regs {
        u32     usb2_misc_clr;          /* 0x258 */
        u32     usb2_misc_tog;          /* 0x25c */
        u32     digprog;                /* 0x260 */
+       u32     reserved1[7];
+       u32     digprog_sololite;       /* 0x280 */
 };
 
 #define ANATOP_PFD_480_PFD0_FRAC_SHIFT         0
index 711b30dfe2801b9186f8d752ed26cfef123448c9..6627bbc02175f224fca06f61a502664801c1783d 100644 (file)
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
 
-#define is_soc_rev(rev)        ((get_cpu_rev() & 0xFF) - rev)
+#define MXC_CPU_MX51           0x51
+#define MXC_CPU_MX53           0x53
+#define MXC_CPU_MX6SL          0x60
+#define MXC_CPU_MX6DL          0x61
+#define MXC_CPU_MX6SOLO                0x62
+#define MXC_CPU_MX6Q           0x63
 
+#define is_soc_rev(rev)        ((get_cpu_rev() & 0xFF) - rev)
 u32 get_cpu_rev(void);
+const char *get_imx_type(u32 imxtype);
 
 void set_vddsoc(u32 mv);