0001
0002 #ifndef __ASM_MACH_CPUTYPE_H
0003 #define __ASM_MACH_CPUTYPE_H
0004
0005 #if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
0006 #include <asm/cputype.h>
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 extern unsigned int mmp_chip_id;
0028
0029 #ifdef CONFIG_CPU_PXA168
0030 static inline int cpu_is_pxa168(void)
0031 {
0032 return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
0033 ((mmp_chip_id & 0xfff) == 0x168);
0034 }
0035 #else
0036 #define cpu_is_pxa168() (0)
0037 #endif
0038
0039
0040 #ifdef CONFIG_CPU_PXA910
0041 static inline int cpu_is_pxa910(void)
0042 {
0043 return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
0044 (((mmp_chip_id & 0xfff) == 0x910) ||
0045 ((mmp_chip_id & 0xfff) == 0x920));
0046 }
0047 #else
0048 #define cpu_is_pxa910() (0)
0049 #endif
0050
0051 #if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT)
0052 static inline int cpu_is_mmp2(void)
0053 {
0054 return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
0055 (((mmp_chip_id & 0xfff) == 0x410) ||
0056 ((mmp_chip_id & 0xfff) == 0x610));
0057 }
0058 #else
0059 #define cpu_is_mmp2() (0)
0060 #endif
0061
0062 #ifdef CONFIG_MACH_MMP3_DT
0063 static inline int cpu_is_mmp3(void)
0064 {
0065 return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
0066 ((mmp_chip_id & 0xffff) == 0x2128);
0067 }
0068
0069 static inline int cpu_is_mmp3_a0(void)
0070 {
0071 return (cpu_is_mmp3() &&
0072 ((mmp_chip_id & 0x00ff0000) == 0x00a00000));
0073 }
0074
0075 static inline int cpu_is_mmp3_b0(void)
0076 {
0077 return (cpu_is_mmp3() &&
0078 ((mmp_chip_id & 0x00ff0000) == 0x00b00000));
0079 }
0080
0081 #else
0082 #define cpu_is_mmp3() (0)
0083 #define cpu_is_mmp3_a0() (0)
0084 #define cpu_is_mmp3_b0() (0)
0085 #endif
0086
0087 #endif