voyagergx.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. /* -------------------------------------------------------------------- */
  2. /* voyagergx.h */
  3. /* -------------------------------------------------------------------- */
  4. /* This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. Copyright 2003 (c) Lineo uSolutions,Inc.
  16. */
  17. /* -------------------------------------------------------------------- */
  18. #ifndef _VOYAGER_GX_REG_H
  19. #define _VOYAGER_GX_REG_H
  20. #define VOYAGER_BASE 0xb3e00000
  21. #define VOYAGER_USBH_BASE (0x40000 + VOYAGER_BASE)
  22. #define VOYAGER_UART_BASE (0x30000 + VOYAGER_BASE)
  23. #define VOYAGER_AC97_BASE (0xa0000 + VOYAGER_BASE)
  24. #define VOYAGER_IRQ_NUM 32
  25. #define VOYAGER_IRQ_BASE 50
  26. #define VOYAGER_USBH_IRQ VOYAGER_IRQ_BASE + 6
  27. #define VOYAGER_8051_IRQ VOYAGER_IRQ_BASE + 10
  28. #define VOYAGER_UART0_IRQ VOYAGER_IRQ_BASE + 12
  29. #define VOYAGER_UART1_IRQ VOYAGER_IRQ_BASE + 13
  30. #define VOYAGER_AC97_IRQ VOYAGER_IRQ_BASE + 17
  31. /* ----- MISC controle register ------------------------------ */
  32. #define MISC_CTRL (0x000004 + VOYAGER_BASE)
  33. #define MISC_CTRL_USBCLK_48 (3 << 28)
  34. #define MISC_CTRL_USBCLK_96 (2 << 28)
  35. #define MISC_CTRL_USBCLK_CRYSTAL (1 << 28)
  36. /* ----- GPIO[31:0] register --------------------------------- */
  37. #define GPIO_MUX_LOW (0x000008 + VOYAGER_BASE)
  38. #define GPIO_MUX_LOW_AC97 0x1F000000
  39. #define GPIO_MUX_LOW_8051 0x0000ffff
  40. #define GPIO_MUX_LOW_PWM (1 << 29)
  41. /* ----- GPIO[63:32] register --------------------------------- */
  42. #define GPIO_MUX_HIGH (0x00000C + VOYAGER_BASE)
  43. /* ----- DRAM controle register ------------------------------- */
  44. #define DRAM_CTRL (0x000010 + VOYAGER_BASE)
  45. #define DRAM_CTRL_EMBEDDED (1 << 31)
  46. #define DRAM_CTRL_CPU_BURST_1 (0 << 28)
  47. #define DRAM_CTRL_CPU_BURST_2 (1 << 28)
  48. #define DRAM_CTRL_CPU_BURST_4 (2 << 28)
  49. #define DRAM_CTRL_CPU_BURST_8 (3 << 28)
  50. #define DRAM_CTRL_CPU_CAS_LATENCY (1 << 27)
  51. #define DRAM_CTRL_CPU_SIZE_2 (0 << 24)
  52. #define DRAM_CTRL_CPU_SIZE_4 (1 << 24)
  53. #define DRAM_CTRL_CPU_SIZE_64 (4 << 24)
  54. #define DRAM_CTRL_CPU_SIZE_32 (5 << 24)
  55. #define DRAM_CTRL_CPU_SIZE_16 (6 << 24)
  56. #define DRAM_CTRL_CPU_SIZE_8 (7 << 24)
  57. #define DRAM_CTRL_CPU_COLUMN_SIZE_1024 (0 << 22)
  58. #define DRAM_CTRL_CPU_COLUMN_SIZE_512 (2 << 22)
  59. #define DRAM_CTRL_CPU_COLUMN_SIZE_256 (3 << 22)
  60. #define DRAM_CTRL_CPU_ACTIVE_PRECHARGE (1 << 21)
  61. #define DRAM_CTRL_CPU_RESET (1 << 20)
  62. #define DRAM_CTRL_CPU_BANKS (1 << 19)
  63. #define DRAM_CTRL_CPU_WRITE_PRECHARGE (1 << 18)
  64. #define DRAM_CTRL_BLOCK_WRITE (1 << 17)
  65. #define DRAM_CTRL_REFRESH_COMMAND (1 << 16)
  66. #define DRAM_CTRL_SIZE_4 (0 << 13)
  67. #define DRAM_CTRL_SIZE_8 (1 << 13)
  68. #define DRAM_CTRL_SIZE_16 (2 << 13)
  69. #define DRAM_CTRL_SIZE_32 (3 << 13)
  70. #define DRAM_CTRL_SIZE_64 (4 << 13)
  71. #define DRAM_CTRL_SIZE_2 (5 << 13)
  72. #define DRAM_CTRL_COLUMN_SIZE_256 (0 << 11)
  73. #define DRAM_CTRL_COLUMN_SIZE_512 (2 << 11)
  74. #define DRAM_CTRL_COLUMN_SIZE_1024 (3 << 11)
  75. #define DRAM_CTRL_BLOCK_WRITE_TIME (1 << 10)
  76. #define DRAM_CTRL_BLOCK_WRITE_PRECHARGE (1 << 9)
  77. #define DRAM_CTRL_ACTIVE_PRECHARGE (1 << 8)
  78. #define DRAM_CTRL_RESET (1 << 7)
  79. #define DRAM_CTRL_REMAIN_ACTIVE (1 << 6)
  80. #define DRAM_CTRL_BANKS (1 << 1)
  81. #define DRAM_CTRL_WRITE_PRECHARGE (1 << 0)
  82. /* ----- Arvitration control register -------------------------- */
  83. #define ARBITRATION_CTRL (0x000014 + VOYAGER_BASE)
  84. #define ARBITRATION_CTRL_CPUMEM (1 << 29)
  85. #define ARBITRATION_CTRL_INTMEM (1 << 28)
  86. #define ARBITRATION_CTRL_USB_OFF (0 << 24)
  87. #define ARBITRATION_CTRL_USB_PRIORITY_1 (1 << 24)
  88. #define ARBITRATION_CTRL_USB_PRIORITY_2 (2 << 24)
  89. #define ARBITRATION_CTRL_USB_PRIORITY_3 (3 << 24)
  90. #define ARBITRATION_CTRL_USB_PRIORITY_4 (4 << 24)
  91. #define ARBITRATION_CTRL_USB_PRIORITY_5 (5 << 24)
  92. #define ARBITRATION_CTRL_USB_PRIORITY_6 (6 << 24)
  93. #define ARBITRATION_CTRL_USB_PRIORITY_7 (7 << 24)
  94. #define ARBITRATION_CTRL_PANEL_OFF (0 << 20)
  95. #define ARBITRATION_CTRL_PANEL_PRIORITY_1 (1 << 20)
  96. #define ARBITRATION_CTRL_PANEL_PRIORITY_2 (2 << 20)
  97. #define ARBITRATION_CTRL_PANEL_PRIORITY_3 (3 << 20)
  98. #define ARBITRATION_CTRL_PANEL_PRIORITY_4 (4 << 20)
  99. #define ARBITRATION_CTRL_PANEL_PRIORITY_5 (5 << 20)
  100. #define ARBITRATION_CTRL_PANEL_PRIORITY_6 (6 << 20)
  101. #define ARBITRATION_CTRL_PANEL_PRIORITY_7 (7 << 20)
  102. #define ARBITRATION_CTRL_ZVPORT_OFF (0 << 16)
  103. #define ARBITRATION_CTRL_ZVPORTL_PRIORITY_1 (1 << 16)
  104. #define ARBITRATION_CTRL_ZVPORTL_PRIORITY_2 (2 << 16)
  105. #define ARBITRATION_CTRL_ZVPORTL_PRIORITY_3 (3 << 16)
  106. #define ARBITRATION_CTRL_ZVPORTL_PRIORITY_4 (4 << 16)
  107. #define ARBITRATION_CTRL_ZVPORTL_PRIORITY_5 (5 << 16)
  108. #define ARBITRATION_CTRL_ZVPORTL_PRIORITY_6 (6 << 16)
  109. #define ARBITRATION_CTRL_ZVPORTL_PRIORITY_7 (7 << 16)
  110. #define ARBITRATION_CTRL_CMD_INTPR_OFF (0 << 12)
  111. #define ARBITRATION_CTRL_CMD_INTPR_PRIORITY_1 (1 << 12)
  112. #define ARBITRATION_CTRL_CMD_INTPR_PRIORITY_2 (2 << 12)
  113. #define ARBITRATION_CTRL_CMD_INTPR_PRIORITY_3 (3 << 12)
  114. #define ARBITRATION_CTRL_CMD_INTPR_PRIORITY_4 (4 << 12)
  115. #define ARBITRATION_CTRL_CMD_INTPR_PRIORITY_5 (5 << 12)
  116. #define ARBITRATION_CTRL_CMD_INTPR_PRIORITY_6 (6 << 12)
  117. #define ARBITRATION_CTRL_CMD_INTPR_PRIORITY_7 (7 << 12)
  118. #define ARBITRATION_CTRL_DMA_OFF (0 << 8)
  119. #define ARBITRATION_CTRL_DMA_PRIORITY_1 (1 << 8)
  120. #define ARBITRATION_CTRL_DMA_PRIORITY_2 (2 << 8)
  121. #define ARBITRATION_CTRL_DMA_PRIORITY_3 (3 << 8)
  122. #define ARBITRATION_CTRL_DMA_PRIORITY_4 (4 << 8)
  123. #define ARBITRATION_CTRL_DMA_PRIORITY_5 (5 << 8)
  124. #define ARBITRATION_CTRL_DMA_PRIORITY_6 (6 << 8)
  125. #define ARBITRATION_CTRL_DMA_PRIORITY_7 (7 << 8)
  126. #define ARBITRATION_CTRL_VIDEO_OFF (0 << 4)
  127. #define ARBITRATION_CTRL_VIDEO_PRIORITY_1 (1 << 4)
  128. #define ARBITRATION_CTRL_VIDEO_PRIORITY_2 (2 << 4)
  129. #define ARBITRATION_CTRL_VIDEO_PRIORITY_3 (3 << 4)
  130. #define ARBITRATION_CTRL_VIDEO_PRIORITY_4 (4 << 4)
  131. #define ARBITRATION_CTRL_VIDEO_PRIORITY_5 (5 << 4)
  132. #define ARBITRATION_CTRL_VIDEO_PRIORITY_6 (6 << 4)
  133. #define ARBITRATION_CTRL_VIDEO_PRIORITY_7 (7 << 4)
  134. #define ARBITRATION_CTRL_CRT_OFF (0 << 0)
  135. #define ARBITRATION_CTRL_CRT_PRIORITY_1 (1 << 0)
  136. #define ARBITRATION_CTRL_CRT_PRIORITY_2 (2 << 0)
  137. #define ARBITRATION_CTRL_CRT_PRIORITY_3 (3 << 0)
  138. #define ARBITRATION_CTRL_CRT_PRIORITY_4 (4 << 0)
  139. #define ARBITRATION_CTRL_CRT_PRIORITY_5 (5 << 0)
  140. #define ARBITRATION_CTRL_CRT_PRIORITY_6 (6 << 0)
  141. #define ARBITRATION_CTRL_CRT_PRIORITY_7 (7 << 0)
  142. /* ----- Command list status register -------------------------- */
  143. #define CMD_INTPR_STATUS (0x000024 + VOYAGER_BASE)
  144. /* ----- Interrupt status register ----------------------------- */
  145. #define INT_STATUS (0x00002c + VOYAGER_BASE)
  146. #define INT_STATUS_UH (1 << 6)
  147. #define INT_STATUS_MC (1 << 10)
  148. #define INT_STATUS_U0 (1 << 12)
  149. #define INT_STATUS_U1 (1 << 13)
  150. #define INT_STATUS_AC (1 << 17)
  151. /* ----- Interrupt mask register ------------------------------ */
  152. #define VOYAGER_INT_MASK (0x000030 + VOYAGER_BASE)
  153. #define VOYAGER_INT_MASK_AC (1 << 17)
  154. /* ----- Current Gate register ---------------------------------*/
  155. #define CURRENT_GATE (0x000038 + VOYAGER_BASE)
  156. /* ----- Power mode 0 gate register --------------------------- */
  157. #define POWER_MODE0_GATE (0x000040 + VOYAGER_BASE)
  158. #define POWER_MODE0_GATE_G (1 << 6)
  159. #define POWER_MODE0_GATE_U0 (1 << 7)
  160. #define POWER_MODE0_GATE_U1 (1 << 8)
  161. #define POWER_MODE0_GATE_UH (1 << 11)
  162. #define POWER_MODE0_GATE_AC (1 << 18)
  163. /* ----- Power mode 1 gate register --------------------------- */
  164. #define POWER_MODE1_GATE (0x000048 + VOYAGER_BASE)
  165. #define POWER_MODE1_GATE_G (1 << 6)
  166. #define POWER_MODE1_GATE_U0 (1 << 7)
  167. #define POWER_MODE1_GATE_U1 (1 << 8)
  168. #define POWER_MODE1_GATE_UH (1 << 11)
  169. #define POWER_MODE1_GATE_AC (1 << 18)
  170. /* ----- Power mode 0 clock register -------------------------- */
  171. #define POWER_MODE0_CLOCK (0x000044 + VOYAGER_BASE)
  172. /* ----- Power mode 1 clock register -------------------------- */
  173. #define POWER_MODE1_CLOCK (0x00004C + VOYAGER_BASE)
  174. /* ----- Power mode controll register ------------------------- */
  175. #define POWER_MODE_CTRL (0x000054 + VOYAGER_BASE)
  176. /* ----- Miscellaneous Timing register ------------------------ */
  177. #define SYSTEM_DRAM_CTRL (0x000068 + VOYAGER_BASE)
  178. /* ----- PWM register ------------------------------------------*/
  179. #define PWM_0 (0x010020 + VOYAGER_BASE)
  180. #define PWM_0_HC(x) (((x)&0x0fff)<<20)
  181. #define PWM_0_LC(x) (((x)&0x0fff)<<8 )
  182. #define PWM_0_CLK_DEV(x) (((x)&0x000f)<<4 )
  183. #define PWM_0_EN (1<<0)
  184. /* ----- I2C register ----------------------------------------- */
  185. #define I2C_BYTECOUNT (0x010040 + VOYAGER_BASE)
  186. #define I2C_CONTROL (0x010041 + VOYAGER_BASE)
  187. #define I2C_STATUS (0x010042 + VOYAGER_BASE)
  188. #define I2C_RESET (0x010042 + VOYAGER_BASE)
  189. #define I2C_SADDRESS (0x010043 + VOYAGER_BASE)
  190. #define I2C_DATA (0x010044 + VOYAGER_BASE)
  191. /* ----- Controle register bits ----------------------------------------- */
  192. #define I2C_CONTROL_E (1 << 0)
  193. #define I2C_CONTROL_MODE (1 << 1)
  194. #define I2C_CONTROL_STATUS (1 << 2)
  195. #define I2C_CONTROL_INT (1 << 4)
  196. #define I2C_CONTROL_INTACK (1 << 5)
  197. #define I2C_CONTROL_REPEAT (1 << 6)
  198. /* ----- Status register bits ----------------------------------------- */
  199. #define I2C_STATUS_BUSY (1 << 0)
  200. #define I2C_STATUS_ACK (1 << 1)
  201. #define I2C_STATUS_ERROR (1 << 2)
  202. #define I2C_STATUS_COMPLETE (1 << 3)
  203. /* ----- Reset register ---------------------------------------------- */
  204. #define I2C_RESET_ERROR (1 << 2)
  205. /* ----- transmission frequencies ------------------------------------- */
  206. #define I2C_SADDRESS_SELECT (1 << 0)
  207. /* ----- Display Controll register ----------------------------------------- */
  208. #define PANEL_DISPLAY_CTRL (0x080000 + VOYAGER_BASE)
  209. #define PANEL_DISPLAY_CTRL_BIAS (1<<26)
  210. #define PANEL_PAN_CTRL (0x080004 + VOYAGER_BASE)
  211. #define PANEL_COLOR_KEY (0x080008 + VOYAGER_BASE)
  212. #define PANEL_FB_ADDRESS (0x08000C + VOYAGER_BASE)
  213. #define PANEL_FB_WIDTH (0x080010 + VOYAGER_BASE)
  214. #define PANEL_WINDOW_WIDTH (0x080014 + VOYAGER_BASE)
  215. #define PANEL_WINDOW_HEIGHT (0x080018 + VOYAGER_BASE)
  216. #define PANEL_PLANE_TL (0x08001C + VOYAGER_BASE)
  217. #define PANEL_PLANE_BR (0x080020 + VOYAGER_BASE)
  218. #define PANEL_HORIZONTAL_TOTAL (0x080024 + VOYAGER_BASE)
  219. #define PANEL_HORIZONTAL_SYNC (0x080028 + VOYAGER_BASE)
  220. #define PANEL_VERTICAL_TOTAL (0x08002C + VOYAGER_BASE)
  221. #define PANEL_VERTICAL_SYNC (0x080030 + VOYAGER_BASE)
  222. #define PANEL_CURRENT_LINE (0x080034 + VOYAGER_BASE)
  223. #define VIDEO_DISPLAY_CTRL (0x080040 + VOYAGER_BASE)
  224. #define VIDEO_FB_0_ADDRESS (0x080044 + VOYAGER_BASE)
  225. #define VIDEO_FB_WIDTH (0x080048 + VOYAGER_BASE)
  226. #define VIDEO_FB_0_LAST_ADDRESS (0x08004C + VOYAGER_BASE)
  227. #define VIDEO_PLANE_TL (0x080050 + VOYAGER_BASE)
  228. #define VIDEO_PLANE_BR (0x080054 + VOYAGER_BASE)
  229. #define VIDEO_SCALE (0x080058 + VOYAGER_BASE)
  230. #define VIDEO_INITIAL_SCALE (0x08005C + VOYAGER_BASE)
  231. #define VIDEO_YUV_CONSTANTS (0x080060 + VOYAGER_BASE)
  232. #define VIDEO_FB_1_ADDRESS (0x080064 + VOYAGER_BASE)
  233. #define VIDEO_FB_1_LAST_ADDRESS (0x080068 + VOYAGER_BASE)
  234. #define VIDEO_ALPHA_DISPLAY_CTRL (0x080080 + VOYAGER_BASE)
  235. #define VIDEO_ALPHA_FB_ADDRESS (0x080084 + VOYAGER_BASE)
  236. #define VIDEO_ALPHA_FB_WIDTH (0x080088 + VOYAGER_BASE)
  237. #define VIDEO_ALPHA_FB_LAST_ADDRESS (0x08008C + VOYAGER_BASE)
  238. #define VIDEO_ALPHA_PLANE_TL (0x080090 + VOYAGER_BASE)
  239. #define VIDEO_ALPHA_PLANE_BR (0x080094 + VOYAGER_BASE)
  240. #define VIDEO_ALPHA_SCALE (0x080098 + VOYAGER_BASE)
  241. #define VIDEO_ALPHA_INITIAL_SCALE (0x08009C + VOYAGER_BASE)
  242. #define VIDEO_ALPHA_CHROMA_KEY (0x0800A0 + VOYAGER_BASE)
  243. #define PANEL_HWC_ADDRESS (0x0800F0 + VOYAGER_BASE)
  244. #define PANEL_HWC_LOCATION (0x0800F4 + VOYAGER_BASE)
  245. #define PANEL_HWC_COLOR_12 (0x0800F8 + VOYAGER_BASE)
  246. #define PANEL_HWC_COLOR_3 (0x0800FC + VOYAGER_BASE)
  247. #define ALPHA_DISPLAY_CTRL (0x080100 + VOYAGER_BASE)
  248. #define ALPHA_FB_ADDRESS (0x080104 + VOYAGER_BASE)
  249. #define ALPHA_FB_WIDTH (0x080108 + VOYAGER_BASE)
  250. #define ALPHA_PLANE_TL (0x08010C + VOYAGER_BASE)
  251. #define ALPHA_PLANE_BR (0x080110 + VOYAGER_BASE)
  252. #define ALPHA_CHROMA_KEY (0x080114 + VOYAGER_BASE)
  253. #define CRT_DISPLAY_CTRL (0x080200 + VOYAGER_BASE)
  254. #define CRT_FB_ADDRESS (0x080204 + VOYAGER_BASE)
  255. #define CRT_FB_WIDTH (0x080208 + VOYAGER_BASE)
  256. #define CRT_HORIZONTAL_TOTAL (0x08020C + VOYAGER_BASE)
  257. #define CRT_HORIZONTAL_SYNC (0x080210 + VOYAGER_BASE)
  258. #define CRT_VERTICAL_TOTAL (0x080214 + VOYAGER_BASE)
  259. #define CRT_VERTICAL_SYNC (0x080218 + VOYAGER_BASE)
  260. #define CRT_SIGNATURE_ANALYZER (0x08021C + VOYAGER_BASE)
  261. #define CRT_CURRENT_LINE (0x080220 + VOYAGER_BASE)
  262. #define CRT_MONITOR_DETECT (0x080224 + VOYAGER_BASE)
  263. #define CRT_HWC_ADDRESS (0x080230 + VOYAGER_BASE)
  264. #define CRT_HWC_LOCATION (0x080234 + VOYAGER_BASE)
  265. #define CRT_HWC_COLOR_12 (0x080238 + VOYAGER_BASE)
  266. #define CRT_HWC_COLOR_3 (0x08023C + VOYAGER_BASE)
  267. #define CRT_PALETTE_RAM (0x080400 + VOYAGER_BASE)
  268. #define PANEL_PALETTE_RAM (0x080800 + VOYAGER_BASE)
  269. #define VIDEO_PALETTE_RAM (0x080C00 + VOYAGER_BASE)
  270. /* ----- 8051 Controle register ----------------------------------------- */
  271. #define VOYAGER_8051_BASE (0x000c0000 + VOYAGER_BASE)
  272. #define VOYAGER_8051_RESET (0x000b0000 + VOYAGER_BASE)
  273. #define VOYAGER_8051_SELECT (0x000b0004 + VOYAGER_BASE)
  274. #define VOYAGER_8051_CPU_INT (0x000b000c + VOYAGER_BASE)
  275. /* ----- AC97 Controle register ----------------------------------------- */
  276. #define AC97_TX_SLOT0 (0x00000000 + VOYAGER_AC97_BASE)
  277. #define AC97_CONTROL_STATUS (0x00000080 + VOYAGER_AC97_BASE)
  278. #define AC97C_READ (1 << 19)
  279. #define AC97C_WD_BIT (1 << 2)
  280. #define AC97C_INDEX_MASK 0x7f
  281. /* -------------------------------------------------------------------- */
  282. #endif /* _VOYAGER_GX_REG_H */