psb_reg.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /**************************************************************************
  2. *
  3. * Copyright (c) (2005-2007) Imagination Technologies Limited.
  4. * Copyright (c) 2007, Intel Corporation.
  5. * All Rights Reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms and conditions of the GNU General Public License,
  9. * version 2, as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA..
  19. *
  20. **************************************************************************/
  21. #ifndef _PSB_REG_H_
  22. #define _PSB_REG_H_
  23. #define PSB_CR_CLKGATECTL 0x0000
  24. #define _PSB_C_CLKGATECTL_AUTO_MAN_REG (1 << 24)
  25. #define _PSB_C_CLKGATECTL_USE_CLKG_SHIFT (20)
  26. #define _PSB_C_CLKGATECTL_USE_CLKG_MASK (0x3 << 20)
  27. #define _PSB_C_CLKGATECTL_DPM_CLKG_SHIFT (16)
  28. #define _PSB_C_CLKGATECTL_DPM_CLKG_MASK (0x3 << 16)
  29. #define _PSB_C_CLKGATECTL_TA_CLKG_SHIFT (12)
  30. #define _PSB_C_CLKGATECTL_TA_CLKG_MASK (0x3 << 12)
  31. #define _PSB_C_CLKGATECTL_TSP_CLKG_SHIFT (8)
  32. #define _PSB_C_CLKGATECTL_TSP_CLKG_MASK (0x3 << 8)
  33. #define _PSB_C_CLKGATECTL_ISP_CLKG_SHIFT (4)
  34. #define _PSB_C_CLKGATECTL_ISP_CLKG_MASK (0x3 << 4)
  35. #define _PSB_C_CLKGATECTL_2D_CLKG_SHIFT (0)
  36. #define _PSB_C_CLKGATECTL_2D_CLKG_MASK (0x3 << 0)
  37. #define _PSB_C_CLKGATECTL_CLKG_ENABLED (0)
  38. #define _PSB_C_CLKGATECTL_CLKG_DISABLED (1)
  39. #define _PSB_C_CLKGATECTL_CLKG_AUTO (2)
  40. #define PSB_CR_CORE_ID 0x0010
  41. #define _PSB_CC_ID_ID_SHIFT (16)
  42. #define _PSB_CC_ID_ID_MASK (0xFFFF << 16)
  43. #define _PSB_CC_ID_CONFIG_SHIFT (0)
  44. #define _PSB_CC_ID_CONFIG_MASK (0xFFFF << 0)
  45. #define PSB_CR_CORE_REVISION 0x0014
  46. #define _PSB_CC_REVISION_DESIGNER_SHIFT (24)
  47. #define _PSB_CC_REVISION_DESIGNER_MASK (0xFF << 24)
  48. #define _PSB_CC_REVISION_MAJOR_SHIFT (16)
  49. #define _PSB_CC_REVISION_MAJOR_MASK (0xFF << 16)
  50. #define _PSB_CC_REVISION_MINOR_SHIFT (8)
  51. #define _PSB_CC_REVISION_MINOR_MASK (0xFF << 8)
  52. #define _PSB_CC_REVISION_MAINTENANCE_SHIFT (0)
  53. #define _PSB_CC_REVISION_MAINTENANCE_MASK (0xFF << 0)
  54. #define PSB_CR_DESIGNER_REV_FIELD1 0x0018
  55. #define PSB_CR_SOFT_RESET 0x0080
  56. #define _PSB_CS_RESET_TSP_RESET (1 << 6)
  57. #define _PSB_CS_RESET_ISP_RESET (1 << 5)
  58. #define _PSB_CS_RESET_USE_RESET (1 << 4)
  59. #define _PSB_CS_RESET_TA_RESET (1 << 3)
  60. #define _PSB_CS_RESET_DPM_RESET (1 << 2)
  61. #define _PSB_CS_RESET_TWOD_RESET (1 << 1)
  62. #define _PSB_CS_RESET_BIF_RESET (1 << 0)
  63. #define PSB_CR_DESIGNER_REV_FIELD2 0x001C
  64. #define PSB_CR_EVENT_HOST_ENABLE2 0x0110
  65. #define PSB_CR_EVENT_STATUS2 0x0118
  66. #define PSB_CR_EVENT_HOST_CLEAR2 0x0114
  67. #define _PSB_CE2_BIF_REQUESTER_FAULT (1 << 4)
  68. #define PSB_CR_EVENT_STATUS 0x012C
  69. #define PSB_CR_EVENT_HOST_ENABLE 0x0130
  70. #define PSB_CR_EVENT_HOST_CLEAR 0x0134
  71. #define _PSB_CE_MASTER_INTERRUPT (1 << 31)
  72. #define _PSB_CE_TA_DPM_FAULT (1 << 28)
  73. #define _PSB_CE_TWOD_COMPLETE (1 << 27)
  74. #define _PSB_CE_DPM_OUT_OF_MEMORY_ZLS (1 << 25)
  75. #define _PSB_CE_DPM_TA_MEM_FREE (1 << 24)
  76. #define _PSB_CE_PIXELBE_END_RENDER (1 << 18)
  77. #define _PSB_CE_SW_EVENT (1 << 14)
  78. #define _PSB_CE_TA_FINISHED (1 << 13)
  79. #define _PSB_CE_TA_TERMINATE (1 << 12)
  80. #define _PSB_CE_DPM_REACHED_MEM_THRESH (1 << 3)
  81. #define _PSB_CE_DPM_OUT_OF_MEMORY_GBL (1 << 2)
  82. #define _PSB_CE_DPM_OUT_OF_MEMORY_MT (1 << 1)
  83. #define _PSB_CE_DPM_3D_MEM_FREE (1 << 0)
  84. #define PSB_USE_OFFSET_MASK 0x0007FFFF
  85. #define PSB_USE_OFFSET_SIZE (PSB_USE_OFFSET_MASK + 1)
  86. #define PSB_CR_USE_CODE_BASE0 0x0A0C
  87. #define PSB_CR_USE_CODE_BASE1 0x0A10
  88. #define PSB_CR_USE_CODE_BASE2 0x0A14
  89. #define PSB_CR_USE_CODE_BASE3 0x0A18
  90. #define PSB_CR_USE_CODE_BASE4 0x0A1C
  91. #define PSB_CR_USE_CODE_BASE5 0x0A20
  92. #define PSB_CR_USE_CODE_BASE6 0x0A24
  93. #define PSB_CR_USE_CODE_BASE7 0x0A28
  94. #define PSB_CR_USE_CODE_BASE8 0x0A2C
  95. #define PSB_CR_USE_CODE_BASE9 0x0A30
  96. #define PSB_CR_USE_CODE_BASE10 0x0A34
  97. #define PSB_CR_USE_CODE_BASE11 0x0A38
  98. #define PSB_CR_USE_CODE_BASE12 0x0A3C
  99. #define PSB_CR_USE_CODE_BASE13 0x0A40
  100. #define PSB_CR_USE_CODE_BASE14 0x0A44
  101. #define PSB_CR_USE_CODE_BASE15 0x0A48
  102. #define PSB_CR_USE_CODE_BASE(_i) (0x0A0C + ((_i) << 2))
  103. #define _PSB_CUC_BASE_DM_SHIFT (25)
  104. #define _PSB_CUC_BASE_DM_MASK (0x3 << 25)
  105. #define _PSB_CUC_BASE_ADDR_SHIFT (0) /* 1024-bit aligned address? */
  106. #define _PSB_CUC_BASE_ADDR_ALIGNSHIFT (7)
  107. #define _PSB_CUC_BASE_ADDR_MASK (0x1FFFFFF << 0)
  108. #define _PSB_CUC_DM_VERTEX (0)
  109. #define _PSB_CUC_DM_PIXEL (1)
  110. #define _PSB_CUC_DM_RESERVED (2)
  111. #define _PSB_CUC_DM_EDM (3)
  112. #define PSB_CR_PDS_EXEC_BASE 0x0AB8
  113. #define _PSB_CR_PDS_EXEC_BASE_ADDR_SHIFT (20) /* 1MB aligned address */
  114. #define _PSB_CR_PDS_EXEC_BASE_ADDR_ALIGNSHIFT (20)
  115. #define PSB_CR_EVENT_KICKER 0x0AC4
  116. #define _PSB_CE_KICKER_ADDRESS_SHIFT (4) /* 128-bit aligned address */
  117. #define PSB_CR_EVENT_KICK 0x0AC8
  118. #define _PSB_CE_KICK_NOW (1 << 0)
  119. #define PSB_CR_BIF_DIR_LIST_BASE1 0x0C38
  120. #define PSB_CR_BIF_CTRL 0x0C00
  121. #define _PSB_CB_CTRL_CLEAR_FAULT (1 << 4)
  122. #define _PSB_CB_CTRL_INVALDC (1 << 3)
  123. #define _PSB_CB_CTRL_FLUSH (1 << 2)
  124. #define PSB_CR_BIF_INT_STAT 0x0C04
  125. #define PSB_CR_BIF_FAULT 0x0C08
  126. #define _PSB_CBI_STAT_PF_N_RW (1 << 14)
  127. #define _PSB_CBI_STAT_FAULT_SHIFT (0)
  128. #define _PSB_CBI_STAT_FAULT_MASK (0x3FFF << 0)
  129. #define _PSB_CBI_STAT_FAULT_CACHE (1 << 1)
  130. #define _PSB_CBI_STAT_FAULT_TA (1 << 2)
  131. #define _PSB_CBI_STAT_FAULT_VDM (1 << 3)
  132. #define _PSB_CBI_STAT_FAULT_2D (1 << 4)
  133. #define _PSB_CBI_STAT_FAULT_PBE (1 << 5)
  134. #define _PSB_CBI_STAT_FAULT_TSP (1 << 6)
  135. #define _PSB_CBI_STAT_FAULT_ISP (1 << 7)
  136. #define _PSB_CBI_STAT_FAULT_USSEPDS (1 << 8)
  137. #define _PSB_CBI_STAT_FAULT_HOST (1 << 9)
  138. #define PSB_CR_BIF_BANK0 0x0C78
  139. #define PSB_CR_BIF_BANK1 0x0C7C
  140. #define PSB_CR_BIF_DIR_LIST_BASE0 0x0C84
  141. #define PSB_CR_BIF_TWOD_REQ_BASE 0x0C88
  142. #define PSB_CR_BIF_3D_REQ_BASE 0x0CAC
  143. #define PSB_CR_2D_SOCIF 0x0E18
  144. #define _PSB_C2_SOCIF_FREESPACE_SHIFT (0)
  145. #define _PSB_C2_SOCIF_FREESPACE_MASK (0xFF << 0)
  146. #define _PSB_C2_SOCIF_EMPTY (0x80 << 0)
  147. #define PSB_CR_2D_BLIT_STATUS 0x0E04
  148. #define _PSB_C2B_STATUS_BUSY (1 << 24)
  149. #define _PSB_C2B_STATUS_COMPLETE_SHIFT (0)
  150. #define _PSB_C2B_STATUS_COMPLETE_MASK (0xFFFFFF << 0)
  151. /*
  152. * 2D defs.
  153. */
  154. /*
  155. * 2D Slave Port Data : Block Header's Object Type
  156. */
  157. #define PSB_2D_CLIP_BH (0x00000000)
  158. #define PSB_2D_PAT_BH (0x10000000)
  159. #define PSB_2D_CTRL_BH (0x20000000)
  160. #define PSB_2D_SRC_OFF_BH (0x30000000)
  161. #define PSB_2D_MASK_OFF_BH (0x40000000)
  162. #define PSB_2D_RESERVED1_BH (0x50000000)
  163. #define PSB_2D_RESERVED2_BH (0x60000000)
  164. #define PSB_2D_FENCE_BH (0x70000000)
  165. #define PSB_2D_BLIT_BH (0x80000000)
  166. #define PSB_2D_SRC_SURF_BH (0x90000000)
  167. #define PSB_2D_DST_SURF_BH (0xA0000000)
  168. #define PSB_2D_PAT_SURF_BH (0xB0000000)
  169. #define PSB_2D_SRC_PAL_BH (0xC0000000)
  170. #define PSB_2D_PAT_PAL_BH (0xD0000000)
  171. #define PSB_2D_MASK_SURF_BH (0xE0000000)
  172. #define PSB_2D_FLUSH_BH (0xF0000000)
  173. /*
  174. * Clip Definition block (PSB_2D_CLIP_BH)
  175. */
  176. #define PSB_2D_CLIPCOUNT_MAX (1)
  177. #define PSB_2D_CLIPCOUNT_MASK (0x00000000)
  178. #define PSB_2D_CLIPCOUNT_CLRMASK (0xFFFFFFFF)
  179. #define PSB_2D_CLIPCOUNT_SHIFT (0)
  180. /* clip rectangle min & max */
  181. #define PSB_2D_CLIP_XMAX_MASK (0x00FFF000)
  182. #define PSB_2D_CLIP_XMAX_CLRMASK (0xFF000FFF)
  183. #define PSB_2D_CLIP_XMAX_SHIFT (12)
  184. #define PSB_2D_CLIP_XMIN_MASK (0x00000FFF)
  185. #define PSB_2D_CLIP_XMIN_CLRMASK (0x00FFF000)
  186. #define PSB_2D_CLIP_XMIN_SHIFT (0)
  187. /* clip rectangle offset */
  188. #define PSB_2D_CLIP_YMAX_MASK (0x00FFF000)
  189. #define PSB_2D_CLIP_YMAX_CLRMASK (0xFF000FFF)
  190. #define PSB_2D_CLIP_YMAX_SHIFT (12)
  191. #define PSB_2D_CLIP_YMIN_MASK (0x00000FFF)
  192. #define PSB_2D_CLIP_YMIN_CLRMASK (0x00FFF000)
  193. #define PSB_2D_CLIP_YMIN_SHIFT (0)
  194. /*
  195. * Pattern Control (PSB_2D_PAT_BH)
  196. */
  197. #define PSB_2D_PAT_HEIGHT_MASK (0x0000001F)
  198. #define PSB_2D_PAT_HEIGHT_SHIFT (0)
  199. #define PSB_2D_PAT_WIDTH_MASK (0x000003E0)
  200. #define PSB_2D_PAT_WIDTH_SHIFT (5)
  201. #define PSB_2D_PAT_YSTART_MASK (0x00007C00)
  202. #define PSB_2D_PAT_YSTART_SHIFT (10)
  203. #define PSB_2D_PAT_XSTART_MASK (0x000F8000)
  204. #define PSB_2D_PAT_XSTART_SHIFT (15)
  205. /*
  206. * 2D Control block (PSB_2D_CTRL_BH)
  207. */
  208. /* Present Flags */
  209. #define PSB_2D_SRCCK_CTRL (0x00000001)
  210. #define PSB_2D_DSTCK_CTRL (0x00000002)
  211. #define PSB_2D_ALPHA_CTRL (0x00000004)
  212. /* Colour Key Colour (SRC/DST)*/
  213. #define PSB_2D_CK_COL_MASK (0xFFFFFFFF)
  214. #define PSB_2D_CK_COL_CLRMASK (0x00000000)
  215. #define PSB_2D_CK_COL_SHIFT (0)
  216. /* Colour Key Mask (SRC/DST)*/
  217. #define PSB_2D_CK_MASK_MASK (0xFFFFFFFF)
  218. #define PSB_2D_CK_MASK_CLRMASK (0x00000000)
  219. #define PSB_2D_CK_MASK_SHIFT (0)
  220. /* Alpha Control (Alpha/RGB)*/
  221. #define PSB_2D_GBLALPHA_MASK (0x000FF000)
  222. #define PSB_2D_GBLALPHA_CLRMASK (0xFFF00FFF)
  223. #define PSB_2D_GBLALPHA_SHIFT (12)
  224. #define PSB_2D_SRCALPHA_OP_MASK (0x00700000)
  225. #define PSB_2D_SRCALPHA_OP_CLRMASK (0xFF8FFFFF)
  226. #define PSB_2D_SRCALPHA_OP_SHIFT (20)
  227. #define PSB_2D_SRCALPHA_OP_ONE (0x00000000)
  228. #define PSB_2D_SRCALPHA_OP_SRC (0x00100000)
  229. #define PSB_2D_SRCALPHA_OP_DST (0x00200000)
  230. #define PSB_2D_SRCALPHA_OP_SG (0x00300000)
  231. #define PSB_2D_SRCALPHA_OP_DG (0x00400000)
  232. #define PSB_2D_SRCALPHA_OP_GBL (0x00500000)
  233. #define PSB_2D_SRCALPHA_OP_ZERO (0x00600000)
  234. #define PSB_2D_SRCALPHA_INVERT (0x00800000)
  235. #define PSB_2D_SRCALPHA_INVERT_CLR (0xFF7FFFFF)
  236. #define PSB_2D_DSTALPHA_OP_MASK (0x07000000)
  237. #define PSB_2D_DSTALPHA_OP_CLRMASK (0xF8FFFFFF)
  238. #define PSB_2D_DSTALPHA_OP_SHIFT (24)
  239. #define PSB_2D_DSTALPHA_OP_ONE (0x00000000)
  240. #define PSB_2D_DSTALPHA_OP_SRC (0x01000000)
  241. #define PSB_2D_DSTALPHA_OP_DST (0x02000000)
  242. #define PSB_2D_DSTALPHA_OP_SG (0x03000000)
  243. #define PSB_2D_DSTALPHA_OP_DG (0x04000000)
  244. #define PSB_2D_DSTALPHA_OP_GBL (0x05000000)
  245. #define PSB_2D_DSTALPHA_OP_ZERO (0x06000000)
  246. #define PSB_2D_DSTALPHA_INVERT (0x08000000)
  247. #define PSB_2D_DSTALPHA_INVERT_CLR (0xF7FFFFFF)
  248. #define PSB_2D_PRE_MULTIPLICATION_ENABLE (0x10000000)
  249. #define PSB_2D_PRE_MULTIPLICATION_CLRMASK (0xEFFFFFFF)
  250. #define PSB_2D_ZERO_SOURCE_ALPHA_ENABLE (0x20000000)
  251. #define PSB_2D_ZERO_SOURCE_ALPHA_CLRMASK (0xDFFFFFFF)
  252. /*
  253. *Source Offset (PSB_2D_SRC_OFF_BH)
  254. */
  255. #define PSB_2D_SRCOFF_XSTART_MASK ((0x00000FFF) << 12)
  256. #define PSB_2D_SRCOFF_XSTART_SHIFT (12)
  257. #define PSB_2D_SRCOFF_YSTART_MASK (0x00000FFF)
  258. #define PSB_2D_SRCOFF_YSTART_SHIFT (0)
  259. /*
  260. * Mask Offset (PSB_2D_MASK_OFF_BH)
  261. */
  262. #define PSB_2D_MASKOFF_XSTART_MASK ((0x00000FFF) << 12)
  263. #define PSB_2D_MASKOFF_XSTART_SHIFT (12)
  264. #define PSB_2D_MASKOFF_YSTART_MASK (0x00000FFF)
  265. #define PSB_2D_MASKOFF_YSTART_SHIFT (0)
  266. /*
  267. * 2D Fence (see PSB_2D_FENCE_BH): bits 0:27 are ignored
  268. */
  269. /*
  270. *Blit Rectangle (PSB_2D_BLIT_BH)
  271. */
  272. #define PSB_2D_ROT_MASK (3 << 25)
  273. #define PSB_2D_ROT_CLRMASK (~PSB_2D_ROT_MASK)
  274. #define PSB_2D_ROT_NONE (0 << 25)
  275. #define PSB_2D_ROT_90DEGS (1 << 25)
  276. #define PSB_2D_ROT_180DEGS (2 << 25)
  277. #define PSB_2D_ROT_270DEGS (3 << 25)
  278. #define PSB_2D_COPYORDER_MASK (3 << 23)
  279. #define PSB_2D_COPYORDER_CLRMASK (~PSB_2D_COPYORDER_MASK)
  280. #define PSB_2D_COPYORDER_TL2BR (0 << 23)
  281. #define PSB_2D_COPYORDER_BR2TL (1 << 23)
  282. #define PSB_2D_COPYORDER_TR2BL (2 << 23)
  283. #define PSB_2D_COPYORDER_BL2TR (3 << 23)
  284. #define PSB_2D_DSTCK_CLRMASK (0xFF9FFFFF)
  285. #define PSB_2D_DSTCK_DISABLE (0x00000000)
  286. #define PSB_2D_DSTCK_PASS (0x00200000)
  287. #define PSB_2D_DSTCK_REJECT (0x00400000)
  288. #define PSB_2D_SRCCK_CLRMASK (0xFFE7FFFF)
  289. #define PSB_2D_SRCCK_DISABLE (0x00000000)
  290. #define PSB_2D_SRCCK_PASS (0x00080000)
  291. #define PSB_2D_SRCCK_REJECT (0x00100000)
  292. #define PSB_2D_CLIP_ENABLE (0x00040000)
  293. #define PSB_2D_ALPHA_ENABLE (0x00020000)
  294. #define PSB_2D_PAT_CLRMASK (0xFFFEFFFF)
  295. #define PSB_2D_PAT_MASK (0x00010000)
  296. #define PSB_2D_USE_PAT (0x00010000)
  297. #define PSB_2D_USE_FILL (0x00000000)
  298. /*
  299. * Tungsten Graphics note on rop codes: If rop A and rop B are
  300. * identical, the mask surface will not be read and need not be
  301. * set up.
  302. */
  303. #define PSB_2D_ROP3B_MASK (0x0000FF00)
  304. #define PSB_2D_ROP3B_CLRMASK (0xFFFF00FF)
  305. #define PSB_2D_ROP3B_SHIFT (8)
  306. /* rop code A */
  307. #define PSB_2D_ROP3A_MASK (0x000000FF)
  308. #define PSB_2D_ROP3A_CLRMASK (0xFFFFFF00)
  309. #define PSB_2D_ROP3A_SHIFT (0)
  310. #define PSB_2D_ROP4_MASK (0x0000FFFF)
  311. /*
  312. * DWORD0: (Only pass if Pattern control == Use Fill Colour)
  313. * Fill Colour RGBA8888
  314. */
  315. #define PSB_2D_FILLCOLOUR_MASK (0xFFFFFFFF)
  316. #define PSB_2D_FILLCOLOUR_SHIFT (0)
  317. /*
  318. * DWORD1: (Always Present)
  319. * X Start (Dest)
  320. * Y Start (Dest)
  321. */
  322. #define PSB_2D_DST_XSTART_MASK (0x00FFF000)
  323. #define PSB_2D_DST_XSTART_CLRMASK (0xFF000FFF)
  324. #define PSB_2D_DST_XSTART_SHIFT (12)
  325. #define PSB_2D_DST_YSTART_MASK (0x00000FFF)
  326. #define PSB_2D_DST_YSTART_CLRMASK (0xFFFFF000)
  327. #define PSB_2D_DST_YSTART_SHIFT (0)
  328. /*
  329. * DWORD2: (Always Present)
  330. * X Size (Dest)
  331. * Y Size (Dest)
  332. */
  333. #define PSB_2D_DST_XSIZE_MASK (0x00FFF000)
  334. #define PSB_2D_DST_XSIZE_CLRMASK (0xFF000FFF)
  335. #define PSB_2D_DST_XSIZE_SHIFT (12)
  336. #define PSB_2D_DST_YSIZE_MASK (0x00000FFF)
  337. #define PSB_2D_DST_YSIZE_CLRMASK (0xFFFFF000)
  338. #define PSB_2D_DST_YSIZE_SHIFT (0)
  339. /*
  340. * Source Surface (PSB_2D_SRC_SURF_BH)
  341. */
  342. /*
  343. * WORD 0
  344. */
  345. #define PSB_2D_SRC_FORMAT_MASK (0x00078000)
  346. #define PSB_2D_SRC_1_PAL (0x00000000)
  347. #define PSB_2D_SRC_2_PAL (0x00008000)
  348. #define PSB_2D_SRC_4_PAL (0x00010000)
  349. #define PSB_2D_SRC_8_PAL (0x00018000)
  350. #define PSB_2D_SRC_8_ALPHA (0x00020000)
  351. #define PSB_2D_SRC_4_ALPHA (0x00028000)
  352. #define PSB_2D_SRC_332RGB (0x00030000)
  353. #define PSB_2D_SRC_4444ARGB (0x00038000)
  354. #define PSB_2D_SRC_555RGB (0x00040000)
  355. #define PSB_2D_SRC_1555ARGB (0x00048000)
  356. #define PSB_2D_SRC_565RGB (0x00050000)
  357. #define PSB_2D_SRC_0888ARGB (0x00058000)
  358. #define PSB_2D_SRC_8888ARGB (0x00060000)
  359. #define PSB_2D_SRC_8888UYVY (0x00068000)
  360. #define PSB_2D_SRC_RESERVED (0x00070000)
  361. #define PSB_2D_SRC_1555ARGB_LOOKUP (0x00078000)
  362. #define PSB_2D_SRC_STRIDE_MASK (0x00007FFF)
  363. #define PSB_2D_SRC_STRIDE_CLRMASK (0xFFFF8000)
  364. #define PSB_2D_SRC_STRIDE_SHIFT (0)
  365. /*
  366. * WORD 1 - Base Address
  367. */
  368. #define PSB_2D_SRC_ADDR_MASK (0x0FFFFFFC)
  369. #define PSB_2D_SRC_ADDR_CLRMASK (0x00000003)
  370. #define PSB_2D_SRC_ADDR_SHIFT (2)
  371. #define PSB_2D_SRC_ADDR_ALIGNSHIFT (2)
  372. /*
  373. * Pattern Surface (PSB_2D_PAT_SURF_BH)
  374. */
  375. /*
  376. * WORD 0
  377. */
  378. #define PSB_2D_PAT_FORMAT_MASK (0x00078000)
  379. #define PSB_2D_PAT_1_PAL (0x00000000)
  380. #define PSB_2D_PAT_2_PAL (0x00008000)
  381. #define PSB_2D_PAT_4_PAL (0x00010000)
  382. #define PSB_2D_PAT_8_PAL (0x00018000)
  383. #define PSB_2D_PAT_8_ALPHA (0x00020000)
  384. #define PSB_2D_PAT_4_ALPHA (0x00028000)
  385. #define PSB_2D_PAT_332RGB (0x00030000)
  386. #define PSB_2D_PAT_4444ARGB (0x00038000)
  387. #define PSB_2D_PAT_555RGB (0x00040000)
  388. #define PSB_2D_PAT_1555ARGB (0x00048000)
  389. #define PSB_2D_PAT_565RGB (0x00050000)
  390. #define PSB_2D_PAT_0888ARGB (0x00058000)
  391. #define PSB_2D_PAT_8888ARGB (0x00060000)
  392. #define PSB_2D_PAT_STRIDE_MASK (0x00007FFF)
  393. #define PSB_2D_PAT_STRIDE_CLRMASK (0xFFFF8000)
  394. #define PSB_2D_PAT_STRIDE_SHIFT (0)
  395. /*
  396. * WORD 1 - Base Address
  397. */
  398. #define PSB_2D_PAT_ADDR_MASK (0x0FFFFFFC)
  399. #define PSB_2D_PAT_ADDR_CLRMASK (0x00000003)
  400. #define PSB_2D_PAT_ADDR_SHIFT (2)
  401. #define PSB_2D_PAT_ADDR_ALIGNSHIFT (2)
  402. /*
  403. * Destination Surface (PSB_2D_DST_SURF_BH)
  404. */
  405. /*
  406. * WORD 0
  407. */
  408. #define PSB_2D_DST_FORMAT_MASK (0x00078000)
  409. #define PSB_2D_DST_332RGB (0x00030000)
  410. #define PSB_2D_DST_4444ARGB (0x00038000)
  411. #define PSB_2D_DST_555RGB (0x00040000)
  412. #define PSB_2D_DST_1555ARGB (0x00048000)
  413. #define PSB_2D_DST_565RGB (0x00050000)
  414. #define PSB_2D_DST_0888ARGB (0x00058000)
  415. #define PSB_2D_DST_8888ARGB (0x00060000)
  416. #define PSB_2D_DST_8888AYUV (0x00070000)
  417. #define PSB_2D_DST_STRIDE_MASK (0x00007FFF)
  418. #define PSB_2D_DST_STRIDE_CLRMASK (0xFFFF8000)
  419. #define PSB_2D_DST_STRIDE_SHIFT (0)
  420. /*
  421. * WORD 1 - Base Address
  422. */
  423. #define PSB_2D_DST_ADDR_MASK (0x0FFFFFFC)
  424. #define PSB_2D_DST_ADDR_CLRMASK (0x00000003)
  425. #define PSB_2D_DST_ADDR_SHIFT (2)
  426. #define PSB_2D_DST_ADDR_ALIGNSHIFT (2)
  427. /*
  428. * Mask Surface (PSB_2D_MASK_SURF_BH)
  429. */
  430. /*
  431. * WORD 0
  432. */
  433. #define PSB_2D_MASK_STRIDE_MASK (0x00007FFF)
  434. #define PSB_2D_MASK_STRIDE_CLRMASK (0xFFFF8000)
  435. #define PSB_2D_MASK_STRIDE_SHIFT (0)
  436. /*
  437. * WORD 1 - Base Address
  438. */
  439. #define PSB_2D_MASK_ADDR_MASK (0x0FFFFFFC)
  440. #define PSB_2D_MASK_ADDR_CLRMASK (0x00000003)
  441. #define PSB_2D_MASK_ADDR_SHIFT (2)
  442. #define PSB_2D_MASK_ADDR_ALIGNSHIFT (2)
  443. /*
  444. * Source Palette (PSB_2D_SRC_PAL_BH)
  445. */
  446. #define PSB_2D_SRCPAL_ADDR_SHIFT (0)
  447. #define PSB_2D_SRCPAL_ADDR_CLRMASK (0xF0000007)
  448. #define PSB_2D_SRCPAL_ADDR_MASK (0x0FFFFFF8)
  449. #define PSB_2D_SRCPAL_BYTEALIGN (1024)
  450. /*
  451. * Pattern Palette (PSB_2D_PAT_PAL_BH)
  452. */
  453. #define PSB_2D_PATPAL_ADDR_SHIFT (0)
  454. #define PSB_2D_PATPAL_ADDR_CLRMASK (0xF0000007)
  455. #define PSB_2D_PATPAL_ADDR_MASK (0x0FFFFFF8)
  456. #define PSB_2D_PATPAL_BYTEALIGN (1024)
  457. /*
  458. * Rop3 Codes (2 LS bytes)
  459. */
  460. #define PSB_2D_ROP3_SRCCOPY (0xCCCC)
  461. #define PSB_2D_ROP3_PATCOPY (0xF0F0)
  462. #define PSB_2D_ROP3_WHITENESS (0xFFFF)
  463. #define PSB_2D_ROP3_BLACKNESS (0x0000)
  464. #define PSB_2D_ROP3_SRC (0xCC)
  465. #define PSB_2D_ROP3_PAT (0xF0)
  466. #define PSB_2D_ROP3_DST (0xAA)
  467. /*
  468. * Sizes.
  469. */
  470. #define PSB_SCENE_HW_COOKIE_SIZE 16
  471. #define PSB_TA_MEM_HW_COOKIE_SIZE 16
  472. /*
  473. * Scene stuff.
  474. */
  475. #define PSB_NUM_HW_SCENES 2
  476. /*
  477. * Scheduler completion actions.
  478. */
  479. #define PSB_RASTER_BLOCK 0
  480. #define PSB_RASTER 1
  481. #define PSB_RETURN 2
  482. #define PSB_TA 3
  483. /* Power management */
  484. #define PSB_PUNIT_PORT 0x04
  485. #define PSB_OSPMBA 0x78
  486. #define PSB_APMBA 0x7a
  487. #define PSB_APM_CMD 0x0
  488. #define PSB_APM_STS 0x04
  489. #define PSB_PWRGT_VID_ENC_MASK 0x30
  490. #define PSB_PWRGT_VID_DEC_MASK 0xc
  491. #define PSB_PWRGT_GL3_MASK 0xc0
  492. #define PSB_PM_SSC 0x20
  493. #define PSB_PM_SSS 0x30
  494. #define PSB_PWRGT_DISPLAY_MASK 0xc /*on a different BA than video/gfx*/
  495. #define MDFLD_PWRGT_DISPLAY_A_CNTR 0x0000000c
  496. #define MDFLD_PWRGT_DISPLAY_B_CNTR 0x0000c000
  497. #define MDFLD_PWRGT_DISPLAY_C_CNTR 0x00030000
  498. #define MDFLD_PWRGT_DISP_MIPI_CNTR 0x000c0000
  499. #define MDFLD_PWRGT_DISPLAY_CNTR (MDFLD_PWRGT_DISPLAY_A_CNTR | MDFLD_PWRGT_DISPLAY_B_CNTR | MDFLD_PWRGT_DISPLAY_C_CNTR | MDFLD_PWRGT_DISP_MIPI_CNTR) /* 0x000fc00c */
  500. /* Display SSS register bits are different in A0 vs. B0 */
  501. #define PSB_PWRGT_GFX_MASK 0x3
  502. #define MDFLD_PWRGT_DISPLAY_A_STS 0x000000c0
  503. #define MDFLD_PWRGT_DISPLAY_B_STS 0x00000300
  504. #define MDFLD_PWRGT_DISPLAY_C_STS 0x00000c00
  505. #define PSB_PWRGT_GFX_MASK_B0 0xc3
  506. #define MDFLD_PWRGT_DISPLAY_A_STS_B0 0x0000000c
  507. #define MDFLD_PWRGT_DISPLAY_B_STS_B0 0x0000c000
  508. #define MDFLD_PWRGT_DISPLAY_C_STS_B0 0x00030000
  509. #define MDFLD_PWRGT_DISP_MIPI_STS 0x000c0000
  510. #define MDFLD_PWRGT_DISPLAY_STS_A0 (MDFLD_PWRGT_DISPLAY_A_STS | MDFLD_PWRGT_DISPLAY_B_STS | MDFLD_PWRGT_DISPLAY_C_STS | MDFLD_PWRGT_DISP_MIPI_STS) /* 0x000fc00c */
  511. #define MDFLD_PWRGT_DISPLAY_STS_B0 (MDFLD_PWRGT_DISPLAY_A_STS_B0 | MDFLD_PWRGT_DISPLAY_B_STS_B0 | MDFLD_PWRGT_DISPLAY_C_STS_B0 | MDFLD_PWRGT_DISP_MIPI_STS) /* 0x000fc00c */
  512. #endif