omap1510.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. /*
  2. *
  3. * BRIEF MODULE DESCRIPTION
  4. * OMAP hardware map
  5. *
  6. * Copyright (C) 2001 RidgeRun, Inc. (http://www.ridgerun.com)
  7. * Author: RidgeRun, Inc.
  8. * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. *
  15. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  16. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  18. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  19. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  21. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  22. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  24. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. *
  26. * You should have received a copy of the GNU General Public License along
  27. * with this program; if not, write to the Free Software Foundation, Inc.,
  28. * 675 Mass Ave, Cambridge, MA 02139, USA.
  29. */
  30. #include <asm/arch/sizes.h>
  31. /*
  32. There are 2 sets of general I/O -->
  33. 1. GPIO (shared between ARM & DSP, configured by ARM)
  34. 2. MPUIO which can be used only by the ARM.
  35. Base address FFFB:5000 is where the ARM accesses the MPUIO control registers
  36. (see 7.2.2 of the TRM for MPUIO reg definitions).
  37. Base address E101:5000 is reserved for ARM access of the same MPUIO control
  38. regs, but via the DSP I/O map. This address is unavailable on 1510.
  39. Base address FFFC:E000 is where the ARM accesses the GPIO config registers
  40. directly via its own peripheral bus.
  41. Base address E101:E000 is where the ARM can access the same GPIO config
  42. registers, but the access takes place through the ARM port interface (called
  43. API or MPUI) via the DSP's peripheral bus (DSP I/O space).
  44. Therefore, the ARM should setup the GPIO regs thru the FFFC:E000 addresses
  45. instead of the E101:E000 addresses. The DSP has only read access of the pin
  46. control register, so this may explain the inability to write to E101:E018.
  47. Try accessing pin control reg at FFFC:E018.
  48. */
  49. #define OMAP1510_GPIO_BASE 0xfffce000
  50. #define OMAP1510_GPIO_START OMAP1510_GPIO_BASE
  51. #define OMAP1510_GPIO_SIZE SZ_4K
  52. #define OMAP1510_MCBSP1_BASE 0xE1011000
  53. #define OMAP1510_MCBSP1_SIZE SZ_4K
  54. #define OMAP1510_MCBSP1_START 0xE1011000
  55. #define OMAP1510_MCBSP2_BASE 0xFFFB1000
  56. #define OMAP1510_MCBSP3_BASE 0xE1017000
  57. #define OMAP1510_MCBSP3_SIZE SZ_4K
  58. #define OMAP1510_MCBSP3_START 0xE1017000
  59. /*
  60. * Where's the flush address (for flushing D and I cache?)
  61. */
  62. #define FLUSH_BASE 0xdf000000
  63. #define FLUSH_BASE_PHYS 0x00000000
  64. #ifndef __ASSEMBLER__
  65. #define PCIO_BASE 0
  66. /*
  67. * RAM definitions
  68. */
  69. #define MAPTOPHYS(a) ((unsigned long)(a) - PAGE_OFFSET)
  70. #define KERNTOPHYS(a) ((unsigned long)(&a))
  71. #define KERNEL_BASE (0x10008000)
  72. #endif
  73. /* macro to get at IO space when running virtually */
  74. #define IO_ADDRESS(x) ((x))
  75. /* ----------------------------------------------------------------------------
  76. * OMAP1510 system registers
  77. * ----------------------------------------------------------------------------
  78. */
  79. #define OMAP1510_UART1_BASE 0xfffb0000 /* "BLUETOOTH-UART" */
  80. #define OMAP1510_UART2_BASE 0xfffb0800 /* "MODEM-UART" */
  81. #define OMAP1510_RTC_BASE 0xfffb4800 /* RTC */
  82. #define OMAP1510_UART3_BASE 0xfffb9800 /* Shared MPU/DSP UART */
  83. #define OMAP1510_COM_MCBSP2_BASE 0xffff1000 /* Com McBSP2 */
  84. #define OMAP1510_AUDIO_MCBSP_BASE 0xffff1800 /* Audio McBSP2 */
  85. #define OMAP1510_ARMIO_BASE 0xfffb5000 /* keyboard/gpio */
  86. /*
  87. * OMAP1510 UART3 Registers
  88. */
  89. #define OMAP_MPU_UART3_BASE 0xFFFB9800 /* UART3 through MPU bus */
  90. /* UART3 Registers Maping through MPU bus */
  91. #define UART3_RHR (OMAP_MPU_UART3_BASE + 0)
  92. #define UART3_THR (OMAP_MPU_UART3_BASE + 0)
  93. #define UART3_DLL (OMAP_MPU_UART3_BASE + 0)
  94. #define UART3_IER (OMAP_MPU_UART3_BASE + 4)
  95. #define UART3_DLH (OMAP_MPU_UART3_BASE + 4)
  96. #define UART3_IIR (OMAP_MPU_UART3_BASE + 8)
  97. #define UART3_FCR (OMAP_MPU_UART3_BASE + 8)
  98. #define UART3_EFR (OMAP_MPU_UART3_BASE + 8)
  99. #define UART3_LCR (OMAP_MPU_UART3_BASE + 0x0C)
  100. #define UART3_MCR (OMAP_MPU_UART3_BASE + 0x10)
  101. #define UART3_XON1_ADDR1 (OMAP_MPU_UART3_BASE + 0x10)
  102. #define UART3_XON2_ADDR2 (OMAP_MPU_UART3_BASE + 0x14)
  103. #define UART3_LSR (OMAP_MPU_UART3_BASE + 0x14)
  104. #define UART3_TCR (OMAP_MPU_UART3_BASE + 0x18)
  105. #define UART3_MSR (OMAP_MPU_UART3_BASE + 0x18)
  106. #define UART3_XOFF1 (OMAP_MPU_UART3_BASE + 0x18)
  107. #define UART3_XOFF2 (OMAP_MPU_UART3_BASE + 0x1C)
  108. #define UART3_SPR (OMAP_MPU_UART3_BASE + 0x1C)
  109. #define UART3_TLR (OMAP_MPU_UART3_BASE + 0x1C)
  110. #define UART3_MDR1 (OMAP_MPU_UART3_BASE + 0x20)
  111. #define UART3_MDR2 (OMAP_MPU_UART3_BASE + 0x24)
  112. #define UART3_SFLSR (OMAP_MPU_UART3_BASE + 0x28)
  113. #define UART3_TXFLL (OMAP_MPU_UART3_BASE + 0x28)
  114. #define UART3_RESUME (OMAP_MPU_UART3_BASE + 0x2C)
  115. #define UART3_TXFLH (OMAP_MPU_UART3_BASE + 0x2C)
  116. #define UART3_SFREGL (OMAP_MPU_UART3_BASE + 0x30)
  117. #define UART3_RXFLL (OMAP_MPU_UART3_BASE + 0x30)
  118. #define UART3_SFREGH (OMAP_MPU_UART3_BASE + 0x34)
  119. #define UART3_RXFLH (OMAP_MPU_UART3_BASE + 0x34)
  120. #define UART3_BLR (OMAP_MPU_UART3_BASE + 0x38)
  121. #define UART3_ACREG (OMAP_MPU_UART3_BASE + 0x3C)
  122. #define UART3_DIV16 (OMAP_MPU_UART3_BASE + 0x3C)
  123. #define UART3_SCR (OMAP_MPU_UART3_BASE + 0x40)
  124. #define UART3_SSR (OMAP_MPU_UART3_BASE + 0x44)
  125. #define UART3_EBLR (OMAP_MPU_UART3_BASE + 0x48)
  126. #define UART3_OSC_12M_SEL (OMAP_MPU_UART3_BASE + 0x4C)
  127. #define UART3_MVR (OMAP_MPU_UART3_BASE + 0x50)
  128. /*
  129. * Configuration Registers
  130. */
  131. #define FUNC_MUX_CTRL_0 0xfffe1000
  132. #define FUNC_MUX_CTRL_1 0xfffe1004
  133. #define FUNC_MUX_CTRL_2 0xfffe1008
  134. #define COMP_MODE_CTRL_0 0xfffe100c
  135. #define FUNC_MUX_CTRL_3 0xfffe1010
  136. #define FUNC_MUX_CTRL_4 0xfffe1014
  137. #define FUNC_MUX_CTRL_5 0xfffe1018
  138. #define FUNC_MUX_CTRL_6 0xfffe101C
  139. #define FUNC_MUX_CTRL_7 0xfffe1020
  140. #define FUNC_MUX_CTRL_8 0xfffe1024
  141. #define FUNC_MUX_CTRL_9 0xfffe1028
  142. #define FUNC_MUX_CTRL_A 0xfffe102C
  143. #define FUNC_MUX_CTRL_B 0xfffe1030
  144. #define FUNC_MUX_CTRL_C 0xfffe1034
  145. #define FUNC_MUX_CTRL_D 0xfffe1038
  146. #define PULL_DWN_CTRL_0 0xfffe1040
  147. #define PULL_DWN_CTRL_1 0xfffe1044
  148. #define PULL_DWN_CTRL_2 0xfffe1048
  149. #define PULL_DWN_CTRL_3 0xfffe104c
  150. #define GATE_INH_CTRL_0 0xfffe1050
  151. #define VOLTAGE_CTRL_0 0xfffe1060
  152. #define TEST_DBG_CTRL_0 0xfffe1070
  153. #define MOD_CONF_CTRL_0 0xfffe1080
  154. /*
  155. * Traffic Controller Memory Interface Registers
  156. */
  157. #define TCMIF_BASE 0xfffecc00
  158. #define IMIF_PRIO (TCMIF_BASE + 0x00)
  159. #define EMIFS_PRIO_REG (TCMIF_BASE + 0x04)
  160. #define EMIFF_PRIO_REG (TCMIF_BASE + 0x08)
  161. #define EMIFS_CONFIG_REG (TCMIF_BASE + 0x0c)
  162. #define EMIFS_CS0_CONFIG (TCMIF_BASE + 0x10)
  163. #define EMIFS_CS1_CONFIG (TCMIF_BASE + 0x14)
  164. #define EMIFS_CS2_CONFIG (TCMIF_BASE + 0x18)
  165. #define EMIFS_CS3_CONFIG (TCMIF_BASE + 0x1c)
  166. #define EMIFF_SDRAM_CONFIG (TCMIF_BASE + 0x20)
  167. #define EMIFF_MRS (TCMIF_BASE + 0x24)
  168. #define TC_TIMEOUT1 (TCMIF_BASE + 0x28)
  169. #define TC_TIMEOUT2 (TCMIF_BASE + 0x2c)
  170. #define TC_TIMEOUT3 (TCMIF_BASE + 0x30)
  171. #define TC_ENDIANISM (TCMIF_BASE + 0x34)
  172. #define EMIFF_SDRAM_CONFIG_2 (TCMIF_BASE + 0x3c)
  173. #define EMIF_CFG_DYNAMIC_WS (TCMIF_BASE + 0x40)
  174. /*
  175. * LCD Panel
  176. */
  177. #define TI925_LCD_BASE 0xFFFEC000
  178. #define TI925_LCD_CONTROL (TI925_LCD_BASE)
  179. #define TI925_LCD_TIMING0 (TI925_LCD_BASE+0x4)
  180. #define TI925_LCD_TIMING1 (TI925_LCD_BASE+0x8)
  181. #define TI925_LCD_TIMING2 (TI925_LCD_BASE+0xc)
  182. #define TI925_LCD_STATUS (TI925_LCD_BASE+0x10)
  183. #define TI925_LCD_SUBPANEL (TI925_LCD_BASE+0x14)
  184. #define OMAP_LCD_CONTROL TI925_LCD_CONTROL
  185. /*
  186. * MMC/SD Host Controller Registers
  187. */
  188. #define OMAP_MMC_CMD 0xFFFB7800 /* MMC Command */
  189. #define OMAP_MMC_ARGL 0xFFFB7804 /* MMC argument low */
  190. #define OMAP_MMC_ARGH 0xFFFB7808 /* MMC argument high */
  191. #define OMAP_MMC_CON 0xFFFB780C /* MMC system configuration */
  192. #define OMAP_MMC_STAT 0xFFFB7810 /* MMC status */
  193. #define OMAP_MMC_IE 0xFFFB7814 /* MMC system interrupt enable */
  194. #define OMAP_MMC_CTO 0xFFFB7818 /* MMC command time-out */
  195. #define OMAP_MMC_DTO 0xFFFB781C /* MMC data time-out */
  196. #define OMAP_MMC_DATA 0xFFFB7820 /* MMC TX/RX FIFO data */
  197. #define OMAP_MMC_BLEN 0xFFFB7824 /* MMC block length */
  198. #define OMAP_MMC_NBLK 0xFFFB7828 /* MMC number of blocks */
  199. #define OMAP_MMC_BUF 0xFFFB782C /* MMC buffer configuration */
  200. #define OMAP_MMC_SPI 0xFFFB7830 /* MMC serial port interface */
  201. #define OMAP_MMC_SDIO 0xFFFB7834 /* MMC SDIO mode configuration */
  202. #define OMAP_MMC_SYST 0xFFFB7838 /* MMC system test */
  203. #define OMAP_MMC_REV 0xFFFB783C /* MMC module version */
  204. #define OMAP_MMC_RSP0 0xFFFB7840 /* MMC command response 0 */
  205. #define OMAP_MMC_RSP1 0xFFFB7844 /* MMC command response 1 */
  206. #define OMAP_MMC_RSP2 0xFFFB7848 /* MMC command response 2 */
  207. #define OMAP_MMC_RSP3 0xFFFB784C /* MMC command response 3 */
  208. #define OMAP_MMC_RSP4 0xFFFB7850 /* MMC command response 4 */
  209. #define OMAP_MMC_RSP5 0xFFFB7854 /* MMC command response 5 */
  210. #define OMAP_MMC_RSP6 0xFFFB7858 /* MMC command response 6 */
  211. #define OMAP_MMC_RSP7 0xFFFB785C /* MMC command response 4 */
  212. /* MMC masks */
  213. #define OMAP_MMC_END_OF_CMD (1 << 0) /* End of command phase */
  214. #define OMAP_MMC_CARD_BUSY (1 << 2) /* Card enter busy state */
  215. #define OMAP_MMC_BLOCK_RS (1 << 3) /* Block received/sent */
  216. #define OMAP_MMC_EOF_BUSY (1 << 4) /* Card exit busy state */
  217. #define OMAP_MMC_DATA_TIMEOUT (1 << 5) /* Data response time-out */
  218. #define OMAP_MMC_DATA_CRC (1 << 6) /* Date CRC error */
  219. #define OMAP_MMC_CMD_TIMEOUT (1 << 7) /* Command response time-out */
  220. #define OMAP_MMC_CMD_CRC (1 << 8) /* Command CRC error */
  221. #define OMAP_MMC_A_FULL (1 << 10) /* Buffer almost full */
  222. #define OMAP_MMC_A_EMPTY (1 << 11) /* Buffer almost empty */
  223. #define OMAP_MMC_OCR_BUSY (1 << 12) /* OCR busy */
  224. #define OMAP_MMC_CARD_IRQ (1 << 13) /* Card IRQ received */
  225. #define OMAP_MMC_CARD_ERR (1 << 14) /* Card status error in response */
  226. /* 2.9.2 MPUI Interface Registers FFFE:C900 */
  227. #define MPUI_CTRL_REG (volatile __u32 *)(0xfffec900)
  228. #define MPUI_DEBUG_ADDR (volatile __u32 *)(0xfffec904)
  229. #define MPUI_DEBUG_DATA (volatile __u32 *)(0xfffec908)
  230. #define MPUI_DEBUG_FLAG (volatile __u16 *)(0xfffec90c)
  231. #define MPUI_STATUS_REG (volatile __u16 *)(0xfffec910)
  232. #define MPUI_DSP_STATUS_REG (volatile __u16 *)(0xfffec914)
  233. #define MPUI_DSP_BOOT_CONFIG (volatile __u16 *)(0xfffec918)
  234. #define MPUI_DSP_API_CONFIG (volatile __u16 *)(0xfffec91c)
  235. /* 2.9.6 Traffic Controller Memory Interface Registers: */
  236. #define OMAP_IMIF_PRIO_REG 0xfffecc00
  237. #define OMAP_EMIFS_PRIO_REG 0xfffecc04
  238. #define OMAP_EMIFF_PRIO_REG 0xfffecc08
  239. #define OMAP_EMIFS_CONFIG_REG 0xfffecc0c
  240. #define OMAP_EMIFS_CS0_CONFIG 0xfffecc10
  241. #define OMAP_EMIFS_CS1_CONFIG 0xfffecc14
  242. #define OMAP_EMIFS_CS2_CONFIG 0xfffecc18
  243. #define OMAP_EMIFS_CS3_CONFIG 0xfffecc1c
  244. #define OMAP_EMIFF_SDRAM_CONFIG 0xfffecc20
  245. #define OMAP_EMIFF_MRS 0xfffecc24
  246. #define OMAP_TIMEOUT1 0xfffecc28
  247. #define OMAP_TIMEOUT2 0xfffecc2c
  248. #define OMAP_TIMEOUT3 0xfffecc30
  249. #define OMAP_ENDIANISM 0xfffecc34
  250. /* 2.9.10 EMIF Slow Interface Configuration Register (EMIFS_CONFIG_REG): */
  251. #define OMAP_EMIFS_CONFIG_FR (1 << 4)
  252. #define OMAP_EMIFS_CONFIG_PDE (1 << 3)
  253. #define OMAP_EMIFS_CONFIG_PWD_EN (1 << 2)
  254. #define OMAP_EMIFS_CONFIG_BM (1 << 1)
  255. #define OMAP_EMIFS_CONFIG_WP (1 << 0)
  256. /*
  257. * Memory chunk set aside for the Framebuffer in SRAM
  258. */
  259. #define SRAM_FRAMEBUFFER_MEMORY OMAP1510_SRAM_BASE
  260. /*
  261. * DMA
  262. */
  263. #define OMAP1510_DMA_BASE 0xFFFED800
  264. #define OMAP_DMA_BASE OMAP1510_DMA_BASE
  265. /* Global Register selection */
  266. #define NO_GLOBAL_DMA_ACCESS 0
  267. /* Channel select field
  268. * NOTE: all other channels are linear, chan0 is 0, chan1 is 1, etc...
  269. */
  270. #define LCD_CHANNEL 0xc
  271. /* Register Select Field (LCD) */
  272. #define DMA_LCD_CTRL 0
  273. #define DMA_LCD_TOP_F1_L 1
  274. #define DMA_LCD_TOP_F1_U 2
  275. #define DMA_LCD_BOT_F1_L 3
  276. #define DMA_LCD_BOT_F1_U 4
  277. #define LCD_FRAME_MODE (1<<0)
  278. #define LCD_FRAME_IT_IE (1<<1)
  279. #define LCD_BUS_ERROR_IT_IE (1<<2)
  280. #define LCD_FRAME_1_IT_COND (1<<3)
  281. #define LCD_FRAME_2_IT_COND (1<<4)
  282. #define LCD_BUS_ERROR_IT_COND (1<<5)
  283. #define LCD_SOURCE_IMIF (1<<6)
  284. /*
  285. * Real-Time Clock
  286. */
  287. #define RTC_SECONDS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x00)
  288. #define RTC_MINUTES (volatile __u8 *)(OMAP1510_RTC_BASE + 0x04)
  289. #define RTC_HOURS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x08)
  290. #define RTC_DAYS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x0C)
  291. #define RTC_MONTHS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x10)
  292. #define RTC_YEARS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x14)
  293. #define RTC_CTRL (volatile __u8 *)(OMAP1510_RTC_BASE + 0x40)
  294. /* ---------------------------------------------------------------------------
  295. * OMAP1510 Interrupt Handlers
  296. * ---------------------------------------------------------------------------
  297. *
  298. */
  299. #define OMAP_IH1_BASE 0xfffecb00
  300. #define OMAP_IH2_BASE 0xfffe0000
  301. #define OMAP1510_ITR 0x0
  302. #define OMAP1510_MASK 0x4
  303. #define INTERRUPT_HANDLER_BASE OMAP_IH1_BASE
  304. #define INTERRUPT_INPUT_REGISTER OMAP1510_ITR
  305. #define INTERRUPT_MASK_REGISTER OMAP1510_MASK
  306. /* ---------------------------------------------------------------------------
  307. * OMAP1510 TIMERS
  308. * ---------------------------------------------------------------------------
  309. *
  310. */
  311. #define OMAP1510_32kHz_TIMER_BASE 0xfffb9000
  312. /* 32k Timer Registers */
  313. #define TIMER32k_CR 0x08
  314. #define TIMER32k_TVR 0x00
  315. #define TIMER32k_TCR 0x04
  316. /* 32k Timer Control Register definition */
  317. #define TIMER32k_TSS (1<<0)
  318. #define TIMER32k_TRB (1<<1)
  319. #define TIMER32k_INT (1<<2)
  320. #define TIMER32k_ARL (1<<3)
  321. /* MPU Timer base addresses */
  322. #define OMAP1510_MPUTIMER_BASE 0xfffec500
  323. #define OMAP1510_MPUTIMER_OFF 0x00000100
  324. #define OMAP1510_TIMER1_BASE 0xfffec500
  325. #define OMAP1510_TIMER2_BASE 0xfffec600
  326. #define OMAP1510_TIMER3_BASE 0xfffec700
  327. /* MPU Timer Registers */
  328. #define CNTL_TIMER 0
  329. #define LOAD_TIM 4
  330. #define READ_TIM 8
  331. /* CNTL_TIMER register bits */
  332. #define MPUTIM_FREE (1<<6)
  333. #define MPUTIM_CLOCK_ENABLE (1<<5)
  334. #define MPUTIM_PTV_MASK (0x7<<PTV_BIT)
  335. #define MPUTIM_PTV_BIT 2
  336. #define MPUTIM_AR (1<<1)
  337. #define MPUTIM_ST (1<<0)
  338. /* ---------------------------------------------------------------------------
  339. * OMAP1510 GPIO (SHARED)
  340. * ---------------------------------------------------------------------------
  341. *
  342. */
  343. #define GPIO_DATA_INPUT_REG (OMAP1510_GPIO_BASE + 0x0)
  344. #define GPIO_DATA_OUTPUT_REG (OMAP1510_GPIO_BASE + 0x4)
  345. #define GPIO_DIR_CONTROL_REG (OMAP1510_GPIO_BASE + 0x8)
  346. #define GPIO_INT_CONTROL_REG (OMAP1510_GPIO_BASE + 0xc)
  347. #define GPIO_INT_MASK_REG (OMAP1510_GPIO_BASE + 0x10)
  348. #define GPIO_INT_STATUS_REG (OMAP1510_GPIO_BASE + 0x14)
  349. #define GPIO_PIN_CONTROL_REG (OMAP1510_GPIO_BASE + 0x18)
  350. /* ---------------------------
  351. * OMAP1510 MPUIO (ARM only)
  352. *----------------------------
  353. */
  354. #define OMAP1510_MPUIO_BASE 0xFFFB5000
  355. #define MPUIO_DATA_INPUT_REG (OMAP1510_MPUIO_BASE + 0x0)
  356. #define MPUIO_DATA_OUTPUT_REG (OMAP1510_MPUIO_BASE + 0x4)
  357. #define MPUIO_DIR_CONTROL_REG (OMAP1510_MPUIO_BASE + 0x8)
  358. /* ---------------------------------------------------------------------------
  359. * OMAP1510 TIPB (only)
  360. * ---------------------------------------------------------------------------
  361. *
  362. */
  363. #define TIPB_PUBLIC_CNTL_BASE 0xfffed300
  364. #define MPU_PUBLIC_TIPB_CNTL_REG (TIPB_PUBLIC_CNTL_BASE + 0x8)
  365. #define TIPB_PRIVATE_CNTL_BASE 0xfffeca00
  366. #define MPU_PRIVATE_TIPB_CNTL_REG (TIPB_PRIVATE_CNTL_BASE + 0x8)
  367. /*
  368. * ---------------------------------------------------------------------------
  369. * OMAP1510 Camera Interface
  370. * ---------------------------------------------------------------------------
  371. */
  372. #define CAMERA_BASE (IO_BASE + 0x6800)
  373. #define CAM_CTRLCLOCK_REG (CAMERA_BASE + 0x00)
  374. #define CAM_IT_STATUS_REG (CAMERA_BASE + 0x04)
  375. #define CAM_MODE_REG (CAMERA_BASE + 0x08)
  376. #define CAM_STATUS_REG (CAMERA_BASE + 0x0C)
  377. #define CAM_CAMDATA_REG (CAMERA_BASE + 0x10)
  378. #define CAM_GPIO_REG (CAMERA_BASE + 0x14)
  379. #define CAM_PEAK_CTR_REG (CAMERA_BASE + 0x18)
  380. #if 0
  381. #ifndef __ASSEMBLY__
  382. typedef struct {
  383. __u32 ctrlclock;
  384. __u32 it_status;
  385. __u32 mode;
  386. __u32 status;
  387. __u32 camdata;
  388. __u32 gpio;
  389. __u32 peak_counter;
  390. } camera_regs_t;
  391. #endif
  392. #endif
  393. /* CTRLCLOCK bit shifts */
  394. #define FOSCMOD_BIT 0
  395. #define FOSCMOD_MASK (0x7 << FOSCMOD_BIT)
  396. #define FOSCMOD_12MHz 0x0
  397. #define FOSCMOD_6MHz 0x2
  398. #define FOSCMOD_9_6MHz 0x4
  399. #define FOSCMOD_24MHz 0x5
  400. #define FOSCMOD_8MHz 0x6
  401. #define POLCLK (1<<3)
  402. #define CAMEXCLK_EN (1<<4)
  403. #define MCLK_EN (1<<5)
  404. #define DPLL_EN (1<<6)
  405. #define LCLK_EN (1<<7)
  406. /* IT_STATUS bit shifts */
  407. #define V_UP (1<<0)
  408. #define V_DOWN (1<<1)
  409. #define H_UP (1<<2)
  410. #define H_DOWN (1<<3)
  411. #define FIFO_FULL (1<<4)
  412. #define DATA_XFER (1<<5)
  413. /* MODE bit shifts */
  414. #define CAMOSC (1<<0)
  415. #define IMGSIZE_BIT 1
  416. #define IMGSIZE_MASK (0x3 << IMGSIZE_BIT)
  417. #define IMGSIZE_CIF (0x0 << IMGSIZE_BIT) /* 352x288 */
  418. #define IMGSIZE_QCIF (0x1 << IMGSIZE_BIT) /* 176x144 */
  419. #define IMGSIZE_VGA (0x2 << IMGSIZE_BIT) /* 640x480 */
  420. #define IMGSIZE_QVGA (0x3 << IMGSIZE_BIT) /* 320x240 */
  421. #define ORDERCAMD (1<<3)
  422. #define EN_V_UP (1<<4)
  423. #define EN_V_DOWN (1<<5)
  424. #define EN_H_UP (1<<6)
  425. #define EN_H_DOWN (1<<7)
  426. #define EN_DMA (1<<8)
  427. #define THRESHOLD (1<<9)
  428. #define THRESHOLD_BIT 9
  429. #define THRESHOLD_MASK (0x7f<<9)
  430. #define EN_NIRQ (1<<16)
  431. #define EN_FIFO_FULL (1<<17)
  432. #define RAZ_FIFO (1<<18)
  433. /* STATUS bit shifts */
  434. #define VSTATUS (1<<0)
  435. #define HSTATUS (1<<1)
  436. /* GPIO bit shifts */
  437. #define CAM_RST (1<<0)
  438. /*********************
  439. * Watchdog timer.
  440. *********************/
  441. #define WDTIM_BASE 0xfffec800
  442. #define WDTIM_CONTROL (WDTIM_BASE+0x00)
  443. #define WDTIM_LOAD (WDTIM_BASE+0x04)
  444. #define WDTIM_READ (WDTIM_BASE+0x04)
  445. #define WDTIM_MODE (WDTIM_BASE+0x08)
  446. /* Values to write to mode register to disable the watchdog function. */
  447. #define DISABLE_SEQ1 0xF5
  448. #define DISABLE_SEQ2 0xA0
  449. /* WDTIM_CONTROL bit definitions. */
  450. #define WDTIM_CONTROL_ST BIT7
  451. /* ---------------------------------------------------------------------------
  452. * Differentiating processor versions for those who care.
  453. * ---------------------------------------------------------------------------
  454. *
  455. */
  456. #define OMAP1509 0
  457. #define OMAP1510 1
  458. #define OMAP1510_ID_CODE_REG 0xfffed404
  459. #ifndef __ASSEMBLY__
  460. int cpu_type(void);
  461. #endif
  462. /*
  463. * EVM Implementation Specifics.
  464. *
  465. * *** NOTE ***
  466. * Any definitions in these files should be prefixed by an identifier -
  467. * eg. OMAP1510P1_FLASH0_BASE .
  468. *
  469. */
  470. #ifdef CONFIG_OMAP_INNOVATOR
  471. #include "innovator.h"
  472. #endif
  473. #ifdef CONFIG_OMAP_1510P1
  474. #include "omap1510p1.h"
  475. #endif
  476. /*****************************************************************************/
  477. #define CLKGEN_RESET_BASE (0xfffece00)
  478. #define ARM_CKCTL (volatile __u16 *)(CLKGEN_RESET_BASE + 0x0)
  479. #define ARM_IDLECT1 (volatile __u16 *)(CLKGEN_RESET_BASE + 0x4)
  480. #define ARM_IDLECT2 (volatile __u16 *)(CLKGEN_RESET_BASE + 0x8)
  481. #define ARM_EWUPCT (volatile __u16 *)(CLKGEN_RESET_BASE + 0xC)
  482. #define ARM_RSTCT1 (volatile __u16 *)(CLKGEN_RESET_BASE + 0x10)
  483. #define ARM_RSTCT2 (volatile __u16 *)(CLKGEN_RESET_BASE + 0x14)
  484. #define ARM_SYSST (volatile __u16 *)(CLKGEN_RESET_BASE + 0x18)
  485. #define CK_CLKIN 12 /* MHz */
  486. #define CK_RATEF 1
  487. #define CK_IDLEF 2
  488. #define CK_ENABLEF 4
  489. #define CK_SELECTF 8
  490. #ifndef __ASSEMBLER__
  491. #define CK_DPLL1 ((volatile __u16 *)0xfffecf00)
  492. #else
  493. #define CK_DPLL1 (0xfffecf00)
  494. #endif
  495. #define SETARM_IDLE_SHIFT
  496. /* ARM_CKCTL bit shifts */
  497. #define PERDIV 0
  498. #define LCDDIV 2
  499. #define ARMDIV 4
  500. #define DSPDIV 6
  501. #define TCDIV 8
  502. #define DSPMMUDIV 10
  503. #define ARM_TIMXO 12
  504. #define EN_DSPCK 13
  505. #define ARM_INTHCK_SEL 14 /* REVISIT -- where is this used? */
  506. #define ARM_CKCTL_RSRVD_BIT15 (1 << 15)
  507. #define ARM_CKCTL_ARM_INTHCK_SEL (1 << 14)
  508. #define ARM_CKCTL_EN_DSPCK (1 << 13)
  509. #define ARM_CKCTL_ARM_TIMXO (1 << 12)
  510. #define ARM_CKCTL_DSPMMU_DIV1 (1 << 11)
  511. #define ARM_CKCTL_DSPMMU_DIV2 (1 << 10)
  512. #define ARM_CKCTL_TCDIV1 (1 << 9)
  513. #define ARM_CKCTL_TCDIV2 (1 << 8)
  514. #define ARM_CKCTL_DSPDIV1 (1 << 7)
  515. #define ARM_CKCTL_DSPDIV0 (1 << 6)
  516. #define ARM_CKCTL_ARMDIV1 (1 << 5)
  517. #define ARM_CKCTL_ARMDIV0 (1 << 4)
  518. #define ARM_CKCTL_LCDDIV1 (1 << 3)
  519. #define ARM_CKCTL_LCDDIV0 (1 << 2)
  520. #define ARM_CKCTL_PERDIV1 (1 << 1)
  521. #define ARM_CKCTL_PERDIV0 (1 << 0)
  522. /* ARM_IDLECT1 bit shifts */
  523. #define IDLWDT_ARM 0
  524. #define IDLXORP_ARM 1
  525. #define IDLPER_ARM 2
  526. #define IDLLCD_ARM 3
  527. #define IDLLB_ARM 4
  528. #define IDLHSAB_ARM 5
  529. #define IDLIF_ARM 6
  530. #define IDLDPLL_ARM 7
  531. #define IDLAPI_ARM 8
  532. #define IDLTIM_ARM 9
  533. #define SETARM_IDLE 11
  534. /* ARM_IDLECT2 bit shifts */
  535. #define EN_WDTCK 0
  536. #define EN_XORPCK 1
  537. #define EN_PERCK 2
  538. #define EN_LCDCK 3
  539. #define EN_LBCK 4
  540. #define EN_HSABCK 5
  541. #define EN_APICK 6
  542. #define EN_TIMCK 7
  543. #define DMACK_REQ 8
  544. #define EN_GPIOCK 9
  545. #define EN_LBFREECK 10
  546. #define ARM_RSTCT1_SW_RST (1 << 3)
  547. #define ARM_RSTCT1_DSP_RST (1 << 2)
  548. #define ARM_RSTCT1_DSP_EN (1 << 1)
  549. #define ARM_RSTCT1_ARM_RST (1 << 0)
  550. /* ARM_RSTCT2 bit shifts */
  551. #define EN_PER 0
  552. #define ARM_SYSST_RSRVD_BIT15 (1 << 15)
  553. #define ARM_SYSST_RSRVD_BIT14 (1 << 14)
  554. #define ARM_SYSST_CLOCK_SELECT2 (1 << 13)
  555. #define ARM_SYSST_CLOCK_SELECT1 (1 << 12)
  556. #define ARM_SYSST_CLOCK_SELECT0 (1 << 11)
  557. #define ARM_SYSST_RSRVD_BIT10 (1 << 10)
  558. #define ARM_SYSST_RSRVD_BIT9 (1 << 9)
  559. #define ARM_SYSST_RSRVD_BIT8 (1 << 8)
  560. #define ARM_SYSST_RSRVD_BIT7 (1 << 7)
  561. #define ARM_SYSST_IDLE_DSP (1 << 6)
  562. #define ARM_SYSST_POR (1 << 5)
  563. #define ARM_SYSST_EXT_RST (1 << 4)
  564. #define ARM_SYSST_ARM_MCRST (1 << 3)
  565. #define ARM_SYSST_ARM_WDRST (1 << 2)
  566. #define ARM_SYSST_GLOB_SWRST (1 << 1)
  567. #define ARM_SYSST_DSP_WDRST (1 << 0)
  568. /* Table 15-23. DPLL Control Registers: */
  569. #define DPLL_CTL_REG (volatile __u16 *)(0xfffecf00)
  570. /* Table 15-24. Control Register (CTL_REG): */
  571. #define DPLL_CTL_REG_IOB (1 << 13)
  572. #define DPLL_CTL_REG_PLL_MULT Fld(5,0)
  573. /*****************************************************************************/
  574. /* OMAP INTERRUPT REGISTERS */
  575. #define IRQ_ITR 0x00
  576. #define IRQ_MIR 0x04
  577. #define IRQ_SIR_IRQ 0x10
  578. #define IRQ_SIR_FIQ 0x14
  579. #define IRQ_CONTROL_REG 0x18
  580. #define IRQ_ISR 0x9c
  581. #define IRQ_ILR0 0x1c
  582. #define REG_IHL1_MIR (OMAP_IH1_BASE+IRQ_MIR)
  583. #define REG_IHL2_MIR (OMAP_IH2_BASE+IRQ_MIR)
  584. /* INTERRUPT LEVEL REGISTER BITS */
  585. #define ILR_PRIORITY_MASK (0x3c)
  586. #define ILR_PRIORITY_SHIFT (2)
  587. #define ILR_LEVEL_TRIGGER (1<<1)
  588. #define ILR_FIQ (1<<0)
  589. #define IRQ_LEVEL_INT 1
  590. #define IRQ_EDGE_INT 0