imx-regs.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. /*
  2. * (C) Copyright 2009 Freescale Semiconductor, Inc.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (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,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef __ASM_ARCH_MXC_MX51_H__
  23. #define __ASM_ARCH_MXC_MX51_H__
  24. /*
  25. * IRAM
  26. */
  27. #define IRAM_BASE_ADDR 0x1FFE8000 /* internal ram */
  28. /*
  29. * Graphics Memory of GPU
  30. */
  31. #define GPU_BASE_ADDR 0x20000000
  32. #define GPU_CTRL_BASE_ADDR 0x30000000
  33. #define IPU_CTRL_BASE_ADDR 0x40000000
  34. /*
  35. * Debug
  36. */
  37. #define DEBUG_BASE_ADDR 0x60000000
  38. #define ETB_BASE_ADDR (DEBUG_BASE_ADDR + 0x00001000)
  39. #define ETM_BASE_ADDR (DEBUG_BASE_ADDR + 0x00002000)
  40. #define TPIU_BASE_ADDR (DEBUG_BASE_ADDR + 0x00003000)
  41. #define CTI0_BASE_ADDR (DEBUG_BASE_ADDR + 0x00004000)
  42. #define CTI1_BASE_ADDR (DEBUG_BASE_ADDR + 0x00005000)
  43. #define CTI2_BASE_ADDR (DEBUG_BASE_ADDR + 0x00006000)
  44. #define CTI3_BASE_ADDR (DEBUG_BASE_ADDR + 0x00007000)
  45. #define CORTEX_DBG_BASE_ADDR (DEBUG_BASE_ADDR + 0x00008000)
  46. /*
  47. * SPBA global module enabled #0
  48. */
  49. #define SPBA0_BASE_ADDR 0x70000000
  50. #define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000)
  51. #define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000)
  52. #define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000)
  53. #define CSPI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000)
  54. #define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000)
  55. #define MMC_SDHC3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000)
  56. #define MMC_SDHC4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
  57. #define SPDIF_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000)
  58. #define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000)
  59. #define SLIM_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000)
  60. #define HSI2C_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000)
  61. #define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
  62. /*
  63. * AIPS 1
  64. */
  65. #define AIPS1_BASE_ADDR 0x73F00000
  66. #define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
  67. #define GPIO1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
  68. #define GPIO2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000)
  69. #define GPIO3_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
  70. #define GPIO4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
  71. #define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
  72. #define WDOG1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
  73. #define WDOG2_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000)
  74. #define GPT1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000)
  75. #define SRTC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000)
  76. #define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000)
  77. #define EPIT1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000)
  78. #define EPIT2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
  79. #define PWM1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
  80. #define PWM2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000)
  81. #define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
  82. #define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000C0000)
  83. #define SRC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D0000)
  84. #define CCM_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D4000)
  85. #define GPC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D8000)
  86. /*
  87. * AIPS 2
  88. */
  89. #define AIPS2_BASE_ADDR 0x83F00000
  90. #define PLL1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000)
  91. #define PLL2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000)
  92. #define PLL3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000)
  93. #define AHBMAX_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000)
  94. #define IIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000)
  95. #define CSU_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000)
  96. #define ARM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000)
  97. #define OWIRE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000)
  98. #define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000)
  99. #define CSPI2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000)
  100. #define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000)
  101. #define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000)
  102. #define ROMCP_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000)
  103. #define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000)
  104. #define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000)
  105. #define I2C2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000)
  106. #define I2C1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000)
  107. #define SSI1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000)
  108. #define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000)
  109. #define M4IF_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000)
  110. #define ESDCTL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D9000)
  111. #define WEIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DA000)
  112. #define NFC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DB000)
  113. #define EMI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DBF00)
  114. #define MIPI_HSC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000)
  115. #define ATA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000)
  116. #define SIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E4000)
  117. #define SSI3BASE_ADDR (AIPS2_BASE_ADDR + 0x000E8000)
  118. #define FEC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
  119. #define TVE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F0000)
  120. #define VPU_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F4000)
  121. #define SAHARA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000)
  122. #define TZIC_BASE_ADDR 0x8FFFC000
  123. /*
  124. * Memory regions and CS
  125. */
  126. #define CSD0_BASE_ADDR 0x90000000
  127. #define CSD1_BASE_ADDR 0xA0000000
  128. #define CS0_BASE_ADDR 0xB0000000
  129. #define CS1_BASE_ADDR 0xB8000000
  130. #define CS2_BASE_ADDR 0xC0000000
  131. #define CS3_BASE_ADDR 0xC8000000
  132. #define CS4_BASE_ADDR 0xCC000000
  133. #define CS5_BASE_ADDR 0xCE000000
  134. /*
  135. * NFC
  136. */
  137. #define NFC_BASE_ADDR_AXI 0xCFFF0000 /* NAND flash AXI */
  138. /*!
  139. * Number of GPIO port as defined in the IC Spec
  140. */
  141. #define GPIO_PORT_NUM 4
  142. /*!
  143. * Number of GPIO pins per port
  144. */
  145. #define GPIO_NUM_PIN 32
  146. #define IIM_SREV 0x24
  147. #define ROM_SI_REV 0x48
  148. #define NFC_BUF_SIZE 0x1000
  149. /* M4IF */
  150. #define M4IF_FBPM0 0x40
  151. #define M4IF_FIDBP 0x48
  152. /* Assuming 24MHz input clock with doubler ON */
  153. /* MFI PDF */
  154. #define DP_OP_850 ((8 << 4) + ((1 - 1) << 0))
  155. #define DP_MFD_850 (48 - 1)
  156. #define DP_MFN_850 41
  157. #define DP_OP_800 ((8 << 4) + ((1 - 1) << 0))
  158. #define DP_MFD_800 (3 - 1)
  159. #define DP_MFN_800 1
  160. #define DP_OP_700 ((7 << 4) + ((1 - 1) << 0))
  161. #define DP_MFD_700 (24 - 1)
  162. #define DP_MFN_700 7
  163. #define DP_OP_665 ((6 << 4) + ((1 - 1) << 0))
  164. #define DP_MFD_665 (96 - 1)
  165. #define DP_MFN_665 89
  166. #define DP_OP_532 ((5 << 4) + ((1 - 1) << 0))
  167. #define DP_MFD_532 (24 - 1)
  168. #define DP_MFN_532 13
  169. #define DP_OP_400 ((8 << 4) + ((2 - 1) << 0))
  170. #define DP_MFD_400 (3 - 1)
  171. #define DP_MFN_400 1
  172. #define DP_OP_216 ((6 << 4) + ((3 - 1) << 0))
  173. #define DP_MFD_216 (4 - 1)
  174. #define DP_MFN_216 3
  175. #define CHIP_REV_1_0 0x10
  176. #define CHIP_REV_1_1 0x11
  177. #define CHIP_REV_2_0 0x20
  178. #define CHIP_REV_2_5 0x25
  179. #define CHIP_REV_3_0 0x30
  180. #define BOARD_REV_1_0 0x0
  181. #define BOARD_REV_2_0 0x1
  182. #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
  183. #include <asm/types.h>
  184. #define __REG(x) (*((volatile u32 *)(x)))
  185. #define __REG16(x) (*((volatile u16 *)(x)))
  186. #define __REG8(x) (*((volatile u8 *)(x)))
  187. struct clkctl {
  188. u32 ccr;
  189. u32 ccdr;
  190. u32 csr;
  191. u32 ccsr;
  192. u32 cacrr;
  193. u32 cbcdr;
  194. u32 cbcmr;
  195. u32 cscmr1;
  196. u32 cscmr2;
  197. u32 cscdr1;
  198. u32 cs1cdr;
  199. u32 cs2cdr;
  200. u32 cdcdr;
  201. u32 chsccdr;
  202. u32 cscdr2;
  203. u32 cscdr3;
  204. u32 cscdr4;
  205. u32 cwdr;
  206. u32 cdhipr;
  207. u32 cdcr;
  208. u32 ctor;
  209. u32 clpcr;
  210. u32 cisr;
  211. u32 cimr;
  212. u32 ccosr;
  213. u32 cgpr;
  214. u32 ccgr0;
  215. u32 ccgr1;
  216. u32 ccgr2;
  217. u32 ccgr3;
  218. u32 ccgr4;
  219. u32 ccgr5;
  220. u32 ccgr6;
  221. u32 cmeor;
  222. };
  223. /* WEIM registers */
  224. struct weim {
  225. u32 csgcr1;
  226. u32 csgcr2;
  227. u32 csrcr1;
  228. u32 csrcr2;
  229. u32 cswcr1;
  230. u32 cswcr2;
  231. };
  232. /* GPIO Registers */
  233. struct gpio_regs {
  234. u32 gpio_dr;
  235. u32 gpio_dir;
  236. u32 gpio_psr;
  237. };
  238. /* System Reset Controller (SRC) */
  239. struct src {
  240. u32 scr;
  241. u32 sbmr;
  242. u32 srsr;
  243. u32 reserved1[2];
  244. u32 sisr;
  245. u32 simr;
  246. };
  247. #endif /* __ASSEMBLER__*/
  248. #endif /* __ASM_ARCH_MXC_MX51_H__ */