imx-regs.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. /*
  27. * IRAM
  28. */
  29. #define IRAM_BASE_ADDR 0x10000000 /* internal ram */
  30. #define IRAM_SIZE 0x00020000 /* 128 KB */
  31. /*
  32. * AIPS 1
  33. */
  34. #define AIPS1_BASE_ADDR 0x43F00000
  35. #define AIPS1_CTRL_BASE_ADDR AIPS1_BASE_ADDR
  36. #define MAX_BASE_ADDR 0x43F04000
  37. #define EVTMON_BASE_ADDR 0x43F08000
  38. #define CLKCTL_BASE_ADDR 0x43F0C000
  39. #define I2C_BASE_ADDR 0x43F80000
  40. #define I2C3_BASE_ADDR 0x43F84000
  41. #define ATA_BASE_ADDR 0x43F8C000
  42. #define UART1_BASE_ADDR 0x43F90000
  43. #define UART2_BASE_ADDR 0x43F94000
  44. #define I2C2_BASE_ADDR 0x43F98000
  45. #define CSPI1_BASE_ADDR 0x43FA4000
  46. #define IOMUXC_BASE_ADDR 0x43FAC000
  47. /*
  48. * SPBA
  49. */
  50. #define SPBA_BASE_ADDR 0x50000000
  51. #define UART3_BASE_ADDR 0x5000C000
  52. #define CSPI2_BASE_ADDR 0x50010000
  53. #define ATA_DMA_BASE_ADDR 0x50020000
  54. #define FEC_BASE_ADDR 0x50038000
  55. #define SPBA_CTRL_BASE_ADDR 0x5003C000
  56. /*
  57. * AIPS 2
  58. */
  59. #define AIPS2_BASE_ADDR 0x53F00000
  60. #define AIPS2_CTRL_BASE_ADDR AIPS2_BASE_ADDR
  61. #define CCM_BASE_ADDR 0x53F80000
  62. #define GPT1_BASE_ADDR 0x53F90000
  63. #define EPIT1_BASE_ADDR 0x53F94000
  64. #define EPIT2_BASE_ADDR 0x53F98000
  65. #define GPIO3_BASE_ADDR 0x53FA4000
  66. #define MMC_SDHC1_BASE_ADDR 0x53FB4000
  67. #define MMC_SDHC2_BASE_ADDR 0x53FB8000
  68. #define MMC_SDHC3_BASE_ADDR 0x53FBC000
  69. #define IPU_CTRL_BASE_ADDR 0x53FC0000
  70. #define GPIO3_BASE_ADDR 0x53FA4000
  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 CSCR_U(x) (WEIM_CTRL_CS#x + 0)
  136. #define CSCR_L(x) (WEIM_CTRL_CS#x + 4)
  137. #define CSCR_A(x) (WEIM_CTRL_CS#x + 8)
  138. #define IIM_SREV 0x24
  139. #define ROMPATCH_REV 0x40
  140. #define IPU_CONF IPU_CTRL_BASE_ADDR
  141. #define IPU_CONF_PXL_ENDIAN (1<<8)
  142. #define IPU_CONF_DU_EN (1<<7)
  143. #define IPU_CONF_DI_EN (1<<6)
  144. #define IPU_CONF_ADC_EN (1<<5)
  145. #define IPU_CONF_SDC_EN (1<<4)
  146. #define IPU_CONF_PF_EN (1<<3)
  147. #define IPU_CONF_ROT_EN (1<<2)
  148. #define IPU_CONF_IC_EN (1<<1)
  149. #define IPU_CONF_SCI_EN (1<<0)
  150. #define GPIO_PORT_NUM 3
  151. #define GPIO_NUM_PIN 32
  152. #define CHIP_REV_1_0 0x10
  153. #define CHIP_REV_2_0 0x20
  154. #define BOARD_REV_1_0 0x0
  155. #define BOARD_REV_2_0 0x1
  156. #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
  157. #include <asm/types.h>
  158. enum mxc_main_clocks {
  159. CPU_CLK,
  160. AHB_CLK,
  161. IPG_CLK,
  162. IPG_PER_CLK,
  163. NFC_CLK,
  164. USB_CLK,
  165. HSP_CLK,
  166. };
  167. enum mxc_peri_clocks {
  168. UART1_BAUD,
  169. UART2_BAUD,
  170. UART3_BAUD,
  171. SSI1_BAUD,
  172. SSI2_BAUD,
  173. CSI_BAUD,
  174. MSHC_CLK,
  175. ESDHC1_CLK,
  176. ESDHC2_CLK,
  177. ESDHC3_CLK,
  178. SPDIF_CLK,
  179. SPI1_CLK,
  180. SPI2_CLK,
  181. };
  182. /* Clock Control Module (CCM) registers */
  183. struct ccm_regs {
  184. u32 ccmr; /* Control */
  185. u32 pdr0; /* Post divider 0 */
  186. u32 pdr1; /* Post divider 1 */
  187. u32 pdr2; /* Post divider 2 */
  188. u32 pdr3; /* Post divider 3 */
  189. u32 pdr4; /* Post divider 4 */
  190. u32 rcsr; /* CCM Status */
  191. u32 mpctl; /* Core PLL Control */
  192. u32 ppctl; /* Peripheral PLL Control */
  193. u32 acmr; /* Audio clock mux */
  194. u32 cosr; /* Clock out source */
  195. u32 cgr0; /* Clock Gating Control 0 */
  196. u32 cgr1; /* Clock Gating Control 1 */
  197. u32 cgr2; /* Clock Gating Control 2 */
  198. u32 cgr3; /* Clock Gating Control 3 */
  199. u32 reserved;
  200. u32 dcvr0; /* DPTC Comparator 0 */
  201. u32 dcvr1; /* DPTC Comparator 0 */
  202. u32 dcvr2; /* DPTC Comparator 0 */
  203. u32 dcvr3; /* DPTC Comparator 0 */
  204. u32 ltr0; /* Load Tracking 0 */
  205. u32 ltr1; /* Load Tracking 1 */
  206. u32 ltr2; /* Load Tracking 2 */
  207. u32 ltr3; /* Load Tracking 3 */
  208. u32 ltbr0; /* Load Tracking Buffer 0 */
  209. };
  210. /* IIM control registers */
  211. struct iim_regs {
  212. u32 iim_stat;
  213. u32 iim_statm;
  214. u32 iim_err;
  215. u32 iim_emask;
  216. u32 iim_fctl;
  217. u32 iim_ua;
  218. u32 iim_la;
  219. u32 iim_sdat;
  220. u32 iim_prev;
  221. u32 iim_srev;
  222. u32 iim_prog_p;
  223. u32 iim_scs0;
  224. u32 iim_scs1;
  225. u32 iim_scs2;
  226. u32 iim_scs3;
  227. };
  228. /* General Purpose Timer (GPT) registers */
  229. struct gpt_regs {
  230. u32 ctrl; /* control */
  231. u32 pre; /* prescaler */
  232. u32 stat; /* status */
  233. u32 intr; /* interrupt */
  234. u32 cmp[3]; /* output compare 1-3 */
  235. u32 capt[2]; /* input capture 1-2 */
  236. u32 counter; /* counter */
  237. };
  238. /* CSPI registers */
  239. struct cspi_regs {
  240. u32 rxdata;
  241. u32 txdata;
  242. u32 ctrl;
  243. u32 intr;
  244. u32 dma;
  245. u32 stat;
  246. u32 period;
  247. u32 test;
  248. };
  249. /* Watchdog Timer (WDOG) registers */
  250. struct wdog_regs {
  251. u16 wcr; /* Control */
  252. u16 wsr; /* Service */
  253. u16 wrsr; /* Reset Status */
  254. u16 wicr; /* Interrupt Control */
  255. u16 wmcr; /* Misc Control */
  256. };
  257. /*
  258. * NFMS bit in RCSR register for pagesize of nandflash
  259. */
  260. #define NFMS_BIT 8
  261. #define NFMS_NF_DWIDTH 14
  262. #define NFMS_NF_PG_SZ 8
  263. #define CCM_RCSR_NF_16BIT_SEL (1 << 14)
  264. extern unsigned int get_board_rev(void);
  265. extern int is_soc_rev(int rev);
  266. extern int sdhc_init(void);
  267. #endif
  268. #endif /* __ASM_ARCH_MX35_H */