mxc.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 IMX_CHIP_REVISION_1_0 0x10
  34. #define IMX_CHIP_REVISION_1_1 0x11
  35. #define IMX_CHIP_REVISION_1_2 0x12
  36. #define IMX_CHIP_REVISION_1_3 0x13
  37. #define IMX_CHIP_REVISION_2_0 0x20
  38. #define IMX_CHIP_REVISION_2_1 0x21
  39. #define IMX_CHIP_REVISION_2_2 0x22
  40. #define IMX_CHIP_REVISION_2_3 0x23
  41. #define IMX_CHIP_REVISION_3_0 0x30
  42. #define IMX_CHIP_REVISION_3_1 0x31
  43. #define IMX_CHIP_REVISION_3_2 0x32
  44. #define IMX_CHIP_REVISION_3_3 0x33
  45. #define IMX_CHIP_REVISION_UNKNOWN 0xff
  46. #ifndef __ASSEMBLY__
  47. extern unsigned int __mxc_cpu_type;
  48. #endif
  49. #ifdef CONFIG_SOC_IMX1
  50. # ifdef mxc_cpu_type
  51. # undef mxc_cpu_type
  52. # define mxc_cpu_type __mxc_cpu_type
  53. # else
  54. # define mxc_cpu_type MXC_CPU_MX1
  55. # endif
  56. # define cpu_is_mx1() (mxc_cpu_type == MXC_CPU_MX1)
  57. #else
  58. # define cpu_is_mx1() (0)
  59. #endif
  60. #ifdef CONFIG_SOC_IMX21
  61. # ifdef mxc_cpu_type
  62. # undef mxc_cpu_type
  63. # define mxc_cpu_type __mxc_cpu_type
  64. # else
  65. # define mxc_cpu_type MXC_CPU_MX21
  66. # endif
  67. # define cpu_is_mx21() (mxc_cpu_type == MXC_CPU_MX21)
  68. #else
  69. # define cpu_is_mx21() (0)
  70. #endif
  71. #ifdef CONFIG_SOC_IMX25
  72. # ifdef mxc_cpu_type
  73. # undef mxc_cpu_type
  74. # define mxc_cpu_type __mxc_cpu_type
  75. # else
  76. # define mxc_cpu_type MXC_CPU_MX25
  77. # endif
  78. # define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25)
  79. #else
  80. # define cpu_is_mx25() (0)
  81. #endif
  82. #ifdef CONFIG_SOC_IMX27
  83. # ifdef mxc_cpu_type
  84. # undef mxc_cpu_type
  85. # define mxc_cpu_type __mxc_cpu_type
  86. # else
  87. # define mxc_cpu_type MXC_CPU_MX27
  88. # endif
  89. # define cpu_is_mx27() (mxc_cpu_type == MXC_CPU_MX27)
  90. #else
  91. # define cpu_is_mx27() (0)
  92. #endif
  93. #ifdef CONFIG_SOC_IMX31
  94. # ifdef mxc_cpu_type
  95. # undef mxc_cpu_type
  96. # define mxc_cpu_type __mxc_cpu_type
  97. # else
  98. # define mxc_cpu_type MXC_CPU_MX31
  99. # endif
  100. # define cpu_is_mx31() (mxc_cpu_type == MXC_CPU_MX31)
  101. #else
  102. # define cpu_is_mx31() (0)
  103. #endif
  104. #ifdef CONFIG_SOC_IMX35
  105. # ifdef mxc_cpu_type
  106. # undef mxc_cpu_type
  107. # define mxc_cpu_type __mxc_cpu_type
  108. # else
  109. # define mxc_cpu_type MXC_CPU_MX35
  110. # endif
  111. # define cpu_is_mx35() (mxc_cpu_type == MXC_CPU_MX35)
  112. #else
  113. # define cpu_is_mx35() (0)
  114. #endif
  115. #ifdef CONFIG_SOC_IMX51
  116. # ifdef mxc_cpu_type
  117. # undef mxc_cpu_type
  118. # define mxc_cpu_type __mxc_cpu_type
  119. # else
  120. # define mxc_cpu_type MXC_CPU_MX51
  121. # endif
  122. # define cpu_is_mx51() (mxc_cpu_type == MXC_CPU_MX51)
  123. #else
  124. # define cpu_is_mx51() (0)
  125. #endif
  126. #ifdef CONFIG_SOC_IMX53
  127. # ifdef mxc_cpu_type
  128. # undef mxc_cpu_type
  129. # define mxc_cpu_type __mxc_cpu_type
  130. # else
  131. # define mxc_cpu_type MXC_CPU_MX53
  132. # endif
  133. # define cpu_is_mx53() (mxc_cpu_type == MXC_CPU_MX53)
  134. #else
  135. # define cpu_is_mx53() (0)
  136. #endif
  137. #ifndef __ASSEMBLY__
  138. struct cpu_op {
  139. u32 cpu_rate;
  140. };
  141. int tzic_enable_wake(void);
  142. extern struct cpu_op *(*get_cpu_op)(int *op);
  143. #endif
  144. #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35())
  145. #define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27())
  146. #endif /* __ASM_ARCH_MXC_H__ */