imx-regs.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. /*
  2. * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
  3. *
  4. * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #ifndef __ASM_ARCH_MX35_H
  25. #define __ASM_ARCH_MX35_H
  26. #define ARCH_MXC
  27. /*
  28. * IRAM
  29. */
  30. #define IRAM_BASE_ADDR 0x10000000 /* internal ram */
  31. #define IRAM_SIZE 0x00020000 /* 128 KB */
  32. /*
  33. * AIPS 1
  34. */
  35. #define AIPS1_BASE_ADDR 0x43F00000
  36. #define AIPS1_CTRL_BASE_ADDR AIPS1_BASE_ADDR
  37. #define MAX_BASE_ADDR 0x43F04000
  38. #define EVTMON_BASE_ADDR 0x43F08000
  39. #define CLKCTL_BASE_ADDR 0x43F0C000
  40. #define I2C1_BASE_ADDR 0x43F80000
  41. #define I2C3_BASE_ADDR 0x43F84000
  42. #define ATA_BASE_ADDR 0x43F8C000
  43. #define UART1_BASE 0x43F90000
  44. #define UART2_BASE 0x43F94000
  45. #define I2C2_BASE_ADDR 0x43F98000
  46. #define CSPI1_BASE_ADDR 0x43FA4000
  47. #define IOMUXC_BASE_ADDR 0x43FAC000
  48. /*
  49. * SPBA
  50. */
  51. #define SPBA_BASE_ADDR 0x50000000
  52. #define UART3_BASE 0x5000C000
  53. #define CSPI2_BASE_ADDR 0x50010000
  54. #define ATA_DMA_BASE_ADDR 0x50020000
  55. #define FEC_BASE_ADDR 0x50038000
  56. #define SPBA_CTRL_BASE_ADDR 0x5003C000
  57. /*
  58. * AIPS 2
  59. */
  60. #define AIPS2_BASE_ADDR 0x53F00000
  61. #define AIPS2_CTRL_BASE_ADDR AIPS2_BASE_ADDR
  62. #define CCM_BASE_ADDR 0x53F80000
  63. #define GPT1_BASE_ADDR 0x53F90000
  64. #define EPIT1_BASE_ADDR 0x53F94000
  65. #define EPIT2_BASE_ADDR 0x53F98000
  66. #define GPIO3_BASE_ADDR 0x53FA4000
  67. #define MMC_SDHC1_BASE_ADDR 0x53FB4000
  68. #define MMC_SDHC2_BASE_ADDR 0x53FB8000
  69. #define MMC_SDHC3_BASE_ADDR 0x53FBC000
  70. #define IPU_CTRL_BASE_ADDR 0x53FC0000
  71. #define GPIO1_BASE_ADDR 0x53FCC000
  72. #define GPIO2_BASE_ADDR 0x53FD0000
  73. #define SDMA_BASE_ADDR 0x53FD4000
  74. #define RTC_BASE_ADDR 0x53FD8000
  75. #define WDOG_BASE_ADDR 0x53FDC000
  76. #define PWM_BASE_ADDR 0x53FE0000
  77. #define RTIC_BASE_ADDR 0x53FEC000
  78. #define IIM_BASE_ADDR 0x53FF0000
  79. #define IMX_CCM_BASE CCM_BASE_ADDR
  80. /*
  81. * ROMPATCH and AVIC
  82. */
  83. #define ROMPATCH_BASE_ADDR 0x60000000
  84. #define AVIC_BASE_ADDR 0x68000000
  85. /*
  86. * NAND, SDRAM, WEIM, M3IF, EMI controllers
  87. */
  88. #define EXT_MEM_CTRL_BASE 0xB8000000
  89. #define ESDCTL_BASE_ADDR 0xB8001000
  90. #define WEIM_BASE_ADDR 0xB8002000
  91. #define WEIM_CTRL_CS0 WEIM_BASE_ADDR
  92. #define WEIM_CTRL_CS1 (WEIM_BASE_ADDR + 0x10)
  93. #define WEIM_CTRL_CS2 (WEIM_BASE_ADDR + 0x20)
  94. #define WEIM_CTRL_CS3 (WEIM_BASE_ADDR + 0x30)
  95. #define WEIM_CTRL_CS4 (WEIM_BASE_ADDR + 0x40)
  96. #define WEIM_CTRL_CS5 (WEIM_BASE_ADDR + 0x50)
  97. #define M3IF_BASE_ADDR 0xB8003000
  98. #define EMI_BASE_ADDR 0xB8004000
  99. #define NFC_BASE_ADDR 0xBB000000
  100. /*
  101. * Memory regions and CS
  102. */
  103. #define IPU_MEM_BASE_ADDR 0x70000000
  104. #define CSD0_BASE_ADDR 0x80000000
  105. #define CSD1_BASE_ADDR 0x90000000
  106. #define CS0_BASE_ADDR 0xA0000000
  107. #define CS1_BASE_ADDR 0xA8000000
  108. #define CS2_BASE_ADDR 0xB0000000
  109. #define CS3_BASE_ADDR 0xB2000000
  110. #define CS4_BASE_ADDR 0xB4000000
  111. #define CS5_BASE_ADDR 0xB6000000
  112. /*
  113. * IRQ Controller Register Definitions.
  114. */
  115. #define AVIC_NIMASK 0x04
  116. #define AVIC_INTTYPEH 0x18
  117. #define AVIC_INTTYPEL 0x1C
  118. /* L210 */
  119. #define L2CC_BASE_ADDR 0x30000000
  120. #define L2_CACHE_LINE_SIZE 32
  121. #define L2_CACHE_CTL_REG 0x100
  122. #define L2_CACHE_AUX_CTL_REG 0x104
  123. #define L2_CACHE_SYNC_REG 0x730
  124. #define L2_CACHE_INV_LINE_REG 0x770
  125. #define L2_CACHE_INV_WAY_REG 0x77C
  126. #define L2_CACHE_CLEAN_LINE_REG 0x7B0
  127. #define L2_CACHE_CLEAN_INV_LINE_REG 0x7F0
  128. #define L2_CACHE_DBG_CTL_REG 0xF40
  129. #define CLKMODE_AUTO 0
  130. #define CLKMODE_CONSUMER 1
  131. #define PLL_PD(x) (((x) & 0xf) << 26)
  132. #define PLL_MFD(x) (((x) & 0x3ff) << 16)
  133. #define PLL_MFI(x) (((x) & 0xf) << 10)
  134. #define PLL_MFN(x) (((x) & 0x3ff) << 0)
  135. #define _PLL_BRM(x) ((x) << 31)
  136. #define _PLL_PD(x) (((x) - 1) << 26)
  137. #define _PLL_MFD(x) (((x) - 1) << 16)
  138. #define _PLL_MFI(x) ((x) << 10)
  139. #define _PLL_MFN(x) (x)
  140. #define _PLL_SETTING(brm, pd, mfd, mfi, mfn) \
  141. (_PLL_BRM(brm) | _PLL_PD(pd) | _PLL_MFD(mfd) | _PLL_MFI(mfi) |\
  142. _PLL_MFN(mfn))
  143. #define CCM_MPLL_532_HZ _PLL_SETTING(1, 1, 12, 11, 1)
  144. #define CCM_MPLL_399_HZ _PLL_SETTING(0, 1, 16, 8, 5)
  145. #define CCM_PPLL_300_HZ _PLL_SETTING(0, 1, 4, 6, 1)
  146. #define CSCR_U(x) (WEIM_CTRL_CS#x + 0)
  147. #define CSCR_L(x) (WEIM_CTRL_CS#x + 4)
  148. #define CSCR_A(x) (WEIM_CTRL_CS#x + 8)
  149. #define IIM_SREV 0x24
  150. #define ROMPATCH_REV 0x40
  151. #define IPU_CONF IPU_CTRL_BASE_ADDR
  152. #define IPU_CONF_PXL_ENDIAN (1<<8)
  153. #define IPU_CONF_DU_EN (1<<7)
  154. #define IPU_CONF_DI_EN (1<<6)
  155. #define IPU_CONF_ADC_EN (1<<5)
  156. #define IPU_CONF_SDC_EN (1<<4)
  157. #define IPU_CONF_PF_EN (1<<3)
  158. #define IPU_CONF_ROT_EN (1<<2)
  159. #define IPU_CONF_IC_EN (1<<1)
  160. #define IPU_CONF_CSI_EN (1<<0)
  161. /*
  162. * CSPI register definitions
  163. */
  164. #define MXC_CSPI
  165. #define MXC_CSPICTRL_EN (1 << 0)
  166. #define MXC_CSPICTRL_MODE (1 << 1)
  167. #define MXC_CSPICTRL_XCH (1 << 2)
  168. #define MXC_CSPICTRL_SMC (1 << 3)
  169. #define MXC_CSPICTRL_POL (1 << 4)
  170. #define MXC_CSPICTRL_PHA (1 << 5)
  171. #define MXC_CSPICTRL_SSCTL (1 << 6)
  172. #define MXC_CSPICTRL_SSPOL (1 << 7)
  173. #define MXC_CSPICTRL_CHIPSELECT(x) (((x) & 0x3) << 12)
  174. #define MXC_CSPICTRL_BITCOUNT(x) (((x) & 0xfff) << 20)
  175. #define MXC_CSPICTRL_DATARATE(x) (((x) & 0x7) << 16)
  176. #define MXC_CSPICTRL_TC (1 << 7)
  177. #define MXC_CSPICTRL_RXOVF (1 << 6)
  178. #define MXC_CSPICTRL_MAXBITS 0xfff
  179. #define MXC_CSPIPERIOD_32KHZ (1 << 15)
  180. #define MAX_SPI_BYTES 4
  181. #define MXC_SPI_BASE_ADDRESSES \
  182. 0x43fa4000, \
  183. 0x50010000,
  184. #define GPIO_PORT_NUM 3
  185. #define GPIO_NUM_PIN 32
  186. #define CHIP_REV_1_0 0x10
  187. #define CHIP_REV_2_0 0x20
  188. #define BOARD_REV_1_0 0x0
  189. #define BOARD_REV_2_0 0x1
  190. #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
  191. #include <asm/types.h>
  192. /* Clock Control Module (CCM) registers */
  193. struct ccm_regs {
  194. u32 ccmr; /* Control */
  195. u32 pdr0; /* Post divider 0 */
  196. u32 pdr1; /* Post divider 1 */
  197. u32 pdr2; /* Post divider 2 */
  198. u32 pdr3; /* Post divider 3 */
  199. u32 pdr4; /* Post divider 4 */
  200. u32 rcsr; /* CCM Status */
  201. u32 mpctl; /* Core PLL Control */
  202. u32 ppctl; /* Peripheral PLL Control */
  203. u32 acmr; /* Audio clock mux */
  204. u32 cosr; /* Clock out source */
  205. u32 cgr0; /* Clock Gating Control 0 */
  206. u32 cgr1; /* Clock Gating Control 1 */
  207. u32 cgr2; /* Clock Gating Control 2 */
  208. u32 cgr3; /* Clock Gating Control 3 */
  209. u32 reserved;
  210. u32 dcvr0; /* DPTC Comparator 0 */
  211. u32 dcvr1; /* DPTC Comparator 0 */
  212. u32 dcvr2; /* DPTC Comparator 0 */
  213. u32 dcvr3; /* DPTC Comparator 0 */
  214. u32 ltr0; /* Load Tracking 0 */
  215. u32 ltr1; /* Load Tracking 1 */
  216. u32 ltr2; /* Load Tracking 2 */
  217. u32 ltr3; /* Load Tracking 3 */
  218. u32 ltbr0; /* Load Tracking Buffer 0 */
  219. };
  220. /* IIM control registers */
  221. struct iim_regs {
  222. u32 iim_stat;
  223. u32 iim_statm;
  224. u32 iim_err;
  225. u32 iim_emask;
  226. u32 iim_fctl;
  227. u32 iim_ua;
  228. u32 iim_la;
  229. u32 iim_sdat;
  230. u32 iim_prev;
  231. u32 iim_srev;
  232. u32 iim_prog_p;
  233. u32 iim_scs0;
  234. u32 iim_scs1;
  235. u32 iim_scs2;
  236. u32 iim_scs3;
  237. };
  238. /* General Purpose Timer (GPT) registers */
  239. struct gpt_regs {
  240. u32 ctrl; /* control */
  241. u32 pre; /* prescaler */
  242. u32 stat; /* status */
  243. u32 intr; /* interrupt */
  244. u32 cmp[3]; /* output compare 1-3 */
  245. u32 capt[2]; /* input capture 1-2 */
  246. u32 counter; /* counter */
  247. };
  248. /* CSPI registers */
  249. struct cspi_regs {
  250. u32 rxdata;
  251. u32 txdata;
  252. u32 ctrl;
  253. u32 intr;
  254. u32 dma;
  255. u32 stat;
  256. u32 period;
  257. u32 test;
  258. };
  259. /* Watchdog Timer (WDOG) registers */
  260. struct wdog_regs {
  261. u16 wcr; /* Control */
  262. u16 wsr; /* Service */
  263. u16 wrsr; /* Reset Status */
  264. u16 wicr; /* Interrupt Control */
  265. u16 wmcr; /* Misc Control */
  266. };
  267. struct esdc_regs {
  268. u32 esdctl0;
  269. u32 esdcfg0;
  270. u32 esdctl1;
  271. u32 esdcfg1;
  272. u32 esdmisc;
  273. u32 reserved[4];
  274. u32 esdcdly[5];
  275. u32 esdcdlyl;
  276. };
  277. #define ESDC_MISC_RST (1 << 1)
  278. #define ESDC_MISC_MDDR_EN (1 << 2)
  279. #define ESDC_MISC_MDDR_DL_RST (1 << 3)
  280. #define ESDC_MISC_DDR_EN (1 << 8)
  281. #define ESDC_MISC_DDR2_EN (1 << 9)
  282. /*
  283. * NFMS bit in RCSR register for pagesize of nandflash
  284. */
  285. #define NFMS_BIT 8
  286. #define NFMS_NF_DWIDTH 14
  287. #define NFMS_NF_PG_SZ 8
  288. #define CCM_RCSR_NF_16BIT_SEL (1 << 14)
  289. #endif
  290. #endif /* __ASM_ARCH_MX35_H */