mxc91231.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. /*
  2. * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * - Platform specific register memory map
  4. *
  5. * Copyright 2005-2007 Motorola, Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef __MACH_MXC91231_H__
  22. #define __MACH_MXC91231_H__
  23. /*
  24. * L2CC
  25. */
  26. #define MXC91231_L2CC_BASE_ADDR 0x30000000
  27. #define MXC91231_L2CC_BASE_ADDR_VIRT 0xF9000000
  28. #define MXC91231_L2CC_SIZE SZ_64K
  29. /*
  30. * AIPS 1
  31. */
  32. #define MXC91231_AIPS1_BASE_ADDR 0x43F00000
  33. #define MXC91231_AIPS1_BASE_ADDR_VIRT 0xFC000000
  34. #define MXC91231_AIPS1_SIZE SZ_1M
  35. #define MXC91231_AIPS1_CTRL_BASE_ADDR MXC91231_AIPS1_BASE_ADDR
  36. #define MXC91231_MAX_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x04000)
  37. #define MXC91231_EVTMON_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x08000)
  38. #define MXC91231_CLKCTL_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x0C000)
  39. #define MXC91231_ETB_SLOT4_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x10000)
  40. #define MXC91231_ETB_SLOT5_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x14000)
  41. #define MXC91231_ECT_CTIO_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x18000)
  42. #define MXC91231_I2C_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x80000)
  43. #define MXC91231_MU_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x88000)
  44. #define MXC91231_UART1_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x90000)
  45. #define MXC91231_UART2_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x94000)
  46. #define MXC91231_DSM_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x98000)
  47. #define MXC91231_OWIRE_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x9C000)
  48. #define MXC91231_SSI1_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0xA0000)
  49. #define MXC91231_KPP_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0xA8000)
  50. #define MXC91231_IOMUX_AP_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0xAC000)
  51. #define MXC91231_CTI_AP_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0xB8000)
  52. /*
  53. * AIPS 2
  54. */
  55. #define MXC91231_AIPS2_BASE_ADDR 0x53F00000
  56. #define MXC91231_AIPS2_BASE_ADDR_VIRT 0xFC100000
  57. #define MXC91231_AIPS2_SIZE SZ_1M
  58. #define MXC91231_GEMK_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0x8C000)
  59. #define MXC91231_GPT1_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0x90000)
  60. #define MXC91231_EPIT1_AP_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0x94000)
  61. #define MXC91231_SCC_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xAC000)
  62. #define MXC91231_RNGA_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xB0000)
  63. #define MXC91231_IPU_CTRL_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xC0000)
  64. #define MXC91231_AUDMUX_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xC4000)
  65. #define MXC91231_EDIO_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xC8000)
  66. #define MXC91231_GPIO1_AP_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xCC000)
  67. #define MXC91231_GPIO2_AP_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xD0000)
  68. #define MXC91231_SDMA_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xD4000)
  69. #define MXC91231_RTC_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xD8000)
  70. #define MXC91231_WDOG1_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xDC000)
  71. #define MXC91231_PWM_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xE0000)
  72. #define MXC91231_GPIO3_AP_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xE4000)
  73. #define MXC91231_WDOG2_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xE8000)
  74. #define MXC91231_RTIC_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xEC000)
  75. #define MXC91231_LPMC_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xF0000)
  76. /*
  77. * SPBA global module 0
  78. */
  79. #define MXC91231_SPBA0_BASE_ADDR 0x50000000
  80. #define MXC91231_SPBA0_BASE_ADDR_VIRT 0xFC200000
  81. #define MXC91231_SPBA0_SIZE SZ_1M
  82. #define MXC91231_MMC_SDHC1_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x04000)
  83. #define MXC91231_MMC_SDHC2_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x08000)
  84. #define MXC91231_UART3_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x0C000)
  85. #define MXC91231_CSPI2_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x10000)
  86. #define MXC91231_SSI2_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x14000)
  87. #define MXC91231_SIM_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x18000)
  88. #define MXC91231_IIM_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x1C000)
  89. #define MXC91231_CTI_SDMA_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x20000)
  90. #define MXC91231_USBOTG_CTRL_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x24000)
  91. #define MXC91231_USBOTG_DATA_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x28000)
  92. #define MXC91231_CSPI1_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x30000)
  93. #define MXC91231_SPBA_CTRL_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x3C000)
  94. #define MXC91231_IOMUX_COM_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x40000)
  95. #define MXC91231_CRM_COM_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x44000)
  96. #define MXC91231_CRM_AP_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x48000)
  97. #define MXC91231_PLL0_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x4C000)
  98. #define MXC91231_PLL1_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x50000)
  99. #define MXC91231_PLL2_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x54000)
  100. #define MXC91231_GPIO4_SH_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x58000)
  101. #define MXC91231_HAC_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x5C000)
  102. #define MXC91231_SAHARA_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x5C000)
  103. #define MXC91231_PLL3_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x60000)
  104. /*
  105. * SPBA global module 1
  106. */
  107. #define MXC91231_SPBA1_BASE_ADDR 0x52000000
  108. #define MXC91231_SPBA1_BASE_ADDR_VIRT 0xFC300000
  109. #define MXC91231_SPBA1_SIZE SZ_1M
  110. #define MXC91231_MQSPI_BASE_ADDR (MXC91231_SPBA1_BASE_ADDR + 0x34000)
  111. #define MXC91231_EL1T_BASE_ADDR (MXC91231_SPBA1_BASE_ADDR + 0x38000)
  112. /*!
  113. * Defines for SPBA modules
  114. */
  115. #define MXC91231_SPBA_SDHC1 0x04
  116. #define MXC91231_SPBA_SDHC2 0x08
  117. #define MXC91231_SPBA_UART3 0x0C
  118. #define MXC91231_SPBA_CSPI2 0x10
  119. #define MXC91231_SPBA_SSI2 0x14
  120. #define MXC91231_SPBA_SIM 0x18
  121. #define MXC91231_SPBA_IIM 0x1C
  122. #define MXC91231_SPBA_CTI_SDMA 0x20
  123. #define MXC91231_SPBA_USBOTG_CTRL_REGS 0x24
  124. #define MXC91231_SPBA_USBOTG_DATA_REGS 0x28
  125. #define MXC91231_SPBA_CSPI1 0x30
  126. #define MXC91231_SPBA_MQSPI 0x34
  127. #define MXC91231_SPBA_EL1T 0x38
  128. #define MXC91231_SPBA_IOMUX 0x40
  129. #define MXC91231_SPBA_CRM_COM 0x44
  130. #define MXC91231_SPBA_CRM_AP 0x48
  131. #define MXC91231_SPBA_PLL0 0x4C
  132. #define MXC91231_SPBA_PLL1 0x50
  133. #define MXC91231_SPBA_PLL2 0x54
  134. #define MXC91231_SPBA_GPIO4 0x58
  135. #define MXC91231_SPBA_SAHARA 0x5C
  136. /*
  137. * ROMP and AVIC
  138. */
  139. #define MXC91231_ROMP_BASE_ADDR 0x60000000
  140. #define MXC91231_ROMP_BASE_ADDR_VIRT 0xFC400000
  141. #define MXC91231_ROMP_SIZE SZ_64K
  142. #define MXC91231_AVIC_BASE_ADDR 0x68000000
  143. #define MXC91231_AVIC_BASE_ADDR_VIRT 0xFC410000
  144. #define MXC91231_AVIC_SIZE SZ_64K
  145. /*
  146. * NAND, SDRAM, WEIM, M3IF, EMI controllers
  147. */
  148. #define MXC91231_X_MEMC_BASE_ADDR 0xB8000000
  149. #define MXC91231_X_MEMC_BASE_ADDR_VIRT 0xFC420000
  150. #define MXC91231_X_MEMC_SIZE SZ_64K
  151. #define MXC91231_NFC_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x0000)
  152. #define MXC91231_ESDCTL_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x1000)
  153. #define MXC91231_WEIM_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x2000)
  154. #define MXC91231_M3IF_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x3000)
  155. #define MXC91231_EMI_CTL_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x4000)
  156. /*
  157. * Memory regions and CS
  158. * CPLD is connected on CS4
  159. * CS5 is TP1021 or it is not connected
  160. * */
  161. #define MXC91231_FB_RAM_BASE_ADDR 0x78000000
  162. #define MXC91231_FB_RAM_SIZE SZ_256K
  163. #define MXC91231_CSD0_BASE_ADDR 0x80000000
  164. #define MXC91231_CSD1_BASE_ADDR 0x90000000
  165. #define MXC91231_CS0_BASE_ADDR 0xA0000000
  166. #define MXC91231_CS1_BASE_ADDR 0xA8000000
  167. #define MXC91231_CS2_BASE_ADDR 0xB0000000
  168. #define MXC91231_CS3_BASE_ADDR 0xB2000000
  169. #define MXC91231_CS4_BASE_ADDR 0xB4000000
  170. #define MXC91231_CS5_BASE_ADDR 0xB6000000
  171. /* Is given address belongs to the specified memory region? */
  172. #define ADDRESS_IN_REGION(addr, start, size) \
  173. (((addr) >= (start)) && ((addr) < (start)+(size)))
  174. /* Is given address belongs to the specified named `module'? */
  175. #define MXC91231_IS_MODULE(addr, module) \
  176. ADDRESS_IN_REGION(addr, MXC91231_ ## module ## _BASE_ADDR, \
  177. MXC91231_ ## module ## _SIZE)
  178. /*
  179. * This macro defines the physical to virtual address mapping for all the
  180. * peripheral modules. It is used by passing in the physical address as x
  181. * and returning the virtual address. If the physical address is not mapped,
  182. * it returns 0xDEADBEEF
  183. */
  184. #define MXC91231_IO_ADDRESS(x) \
  185. (void __iomem *) \
  186. (MXC91231_IS_MODULE(x, L2CC) ? MXC91231_L2CC_IO_ADDRESS(x) : \
  187. MXC91231_IS_MODULE(x, AIPS1) ? MXC91231_AIPS1_IO_ADDRESS(x) : \
  188. MXC91231_IS_MODULE(x, AIPS2) ? MXC91231_AIPS2_IO_ADDRESS(x) : \
  189. MXC91231_IS_MODULE(x, SPBA0) ? MXC91231_SPBA0_IO_ADDRESS(x) : \
  190. MXC91231_IS_MODULE(x, SPBA1) ? MXC91231_SPBA1_IO_ADDRESS(x) : \
  191. MXC91231_IS_MODULE(x, ROMP) ? MXC91231_ROMP_IO_ADDRESS(x) : \
  192. MXC91231_IS_MODULE(x, AVIC) ? MXC91231_AVIC_IO_ADDRESS(x) : \
  193. MXC91231_IS_MODULE(x, X_MEMC) ? MXC91231_X_MEMC_IO_ADDRESS(x) : \
  194. 0xDEADBEEF)
  195. /*
  196. * define the address mapping macros: in physical address order
  197. */
  198. #define MXC91231_L2CC_IO_ADDRESS(x) \
  199. (((x) - MXC91231_L2CC_BASE_ADDR) + MXC91231_L2CC_BASE_ADDR_VIRT)
  200. #define MXC91231_AIPS1_IO_ADDRESS(x) \
  201. (((x) - MXC91231_AIPS1_BASE_ADDR) + MXC91231_AIPS1_BASE_ADDR_VIRT)
  202. #define MXC91231_SPBA0_IO_ADDRESS(x) \
  203. (((x) - MXC91231_SPBA0_BASE_ADDR) + MXC91231_SPBA0_BASE_ADDR_VIRT)
  204. #define MXC91231_SPBA1_IO_ADDRESS(x) \
  205. (((x) - MXC91231_SPBA1_BASE_ADDR) + MXC91231_SPBA1_BASE_ADDR_VIRT)
  206. #define MXC91231_AIPS2_IO_ADDRESS(x) \
  207. (((x) - MXC91231_AIPS2_BASE_ADDR) + MXC91231_AIPS2_BASE_ADDR_VIRT)
  208. #define MXC91231_ROMP_IO_ADDRESS(x) \
  209. (((x) - MXC91231_ROMP_BASE_ADDR) + MXC91231_ROMP_BASE_ADDR_VIRT)
  210. #define MXC91231_AVIC_IO_ADDRESS(x) \
  211. (((x) - MXC91231_AVIC_BASE_ADDR) + MXC91231_AVIC_BASE_ADDR_VIRT)
  212. #define MXC91231_X_MEMC_IO_ADDRESS(x) \
  213. (((x) - MXC91231_X_MEMC_BASE_ADDR) + MXC91231_X_MEMC_BASE_ADDR_VIRT)
  214. /*
  215. * Interrupt numbers
  216. */
  217. #define MXC91231_INT_GPIO3 0
  218. #define MXC91231_INT_EL1T_CI 1
  219. #define MXC91231_INT_EL1T_RFCI 2
  220. #define MXC91231_INT_EL1T_RFI 3
  221. #define MXC91231_INT_EL1T_MCU 4
  222. #define MXC91231_INT_EL1T_IPI 5
  223. #define MXC91231_INT_MU_GEN 6
  224. #define MXC91231_INT_GPIO4 7
  225. #define MXC91231_INT_MMC_SDHC2 8
  226. #define MXC91231_INT_MMC_SDHC1 9
  227. #define MXC91231_INT_I2C 10
  228. #define MXC91231_INT_SSI2 11
  229. #define MXC91231_INT_SSI1 12
  230. #define MXC91231_INT_CSPI2 13
  231. #define MXC91231_INT_CSPI1 14
  232. #define MXC91231_INT_RTIC 15
  233. #define MXC91231_INT_SAHARA 15
  234. #define MXC91231_INT_HAC 15
  235. #define MXC91231_INT_UART3_RX 16
  236. #define MXC91231_INT_UART3_TX 17
  237. #define MXC91231_INT_UART3_MINT 18
  238. #define MXC91231_INT_ECT 19
  239. #define MXC91231_INT_SIM_IPB 20
  240. #define MXC91231_INT_SIM_DATA 21
  241. #define MXC91231_INT_RNGA 22
  242. #define MXC91231_INT_DSM_AP 23
  243. #define MXC91231_INT_KPP 24
  244. #define MXC91231_INT_RTC 25
  245. #define MXC91231_INT_PWM 26
  246. #define MXC91231_INT_GEMK_AP 27
  247. #define MXC91231_INT_EPIT 28
  248. #define MXC91231_INT_GPT 29
  249. #define MXC91231_INT_UART2_RX 30
  250. #define MXC91231_INT_UART2_TX 31
  251. #define MXC91231_INT_UART2_MINT 32
  252. #define MXC91231_INT_NANDFC 33
  253. #define MXC91231_INT_SDMA 34
  254. #define MXC91231_INT_USB_WAKEUP 35
  255. #define MXC91231_INT_USB_SOF 36
  256. #define MXC91231_INT_PMU_EVTMON 37
  257. #define MXC91231_INT_USB_FUNC 38
  258. #define MXC91231_INT_USB_DMA 39
  259. #define MXC91231_INT_USB_CTRL 40
  260. #define MXC91231_INT_IPU_ERR 41
  261. #define MXC91231_INT_IPU_SYN 42
  262. #define MXC91231_INT_UART1_RX 43
  263. #define MXC91231_INT_UART1_TX 44
  264. #define MXC91231_INT_UART1_MINT 45
  265. #define MXC91231_INT_IIM 46
  266. #define MXC91231_INT_MU_RX_OR 47
  267. #define MXC91231_INT_MU_TX_OR 48
  268. #define MXC91231_INT_SCC_SCM 49
  269. #define MXC91231_INT_SCC_SMN 50
  270. #define MXC91231_INT_GPIO2 51
  271. #define MXC91231_INT_GPIO1 52
  272. #define MXC91231_INT_MQSPI1 53
  273. #define MXC91231_INT_MQSPI2 54
  274. #define MXC91231_INT_WDOG2 55
  275. #define MXC91231_INT_EXT_INT7 56
  276. #define MXC91231_INT_EXT_INT6 57
  277. #define MXC91231_INT_EXT_INT5 58
  278. #define MXC91231_INT_EXT_INT4 59
  279. #define MXC91231_INT_EXT_INT3 60
  280. #define MXC91231_INT_EXT_INT2 61
  281. #define MXC91231_INT_EXT_INT1 62
  282. #define MXC91231_INT_EXT_INT0 63
  283. #define MXC91231_MAX_INT_LINES 63
  284. #define MXC91231_MAX_EXT_LINES 8
  285. #endif /* __MACH_MXC91231_H__ */