cputype.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_MACH_CPUTYPE_H
  3. #define __ASM_MACH_CPUTYPE_H
  4. #include <asm/cputype.h>
  5. /*
  6. * CPU Stepping CPU_ID CHIP_ID
  7. *
  8. * PXA168 S0 0x56158400 0x0000C910
  9. * PXA168 A0 0x56158400 0x00A0A168
  10. * PXA910 Y1 0x56158400 0x00F2C920
  11. * PXA910 A0 0x56158400 0x00F2C910
  12. * PXA910 A1 0x56158400 0x00A0C910
  13. * PXA920 Y0 0x56158400 0x00F2C920
  14. * PXA920 A0 0x56158400 0x00A0C920
  15. * PXA920 A1 0x56158400 0x00A1C920
  16. * MMP2 Z0 0x560f5811 0x00F00410
  17. * MMP2 Z1 0x560f5811 0x00E00410
  18. * MMP2 A0 0x560f5811 0x00A0A610
  19. */
  20. extern unsigned int mmp_chip_id;
  21. #ifdef CONFIG_CPU_PXA168
  22. static inline int cpu_is_pxa168(void)
  23. {
  24. return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
  25. ((mmp_chip_id & 0xfff) == 0x168);
  26. }
  27. #else
  28. #define cpu_is_pxa168() (0)
  29. #endif
  30. /* cpu_is_pxa910() is shared on both pxa910 and pxa920 */
  31. #ifdef CONFIG_CPU_PXA910
  32. static inline int cpu_is_pxa910(void)
  33. {
  34. return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
  35. (((mmp_chip_id & 0xfff) == 0x910) ||
  36. ((mmp_chip_id & 0xfff) == 0x920));
  37. }
  38. #else
  39. #define cpu_is_pxa910() (0)
  40. #endif
  41. #if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT)
  42. static inline int cpu_is_mmp2(void)
  43. {
  44. return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
  45. (((mmp_chip_id & 0xfff) == 0x410) ||
  46. ((mmp_chip_id & 0xfff) == 0x610));
  47. }
  48. #else
  49. #define cpu_is_mmp2() (0)
  50. #endif
  51. #endif /* __ASM_MACH_CPUTYPE_H */