Skip to content

Commit

Permalink
ARM: mmp/mmp2: fix cpu_is_mmp2() on mmp2-dt
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Cc: [email protected]
Signed-off-by: Olof Johansson <[email protected]>
  • Loading branch information
lkundrak authored and olofj committed Dec 3, 2018
1 parent 358b5f7 commit 76f4e2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/arm/mach-mmp/cputype.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ static inline int cpu_is_pxa910(void)
#define cpu_is_pxa910() (0)
#endif

#ifdef CONFIG_CPU_MMP2
#if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT)
static inline int cpu_is_mmp2(void)
{
return (((read_cpuid_id() >> 8) & 0xff) == 0x58);
return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
(((mmp_chip_id & 0xfff) == 0x410) ||
((mmp_chip_id & 0xfff) == 0x610));
}
#else
#define cpu_is_mmp2() (0)
Expand Down

0 comments on commit 76f4e2c

Please sign in to comment.