hardware.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (C) 2009 ST-Ericsson.
  3. *
  4. * U8500 hardware definitions
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #ifndef __MACH_HARDWARE_H
  11. #define __MACH_HARDWARE_H
  12. /* macros to get at IO space when running virtually
  13. * We dont map all the peripherals, let ioremap do
  14. * this for us. We map only very basic peripherals here.
  15. */
  16. #define U8500_IO_VIRTUAL 0xf0000000
  17. #define U8500_IO_PHYSICAL 0xa0000000
  18. /* this macro is used in assembly, so no cast */
  19. #define IO_ADDRESS(x) \
  20. (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL)
  21. /* typesafe io address */
  22. #define __io_address(n) __io(IO_ADDRESS(n))
  23. /* used by some plat-nomadik code */
  24. #define io_p2v(n) __io_address(n)
  25. #include <mach/db8500-regs.h>
  26. #include <mach/db5500-regs.h>
  27. /* ST-Ericsson modified pl022 id */
  28. #define SSP_PER_ID 0x01080022
  29. #ifndef __ASSEMBLY__
  30. #include <asm/cputype.h>
  31. static inline bool cpu_is_u8500(void)
  32. {
  33. #ifdef CONFIG_UX500_SOC_DB8500
  34. return 1;
  35. #else
  36. return 0;
  37. #endif
  38. }
  39. #define CPUID_DB8500ED 0x410fc090
  40. #define CPUID_DB8500V1 0x411fc091
  41. #define CPUID_DB8500V2 0x412fc091
  42. static inline bool cpu_is_u8500ed(void)
  43. {
  44. return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500ED);
  45. }
  46. static inline bool cpu_is_u8500v1(void)
  47. {
  48. return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500V1);
  49. }
  50. static inline bool cpu_is_u8500v2(void)
  51. {
  52. return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500V2);
  53. }
  54. #ifdef CONFIG_UX500_SOC_DB8500
  55. bool cpu_is_u8500v10(void);
  56. bool cpu_is_u8500v11(void);
  57. bool cpu_is_u8500v20(void);
  58. #else
  59. static inline bool cpu_is_u8500v10(void) { return false; }
  60. static inline bool cpu_is_u8500v11(void) { return false; }
  61. static inline bool cpu_is_u8500v20(void) { return false; }
  62. #endif
  63. static inline bool cpu_is_u5500(void)
  64. {
  65. #ifdef CONFIG_UX500_SOC_DB5500
  66. return 1;
  67. #else
  68. return 0;
  69. #endif
  70. }
  71. #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
  72. #define ux500_unknown_soc() BUG()
  73. #endif
  74. #endif /* __MACH_HARDWARE_H */