summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorChao Xie Linux <xiechao.mail@gmail.com>2014-04-02 02:47:09 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-04-08 17:55:27 +0100
commitfdb487f5c961b94486a78fa61fa28b8eff1954ab (patch)
treed410f30c369db2898f28cca587e789ddba45f385 /arch/arm
parent779dd9590b00bd91b7811c24f0df34a9d91bfa0f (diff)
downloadop-kernel-dev-fdb487f5c961b94486a78fa61fa28b8eff1954ab.zip
op-kernel-dev-fdb487f5c961b94486a78fa61fa28b8eff1954ab.tar.gz
ARM: 8015/1: Add cpu_is_pj4 to distinguish PJ4 because it has some differences with V7
The patch add cpu_is_pj4 at arch/arm/include/asm/cputype.h PJ4 has some differences with V7, for example the coprocessor. To disinguish this kind of situation. cpu_is_pj4 is needed. Signed-off-by: Chao Xie <chao.xie@marvell.com> Reviewed-by: Kevin Hilman <khilman@linaro.org> Tested-by: Kevin Hilman <khilman@linaro.org> Tested-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Matt Porter <mporter@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/include/asm/cputype.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
index 42f0889..c651e3b 100644
--- a/arch/arm/include/asm/cputype.h
+++ b/arch/arm/include/asm/cputype.h
@@ -221,4 +221,23 @@ static inline int cpu_is_xsc3(void)
#define cpu_is_xscale() 1
#endif
+/*
+ * Marvell's PJ4 core is based on V7 version. It has some modification
+ * for coprocessor setting. For this reason, we need a way to distinguish
+ * it.
+ */
+#ifndef CONFIG_CPU_PJ4
+#define cpu_is_pj4() 0
+#else
+static inline int cpu_is_pj4(void)
+{
+ unsigned int id;
+
+ id = read_cpuid_id();
+ if ((id & 0xfffffff0) == 0x562f5840)
+ return 1;
+
+ return 0;
+}
+#endif
#endif
OpenPOWER on IntegriCloud