mxc.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. #define IMX_CHIP_REVISION_1_0_STRING "1.0"
  48. #define IMX_CHIP_REVISION_1_1_STRING "1.1"
  49. #define IMX_CHIP_REVISION_1_2_STRING "1.2"
  50. #define IMX_CHIP_REVISION_1_3_STRING "1.3"
  51. #define IMX_CHIP_REVISION_2_0_STRING "2.0"
  52. #define IMX_CHIP_REVISION_2_1_STRING "2.1"
  53. #define IMX_CHIP_REVISION_2_2_STRING "2.2"
  54. #define IMX_CHIP_REVISION_2_3_STRING "2.3"
  55. #define IMX_CHIP_REVISION_3_0_STRING "3.0"
  56. #define IMX_CHIP_REVISION_3_1_STRING "3.1"
  57. #define IMX_CHIP_REVISION_3_2_STRING "3.2"
  58. #define IMX_CHIP_REVISION_3_3_STRING "3.3"
  59. #define IMX_CHIP_REVISION_UNKNOWN_STRING "unknown"
  60. #ifndef __ASSEMBLY__
  61. extern unsigned int __mxc_cpu_type;
  62. #endif
  63. #ifdef CONFIG_SOC_IMX1
  64. # ifdef mxc_cpu_type
  65. # undef mxc_cpu_type
  66. # define mxc_cpu_type __mxc_cpu_type
  67. # else
  68. # define mxc_cpu_type MXC_CPU_MX1
  69. # endif
  70. # define cpu_is_mx1() (mxc_cpu_type == MXC_CPU_MX1)
  71. #else
  72. # define cpu_is_mx1() (0)
  73. #endif
  74. #ifdef CONFIG_SOC_IMX21
  75. # ifdef mxc_cpu_type
  76. # undef mxc_cpu_type
  77. # define mxc_cpu_type __mxc_cpu_type
  78. # else
  79. # define mxc_cpu_type MXC_CPU_MX21
  80. # endif
  81. # define cpu_is_mx21() (mxc_cpu_type == MXC_CPU_MX21)
  82. #else
  83. # define cpu_is_mx21() (0)
  84. #endif
  85. #ifdef CONFIG_SOC_IMX25
  86. # ifdef mxc_cpu_type
  87. # undef mxc_cpu_type
  88. # define mxc_cpu_type __mxc_cpu_type
  89. # else
  90. # define mxc_cpu_type MXC_CPU_MX25
  91. # endif
  92. # define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25)
  93. #else
  94. # define cpu_is_mx25() (0)
  95. #endif
  96. #ifdef CONFIG_SOC_IMX27
  97. # ifdef mxc_cpu_type
  98. # undef mxc_cpu_type
  99. # define mxc_cpu_type __mxc_cpu_type
  100. # else
  101. # define mxc_cpu_type MXC_CPU_MX27
  102. # endif
  103. # define cpu_is_mx27() (mxc_cpu_type == MXC_CPU_MX27)
  104. #else
  105. # define cpu_is_mx27() (0)
  106. #endif
  107. #ifdef CONFIG_SOC_IMX31
  108. # ifdef mxc_cpu_type
  109. # undef mxc_cpu_type
  110. # define mxc_cpu_type __mxc_cpu_type
  111. # else
  112. # define mxc_cpu_type MXC_CPU_MX31
  113. # endif
  114. # define cpu_is_mx31() (mxc_cpu_type == MXC_CPU_MX31)
  115. #else
  116. # define cpu_is_mx31() (0)
  117. #endif
  118. #ifdef CONFIG_SOC_IMX35
  119. # ifdef mxc_cpu_type
  120. # undef mxc_cpu_type
  121. # define mxc_cpu_type __mxc_cpu_type
  122. # else
  123. # define mxc_cpu_type MXC_CPU_MX35
  124. # endif
  125. # define cpu_is_mx35() (mxc_cpu_type == MXC_CPU_MX35)
  126. #else
  127. # define cpu_is_mx35() (0)
  128. #endif
  129. #ifdef CONFIG_SOC_IMX50
  130. # ifdef mxc_cpu_type
  131. # undef mxc_cpu_type
  132. # define mxc_cpu_type __mxc_cpu_type
  133. # else
  134. # define mxc_cpu_type MXC_CPU_MX50
  135. # endif
  136. # define cpu_is_mx50() (mxc_cpu_type == MXC_CPU_MX50)
  137. #else
  138. # define cpu_is_mx50() (0)
  139. #endif
  140. #ifdef CONFIG_SOC_IMX51
  141. # ifdef mxc_cpu_type
  142. # undef mxc_cpu_type
  143. # define mxc_cpu_type __mxc_cpu_type
  144. # else
  145. # define mxc_cpu_type MXC_CPU_MX51
  146. # endif
  147. # define cpu_is_mx51() (mxc_cpu_type == MXC_CPU_MX51)
  148. #else
  149. # define cpu_is_mx51() (0)
  150. #endif
  151. #ifdef CONFIG_SOC_IMX53
  152. # ifdef mxc_cpu_type
  153. # undef mxc_cpu_type
  154. # define mxc_cpu_type __mxc_cpu_type
  155. # else
  156. # define mxc_cpu_type MXC_CPU_MX53
  157. # endif
  158. # define cpu_is_mx53() (mxc_cpu_type == MXC_CPU_MX53)
  159. #else
  160. # define cpu_is_mx53() (0)
  161. #endif
  162. #ifndef __ASSEMBLY__
  163. struct cpu_op {
  164. u32 cpu_rate;
  165. };
  166. int tzic_enable_wake(int is_idle);
  167. enum mxc_cpu_pwr_mode {
  168. WAIT_CLOCKED, /* wfi only */
  169. WAIT_UNCLOCKED, /* WAIT */
  170. WAIT_UNCLOCKED_POWER_OFF, /* WAIT + SRPG */
  171. STOP_POWER_ON, /* just STOP */
  172. STOP_POWER_OFF, /* STOP + SRPG */
  173. };
  174. extern struct cpu_op *(*get_cpu_op)(int *op);
  175. #endif
  176. #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35())
  177. #define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27())
  178. #endif /* __ASM_ARCH_MXC_H__ */