psb_reg.h 17 KB

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