mx2x.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /*
  2. * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
  4. *
  5. * This contains hardware definitions that are common between i.MX21 and
  6. * i.MX27.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  20. * MA 02110-1301, USA.
  21. */
  22. #ifndef __ASM_ARCH_MXC_MX2x_H__
  23. #define __ASM_ARCH_MXC_MX2x_H__
  24. #ifndef __ASM_ARCH_MXC_HARDWARE_H__
  25. #error "Do not include directly."
  26. #endif
  27. /* The following addresses are common between i.MX21 and i.MX27 */
  28. /* Register offests */
  29. #define AIPI_BASE_ADDR 0x10000000
  30. #define AIPI_BASE_ADDR_VIRT 0xF4000000
  31. #define AIPI_SIZE SZ_1M
  32. #define DMA_BASE_ADDR (AIPI_BASE_ADDR + 0x01000)
  33. #define WDOG_BASE_ADDR (AIPI_BASE_ADDR + 0x02000)
  34. #define GPT1_BASE_ADDR (AIPI_BASE_ADDR + 0x03000)
  35. #define GPT2_BASE_ADDR (AIPI_BASE_ADDR + 0x04000)
  36. #define GPT3_BASE_ADDR (AIPI_BASE_ADDR + 0x05000)
  37. #define PWM_BASE_ADDR (AIPI_BASE_ADDR + 0x06000)
  38. #define RTC_BASE_ADDR (AIPI_BASE_ADDR + 0x07000)
  39. #define KPP_BASE_ADDR (AIPI_BASE_ADDR + 0x08000)
  40. #define OWIRE_BASE_ADDR (AIPI_BASE_ADDR + 0x09000)
  41. #define UART1_BASE_ADDR (AIPI_BASE_ADDR + 0x0A000)
  42. #define UART2_BASE_ADDR (AIPI_BASE_ADDR + 0x0B000)
  43. #define UART3_BASE_ADDR (AIPI_BASE_ADDR + 0x0C000)
  44. #define UART4_BASE_ADDR (AIPI_BASE_ADDR + 0x0D000)
  45. #define CSPI1_BASE_ADDR (AIPI_BASE_ADDR + 0x0E000)
  46. #define CSPI2_BASE_ADDR (AIPI_BASE_ADDR + 0x0F000)
  47. #define SSI1_BASE_ADDR (AIPI_BASE_ADDR + 0x10000)
  48. #define SSI2_BASE_ADDR (AIPI_BASE_ADDR + 0x11000)
  49. #define I2C_BASE_ADDR (AIPI_BASE_ADDR + 0x12000)
  50. #define SDHC1_BASE_ADDR (AIPI_BASE_ADDR + 0x13000)
  51. #define SDHC2_BASE_ADDR (AIPI_BASE_ADDR + 0x14000)
  52. #define GPIO_BASE_ADDR (AIPI_BASE_ADDR + 0x15000)
  53. #define AUDMUX_BASE_ADDR (AIPI_BASE_ADDR + 0x16000)
  54. #define CSPI3_BASE_ADDR (AIPI_BASE_ADDR + 0x17000)
  55. #define LCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x21000)
  56. #define SLCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x22000)
  57. #define USBOTG_BASE_ADDR (AIPI_BASE_ADDR + 0x24000)
  58. #define EMMA_PP_BASE_ADDR (AIPI_BASE_ADDR + 0x26000)
  59. #define EMMA_PRP_BASE_ADDR (AIPI_BASE_ADDR + 0x26400)
  60. #define CCM_BASE_ADDR (AIPI_BASE_ADDR + 0x27000)
  61. #define SYSCTRL_BASE_ADDR (AIPI_BASE_ADDR + 0x27800)
  62. #define JAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3E000)
  63. #define MAX_BASE_ADDR (AIPI_BASE_ADDR + 0x3F000)
  64. #define AVIC_BASE_ADDR 0x10040000
  65. #define SAHB1_BASE_ADDR 0x80000000
  66. #define SAHB1_BASE_ADDR_VIRT 0xF4100000
  67. #define SAHB1_SIZE SZ_1M
  68. #define CSI_BASE_ADDR (SAHB1_BASE_ADDR + 0x0000)
  69. /*
  70. * This macro defines the physical to virtual address mapping for all the
  71. * peripheral modules. It is used by passing in the physical address as x
  72. * and returning the virtual address. If the physical address is not mapped,
  73. * it returns 0xDEADBEEF
  74. */
  75. #define IO_ADDRESS(x) \
  76. (void __force __iomem *) \
  77. (((x >= AIPI_BASE_ADDR) && (x < (AIPI_BASE_ADDR + AIPI_SIZE))) ? \
  78. AIPI_IO_ADDRESS(x) : \
  79. ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \
  80. SAHB1_IO_ADDRESS(x) : \
  81. ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \
  82. X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF)
  83. /* define the address mapping macros: in physical address order */
  84. #define AIPI_IO_ADDRESS(x) \
  85. (((x) - AIPI_BASE_ADDR) + AIPI_BASE_ADDR_VIRT)
  86. #define AVIC_IO_ADDRESS(x) AIPI_IO_ADDRESS(x)
  87. #define SAHB1_IO_ADDRESS(x) \
  88. (((x) - SAHB1_BASE_ADDR) + SAHB1_BASE_ADDR_VIRT)
  89. #define CS4_IO_ADDRESS(x) \
  90. (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
  91. #define X_MEMC_IO_ADDRESS(x) \
  92. (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
  93. #define PCMCIA_IO_ADDRESS(x) \
  94. (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
  95. /* fixed interrupt numbers */
  96. #define MXC_INT_LCDC 61
  97. #define MXC_INT_SLCDC 60
  98. #define MXC_INT_EMMAPP 52
  99. #define MXC_INT_EMMAPRP 51
  100. #define MXC_INT_DMACH15 47
  101. #define MXC_INT_DMACH14 46
  102. #define MXC_INT_DMACH13 45
  103. #define MXC_INT_DMACH12 44
  104. #define MXC_INT_DMACH11 43
  105. #define MXC_INT_DMACH10 42
  106. #define MXC_INT_DMACH9 41
  107. #define MXC_INT_DMACH8 40
  108. #define MXC_INT_DMACH7 39
  109. #define MXC_INT_DMACH6 38
  110. #define MXC_INT_DMACH5 37
  111. #define MXC_INT_DMACH4 36
  112. #define MXC_INT_DMACH3 35
  113. #define MXC_INT_DMACH2 34
  114. #define MXC_INT_DMACH1 33
  115. #define MXC_INT_DMACH0 32
  116. #define MXC_INT_CSI 31
  117. #define MXC_INT_NANDFC 29
  118. #define MXC_INT_PCMCIA 28
  119. #define MXC_INT_WDOG 27
  120. #define MXC_INT_GPT1 26
  121. #define MXC_INT_GPT2 25
  122. #define MXC_INT_GPT3 24
  123. #define MXC_INT_GPT INT_GPT1
  124. #define MXC_INT_PWM 23
  125. #define MXC_INT_RTC 22
  126. #define MXC_INT_KPP 21
  127. #define MXC_INT_UART1 20
  128. #define MXC_INT_UART2 19
  129. #define MXC_INT_UART3 18
  130. #define MXC_INT_UART4 17
  131. #define MXC_INT_CSPI1 16
  132. #define MXC_INT_CSPI2 15
  133. #define MXC_INT_SSI1 14
  134. #define MXC_INT_SSI2 13
  135. #define MXC_INT_I2C 12
  136. #define MXC_INT_SDHC1 11
  137. #define MXC_INT_SDHC2 10
  138. #define MXC_INT_GPIO 8
  139. #define MXC_INT_CSPI3 6
  140. /* gpio and gpio based interrupt handling */
  141. #define GPIO_DR 0x1C
  142. #define GPIO_GDIR 0x00
  143. #define GPIO_PSR 0x24
  144. #define GPIO_ICR1 0x28
  145. #define GPIO_ICR2 0x2C
  146. #define GPIO_IMR 0x30
  147. #define GPIO_ISR 0x34
  148. #define GPIO_INT_LOW_LEV 0x3
  149. #define GPIO_INT_HIGH_LEV 0x2
  150. #define GPIO_INT_RISE_EDGE 0x0
  151. #define GPIO_INT_FALL_EDGE 0x1
  152. #define GPIO_INT_NONE 0x4
  153. /* fixed DMA request numbers */
  154. #define DMA_REQ_CSI_RX 31
  155. #define DMA_REQ_CSI_STAT 30
  156. #define DMA_REQ_UART1_TX 27
  157. #define DMA_REQ_UART1_RX 26
  158. #define DMA_REQ_UART2_TX 25
  159. #define DMA_REQ_UART2_RX 24
  160. #define DMA_REQ_UART3_TX 23
  161. #define DMA_REQ_UART3_RX 22
  162. #define DMA_REQ_UART4_TX 21
  163. #define DMA_REQ_UART4_RX 20
  164. #define DMA_REQ_CSPI1_TX 19
  165. #define DMA_REQ_CSPI1_RX 18
  166. #define DMA_REQ_CSPI2_TX 17
  167. #define DMA_REQ_CSPI2_RX 16
  168. #define DMA_REQ_SSI1_TX1 15
  169. #define DMA_REQ_SSI1_RX1 14
  170. #define DMA_REQ_SSI1_TX0 13
  171. #define DMA_REQ_SSI1_RX0 12
  172. #define DMA_REQ_SSI2_TX1 11
  173. #define DMA_REQ_SSI2_RX1 10
  174. #define DMA_REQ_SSI2_TX0 9
  175. #define DMA_REQ_SSI2_RX0 8
  176. #define DMA_REQ_SDHC1 7
  177. #define DMA_REQ_SDHC2 6
  178. #define DMA_REQ_EXT 3
  179. #define DMA_REQ_CSPI3_TX 2
  180. #define DMA_REQ_CSPI3_RX 1
  181. #endif /* __ASM_ARCH_MXC_MX2x_H__ */