cpu.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * include/asm-arm/arch-at91rm9200/cpu.h
  3. *
  4. * Copyright (C) 2006 SAN People
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. */
  12. #ifndef __ASM_ARCH_CPU_H
  13. #define __ASM_ARCH_CPU_H
  14. #include <asm/hardware.h>
  15. #include <asm/arch/at91_dbgu.h>
  16. #define ARCH_ID_AT91RM9200 0x09290780
  17. #define ARCH_ID_AT91SAM9260 0x019803a0
  18. #define ARCH_ID_AT91SAM9261 0x019703a0
  19. static inline unsigned long at91_cpu_identify(void)
  20. {
  21. return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION);
  22. }
  23. #ifdef CONFIG_ARCH_AT91RM9200
  24. #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200)
  25. #else
  26. #define cpu_is_at91rm9200() (0)
  27. #endif
  28. #ifdef CONFIG_ARCH_AT91SAM9260
  29. #define cpu_is_at91sam9260() (at91_cpu_identify() == ARCH_ID_AT91SAM9260)
  30. #else
  31. #define cpu_is_at91sam9260() (0)
  32. #endif
  33. #ifdef CONFIG_ARCH_AT91SAM9261
  34. #define cpu_is_at91sam9261() (at91_cpu_identify() == ARCH_ID_AT91SAM9261)
  35. #else
  36. #define cpu_is_at91sam9261() (0)
  37. #endif
  38. #endif