summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/mx7
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2016-02-28 12:33:17 -0300
committerStefano Babic <sbabic@denx.de>2016-03-09 12:50:39 +0100
commite25a0656bac63c5fcd20ef4313dc09c409fc512d (patch)
tree4a30d53acb7d103362be51f92a404b1f7886cde9 /arch/arm/cpu/armv7/mx7
parent5d69269deed053d2733bdd0fe537fcba663c0826 (diff)
mx7: Distinguish between dual and solo versions
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>
Diffstat (limited to 'arch/arm/cpu/armv7/mx7')
-rw-r--r--arch/arm/cpu/armv7/mx7/soc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c
index ba6cfb9dce..073bbc6d01 100644
--- a/arch/arm/cpu/armv7/mx7/soc.c
+++ b/arch/arm/cpu/armv7/mx7/soc.c
@@ -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;
}