]> git.sur5r.net Git - u-boot/commitdiff
mx7: Distinguish between dual and solo versions
authorFabio Estevam <fabio.estevam@nxp.com>
Sun, 28 Feb 2016 15:33:17 +0000 (12:33 -0300)
committerStefano Babic <sbabic@denx.de>
Wed, 9 Mar 2016 11:50:39 +0000 (12:50 +0100)
Read the number of cores in the fuses to distinguish between
the dual and solo versions.

Tested on a mx7d sabresd and on a mx7solo warp7.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
arch/arm/cpu/armv7/mx7/soc.c
arch/arm/imx-common/cpu.c
arch/arm/include/asm/arch-imx/cpu.h

index ba6cfb9dce7312a643562360339bbd9415c3fac0..073bbc6d014e1d05e3bf13a981c5fc3544fc15fb 100644 (file)
@@ -165,6 +165,21 @@ u32 get_cpu_temp_grade(int *minc, int *maxc)
        return val;
 }
 
+static bool is_mx7d(void)
+{
+       struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+       struct fuse_bank *bank = &ocotp->bank[1];
+       struct fuse_bank1_regs *fuse =
+               (struct fuse_bank1_regs *)bank->fuse_regs;
+       int val;
+
+       val = readl(&fuse->tester4);
+       if (val & 1)
+               return false;
+       else
+               return true;
+}
+
 u32 get_cpu_rev(void)
 {
        struct mxc_ccm_anatop_reg *ccm_anatop = (struct mxc_ccm_anatop_reg *)
@@ -172,6 +187,9 @@ u32 get_cpu_rev(void)
        u32 reg = readl(&ccm_anatop->digprog);
        u32 type = (reg >> 16) & 0xff;
 
+       if (!is_mx7d())
+               type = MXC_CPU_MX7S;
+
        reg &= 0xff;
        return (type << 12) | reg;
 }
index 656bb60bbe203e7fffa2d4c8536fc9d4069f7bb5..5fb3ed840f8dd933637ef5cb9ca17b7341e2e949 100644 (file)
@@ -137,6 +137,8 @@ unsigned imx_ddr_size(void)
 const char *get_imx_type(u32 imxtype)
 {
        switch (imxtype) {
+       case MXC_CPU_MX7S:
+               return "7SOLO"; /* Single-core version of the mx7 */
        case MXC_CPU_MX7D:
                return "7D";    /* Dual-core version of the mx7 */
        case MXC_CPU_MX6QP:
index 8a75902ee5d6f43407c0d1c6c98cd8a54ae86131..7c63c13d7b51a0c36b11d90c3630189352577b5d 100644 (file)
@@ -21,6 +21,7 @@
 #define MXC_CPU_MX6D           0x67
 #define MXC_CPU_MX6DP          0x68
 #define MXC_CPU_MX6QP          0x69
+#define MXC_CPU_MX7S           0x71 /* dummy ID */
 #define MXC_CPU_MX7D           0x72
 #define MXC_CPU_VF610          0xF6 /* dummy ID */