mxc.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * Copyright 2004-2007, 2010 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or (at your option) any later version.
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  17. * MA 02110-1301, USA.
  18. */
  19. #ifndef __ASM_ARCH_MXC_H__
  20. #define __ASM_ARCH_MXC_H__
  21. #include <linux/types.h>
  22. #ifndef __ASM_ARCH_MXC_HARDWARE_H__
  23. #error "Do not include directly."
  24. #endif
  25. #define MXC_CPU_MX1 1
  26. #define MXC_CPU_MX21 21
  27. #define MXC_CPU_MX25 25
  28. #define MXC_CPU_MX27 27
  29. #define MXC_CPU_MX31 31
  30. #define MXC_CPU_MX35 35
  31. #define MXC_CPU_MX50 50
  32. #define MXC_CPU_MX51 51
  33. #define MXC_CPU_MX53 53
  34. #define IMX_CHIP_REVISION_1_0 0x10
  35. #define IMX_CHIP_REVISION_1_1 0x11
  36. #define IMX_CHIP_REVISION_1_2 0x12
  37. #define IMX_CHIP_REVISION_1_3 0x13
  38. #define IMX_CHIP_REVISION_2_0 0x20
  39. #define IMX_CHIP_REVISION_2_1 0x21
  40. #define IMX_CHIP_REVISION_2_2 0x22
  41. #define IMX_CHIP_REVISION_2_3 0x23
  42. #define IMX_CHIP_REVISION_3_0 0x30
  43. #define IMX_CHIP_REVISION_3_1 0x31
  44. #define IMX_CHIP_REVISION_3_2 0x32
  45. #define IMX_CHIP_REVISION_3_3 0x33
  46. #define IMX_CHIP_REVISION_UNKNOWN 0xff
  47. #ifndef __ASSEMBLY__
  48. extern unsigned int __mxc_cpu_type;
  49. #endif
  50. #ifdef CONFIG_SOC_IMX1
  51. # ifdef mxc_cpu_type
  52. # undef mxc_cpu_type
  53. # define mxc_cpu_type __mxc_cpu_type
  54. # else
  55. # define mxc_cpu_type MXC_CPU_MX1
  56. # endif
  57. # define cpu_is_mx1() (mxc_cpu_type == MXC_CPU_MX1)
  58. #else
  59. # define cpu_is_mx1() (0)
  60. #endif
  61. #ifdef CONFIG_SOC_IMX21
  62. # ifdef mxc_cpu_type
  63. # undef mxc_cpu_type
  64. # define mxc_cpu_type __mxc_cpu_type
  65. # else
  66. # define mxc_cpu_type MXC_CPU_MX21
  67. # endif
  68. # define cpu_is_mx21() (mxc_cpu_type == MXC_CPU_MX21)
  69. #else
  70. # define cpu_is_mx21() (0)
  71. #endif
  72. #ifdef CONFIG_SOC_IMX25
  73. # ifdef mxc_cpu_type
  74. # undef mxc_cpu_type
  75. # define mxc_cpu_type __mxc_cpu_type
  76. # else
  77. # define mxc_cpu_type MXC_CPU_MX25
  78. # endif
  79. # define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25)
  80. #else
  81. # define cpu_is_mx25() (0)
  82. #endif
  83. #ifdef CONFIG_SOC_IMX27
  84. # ifdef mxc_cpu_type
  85. # undef mxc_cpu_type
  86. # define mxc_cpu_type __mxc_cpu_type
  87. # else
  88. # define mxc_cpu_type MXC_CPU_MX27
  89. # endif
  90. # define cpu_is_mx27() (mxc_cpu_type == MXC_CPU_MX27)
  91. #else
  92. # define cpu_is_mx27() (0)
  93. #endif
  94. #ifdef CONFIG_SOC_IMX31
  95. # ifdef mxc_cpu_type
  96. # undef mxc_cpu_type
  97. # define mxc_cpu_type __mxc_cpu_type
  98. # else
  99. # define mxc_cpu_type MXC_CPU_MX31
  100. # endif
  101. # define cpu_is_mx31() (mxc_cpu_type == MXC_CPU_MX31)
  102. #else
  103. # define cpu_is_mx31() (0)
  104. #endif
  105. #ifdef CONFIG_SOC_IMX35
  106. # ifdef mxc_cpu_type
  107. # undef mxc_cpu_type
  108. # define mxc_cpu_type __mxc_cpu_type
  109. # else
  110. # define mxc_cpu_type MXC_CPU_MX35
  111. # endif
  112. # define cpu_is_mx35() (mxc_cpu_type == MXC_CPU_MX35)
  113. #else
  114. # define cpu_is_mx35() (0)
  115. #endif
  116. #ifdef CONFIG_SOC_IMX50
  117. # ifdef mxc_cpu_type
  118. # undef mxc_cpu_type
  119. # define mxc_cpu_type __mxc_cpu_type
  120. # else
  121. # define mxc_cpu_type MXC_CPU_MX50
  122. # endif
  123. # define cpu_is_mx50() (mxc_cpu_type == MXC_CPU_MX50)
  124. #else
  125. # define cpu_is_mx50() (0)
  126. #endif
  127. #ifdef CONFIG_SOC_IMX51
  128. # ifdef mxc_cpu_type
  129. # undef mxc_cpu_type
  130. # define mxc_cpu_type __mxc_cpu_type
  131. # else
  132. # define mxc_cpu_type MXC_CPU_MX51
  133. # endif
  134. # define cpu_is_mx51() (mxc_cpu_type == MXC_CPU_MX51)
  135. #else
  136. # define cpu_is_mx51() (0)
  137. #endif
  138. #ifdef CONFIG_SOC_IMX53
  139. # ifdef mxc_cpu_type
  140. # undef mxc_cpu_type
  141. # define mxc_cpu_type __mxc_cpu_type
  142. # else
  143. # define mxc_cpu_type MXC_CPU_MX53
  144. # endif
  145. # define cpu_is_mx53() (mxc_cpu_type == MXC_CPU_MX53)
  146. #else
  147. # define cpu_is_mx53() (0)
  148. #endif
  149. #ifndef __ASSEMBLY__
  150. struct cpu_op {
  151. u32 cpu_rate;
  152. };
  153. int tzic_enable_wake(void);
  154. extern struct cpu_op *(*get_cpu_op)(int *op);
  155. #endif
  156. #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35())
  157. #define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27())
  158. #endif /* __ASM_ARCH_MXC_H__ */