mxc.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * Copyright 2004-2007 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. #ifndef __ASM_ARCH_MXC_HARDWARE_H__
  22. #error "Do not include directly."
  23. #endif
  24. #define MXC_CPU_MX1 1
  25. #define MXC_CPU_MX21 21
  26. #define MXC_CPU_MX25 25
  27. #define MXC_CPU_MX27 27
  28. #define MXC_CPU_MX31 31
  29. #define MXC_CPU_MX35 35
  30. #define MXC_CPU_MXC91231 91231
  31. #ifndef __ASSEMBLY__
  32. extern unsigned int __mxc_cpu_type;
  33. #endif
  34. #ifdef CONFIG_ARCH_MX1
  35. # ifdef mxc_cpu_type
  36. # undef mxc_cpu_type
  37. # define mxc_cpu_type __mxc_cpu_type
  38. # else
  39. # define mxc_cpu_type MXC_CPU_MX1
  40. # endif
  41. # define cpu_is_mx1() (mxc_cpu_type == MXC_CPU_MX1)
  42. #else
  43. # define cpu_is_mx1() (0)
  44. #endif
  45. #ifdef CONFIG_MACH_MX21
  46. # ifdef mxc_cpu_type
  47. # undef mxc_cpu_type
  48. # define mxc_cpu_type __mxc_cpu_type
  49. # else
  50. # define mxc_cpu_type MXC_CPU_MX21
  51. # endif
  52. # define cpu_is_mx21() (mxc_cpu_type == MXC_CPU_MX21)
  53. #else
  54. # define cpu_is_mx21() (0)
  55. #endif
  56. #ifdef CONFIG_ARCH_MX25
  57. # ifdef mxc_cpu_type
  58. # undef mxc_cpu_type
  59. # define mxc_cpu_type __mxc_cpu_type
  60. # else
  61. # define mxc_cpu_type MXC_CPU_MX25
  62. # endif
  63. # define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25)
  64. #else
  65. # define cpu_is_mx25() (0)
  66. #endif
  67. #ifdef CONFIG_MACH_MX27
  68. # ifdef mxc_cpu_type
  69. # undef mxc_cpu_type
  70. # define mxc_cpu_type __mxc_cpu_type
  71. # else
  72. # define mxc_cpu_type MXC_CPU_MX27
  73. # endif
  74. # define cpu_is_mx27() (mxc_cpu_type == MXC_CPU_MX27)
  75. #else
  76. # define cpu_is_mx27() (0)
  77. #endif
  78. #ifdef CONFIG_ARCH_MX31
  79. # ifdef mxc_cpu_type
  80. # undef mxc_cpu_type
  81. # define mxc_cpu_type __mxc_cpu_type
  82. # else
  83. # define mxc_cpu_type MXC_CPU_MX31
  84. # endif
  85. # define cpu_is_mx31() (mxc_cpu_type == MXC_CPU_MX31)
  86. #else
  87. # define cpu_is_mx31() (0)
  88. #endif
  89. #ifdef CONFIG_ARCH_MX35
  90. # ifdef mxc_cpu_type
  91. # undef mxc_cpu_type
  92. # define mxc_cpu_type __mxc_cpu_type
  93. # else
  94. # define mxc_cpu_type MXC_CPU_MX35
  95. # endif
  96. # define cpu_is_mx35() (mxc_cpu_type == MXC_CPU_MX35)
  97. #else
  98. # define cpu_is_mx35() (0)
  99. #endif
  100. #ifdef CONFIG_ARCH_MXC91231
  101. # ifdef mxc_cpu_type
  102. # undef mxc_cpu_type
  103. # define mxc_cpu_type __mxc_cpu_type
  104. # else
  105. # define mxc_cpu_type MXC_CPU_MXC91231
  106. # endif
  107. # define cpu_is_mxc91231() (mxc_cpu_type == MXC_CPU_MXC91231)
  108. #else
  109. # define cpu_is_mxc91231() (0)
  110. #endif
  111. #if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2)
  112. #define CSCR_U(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10)
  113. #define CSCR_L(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x4)
  114. #define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x8)
  115. #endif
  116. #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35() || cpu_is_mxc91231())
  117. #define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27())
  118. #endif /* __ASM_ARCH_MXC_H__ */