Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: mmp/mmp2: fix cpu_is_mmp2() on mmp2-dt

cpu_is_mmp2() was equivalent to cpu_is_pj4(), wouldn't be correct for
multiplatform kernels. Fix it by also considering mmp_chip_id, as is
done for cpu_is_pxa168() and cpu_is_pxa910() above.

Moreover, it is only available with CONFIG_CPU_MMP2 and thus doesn't work
on DT-based MMP2 machines. Enable it on CONFIG_MACH_MMP2_DT too.

Note: CONFIG_CPU_MMP2 is only used for machines that use board files
instead of DT. It should perhaps be renamed. I'm not doing it now, because
I don't have a better idea.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: stable@vger.kernel.org
Signed-off-by: Olof Johansson <olof@lixom.net>

authored by

Lubomir Rintel and committed by
Olof Johansson
76f4e2c3 358b5f73

+4 -2
+4 -2
arch/arm/mach-mmp/cputype.h
··· 44 44 #define cpu_is_pxa910() (0) 45 45 #endif 46 46 47 - #ifdef CONFIG_CPU_MMP2 47 + #if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT) 48 48 static inline int cpu_is_mmp2(void) 49 49 { 50 - return (((read_cpuid_id() >> 8) & 0xff) == 0x58); 50 + return (((read_cpuid_id() >> 8) & 0xff) == 0x58) && 51 + (((mmp_chip_id & 0xfff) == 0x410) || 52 + ((mmp_chip_id & 0xfff) == 0x610)); 51 53 } 52 54 #else 53 55 #define cpu_is_mmp2() (0)