gk110b.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. static const struct gf100_gr_init
  31. gk110b_gr_init_l1c_0[] = {
  32. { 0x419c98, 1, 0x04, 0x00000000 },
  33. { 0x419ca8, 1, 0x04, 0x00000000 },
  34. { 0x419cb0, 1, 0x04, 0x09000000 },
  35. { 0x419cb4, 1, 0x04, 0x00000000 },
  36. { 0x419cb8, 1, 0x04, 0x00b08bea },
  37. { 0x419c84, 1, 0x04, 0x00010384 },
  38. { 0x419cbc, 1, 0x04, 0x281b3646 },
  39. { 0x419cc0, 2, 0x04, 0x00000000 },
  40. { 0x419c80, 1, 0x04, 0x00020230 },
  41. { 0x419ccc, 2, 0x04, 0x00000000 },
  42. {}
  43. };
  44. static const struct gf100_gr_init
  45. gk110b_gr_init_sm_0[] = {
  46. { 0x419e00, 1, 0x04, 0x00000080 },
  47. { 0x419ea0, 1, 0x04, 0x00000000 },
  48. { 0x419ee4, 1, 0x04, 0x00000000 },
  49. { 0x419ea4, 1, 0x04, 0x00000100 },
  50. { 0x419ea8, 1, 0x04, 0x00000000 },
  51. { 0x419eb4, 1, 0x04, 0x00000000 },
  52. { 0x419ebc, 2, 0x04, 0x00000000 },
  53. { 0x419edc, 1, 0x04, 0x00000000 },
  54. { 0x419f00, 1, 0x04, 0x00000000 },
  55. { 0x419ed0, 1, 0x04, 0x00002616 },
  56. { 0x419f74, 1, 0x04, 0x00015555 },
  57. { 0x419f80, 4, 0x04, 0x00000000 },
  58. {}
  59. };
  60. static const struct gf100_gr_pack
  61. gk110b_gr_pack_mmio[] = {
  62. { gk104_gr_init_main_0 },
  63. { gk110_gr_init_fe_0 },
  64. { gf100_gr_init_pri_0 },
  65. { gf100_gr_init_rstr2d_0 },
  66. { gf119_gr_init_pd_0 },
  67. { gk110_gr_init_ds_0 },
  68. { gf100_gr_init_scc_0 },
  69. { gk110_gr_init_sked_0 },
  70. { gk110_gr_init_cwd_0 },
  71. { gf119_gr_init_prop_0 },
  72. { gf108_gr_init_gpc_unk_0 },
  73. { gf100_gr_init_setup_0 },
  74. { gf100_gr_init_crstr_0 },
  75. { gf108_gr_init_setup_1 },
  76. { gf100_gr_init_zcull_0 },
  77. { gf119_gr_init_gpm_0 },
  78. { gk110_gr_init_gpc_unk_1 },
  79. { gf100_gr_init_gcc_0 },
  80. { gk104_gr_init_tpccs_0 },
  81. { gk110_gr_init_tex_0 },
  82. { gk104_gr_init_pe_0 },
  83. { gk110b_gr_init_l1c_0 },
  84. { gf100_gr_init_mpc_0 },
  85. { gk110b_gr_init_sm_0 },
  86. { gf117_gr_init_pes_0 },
  87. { gf117_gr_init_wwdx_0 },
  88. { gf117_gr_init_cbm_0 },
  89. { gk104_gr_init_be_0 },
  90. { gf100_gr_init_fe_1 },
  91. {}
  92. };
  93. /*******************************************************************************
  94. * PGRAPH engine/subdev functions
  95. ******************************************************************************/
  96. static const struct gf100_gr_func
  97. gk110b_gr = {
  98. .init = gk104_gr_init,
  99. .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
  100. .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
  101. .mmio = gk110b_gr_pack_mmio,
  102. .fecs.ucode = &gk110_gr_fecs_ucode,
  103. .gpccs.ucode = &gk110_gr_gpccs_ucode,
  104. .rops = gf100_gr_rops,
  105. .ppc_nr = 2,
  106. .grctx = &gk110b_grctx,
  107. .sclass = {
  108. { -1, -1, FERMI_TWOD_A },
  109. { -1, -1, KEPLER_INLINE_TO_MEMORY_B },
  110. { -1, -1, KEPLER_B, &gf100_fermi },
  111. { -1, -1, KEPLER_COMPUTE_B },
  112. {}
  113. }
  114. };
  115. int
  116. gk110b_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
  117. {
  118. return gf100_gr_new_(&gk110b_gr, device, index, pgr);
  119. }