summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2016-02-28 12:33:17 -0300
committerMax Krummenacher <max.krummenacher@toradex.com>2016-06-22 14:36:39 +0200
commitbb1835aed9f24b6edbc9d04980e2b27578c6129e (patch)
tree81ca3e3b32803cab4e82042be3351a5074970259
parenteb5f9d279d2f1140ddc4204f9b0bf02422ebabda (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> (cherry picked from commit e25a0656bac63c5fcd20ef4313dc09c409fc512d) Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--arch/arm/cpu/armv7/mx7/soc.c18
-rw-r--r--arch/arm/imx-common/cpu.c2
-rw-r--r--arch/arm/include/asm/arch-imx/cpu.h1
3 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c
index d5403662bf..18261ad49d 100644
--- a/arch/arm/cpu/armv7/mx7/soc.c
+++ b/arch/arm/cpu/armv7/mx7/soc.c
@@ -87,6 +87,21 @@ static void isolate_resource(void)
}
#endif
+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 *)
@@ -94,6 +109,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;
}
diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
index 8eb6a5aba0..7bca1f733f 100644
--- a/arch/arm/imx-common/cpu.c
+++ b/arch/arm/imx-common/cpu.c
@@ -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_MX6Q:
diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index d198906590..2f07572469 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -13,6 +13,7 @@
#define MXC_CPU_MX6UL 0x64
#define MXC_CPU_MX6SOLO 0x66 /* dummy */
#define MXC_CPU_MX6D 0x67
+#define MXC_CPU_MX7S 0x71 /* dummy ID */
#define MXC_CPU_MX7D 0x72
#define CS0_128 0