From: Chao Xie Linux Date: Wed, 2 Apr 2014 01:47:09 +0000 (+0100) Subject: ARM: 8015/1: Add cpu_is_pj4 to distinguish PJ4 because it has some differences with V7 X-Git-Tag: firefly_0821_release~176^2~4085^2~1^3~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fdb487f5c961b94486a78fa61fa28b8eff1954ab;p=firefly-linux-kernel-4.4.55.git 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 Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman Tested-by: Stephen Warren Reviewed-by: Stephen Warren Tested-by: Matt Porter Signed-off-by: Russell King --- diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index 42f0889f0584..c651e3b26ec7 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