nouveau_reg.h 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858
  1. #define NV04_PFB_BOOT_0 0x00100000
  2. # define NV04_PFB_BOOT_0_RAM_AMOUNT 0x00000003
  3. # define NV04_PFB_BOOT_0_RAM_AMOUNT_32MB 0x00000000
  4. # define NV04_PFB_BOOT_0_RAM_AMOUNT_4MB 0x00000001
  5. # define NV04_PFB_BOOT_0_RAM_AMOUNT_8MB 0x00000002
  6. # define NV04_PFB_BOOT_0_RAM_AMOUNT_16MB 0x00000003
  7. # define NV04_PFB_BOOT_0_RAM_WIDTH_128 0x00000004
  8. # define NV04_PFB_BOOT_0_RAM_TYPE 0x00000028
  9. # define NV04_PFB_BOOT_0_RAM_TYPE_SGRAM_8MBIT 0x00000000
  10. # define NV04_PFB_BOOT_0_RAM_TYPE_SGRAM_16MBIT 0x00000008
  11. # define NV04_PFB_BOOT_0_RAM_TYPE_SGRAM_16MBIT_4BANK 0x00000010
  12. # define NV04_PFB_BOOT_0_RAM_TYPE_SDRAM_16MBIT 0x00000018
  13. # define NV04_PFB_BOOT_0_RAM_TYPE_SDRAM_64MBIT 0x00000020
  14. # define NV04_PFB_BOOT_0_RAM_TYPE_SDRAM_64MBITX16 0x00000028
  15. # define NV04_PFB_BOOT_0_UMA_ENABLE 0x00000100
  16. # define NV04_PFB_BOOT_0_UMA_SIZE 0x0000f000
  17. #define NV04_PFB_DEBUG_0 0x00100080
  18. # define NV04_PFB_DEBUG_0_PAGE_MODE 0x00000001
  19. # define NV04_PFB_DEBUG_0_REFRESH_OFF 0x00000010
  20. # define NV04_PFB_DEBUG_0_REFRESH_COUNTX64 0x00003f00
  21. # define NV04_PFB_DEBUG_0_REFRESH_SLOW_CLK 0x00004000
  22. # define NV04_PFB_DEBUG_0_SAFE_MODE 0x00008000
  23. # define NV04_PFB_DEBUG_0_ALOM_ENABLE 0x00010000
  24. # define NV04_PFB_DEBUG_0_CASOE 0x00100000
  25. # define NV04_PFB_DEBUG_0_CKE_INVERT 0x10000000
  26. # define NV04_PFB_DEBUG_0_REFINC 0x20000000
  27. # define NV04_PFB_DEBUG_0_SAVE_POWER_OFF 0x40000000
  28. #define NV04_PFB_CFG0 0x00100200
  29. # define NV04_PFB_CFG0_SCRAMBLE 0x20000000
  30. #define NV04_PFB_CFG1 0x00100204
  31. #define NV04_PFB_FIFO_DATA 0x0010020c
  32. # define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK 0xfff00000
  33. # define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_SHIFT 20
  34. #define NV10_PFB_REFCTRL 0x00100210
  35. # define NV10_PFB_REFCTRL_VALID_1 (1 << 31)
  36. #define NV04_PFB_PAD 0x0010021c
  37. # define NV04_PFB_PAD_CKE_NORMAL (1 << 0)
  38. #define NV10_PFB_TILE(i) (0x00100240 + (i*16))
  39. #define NV10_PFB_TILE__SIZE 8
  40. #define NV10_PFB_TLIMIT(i) (0x00100244 + (i*16))
  41. #define NV10_PFB_TSIZE(i) (0x00100248 + (i*16))
  42. #define NV10_PFB_TSTATUS(i) (0x0010024c + (i*16))
  43. #define NV04_PFB_REF 0x001002d0
  44. # define NV04_PFB_REF_CMD_REFRESH (1 << 0)
  45. #define NV04_PFB_PRE 0x001002d4
  46. # define NV04_PFB_PRE_CMD_PRECHARGE (1 << 0)
  47. #define NV20_PFB_ZCOMP(i) (0x00100300 + 4*(i))
  48. # define NV20_PFB_ZCOMP_MODE_32 (4 << 24)
  49. # define NV20_PFB_ZCOMP_EN (1 << 31)
  50. # define NV25_PFB_ZCOMP_MODE_16 (1 << 20)
  51. # define NV25_PFB_ZCOMP_MODE_32 (2 << 20)
  52. #define NV10_PFB_CLOSE_PAGE2 0x0010033c
  53. #define NV04_PFB_SCRAMBLE(i) (0x00100400 + 4 * (i))
  54. #define NV40_PFB_TILE(i) (0x00100600 + (i*16))
  55. #define NV40_PFB_TILE__SIZE_0 12
  56. #define NV40_PFB_TILE__SIZE_1 15
  57. #define NV40_PFB_TLIMIT(i) (0x00100604 + (i*16))
  58. #define NV40_PFB_TSIZE(i) (0x00100608 + (i*16))
  59. #define NV40_PFB_TSTATUS(i) (0x0010060c + (i*16))
  60. #define NV40_PFB_UNK_800 0x00100800
  61. #define NV_PEXTDEV_BOOT_0 0x00101000
  62. #define NV_PEXTDEV_BOOT_0_RAMCFG 0x0000003c
  63. # define NV_PEXTDEV_BOOT_0_STRAP_FP_IFACE_12BIT (8 << 12)
  64. #define NV_PEXTDEV_BOOT_3 0x0010100c
  65. #define NV_RAMIN 0x00700000
  66. #define NV_RAMHT_HANDLE_OFFSET 0
  67. #define NV_RAMHT_CONTEXT_OFFSET 4
  68. # define NV_RAMHT_CONTEXT_VALID (1<<31)
  69. # define NV_RAMHT_CONTEXT_CHANNEL_SHIFT 24
  70. # define NV_RAMHT_CONTEXT_ENGINE_SHIFT 16
  71. # define NV_RAMHT_CONTEXT_ENGINE_SW 0
  72. # define NV_RAMHT_CONTEXT_ENGINE_GRAPHICS 1
  73. # define NV_RAMHT_CONTEXT_INSTANCE_SHIFT 0
  74. # define NV40_RAMHT_CONTEXT_CHANNEL_SHIFT 23
  75. # define NV40_RAMHT_CONTEXT_ENGINE_SHIFT 20
  76. # define NV40_RAMHT_CONTEXT_INSTANCE_SHIFT 0
  77. /* Some object classes we care about in the drm */
  78. #define NV_CLASS_DMA_FROM_MEMORY 0x00000002
  79. #define NV_CLASS_DMA_TO_MEMORY 0x00000003
  80. #define NV_CLASS_NULL 0x00000030
  81. #define NV_CLASS_DMA_IN_MEMORY 0x0000003D
  82. #define NV03_USER(i) (0x00800000+(i*NV03_USER_SIZE))
  83. #define NV03_USER__SIZE 16
  84. #define NV10_USER__SIZE 32
  85. #define NV03_USER_SIZE 0x00010000
  86. #define NV03_USER_DMA_PUT(i) (0x00800040+(i*NV03_USER_SIZE))
  87. #define NV03_USER_DMA_PUT__SIZE 16
  88. #define NV10_USER_DMA_PUT__SIZE 32
  89. #define NV03_USER_DMA_GET(i) (0x00800044+(i*NV03_USER_SIZE))
  90. #define NV03_USER_DMA_GET__SIZE 16
  91. #define NV10_USER_DMA_GET__SIZE 32
  92. #define NV03_USER_REF_CNT(i) (0x00800048+(i*NV03_USER_SIZE))
  93. #define NV03_USER_REF_CNT__SIZE 16
  94. #define NV10_USER_REF_CNT__SIZE 32
  95. #define NV40_USER(i) (0x00c00000+(i*NV40_USER_SIZE))
  96. #define NV40_USER_SIZE 0x00001000
  97. #define NV40_USER_DMA_PUT(i) (0x00c00040+(i*NV40_USER_SIZE))
  98. #define NV40_USER_DMA_PUT__SIZE 32
  99. #define NV40_USER_DMA_GET(i) (0x00c00044+(i*NV40_USER_SIZE))
  100. #define NV40_USER_DMA_GET__SIZE 32
  101. #define NV40_USER_REF_CNT(i) (0x00c00048+(i*NV40_USER_SIZE))
  102. #define NV40_USER_REF_CNT__SIZE 32
  103. #define NV50_USER(i) (0x00c00000+(i*NV50_USER_SIZE))
  104. #define NV50_USER_SIZE 0x00002000
  105. #define NV50_USER_DMA_PUT(i) (0x00c00040+(i*NV50_USER_SIZE))
  106. #define NV50_USER_DMA_PUT__SIZE 128
  107. #define NV50_USER_DMA_GET(i) (0x00c00044+(i*NV50_USER_SIZE))
  108. #define NV50_USER_DMA_GET__SIZE 128
  109. #define NV50_USER_REF_CNT(i) (0x00c00048+(i*NV50_USER_SIZE))
  110. #define NV50_USER_REF_CNT__SIZE 128
  111. #define NV03_FIFO_SIZE 0x8000UL
  112. #define NV03_PMC_BOOT_0 0x00000000
  113. #define NV03_PMC_BOOT_1 0x00000004
  114. #define NV03_PMC_INTR_0 0x00000100
  115. # define NV_PMC_INTR_0_PFIFO_PENDING (1<<8)
  116. # define NV_PMC_INTR_0_PGRAPH_PENDING (1<<12)
  117. # define NV_PMC_INTR_0_NV50_I2C_PENDING (1<<21)
  118. # define NV_PMC_INTR_0_CRTC0_PENDING (1<<24)
  119. # define NV_PMC_INTR_0_CRTC1_PENDING (1<<25)
  120. # define NV_PMC_INTR_0_NV50_DISPLAY_PENDING (1<<26)
  121. # define NV_PMC_INTR_0_CRTCn_PENDING (3<<24)
  122. #define NV03_PMC_INTR_EN_0 0x00000140
  123. # define NV_PMC_INTR_EN_0_MASTER_ENABLE (1<<0)
  124. #define NV03_PMC_ENABLE 0x00000200
  125. # define NV_PMC_ENABLE_PFIFO (1<<8)
  126. # define NV_PMC_ENABLE_PGRAPH (1<<12)
  127. /* Disabling the below bit breaks newer (G7X only?) mobile chipsets,
  128. * the card will hang early on in the X init process.
  129. */
  130. # define NV_PMC_ENABLE_UNK13 (1<<13)
  131. #define NV40_PMC_GRAPH_UNITS 0x00001540
  132. #define NV40_PMC_BACKLIGHT 0x000015f0
  133. # define NV40_PMC_BACKLIGHT_MASK 0x001f0000
  134. #define NV40_PMC_1700 0x00001700
  135. #define NV40_PMC_1704 0x00001704
  136. #define NV40_PMC_1708 0x00001708
  137. #define NV40_PMC_170C 0x0000170C
  138. /* probably PMC ? */
  139. #define NV50_PUNK_BAR0_PRAMIN 0x00001700
  140. #define NV50_PUNK_BAR_CFG_BASE 0x00001704
  141. #define NV50_PUNK_BAR_CFG_BASE_VALID (1<<30)
  142. #define NV50_PUNK_BAR1_CTXDMA 0x00001708
  143. #define NV50_PUNK_BAR1_CTXDMA_VALID (1<<31)
  144. #define NV50_PUNK_BAR3_CTXDMA 0x0000170C
  145. #define NV50_PUNK_BAR3_CTXDMA_VALID (1<<31)
  146. #define NV50_PUNK_UNK1710 0x00001710
  147. #define NV04_PBUS_PCI_NV_1 0x00001804
  148. #define NV04_PBUS_PCI_NV_19 0x0000184C
  149. #define NV04_PBUS_PCI_NV_20 0x00001850
  150. # define NV04_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED (0 << 0)
  151. # define NV04_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED (1 << 0)
  152. #define NV04_PTIMER_INTR_0 0x00009100
  153. #define NV04_PTIMER_INTR_EN_0 0x00009140
  154. #define NV04_PTIMER_NUMERATOR 0x00009200
  155. #define NV04_PTIMER_DENOMINATOR 0x00009210
  156. #define NV04_PTIMER_TIME_0 0x00009400
  157. #define NV04_PTIMER_TIME_1 0x00009410
  158. #define NV04_PTIMER_ALARM_0 0x00009420
  159. #define NV04_PGRAPH_DEBUG_0 0x00400080
  160. #define NV04_PGRAPH_DEBUG_1 0x00400084
  161. #define NV04_PGRAPH_DEBUG_2 0x00400088
  162. #define NV04_PGRAPH_DEBUG_3 0x0040008c
  163. #define NV10_PGRAPH_DEBUG_4 0x00400090
  164. #define NV03_PGRAPH_INTR 0x00400100
  165. #define NV03_PGRAPH_NSTATUS 0x00400104
  166. # define NV04_PGRAPH_NSTATUS_STATE_IN_USE (1<<11)
  167. # define NV04_PGRAPH_NSTATUS_INVALID_STATE (1<<12)
  168. # define NV04_PGRAPH_NSTATUS_BAD_ARGUMENT (1<<13)
  169. # define NV04_PGRAPH_NSTATUS_PROTECTION_FAULT (1<<14)
  170. # define NV10_PGRAPH_NSTATUS_STATE_IN_USE (1<<23)
  171. # define NV10_PGRAPH_NSTATUS_INVALID_STATE (1<<24)
  172. # define NV10_PGRAPH_NSTATUS_BAD_ARGUMENT (1<<25)
  173. # define NV10_PGRAPH_NSTATUS_PROTECTION_FAULT (1<<26)
  174. #define NV03_PGRAPH_NSOURCE 0x00400108
  175. # define NV03_PGRAPH_NSOURCE_NOTIFICATION (1<<0)
  176. # define NV03_PGRAPH_NSOURCE_DATA_ERROR (1<<1)
  177. # define NV03_PGRAPH_NSOURCE_PROTECTION_ERROR (1<<2)
  178. # define NV03_PGRAPH_NSOURCE_RANGE_EXCEPTION (1<<3)
  179. # define NV03_PGRAPH_NSOURCE_LIMIT_COLOR (1<<4)
  180. # define NV03_PGRAPH_NSOURCE_LIMIT_ZETA (1<<5)
  181. # define NV03_PGRAPH_NSOURCE_ILLEGAL_MTHD (1<<6)
  182. # define NV03_PGRAPH_NSOURCE_DMA_R_PROTECTION (1<<7)
  183. # define NV03_PGRAPH_NSOURCE_DMA_W_PROTECTION (1<<8)
  184. # define NV03_PGRAPH_NSOURCE_FORMAT_EXCEPTION (1<<9)
  185. # define NV03_PGRAPH_NSOURCE_PATCH_EXCEPTION (1<<10)
  186. # define NV03_PGRAPH_NSOURCE_STATE_INVALID (1<<11)
  187. # define NV03_PGRAPH_NSOURCE_DOUBLE_NOTIFY (1<<12)
  188. # define NV03_PGRAPH_NSOURCE_NOTIFY_IN_USE (1<<13)
  189. # define NV03_PGRAPH_NSOURCE_METHOD_CNT (1<<14)
  190. # define NV03_PGRAPH_NSOURCE_BFR_NOTIFICATION (1<<15)
  191. # define NV03_PGRAPH_NSOURCE_DMA_VTX_PROTECTION (1<<16)
  192. # define NV03_PGRAPH_NSOURCE_DMA_WIDTH_A (1<<17)
  193. # define NV03_PGRAPH_NSOURCE_DMA_WIDTH_B (1<<18)
  194. #define NV03_PGRAPH_INTR_EN 0x00400140
  195. #define NV40_PGRAPH_INTR_EN 0x0040013C
  196. # define NV_PGRAPH_INTR_NOTIFY (1<<0)
  197. # define NV_PGRAPH_INTR_MISSING_HW (1<<4)
  198. # define NV_PGRAPH_INTR_CONTEXT_SWITCH (1<<12)
  199. # define NV_PGRAPH_INTR_BUFFER_NOTIFY (1<<16)
  200. # define NV_PGRAPH_INTR_ERROR (1<<20)
  201. #define NV10_PGRAPH_CTX_CONTROL 0x00400144
  202. #define NV10_PGRAPH_CTX_USER 0x00400148
  203. #define NV10_PGRAPH_CTX_SWITCH(i) (0x0040014C + 0x4*(i))
  204. #define NV04_PGRAPH_CTX_SWITCH1 0x00400160
  205. #define NV10_PGRAPH_CTX_CACHE(i, j) (0x00400160 \
  206. + 0x4*(i) + 0x20*(j))
  207. #define NV04_PGRAPH_CTX_SWITCH2 0x00400164
  208. #define NV04_PGRAPH_CTX_SWITCH3 0x00400168
  209. #define NV04_PGRAPH_CTX_SWITCH4 0x0040016C
  210. #define NV04_PGRAPH_CTX_CONTROL 0x00400170
  211. #define NV04_PGRAPH_CTX_USER 0x00400174
  212. #define NV04_PGRAPH_CTX_CACHE1 0x00400180
  213. #define NV03_PGRAPH_CTX_CONTROL 0x00400190
  214. #define NV03_PGRAPH_CTX_USER 0x00400194
  215. #define NV04_PGRAPH_CTX_CACHE2 0x004001A0
  216. #define NV04_PGRAPH_CTX_CACHE3 0x004001C0
  217. #define NV04_PGRAPH_CTX_CACHE4 0x004001E0
  218. #define NV40_PGRAPH_CTXCTL_0304 0x00400304
  219. #define NV40_PGRAPH_CTXCTL_0304_XFER_CTX 0x00000001
  220. #define NV40_PGRAPH_CTXCTL_UCODE_STAT 0x00400308
  221. #define NV40_PGRAPH_CTXCTL_UCODE_STAT_IP_MASK 0xff000000
  222. #define NV40_PGRAPH_CTXCTL_UCODE_STAT_IP_SHIFT 24
  223. #define NV40_PGRAPH_CTXCTL_UCODE_STAT_OP_MASK 0x00ffffff
  224. #define NV40_PGRAPH_CTXCTL_0310 0x00400310
  225. #define NV40_PGRAPH_CTXCTL_0310_XFER_SAVE 0x00000020
  226. #define NV40_PGRAPH_CTXCTL_0310_XFER_LOAD 0x00000040
  227. #define NV40_PGRAPH_CTXCTL_030C 0x0040030c
  228. #define NV40_PGRAPH_CTXCTL_UCODE_INDEX 0x00400324
  229. #define NV40_PGRAPH_CTXCTL_UCODE_DATA 0x00400328
  230. #define NV40_PGRAPH_CTXCTL_CUR 0x0040032c
  231. #define NV40_PGRAPH_CTXCTL_CUR_LOADED 0x01000000
  232. #define NV40_PGRAPH_CTXCTL_CUR_INSTANCE 0x000FFFFF
  233. #define NV40_PGRAPH_CTXCTL_NEXT 0x00400330
  234. #define NV40_PGRAPH_CTXCTL_NEXT_INSTANCE 0x000fffff
  235. #define NV50_PGRAPH_CTXCTL_CUR 0x0040032c
  236. #define NV50_PGRAPH_CTXCTL_CUR_LOADED 0x80000000
  237. #define NV50_PGRAPH_CTXCTL_CUR_INSTANCE 0x00ffffff
  238. #define NV50_PGRAPH_CTXCTL_NEXT 0x00400330
  239. #define NV50_PGRAPH_CTXCTL_NEXT_INSTANCE 0x00ffffff
  240. #define NV03_PGRAPH_ABS_X_RAM 0x00400400
  241. #define NV03_PGRAPH_ABS_Y_RAM 0x00400480
  242. #define NV03_PGRAPH_X_MISC 0x00400500
  243. #define NV03_PGRAPH_Y_MISC 0x00400504
  244. #define NV04_PGRAPH_VALID1 0x00400508
  245. #define NV04_PGRAPH_SOURCE_COLOR 0x0040050C
  246. #define NV04_PGRAPH_MISC24_0 0x00400510
  247. #define NV03_PGRAPH_XY_LOGIC_MISC0 0x00400514
  248. #define NV03_PGRAPH_XY_LOGIC_MISC1 0x00400518
  249. #define NV03_PGRAPH_XY_LOGIC_MISC2 0x0040051C
  250. #define NV03_PGRAPH_XY_LOGIC_MISC3 0x00400520
  251. #define NV03_PGRAPH_CLIPX_0 0x00400524
  252. #define NV03_PGRAPH_CLIPX_1 0x00400528
  253. #define NV03_PGRAPH_CLIPY_0 0x0040052C
  254. #define NV03_PGRAPH_CLIPY_1 0x00400530
  255. #define NV03_PGRAPH_ABS_ICLIP_XMAX 0x00400534
  256. #define NV03_PGRAPH_ABS_ICLIP_YMAX 0x00400538
  257. #define NV03_PGRAPH_ABS_UCLIP_XMIN 0x0040053C
  258. #define NV03_PGRAPH_ABS_UCLIP_YMIN 0x00400540
  259. #define NV03_PGRAPH_ABS_UCLIP_XMAX 0x00400544
  260. #define NV03_PGRAPH_ABS_UCLIP_YMAX 0x00400548
  261. #define NV03_PGRAPH_ABS_UCLIPA_XMIN 0x00400560
  262. #define NV03_PGRAPH_ABS_UCLIPA_YMIN 0x00400564
  263. #define NV03_PGRAPH_ABS_UCLIPA_XMAX 0x00400568
  264. #define NV03_PGRAPH_ABS_UCLIPA_YMAX 0x0040056C
  265. #define NV04_PGRAPH_MISC24_1 0x00400570
  266. #define NV04_PGRAPH_MISC24_2 0x00400574
  267. #define NV04_PGRAPH_VALID2 0x00400578
  268. #define NV04_PGRAPH_PASSTHRU_0 0x0040057C
  269. #define NV04_PGRAPH_PASSTHRU_1 0x00400580
  270. #define NV04_PGRAPH_PASSTHRU_2 0x00400584
  271. #define NV10_PGRAPH_DIMX_TEXTURE 0x00400588
  272. #define NV10_PGRAPH_WDIMX_TEXTURE 0x0040058C
  273. #define NV04_PGRAPH_COMBINE_0_ALPHA 0x00400590
  274. #define NV04_PGRAPH_COMBINE_0_COLOR 0x00400594
  275. #define NV04_PGRAPH_COMBINE_1_ALPHA 0x00400598
  276. #define NV04_PGRAPH_COMBINE_1_COLOR 0x0040059C
  277. #define NV04_PGRAPH_FORMAT_0 0x004005A8
  278. #define NV04_PGRAPH_FORMAT_1 0x004005AC
  279. #define NV04_PGRAPH_FILTER_0 0x004005B0
  280. #define NV04_PGRAPH_FILTER_1 0x004005B4
  281. #define NV03_PGRAPH_MONO_COLOR0 0x00400600
  282. #define NV04_PGRAPH_ROP3 0x00400604
  283. #define NV04_PGRAPH_BETA_AND 0x00400608
  284. #define NV04_PGRAPH_BETA_PREMULT 0x0040060C
  285. #define NV04_PGRAPH_LIMIT_VIOL_PIX 0x00400610
  286. #define NV04_PGRAPH_FORMATS 0x00400618
  287. #define NV10_PGRAPH_DEBUG_2 0x00400620
  288. #define NV04_PGRAPH_BOFFSET0 0x00400640
  289. #define NV04_PGRAPH_BOFFSET1 0x00400644
  290. #define NV04_PGRAPH_BOFFSET2 0x00400648
  291. #define NV04_PGRAPH_BOFFSET3 0x0040064C
  292. #define NV04_PGRAPH_BOFFSET4 0x00400650
  293. #define NV04_PGRAPH_BOFFSET5 0x00400654
  294. #define NV04_PGRAPH_BBASE0 0x00400658
  295. #define NV04_PGRAPH_BBASE1 0x0040065C
  296. #define NV04_PGRAPH_BBASE2 0x00400660
  297. #define NV04_PGRAPH_BBASE3 0x00400664
  298. #define NV04_PGRAPH_BBASE4 0x00400668
  299. #define NV04_PGRAPH_BBASE5 0x0040066C
  300. #define NV04_PGRAPH_BPITCH0 0x00400670
  301. #define NV04_PGRAPH_BPITCH1 0x00400674
  302. #define NV04_PGRAPH_BPITCH2 0x00400678
  303. #define NV04_PGRAPH_BPITCH3 0x0040067C
  304. #define NV04_PGRAPH_BPITCH4 0x00400680
  305. #define NV04_PGRAPH_BLIMIT0 0x00400684
  306. #define NV04_PGRAPH_BLIMIT1 0x00400688
  307. #define NV04_PGRAPH_BLIMIT2 0x0040068C
  308. #define NV04_PGRAPH_BLIMIT3 0x00400690
  309. #define NV04_PGRAPH_BLIMIT4 0x00400694
  310. #define NV04_PGRAPH_BLIMIT5 0x00400698
  311. #define NV04_PGRAPH_BSWIZZLE2 0x0040069C
  312. #define NV04_PGRAPH_BSWIZZLE5 0x004006A0
  313. #define NV03_PGRAPH_STATUS 0x004006B0
  314. #define NV04_PGRAPH_STATUS 0x00400700
  315. # define NV40_PGRAPH_STATUS_SYNC_STALL 0x00004000
  316. #define NV04_PGRAPH_TRAPPED_ADDR 0x00400704
  317. #define NV04_PGRAPH_TRAPPED_DATA 0x00400708
  318. #define NV04_PGRAPH_SURFACE 0x0040070C
  319. #define NV10_PGRAPH_TRAPPED_DATA_HIGH 0x0040070C
  320. #define NV04_PGRAPH_STATE 0x00400710
  321. #define NV10_PGRAPH_SURFACE 0x00400710
  322. #define NV04_PGRAPH_NOTIFY 0x00400714
  323. #define NV10_PGRAPH_STATE 0x00400714
  324. #define NV10_PGRAPH_NOTIFY 0x00400718
  325. #define NV04_PGRAPH_FIFO 0x00400720
  326. #define NV04_PGRAPH_BPIXEL 0x00400724
  327. #define NV10_PGRAPH_RDI_INDEX 0x00400750
  328. #define NV04_PGRAPH_FFINTFC_ST2 0x00400754
  329. #define NV10_PGRAPH_RDI_DATA 0x00400754
  330. #define NV04_PGRAPH_DMA_PITCH 0x00400760
  331. #define NV10_PGRAPH_FFINTFC_FIFO_PTR 0x00400760
  332. #define NV04_PGRAPH_DVD_COLORFMT 0x00400764
  333. #define NV10_PGRAPH_FFINTFC_ST2 0x00400764
  334. #define NV04_PGRAPH_SCALED_FORMAT 0x00400768
  335. #define NV10_PGRAPH_FFINTFC_ST2_DL 0x00400768
  336. #define NV10_PGRAPH_FFINTFC_ST2_DH 0x0040076c
  337. #define NV10_PGRAPH_DMA_PITCH 0x00400770
  338. #define NV10_PGRAPH_DVD_COLORFMT 0x00400774
  339. #define NV10_PGRAPH_SCALED_FORMAT 0x00400778
  340. #define NV20_PGRAPH_CHANNEL_CTX_TABLE 0x00400780
  341. #define NV20_PGRAPH_CHANNEL_CTX_POINTER 0x00400784
  342. #define NV20_PGRAPH_CHANNEL_CTX_XFER 0x00400788
  343. #define NV20_PGRAPH_CHANNEL_CTX_XFER_LOAD 0x00000001
  344. #define NV20_PGRAPH_CHANNEL_CTX_XFER_SAVE 0x00000002
  345. #define NV04_PGRAPH_PATT_COLOR0 0x00400800
  346. #define NV04_PGRAPH_PATT_COLOR1 0x00400804
  347. #define NV04_PGRAPH_PATTERN 0x00400808
  348. #define NV04_PGRAPH_PATTERN_SHAPE 0x00400810
  349. #define NV04_PGRAPH_CHROMA 0x00400814
  350. #define NV04_PGRAPH_CONTROL0 0x00400818
  351. #define NV04_PGRAPH_CONTROL1 0x0040081C
  352. #define NV04_PGRAPH_CONTROL2 0x00400820
  353. #define NV04_PGRAPH_BLEND 0x00400824
  354. #define NV04_PGRAPH_STORED_FMT 0x00400830
  355. #define NV04_PGRAPH_PATT_COLORRAM 0x00400900
  356. #define NV20_PGRAPH_TILE(i) (0x00400900 + (i*16))
  357. #define NV20_PGRAPH_TLIMIT(i) (0x00400904 + (i*16))
  358. #define NV20_PGRAPH_TSIZE(i) (0x00400908 + (i*16))
  359. #define NV20_PGRAPH_TSTATUS(i) (0x0040090C + (i*16))
  360. #define NV20_PGRAPH_ZCOMP(i) (0x00400980 + 4*(i))
  361. #define NV10_PGRAPH_TILE(i) (0x00400B00 + (i*16))
  362. #define NV10_PGRAPH_TLIMIT(i) (0x00400B04 + (i*16))
  363. #define NV10_PGRAPH_TSIZE(i) (0x00400B08 + (i*16))
  364. #define NV10_PGRAPH_TSTATUS(i) (0x00400B0C + (i*16))
  365. #define NV04_PGRAPH_U_RAM 0x00400D00
  366. #define NV47_PGRAPH_TILE(i) (0x00400D00 + (i*16))
  367. #define NV47_PGRAPH_TLIMIT(i) (0x00400D04 + (i*16))
  368. #define NV47_PGRAPH_TSIZE(i) (0x00400D08 + (i*16))
  369. #define NV47_PGRAPH_TSTATUS(i) (0x00400D0C + (i*16))
  370. #define NV04_PGRAPH_V_RAM 0x00400D40
  371. #define NV04_PGRAPH_W_RAM 0x00400D80
  372. #define NV10_PGRAPH_COMBINER0_IN_ALPHA 0x00400E40
  373. #define NV10_PGRAPH_COMBINER1_IN_ALPHA 0x00400E44
  374. #define NV10_PGRAPH_COMBINER0_IN_RGB 0x00400E48
  375. #define NV10_PGRAPH_COMBINER1_IN_RGB 0x00400E4C
  376. #define NV10_PGRAPH_COMBINER_COLOR0 0x00400E50
  377. #define NV10_PGRAPH_COMBINER_COLOR1 0x00400E54
  378. #define NV10_PGRAPH_COMBINER0_OUT_ALPHA 0x00400E58
  379. #define NV10_PGRAPH_COMBINER1_OUT_ALPHA 0x00400E5C
  380. #define NV10_PGRAPH_COMBINER0_OUT_RGB 0x00400E60
  381. #define NV10_PGRAPH_COMBINER1_OUT_RGB 0x00400E64
  382. #define NV10_PGRAPH_COMBINER_FINAL0 0x00400E68
  383. #define NV10_PGRAPH_COMBINER_FINAL1 0x00400E6C
  384. #define NV10_PGRAPH_WINDOWCLIP_HORIZONTAL 0x00400F00
  385. #define NV10_PGRAPH_WINDOWCLIP_VERTICAL 0x00400F20
  386. #define NV10_PGRAPH_XFMODE0 0x00400F40
  387. #define NV10_PGRAPH_XFMODE1 0x00400F44
  388. #define NV10_PGRAPH_GLOBALSTATE0 0x00400F48
  389. #define NV10_PGRAPH_GLOBALSTATE1 0x00400F4C
  390. #define NV10_PGRAPH_PIPE_ADDRESS 0x00400F50
  391. #define NV10_PGRAPH_PIPE_DATA 0x00400F54
  392. #define NV04_PGRAPH_DMA_START_0 0x00401000
  393. #define NV04_PGRAPH_DMA_START_1 0x00401004
  394. #define NV04_PGRAPH_DMA_LENGTH 0x00401008
  395. #define NV04_PGRAPH_DMA_MISC 0x0040100C
  396. #define NV04_PGRAPH_DMA_DATA_0 0x00401020
  397. #define NV04_PGRAPH_DMA_DATA_1 0x00401024
  398. #define NV04_PGRAPH_DMA_RM 0x00401030
  399. #define NV04_PGRAPH_DMA_A_XLATE_INST 0x00401040
  400. #define NV04_PGRAPH_DMA_A_CONTROL 0x00401044
  401. #define NV04_PGRAPH_DMA_A_LIMIT 0x00401048
  402. #define NV04_PGRAPH_DMA_A_TLB_PTE 0x0040104C
  403. #define NV04_PGRAPH_DMA_A_TLB_TAG 0x00401050
  404. #define NV04_PGRAPH_DMA_A_ADJ_OFFSET 0x00401054
  405. #define NV04_PGRAPH_DMA_A_OFFSET 0x00401058
  406. #define NV04_PGRAPH_DMA_A_SIZE 0x0040105C
  407. #define NV04_PGRAPH_DMA_A_Y_SIZE 0x00401060
  408. #define NV04_PGRAPH_DMA_B_XLATE_INST 0x00401080
  409. #define NV04_PGRAPH_DMA_B_CONTROL 0x00401084
  410. #define NV04_PGRAPH_DMA_B_LIMIT 0x00401088
  411. #define NV04_PGRAPH_DMA_B_TLB_PTE 0x0040108C
  412. #define NV04_PGRAPH_DMA_B_TLB_TAG 0x00401090
  413. #define NV04_PGRAPH_DMA_B_ADJ_OFFSET 0x00401094
  414. #define NV04_PGRAPH_DMA_B_OFFSET 0x00401098
  415. #define NV04_PGRAPH_DMA_B_SIZE 0x0040109C
  416. #define NV04_PGRAPH_DMA_B_Y_SIZE 0x004010A0
  417. #define NV40_PGRAPH_TILE1(i) (0x00406900 + (i*16))
  418. #define NV40_PGRAPH_TLIMIT1(i) (0x00406904 + (i*16))
  419. #define NV40_PGRAPH_TSIZE1(i) (0x00406908 + (i*16))
  420. #define NV40_PGRAPH_TSTATUS1(i) (0x0040690C + (i*16))
  421. /* It's a guess that this works on NV03. Confirmed on NV04, though */
  422. #define NV04_PFIFO_DELAY_0 0x00002040
  423. #define NV04_PFIFO_DMA_TIMESLICE 0x00002044
  424. #define NV04_PFIFO_NEXT_CHANNEL 0x00002050
  425. #define NV03_PFIFO_INTR_0 0x00002100
  426. #define NV03_PFIFO_INTR_EN_0 0x00002140
  427. # define NV_PFIFO_INTR_CACHE_ERROR (1<<0)
  428. # define NV_PFIFO_INTR_RUNOUT (1<<4)
  429. # define NV_PFIFO_INTR_RUNOUT_OVERFLOW (1<<8)
  430. # define NV_PFIFO_INTR_DMA_PUSHER (1<<12)
  431. # define NV_PFIFO_INTR_DMA_PT (1<<16)
  432. # define NV_PFIFO_INTR_SEMAPHORE (1<<20)
  433. # define NV_PFIFO_INTR_ACQUIRE_TIMEOUT (1<<24)
  434. #define NV03_PFIFO_RAMHT 0x00002210
  435. #define NV03_PFIFO_RAMFC 0x00002214
  436. #define NV03_PFIFO_RAMRO 0x00002218
  437. #define NV40_PFIFO_RAMFC 0x00002220
  438. #define NV03_PFIFO_CACHES 0x00002500
  439. #define NV04_PFIFO_MODE 0x00002504
  440. #define NV04_PFIFO_DMA 0x00002508
  441. #define NV04_PFIFO_SIZE 0x0000250c
  442. #define NV50_PFIFO_CTX_TABLE(c) (0x2600+(c)*4)
  443. #define NV50_PFIFO_CTX_TABLE__SIZE 128
  444. #define NV50_PFIFO_CTX_TABLE_CHANNEL_ENABLED (1<<31)
  445. #define NV50_PFIFO_CTX_TABLE_UNK30_BAD (1<<30)
  446. #define NV50_PFIFO_CTX_TABLE_INSTANCE_MASK_G80 0x0FFFFFFF
  447. #define NV50_PFIFO_CTX_TABLE_INSTANCE_MASK_G84 0x00FFFFFF
  448. #define NV03_PFIFO_CACHE0_PUSH0 0x00003000
  449. #define NV03_PFIFO_CACHE0_PULL0 0x00003040
  450. #define NV04_PFIFO_CACHE0_PULL0 0x00003050
  451. #define NV04_PFIFO_CACHE0_PULL1 0x00003054
  452. #define NV03_PFIFO_CACHE1_PUSH0 0x00003200
  453. #define NV03_PFIFO_CACHE1_PUSH1 0x00003204
  454. #define NV03_PFIFO_CACHE1_PUSH1_DMA (1<<8)
  455. #define NV40_PFIFO_CACHE1_PUSH1_DMA (1<<16)
  456. #define NV03_PFIFO_CACHE1_PUSH1_CHID_MASK 0x0000000f
  457. #define NV10_PFIFO_CACHE1_PUSH1_CHID_MASK 0x0000001f
  458. #define NV50_PFIFO_CACHE1_PUSH1_CHID_MASK 0x0000007f
  459. #define NV03_PFIFO_CACHE1_PUT 0x00003210
  460. #define NV04_PFIFO_CACHE1_DMA_PUSH 0x00003220
  461. #define NV04_PFIFO_CACHE1_DMA_FETCH 0x00003224
  462. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_8_BYTES 0x00000000
  463. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_16_BYTES 0x00000008
  464. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_24_BYTES 0x00000010
  465. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_32_BYTES 0x00000018
  466. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_40_BYTES 0x00000020
  467. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_48_BYTES 0x00000028
  468. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_56_BYTES 0x00000030
  469. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_64_BYTES 0x00000038
  470. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_72_BYTES 0x00000040
  471. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_80_BYTES 0x00000048
  472. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_88_BYTES 0x00000050
  473. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_96_BYTES 0x00000058
  474. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_104_BYTES 0x00000060
  475. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_112_BYTES 0x00000068
  476. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_120_BYTES 0x00000070
  477. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES 0x00000078
  478. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_136_BYTES 0x00000080
  479. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_144_BYTES 0x00000088
  480. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_152_BYTES 0x00000090
  481. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_160_BYTES 0x00000098
  482. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_168_BYTES 0x000000A0
  483. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_176_BYTES 0x000000A8
  484. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_184_BYTES 0x000000B0
  485. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_192_BYTES 0x000000B8
  486. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_200_BYTES 0x000000C0
  487. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_208_BYTES 0x000000C8
  488. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_216_BYTES 0x000000D0
  489. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_224_BYTES 0x000000D8
  490. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_232_BYTES 0x000000E0
  491. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_240_BYTES 0x000000E8
  492. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_248_BYTES 0x000000F0
  493. # define NV_PFIFO_CACHE1_DMA_FETCH_TRIG_256_BYTES 0x000000F8
  494. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE 0x0000E000
  495. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE_32_BYTES 0x00000000
  496. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE_64_BYTES 0x00002000
  497. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE_96_BYTES 0x00004000
  498. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE_128_BYTES 0x00006000
  499. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE_160_BYTES 0x00008000
  500. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE_192_BYTES 0x0000A000
  501. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE_224_BYTES 0x0000C000
  502. # define NV_PFIFO_CACHE1_DMA_FETCH_SIZE_256_BYTES 0x0000E000
  503. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS 0x001F0000
  504. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_0 0x00000000
  505. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_1 0x00010000
  506. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_2 0x00020000
  507. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_3 0x00030000
  508. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_4 0x00040000
  509. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_5 0x00050000
  510. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_6 0x00060000
  511. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_7 0x00070000
  512. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_8 0x00080000
  513. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_9 0x00090000
  514. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_10 0x000A0000
  515. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_11 0x000B0000
  516. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_12 0x000C0000
  517. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_13 0x000D0000
  518. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_14 0x000E0000
  519. # define NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_15 0x000F0000
  520. # define NV_PFIFO_CACHE1_ENDIAN 0x80000000
  521. # define NV_PFIFO_CACHE1_LITTLE_ENDIAN 0x7FFFFFFF
  522. # define NV_PFIFO_CACHE1_BIG_ENDIAN 0x80000000
  523. #define NV04_PFIFO_CACHE1_DMA_STATE 0x00003228
  524. #define NV04_PFIFO_CACHE1_DMA_INSTANCE 0x0000322c
  525. #define NV04_PFIFO_CACHE1_DMA_CTL 0x00003230
  526. #define NV04_PFIFO_CACHE1_DMA_PUT 0x00003240
  527. #define NV04_PFIFO_CACHE1_DMA_GET 0x00003244
  528. #define NV10_PFIFO_CACHE1_REF_CNT 0x00003248
  529. #define NV10_PFIFO_CACHE1_DMA_SUBROUTINE 0x0000324C
  530. #define NV03_PFIFO_CACHE1_PULL0 0x00003240
  531. #define NV04_PFIFO_CACHE1_PULL0 0x00003250
  532. # define NV04_PFIFO_CACHE1_PULL0_HASH_FAILED 0x00000010
  533. # define NV04_PFIFO_CACHE1_PULL0_HASH_BUSY 0x00001000
  534. #define NV03_PFIFO_CACHE1_PULL1 0x00003250
  535. #define NV04_PFIFO_CACHE1_PULL1 0x00003254
  536. #define NV04_PFIFO_CACHE1_HASH 0x00003258
  537. #define NV10_PFIFO_CACHE1_ACQUIRE_TIMEOUT 0x00003260
  538. #define NV10_PFIFO_CACHE1_ACQUIRE_TIMESTAMP 0x00003264
  539. #define NV10_PFIFO_CACHE1_ACQUIRE_VALUE 0x00003268
  540. #define NV10_PFIFO_CACHE1_SEMAPHORE 0x0000326C
  541. #define NV03_PFIFO_CACHE1_GET 0x00003270
  542. #define NV04_PFIFO_CACHE1_ENGINE 0x00003280
  543. #define NV04_PFIFO_CACHE1_DMA_DCOUNT 0x000032A0
  544. #define NV40_PFIFO_GRCTX_INSTANCE 0x000032E0
  545. #define NV40_PFIFO_UNK32E4 0x000032E4
  546. #define NV04_PFIFO_CACHE1_METHOD(i) (0x00003800+(i*8))
  547. #define NV04_PFIFO_CACHE1_DATA(i) (0x00003804+(i*8))
  548. #define NV40_PFIFO_CACHE1_METHOD(i) (0x00090000+(i*8))
  549. #define NV40_PFIFO_CACHE1_DATA(i) (0x00090004+(i*8))
  550. #define NV_CRTC0_INTSTAT 0x00600100
  551. #define NV_CRTC0_INTEN 0x00600140
  552. #define NV_CRTC1_INTSTAT 0x00602100
  553. #define NV_CRTC1_INTEN 0x00602140
  554. # define NV_CRTC_INTR_VBLANK (1<<0)
  555. #define NV04_PRAMIN 0x00700000
  556. /* Fifo commands. These are not regs, neither masks */
  557. #define NV03_FIFO_CMD_JUMP 0x20000000
  558. #define NV03_FIFO_CMD_JUMP_OFFSET_MASK 0x1ffffffc
  559. #define NV03_FIFO_CMD_REWIND (NV03_FIFO_CMD_JUMP | (0 & NV03_FIFO_CMD_JUMP_OFFSET_MASK))
  560. /* This is a partial import from rules-ng, a few things may be duplicated.
  561. * Eventually we should completely import everything from rules-ng.
  562. * For the moment check rules-ng for docs.
  563. */
  564. #define NV50_PMC 0x00000000
  565. #define NV50_PMC__LEN 0x1
  566. #define NV50_PMC__ESIZE 0x2000
  567. # define NV50_PMC_BOOT_0 0x00000000
  568. # define NV50_PMC_BOOT_0_REVISION 0x000000ff
  569. # define NV50_PMC_BOOT_0_REVISION__SHIFT 0
  570. # define NV50_PMC_BOOT_0_ARCH 0x0ff00000
  571. # define NV50_PMC_BOOT_0_ARCH__SHIFT 20
  572. # define NV50_PMC_INTR_0 0x00000100
  573. # define NV50_PMC_INTR_0_PFIFO (1<<8)
  574. # define NV50_PMC_INTR_0_PGRAPH (1<<12)
  575. # define NV50_PMC_INTR_0_PTIMER (1<<20)
  576. # define NV50_PMC_INTR_0_HOTPLUG (1<<21)
  577. # define NV50_PMC_INTR_0_DISPLAY (1<<26)
  578. # define NV50_PMC_INTR_EN_0 0x00000140
  579. # define NV50_PMC_INTR_EN_0_MASTER (1<<0)
  580. # define NV50_PMC_INTR_EN_0_MASTER_DISABLED (0<<0)
  581. # define NV50_PMC_INTR_EN_0_MASTER_ENABLED (1<<0)
  582. # define NV50_PMC_ENABLE 0x00000200
  583. # define NV50_PMC_ENABLE_PFIFO (1<<8)
  584. # define NV50_PMC_ENABLE_PGRAPH (1<<12)
  585. #define NV50_PCONNECTOR 0x0000e000
  586. #define NV50_PCONNECTOR__LEN 0x1
  587. #define NV50_PCONNECTOR__ESIZE 0x1000
  588. # define NV50_PCONNECTOR_HOTPLUG_INTR 0x0000e050
  589. # define NV50_PCONNECTOR_HOTPLUG_INTR_PLUG_I2C0 (1<<0)
  590. # define NV50_PCONNECTOR_HOTPLUG_INTR_PLUG_I2C1 (1<<1)
  591. # define NV50_PCONNECTOR_HOTPLUG_INTR_PLUG_I2C2 (1<<2)
  592. # define NV50_PCONNECTOR_HOTPLUG_INTR_PLUG_I2C3 (1<<3)
  593. # define NV50_PCONNECTOR_HOTPLUG_INTR_UNPLUG_I2C0 (1<<16)
  594. # define NV50_PCONNECTOR_HOTPLUG_INTR_UNPLUG_I2C1 (1<<17)
  595. # define NV50_PCONNECTOR_HOTPLUG_INTR_UNPLUG_I2C2 (1<<18)
  596. # define NV50_PCONNECTOR_HOTPLUG_INTR_UNPLUG_I2C3 (1<<19)
  597. # define NV50_PCONNECTOR_HOTPLUG_CTRL 0x0000e054
  598. # define NV50_PCONNECTOR_HOTPLUG_CTRL_PLUG_I2C0 (1<<0)
  599. # define NV50_PCONNECTOR_HOTPLUG_CTRL_PLUG_I2C1 (1<<1)
  600. # define NV50_PCONNECTOR_HOTPLUG_CTRL_PLUG_I2C2 (1<<2)
  601. # define NV50_PCONNECTOR_HOTPLUG_CTRL_PLUG_I2C3 (1<<3)
  602. # define NV50_PCONNECTOR_HOTPLUG_CTRL_UNPLUG_I2C0 (1<<16)
  603. # define NV50_PCONNECTOR_HOTPLUG_CTRL_UNPLUG_I2C1 (1<<17)
  604. # define NV50_PCONNECTOR_HOTPLUG_CTRL_UNPLUG_I2C2 (1<<18)
  605. # define NV50_PCONNECTOR_HOTPLUG_CTRL_UNPLUG_I2C3 (1<<19)
  606. # define NV50_PCONNECTOR_HOTPLUG_STATE 0x0000e104
  607. # define NV50_PCONNECTOR_HOTPLUG_STATE_PIN_CONNECTED_I2C0 (1<<2)
  608. # define NV50_PCONNECTOR_HOTPLUG_STATE_PIN_CONNECTED_I2C1 (1<<6)
  609. # define NV50_PCONNECTOR_HOTPLUG_STATE_PIN_CONNECTED_I2C2 (1<<10)
  610. # define NV50_PCONNECTOR_HOTPLUG_STATE_PIN_CONNECTED_I2C3 (1<<14)
  611. # define NV50_PCONNECTOR_I2C_PORT_0 0x0000e138
  612. # define NV50_PCONNECTOR_I2C_PORT_1 0x0000e150
  613. # define NV50_PCONNECTOR_I2C_PORT_2 0x0000e168
  614. # define NV50_PCONNECTOR_I2C_PORT_3 0x0000e180
  615. # define NV50_PCONNECTOR_I2C_PORT_4 0x0000e240
  616. # define NV50_PCONNECTOR_I2C_PORT_5 0x0000e258
  617. #define NV50_AUXCH_DATA_OUT(i, n) ((n) * 4 + (i) * 0x50 + 0x0000e4c0)
  618. #define NV50_AUXCH_DATA_OUT__SIZE 4
  619. #define NV50_AUXCH_DATA_IN(i, n) ((n) * 4 + (i) * 0x50 + 0x0000e4d0)
  620. #define NV50_AUXCH_DATA_IN__SIZE 4
  621. #define NV50_AUXCH_ADDR(i) ((i) * 0x50 + 0x0000e4e0)
  622. #define NV50_AUXCH_CTRL(i) ((i) * 0x50 + 0x0000e4e4)
  623. #define NV50_AUXCH_CTRL_LINKSTAT 0x01000000
  624. #define NV50_AUXCH_CTRL_LINKSTAT_NOT_READY 0x00000000
  625. #define NV50_AUXCH_CTRL_LINKSTAT_READY 0x01000000
  626. #define NV50_AUXCH_CTRL_LINKEN 0x00100000
  627. #define NV50_AUXCH_CTRL_LINKEN_DISABLED 0x00000000
  628. #define NV50_AUXCH_CTRL_LINKEN_ENABLED 0x00100000
  629. #define NV50_AUXCH_CTRL_EXEC 0x00010000
  630. #define NV50_AUXCH_CTRL_EXEC_COMPLETE 0x00000000
  631. #define NV50_AUXCH_CTRL_EXEC_IN_PROCESS 0x00010000
  632. #define NV50_AUXCH_CTRL_CMD 0x0000f000
  633. #define NV50_AUXCH_CTRL_CMD_SHIFT 12
  634. #define NV50_AUXCH_CTRL_LEN 0x0000000f
  635. #define NV50_AUXCH_CTRL_LEN_SHIFT 0
  636. #define NV50_AUXCH_STAT(i) ((i) * 0x50 + 0x0000e4e8)
  637. #define NV50_AUXCH_STAT_STATE 0x10000000
  638. #define NV50_AUXCH_STAT_STATE_NOT_READY 0x00000000
  639. #define NV50_AUXCH_STAT_STATE_READY 0x10000000
  640. #define NV50_AUXCH_STAT_REPLY 0x000f0000
  641. #define NV50_AUXCH_STAT_REPLY_AUX 0x00030000
  642. #define NV50_AUXCH_STAT_REPLY_AUX_ACK 0x00000000
  643. #define NV50_AUXCH_STAT_REPLY_AUX_NACK 0x00010000
  644. #define NV50_AUXCH_STAT_REPLY_AUX_DEFER 0x00020000
  645. #define NV50_AUXCH_STAT_REPLY_I2C 0x000c0000
  646. #define NV50_AUXCH_STAT_REPLY_I2C_ACK 0x00000000
  647. #define NV50_AUXCH_STAT_REPLY_I2C_NACK 0x00040000
  648. #define NV50_AUXCH_STAT_REPLY_I2C_DEFER 0x00080000
  649. #define NV50_AUXCH_STAT_COUNT 0x0000001f
  650. #define NV50_PBUS 0x00088000
  651. #define NV50_PBUS__LEN 0x1
  652. #define NV50_PBUS__ESIZE 0x1000
  653. # define NV50_PBUS_PCI_ID 0x00088000
  654. # define NV50_PBUS_PCI_ID_VENDOR_ID 0x0000ffff
  655. # define NV50_PBUS_PCI_ID_VENDOR_ID__SHIFT 0
  656. # define NV50_PBUS_PCI_ID_DEVICE_ID 0xffff0000
  657. # define NV50_PBUS_PCI_ID_DEVICE_ID__SHIFT 16
  658. #define NV50_PFB 0x00100000
  659. #define NV50_PFB__LEN 0x1
  660. #define NV50_PFB__ESIZE 0x1000
  661. #define NV50_PEXTDEV 0x00101000
  662. #define NV50_PEXTDEV__LEN 0x1
  663. #define NV50_PEXTDEV__ESIZE 0x1000
  664. #define NV50_PROM 0x00300000
  665. #define NV50_PROM__LEN 0x1
  666. #define NV50_PROM__ESIZE 0x10000
  667. #define NV50_PGRAPH 0x00400000
  668. #define NV50_PGRAPH__LEN 0x1
  669. #define NV50_PGRAPH__ESIZE 0x10000
  670. #define NV50_PDISPLAY 0x00610000
  671. #define NV50_PDISPLAY_OBJECTS 0x00610010
  672. #define NV50_PDISPLAY_INTR_0 0x00610020
  673. #define NV50_PDISPLAY_INTR_1 0x00610024
  674. #define NV50_PDISPLAY_INTR_1_VBLANK_CRTC 0x0000000c
  675. #define NV50_PDISPLAY_INTR_1_VBLANK_CRTC_SHIFT 2
  676. #define NV50_PDISPLAY_INTR_1_VBLANK_CRTC_(n) (1 << ((n) + 2))
  677. #define NV50_PDISPLAY_INTR_1_VBLANK_CRTC_0 0x00000004
  678. #define NV50_PDISPLAY_INTR_1_VBLANK_CRTC_1 0x00000008
  679. #define NV50_PDISPLAY_INTR_1_CLK_UNK10 0x00000010
  680. #define NV50_PDISPLAY_INTR_1_CLK_UNK20 0x00000020
  681. #define NV50_PDISPLAY_INTR_1_CLK_UNK40 0x00000040
  682. #define NV50_PDISPLAY_INTR_EN_0 0x00610028
  683. #define NV50_PDISPLAY_INTR_EN_1 0x0061002c
  684. #define NV50_PDISPLAY_INTR_EN_1_VBLANK_CRTC 0x0000000c
  685. #define NV50_PDISPLAY_INTR_EN_1_VBLANK_CRTC_(n) (1 << ((n) + 2))
  686. #define NV50_PDISPLAY_INTR_EN_1_VBLANK_CRTC_0 0x00000004
  687. #define NV50_PDISPLAY_INTR_EN_1_VBLANK_CRTC_1 0x00000008
  688. #define NV50_PDISPLAY_INTR_EN_1_CLK_UNK10 0x00000010
  689. #define NV50_PDISPLAY_INTR_EN_1_CLK_UNK20 0x00000020
  690. #define NV50_PDISPLAY_INTR_EN_1_CLK_UNK40 0x00000040
  691. #define NV50_PDISPLAY_UNK30_CTRL 0x00610030
  692. #define NV50_PDISPLAY_UNK30_CTRL_UPDATE_VCLK0 0x00000200
  693. #define NV50_PDISPLAY_UNK30_CTRL_UPDATE_VCLK1 0x00000400
  694. #define NV50_PDISPLAY_UNK30_CTRL_PENDING 0x80000000
  695. #define NV50_PDISPLAY_TRAPPED_ADDR(i) ((i) * 0x08 + 0x00610080)
  696. #define NV50_PDISPLAY_TRAPPED_DATA(i) ((i) * 0x08 + 0x00610084)
  697. #define NV50_PDISPLAY_EVO_CTRL(i) ((i) * 0x10 + 0x00610200)
  698. #define NV50_PDISPLAY_EVO_CTRL_DMA 0x00000010
  699. #define NV50_PDISPLAY_EVO_CTRL_DMA_DISABLED 0x00000000
  700. #define NV50_PDISPLAY_EVO_CTRL_DMA_ENABLED 0x00000010
  701. #define NV50_PDISPLAY_EVO_DMA_CB(i) ((i) * 0x10 + 0x00610204)
  702. #define NV50_PDISPLAY_EVO_DMA_CB_LOCATION 0x00000002
  703. #define NV50_PDISPLAY_EVO_DMA_CB_LOCATION_VRAM 0x00000000
  704. #define NV50_PDISPLAY_EVO_DMA_CB_LOCATION_SYSTEM 0x00000002
  705. #define NV50_PDISPLAY_EVO_DMA_CB_VALID 0x00000001
  706. #define NV50_PDISPLAY_EVO_UNK2(i) ((i) * 0x10 + 0x00610208)
  707. #define NV50_PDISPLAY_EVO_HASH_TAG(i) ((i) * 0x10 + 0x0061020c)
  708. #define NV50_PDISPLAY_CURSOR 0x00610270
  709. #define NV50_PDISPLAY_CURSOR_CURSOR_CTRL2(i) ((i) * 0x10 + 0x00610270)
  710. #define NV50_PDISPLAY_CURSOR_CURSOR_CTRL2_ON 0x00000001
  711. #define NV50_PDISPLAY_CURSOR_CURSOR_CTRL2_STATUS 0x00030000
  712. #define NV50_PDISPLAY_CURSOR_CURSOR_CTRL2_STATUS_ACTIVE 0x00010000
  713. #define NV50_PDISPLAY_PIO_CTRL 0x00610300
  714. #define NV50_PDISPLAY_PIO_CTRL_PENDING 0x80000000
  715. #define NV50_PDISPLAY_PIO_CTRL_MTHD 0x00001ffc
  716. #define NV50_PDISPLAY_PIO_CTRL_ENABLED 0x00000001
  717. #define NV50_PDISPLAY_PIO_DATA 0x00610304
  718. #define NV50_PDISPLAY_CRTC_P(i, r) ((i) * 0x540 + NV50_PDISPLAY_CRTC_##r)
  719. #define NV50_PDISPLAY_CRTC_C(i, r) (4 + (i) * 0x540 + NV50_PDISPLAY_CRTC_##r)
  720. #define NV50_PDISPLAY_CRTC_UNK_0A18 /* mthd 0x0900 */ 0x00610a18
  721. #define NV50_PDISPLAY_CRTC_CLUT_MODE 0x00610a24
  722. #define NV50_PDISPLAY_CRTC_INTERLACE 0x00610a48
  723. #define NV50_PDISPLAY_CRTC_SCALE_CTRL 0x00610a50
  724. #define NV50_PDISPLAY_CRTC_CURSOR_CTRL 0x00610a58
  725. #define NV50_PDISPLAY_CRTC_UNK0A78 /* mthd 0x0904 */ 0x00610a78
  726. #define NV50_PDISPLAY_CRTC_UNK0AB8 0x00610ab8
  727. #define NV50_PDISPLAY_CRTC_DEPTH 0x00610ac8
  728. #define NV50_PDISPLAY_CRTC_CLOCK 0x00610ad0
  729. #define NV50_PDISPLAY_CRTC_COLOR_CTRL 0x00610ae0
  730. #define NV50_PDISPLAY_CRTC_SYNC_START_TO_BLANK_END 0x00610ae8
  731. #define NV50_PDISPLAY_CRTC_MODE_UNK1 0x00610af0
  732. #define NV50_PDISPLAY_CRTC_DISPLAY_TOTAL 0x00610af8
  733. #define NV50_PDISPLAY_CRTC_SYNC_DURATION 0x00610b00
  734. #define NV50_PDISPLAY_CRTC_MODE_UNK2 0x00610b08
  735. #define NV50_PDISPLAY_CRTC_UNK_0B10 /* mthd 0x0828 */ 0x00610b10
  736. #define NV50_PDISPLAY_CRTC_FB_SIZE 0x00610b18
  737. #define NV50_PDISPLAY_CRTC_FB_PITCH 0x00610b20
  738. #define NV50_PDISPLAY_CRTC_FB_PITCH_LINEAR 0x00100000
  739. #define NV50_PDISPLAY_CRTC_FB_POS 0x00610b28
  740. #define NV50_PDISPLAY_CRTC_SCALE_CENTER_OFFSET 0x00610b38
  741. #define NV50_PDISPLAY_CRTC_REAL_RES 0x00610b40
  742. #define NV50_PDISPLAY_CRTC_SCALE_RES1 0x00610b48
  743. #define NV50_PDISPLAY_CRTC_SCALE_RES2 0x00610b50
  744. #define NV50_PDISPLAY_DAC_MODE_CTRL_P(i) (0x00610b58 + (i) * 0x8)
  745. #define NV50_PDISPLAY_DAC_MODE_CTRL_C(i) (0x00610b5c + (i) * 0x8)
  746. #define NV50_PDISPLAY_SOR_MODE_CTRL_P(i) (0x00610b70 + (i) * 0x8)
  747. #define NV50_PDISPLAY_SOR_MODE_CTRL_C(i) (0x00610b74 + (i) * 0x8)
  748. #define NV50_PDISPLAY_EXT_MODE_CTRL_P(i) (0x00610b80 + (i) * 0x8)
  749. #define NV50_PDISPLAY_EXT_MODE_CTRL_C(i) (0x00610b84 + (i) * 0x8)
  750. #define NV50_PDISPLAY_DAC_MODE_CTRL2_P(i) (0x00610bdc + (i) * 0x8)
  751. #define NV50_PDISPLAY_DAC_MODE_CTRL2_C(i) (0x00610be0 + (i) * 0x8)
  752. #define NV90_PDISPLAY_SOR_MODE_CTRL_P(i) (0x00610794 + (i) * 0x8)
  753. #define NV90_PDISPLAY_SOR_MODE_CTRL_C(i) (0x00610798 + (i) * 0x8)
  754. #define NV50_PDISPLAY_CRTC_CLK 0x00614000
  755. #define NV50_PDISPLAY_CRTC_CLK_CTRL1(i) ((i) * 0x800 + 0x614100)
  756. #define NV50_PDISPLAY_CRTC_CLK_CTRL1_CONNECTED 0x00000600
  757. #define NV50_PDISPLAY_CRTC_CLK_VPLL_A(i) ((i) * 0x800 + 0x614104)
  758. #define NV50_PDISPLAY_CRTC_CLK_VPLL_B(i) ((i) * 0x800 + 0x614108)
  759. #define NV50_PDISPLAY_CRTC_CLK_CTRL2(i) ((i) * 0x800 + 0x614200)
  760. #define NV50_PDISPLAY_DAC_CLK 0x00614000
  761. #define NV50_PDISPLAY_DAC_CLK_CTRL2(i) ((i) * 0x800 + 0x614280)
  762. #define NV50_PDISPLAY_SOR_CLK 0x00614000
  763. #define NV50_PDISPLAY_SOR_CLK_CTRL2(i) ((i) * 0x800 + 0x614300)
  764. #define NV50_PDISPLAY_VGACRTC(r) ((r) + 0x619400)
  765. #define NV50_PDISPLAY_DAC 0x0061a000
  766. #define NV50_PDISPLAY_DAC_DPMS_CTRL(i) (0x0061a004 + (i) * 0x800)
  767. #define NV50_PDISPLAY_DAC_DPMS_CTRL_HSYNC_OFF 0x00000001
  768. #define NV50_PDISPLAY_DAC_DPMS_CTRL_VSYNC_OFF 0x00000004
  769. #define NV50_PDISPLAY_DAC_DPMS_CTRL_BLANKED 0x00000010
  770. #define NV50_PDISPLAY_DAC_DPMS_CTRL_OFF 0x00000040
  771. #define NV50_PDISPLAY_DAC_DPMS_CTRL_PENDING 0x80000000
  772. #define NV50_PDISPLAY_DAC_LOAD_CTRL(i) (0x0061a00c + (i) * 0x800)
  773. #define NV50_PDISPLAY_DAC_LOAD_CTRL_ACTIVE 0x00100000
  774. #define NV50_PDISPLAY_DAC_LOAD_CTRL_PRESENT 0x38000000
  775. #define NV50_PDISPLAY_DAC_LOAD_CTRL_DONE 0x80000000
  776. #define NV50_PDISPLAY_DAC_CLK_CTRL1(i) (0x0061a010 + (i) * 0x800)
  777. #define NV50_PDISPLAY_DAC_CLK_CTRL1_CONNECTED 0x00000600
  778. #define NV50_PDISPLAY_SOR 0x0061c000
  779. #define NV50_PDISPLAY_SOR_DPMS_CTRL(i) (0x0061c004 + (i) * 0x800)
  780. #define NV50_PDISPLAY_SOR_DPMS_CTRL_PENDING 0x80000000
  781. #define NV50_PDISPLAY_SOR_DPMS_CTRL_ON 0x00000001
  782. #define NV50_PDISPLAY_SOR_CLK_CTRL1(i) (0x0061c008 + (i) * 0x800)
  783. #define NV50_PDISPLAY_SOR_CLK_CTRL1_CONNECTED 0x00000600
  784. #define NV50_PDISPLAY_SOR_DPMS_STATE(i) (0x0061c030 + (i) * 0x800)
  785. #define NV50_PDISPLAY_SOR_DPMS_STATE_ACTIVE 0x00030000
  786. #define NV50_PDISPLAY_SOR_DPMS_STATE_BLANKED 0x00080000
  787. #define NV50_PDISPLAY_SOR_DPMS_STATE_WAIT 0x10000000
  788. #define NV50_PDISP_SOR_PWM_DIV(i) (0x0061c080 + (i) * 0x800)
  789. #define NV50_PDISP_SOR_PWM_CTL(i) (0x0061c084 + (i) * 0x800)
  790. #define NV50_PDISP_SOR_PWM_CTL_NEW 0x80000000
  791. #define NVA3_PDISP_SOR_PWM_CTL_UNK 0x40000000
  792. #define NV50_PDISP_SOR_PWM_CTL_VAL 0x000007ff
  793. #define NVA3_PDISP_SOR_PWM_CTL_VAL 0x00ffffff
  794. #define NV50_SOR_DP_CTRL(i, l) (0x0061c10c + (i) * 0x800 + (l) * 0x80)
  795. #define NV50_SOR_DP_CTRL_ENABLED 0x00000001
  796. #define NV50_SOR_DP_CTRL_ENHANCED_FRAME_ENABLED 0x00004000
  797. #define NV50_SOR_DP_CTRL_LANE_MASK 0x001f0000
  798. #define NV50_SOR_DP_CTRL_LANE_0_ENABLED 0x00010000
  799. #define NV50_SOR_DP_CTRL_LANE_1_ENABLED 0x00020000
  800. #define NV50_SOR_DP_CTRL_LANE_2_ENABLED 0x00040000
  801. #define NV50_SOR_DP_CTRL_LANE_3_ENABLED 0x00080000
  802. #define NV50_SOR_DP_CTRL_TRAINING_PATTERN 0x0f000000
  803. #define NV50_SOR_DP_CTRL_TRAINING_PATTERN_DISABLED 0x00000000
  804. #define NV50_SOR_DP_CTRL_TRAINING_PATTERN_1 0x01000000
  805. #define NV50_SOR_DP_CTRL_TRAINING_PATTERN_2 0x02000000
  806. #define NV50_SOR_DP_UNK118(i, l) (0x0061c118 + (i) * 0x800 + (l) * 0x80)
  807. #define NV50_SOR_DP_UNK120(i, l) (0x0061c120 + (i) * 0x800 + (l) * 0x80)
  808. #define NV50_SOR_DP_SCFG(i, l) (0x0061c128 + (i) * 0x800 + (l) * 0x80)
  809. #define NV50_SOR_DP_UNK130(i, l) (0x0061c130 + (i) * 0x800 + (l) * 0x80)
  810. #define NV50_PDISPLAY_USER(i) ((i) * 0x1000 + 0x00640000)
  811. #define NV50_PDISPLAY_USER_PUT(i) ((i) * 0x1000 + 0x00640000)
  812. #define NV50_PDISPLAY_USER_GET(i) ((i) * 0x1000 + 0x00640004)
  813. #define NV50_PDISPLAY_CURSOR_USER 0x00647000
  814. #define NV50_PDISPLAY_CURSOR_USER_POS_CTRL(i) ((i) * 0x1000 + 0x00647080)
  815. #define NV50_PDISPLAY_CURSOR_USER_POS(i) ((i) * 0x1000 + 0x00647084)