gf119.c 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /*
  2. * Copyright 2013 Red Hat Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: Ben Skeggs <bskeggs@redhat.com>
  23. */
  24. #include "gf100.h"
  25. #include "ctxgf100.h"
  26. #include <nvif/class.h>
  27. /*******************************************************************************
  28. * PGRAPH register lists
  29. ******************************************************************************/
  30. const struct gf100_gr_init
  31. gf119_gr_init_pd_0[] = {
  32. { 0x406024, 1, 0x04, 0x00000000 },
  33. { 0x4064f0, 3, 0x04, 0x00000000 },
  34. {}
  35. };
  36. const struct gf100_gr_init
  37. gf119_gr_init_ds_0[] = {
  38. { 0x405844, 1, 0x04, 0x00ffffff },
  39. { 0x405850, 1, 0x04, 0x00000000 },
  40. { 0x405900, 1, 0x04, 0x00002834 },
  41. { 0x405908, 1, 0x04, 0x00000000 },
  42. { 0x405928, 2, 0x04, 0x00000000 },
  43. {}
  44. };
  45. const struct gf100_gr_init
  46. gf119_gr_init_prop_0[] = {
  47. { 0x418408, 1, 0x04, 0x00000000 },
  48. { 0x4184a0, 3, 0x04, 0x00000000 },
  49. {}
  50. };
  51. const struct gf100_gr_init
  52. gf119_gr_init_gpm_0[] = {
  53. { 0x418c04, 1, 0x04, 0x00000000 },
  54. { 0x418c64, 2, 0x04, 0x00000000 },
  55. { 0x418c88, 1, 0x04, 0x00000000 },
  56. { 0x418cb4, 2, 0x04, 0x00000000 },
  57. {}
  58. };
  59. const struct gf100_gr_init
  60. gf119_gr_init_gpc_unk_1[] = {
  61. { 0x418d00, 1, 0x04, 0x00000000 },
  62. { 0x418d28, 2, 0x04, 0x00000000 },
  63. { 0x418f00, 1, 0x04, 0x00000000 },
  64. { 0x418f08, 1, 0x04, 0x00000000 },
  65. { 0x418f20, 2, 0x04, 0x00000000 },
  66. { 0x418e00, 1, 0x04, 0x00000003 },
  67. { 0x418e08, 1, 0x04, 0x00000000 },
  68. { 0x418e1c, 2, 0x04, 0x00000000 },
  69. {}
  70. };
  71. const struct gf100_gr_init
  72. gf119_gr_init_tex_0[] = {
  73. { 0x419ab0, 1, 0x04, 0x00000000 },
  74. { 0x419ac8, 1, 0x04, 0x00000000 },
  75. { 0x419ab8, 1, 0x04, 0x000000e7 },
  76. { 0x419abc, 2, 0x04, 0x00000000 },
  77. { 0x419ab4, 1, 0x04, 0x00000000 },
  78. {}
  79. };
  80. static const struct gf100_gr_init
  81. gf119_gr_init_pe_0[] = {
  82. { 0x41980c, 1, 0x04, 0x00000010 },
  83. { 0x419810, 1, 0x04, 0x00000000 },
  84. { 0x419814, 1, 0x04, 0x00000004 },
  85. { 0x419844, 1, 0x04, 0x00000000 },
  86. { 0x41984c, 1, 0x04, 0x0000a918 },
  87. { 0x419850, 4, 0x04, 0x00000000 },
  88. { 0x419880, 1, 0x04, 0x00000002 },
  89. {}
  90. };
  91. static const struct gf100_gr_init
  92. gf119_gr_init_wwdx_0[] = {
  93. { 0x419bd4, 1, 0x04, 0x00800000 },
  94. { 0x419bdc, 1, 0x04, 0x00000000 },
  95. { 0x419bf8, 2, 0x04, 0x00000000 },
  96. {}
  97. };
  98. static const struct gf100_gr_init
  99. gf119_gr_init_tpccs_1[] = {
  100. { 0x419d2c, 1, 0x04, 0x00000000 },
  101. { 0x419d48, 2, 0x04, 0x00000000 },
  102. {}
  103. };
  104. const struct gf100_gr_init
  105. gf119_gr_init_sm_0[] = {
  106. { 0x419e00, 1, 0x04, 0x00000000 },
  107. { 0x419ea0, 1, 0x04, 0x00000000 },
  108. { 0x419ea4, 1, 0x04, 0x00000100 },
  109. { 0x419ea8, 1, 0x04, 0x02001100 },
  110. { 0x419eac, 1, 0x04, 0x11100702 },
  111. { 0x419eb0, 1, 0x04, 0x00000003 },
  112. { 0x419eb4, 4, 0x04, 0x00000000 },
  113. { 0x419ec8, 1, 0x04, 0x0e063818 },
  114. { 0x419ecc, 1, 0x04, 0x0e060e06 },
  115. { 0x419ed0, 1, 0x04, 0x00003818 },
  116. { 0x419ed4, 1, 0x04, 0x011104f1 },
  117. { 0x419edc, 1, 0x04, 0x00000000 },
  118. { 0x419f00, 1, 0x04, 0x00000000 },
  119. { 0x419f2c, 1, 0x04, 0x00000000 },
  120. {}
  121. };
  122. const struct gf100_gr_init
  123. gf119_gr_init_fe_1[] = {
  124. { 0x40402c, 1, 0x04, 0x00000000 },
  125. { 0x4040f0, 1, 0x04, 0x00000000 },
  126. { 0x404174, 1, 0x04, 0x00000000 },
  127. {}
  128. };
  129. static const struct gf100_gr_pack
  130. gf119_gr_pack_mmio[] = {
  131. { gf100_gr_init_main_0 },
  132. { gf100_gr_init_fe_0 },
  133. { gf100_gr_init_pri_0 },
  134. { gf100_gr_init_rstr2d_0 },
  135. { gf119_gr_init_pd_0 },
  136. { gf119_gr_init_ds_0 },
  137. { gf100_gr_init_scc_0 },
  138. { gf119_gr_init_prop_0 },
  139. { gf108_gr_init_gpc_unk_0 },
  140. { gf100_gr_init_setup_0 },
  141. { gf100_gr_init_crstr_0 },
  142. { gf108_gr_init_setup_1 },
  143. { gf100_gr_init_zcull_0 },
  144. { gf119_gr_init_gpm_0 },
  145. { gf119_gr_init_gpc_unk_1 },
  146. { gf100_gr_init_gcc_0 },
  147. { gf100_gr_init_tpccs_0 },
  148. { gf119_gr_init_tex_0 },
  149. { gf119_gr_init_pe_0 },
  150. { gf100_gr_init_l1c_0 },
  151. { gf119_gr_init_wwdx_0 },
  152. { gf119_gr_init_tpccs_1 },
  153. { gf100_gr_init_mpc_0 },
  154. { gf119_gr_init_sm_0 },
  155. { gf100_gr_init_be_0 },
  156. { gf119_gr_init_fe_1 },
  157. {}
  158. };
  159. /*******************************************************************************
  160. * PGRAPH engine/subdev functions
  161. ******************************************************************************/
  162. static const struct gf100_gr_func
  163. gf119_gr = {
  164. .init = gf100_gr_init,
  165. .mmio = gf119_gr_pack_mmio,
  166. .fecs.ucode = &gf100_gr_fecs_ucode,
  167. .gpccs.ucode = &gf100_gr_gpccs_ucode,
  168. .rops = gf100_gr_rops,
  169. .grctx = &gf119_grctx,
  170. .sclass = {
  171. { -1, -1, FERMI_TWOD_A },
  172. { -1, -1, FERMI_MEMORY_TO_MEMORY_FORMAT_A },
  173. { -1, -1, FERMI_A, &gf100_fermi },
  174. { -1, -1, FERMI_B, &gf100_fermi },
  175. { -1, -1, FERMI_C, &gf100_fermi },
  176. { -1, -1, FERMI_COMPUTE_A },
  177. { -1, -1, FERMI_COMPUTE_B },
  178. {}
  179. }
  180. };
  181. int
  182. gf119_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
  183. {
  184. return gf100_gr_new_(&gf119_gr, device, index, pgr);
  185. }