mxc.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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_MX51 51
  32. #define MXC_CPU_MX53 53
  33. #define MXC_CPU_IMX6SL 0x60
  34. #define MXC_CPU_IMX6DL 0x61
  35. #define MXC_CPU_IMX6Q 0x63
  36. #define IMX_CHIP_REVISION_1_0 0x10
  37. #define IMX_CHIP_REVISION_1_1 0x11
  38. #define IMX_CHIP_REVISION_1_2 0x12
  39. #define IMX_CHIP_REVISION_1_3 0x13
  40. #define IMX_CHIP_REVISION_2_0 0x20
  41. #define IMX_CHIP_REVISION_2_1 0x21
  42. #define IMX_CHIP_REVISION_2_2 0x22
  43. #define IMX_CHIP_REVISION_2_3 0x23
  44. #define IMX_CHIP_REVISION_3_0 0x30
  45. #define IMX_CHIP_REVISION_3_1 0x31
  46. #define IMX_CHIP_REVISION_3_2 0x32
  47. #define IMX_CHIP_REVISION_3_3 0x33
  48. #define IMX_CHIP_REVISION_UNKNOWN 0xff
  49. #ifndef __ASSEMBLY__
  50. extern unsigned int __mxc_cpu_type;
  51. #endif
  52. #ifdef CONFIG_SOC_IMX1
  53. # ifdef mxc_cpu_type
  54. # undef mxc_cpu_type
  55. # define mxc_cpu_type __mxc_cpu_type
  56. # else
  57. # define mxc_cpu_type MXC_CPU_MX1
  58. # endif
  59. # define cpu_is_mx1() (mxc_cpu_type == MXC_CPU_MX1)
  60. #else
  61. # define cpu_is_mx1() (0)
  62. #endif
  63. #ifdef CONFIG_SOC_IMX21
  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_MX21
  69. # endif
  70. # define cpu_is_mx21() (mxc_cpu_type == MXC_CPU_MX21)
  71. #else
  72. # define cpu_is_mx21() (0)
  73. #endif
  74. #ifdef CONFIG_SOC_IMX25
  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_MX25
  80. # endif
  81. # define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25)
  82. #else
  83. # define cpu_is_mx25() (0)
  84. #endif
  85. #ifdef CONFIG_SOC_IMX27
  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_MX27
  91. # endif
  92. # define cpu_is_mx27() (mxc_cpu_type == MXC_CPU_MX27)
  93. #else
  94. # define cpu_is_mx27() (0)
  95. #endif
  96. #ifdef CONFIG_SOC_IMX31
  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_MX31
  102. # endif
  103. # define cpu_is_mx31() (mxc_cpu_type == MXC_CPU_MX31)
  104. #else
  105. # define cpu_is_mx31() (0)
  106. #endif
  107. #ifdef CONFIG_SOC_IMX35
  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_MX35
  113. # endif
  114. # define cpu_is_mx35() (mxc_cpu_type == MXC_CPU_MX35)
  115. #else
  116. # define cpu_is_mx35() (0)
  117. #endif
  118. #ifdef CONFIG_SOC_IMX51
  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_MX51
  124. # endif
  125. # define cpu_is_mx51() (mxc_cpu_type == MXC_CPU_MX51)
  126. #else
  127. # define cpu_is_mx51() (0)
  128. #endif
  129. #ifdef CONFIG_SOC_IMX53
  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_MX53
  135. # endif
  136. # define cpu_is_mx53() (mxc_cpu_type == MXC_CPU_MX53)
  137. #else
  138. # define cpu_is_mx53() (0)
  139. #endif
  140. #ifndef __ASSEMBLY__
  141. static inline bool cpu_is_imx6sl(void)
  142. {
  143. return __mxc_cpu_type == MXC_CPU_IMX6SL;
  144. }
  145. static inline bool cpu_is_imx6dl(void)
  146. {
  147. return __mxc_cpu_type == MXC_CPU_IMX6DL;
  148. }
  149. static inline bool cpu_is_imx6q(void)
  150. {
  151. return __mxc_cpu_type == MXC_CPU_IMX6Q;
  152. }
  153. struct cpu_op {
  154. u32 cpu_rate;
  155. };
  156. int tzic_enable_wake(void);
  157. extern struct cpu_op *(*get_cpu_op)(int *op);
  158. #endif
  159. #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35())
  160. #define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27())
  161. #endif /* __ASM_ARCH_MXC_H__ */