gk104.c 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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
  23. */
  24. #include "gf100.h"
  25. static const struct nvkm_specsrc
  26. gk104_pmfb_sources[] = {
  27. { 0x140028, (const struct nvkm_specmux[]) {
  28. { 0x3fff, 0, "unk0" },
  29. { 0x7, 16, "unk16" },
  30. { 0x3, 24, "unk24" },
  31. { 0x2, 28, "unk28" },
  32. {}
  33. }, "pmfb0_pm_unk28" },
  34. { 0x14125c, (const struct nvkm_specmux[]) {
  35. { 0x3fff, 0, "unk0" },
  36. {}
  37. }, "pmfb0_subp0_pm_unk25c" },
  38. { 0x14165c, (const struct nvkm_specmux[]) {
  39. { 0x3fff, 0, "unk0" },
  40. {}
  41. }, "pmfb0_subp1_pm_unk25c" },
  42. { 0x141a5c, (const struct nvkm_specmux[]) {
  43. { 0x3fff, 0, "unk0" },
  44. {}
  45. }, "pmfb0_subp2_pm_unk25c" },
  46. { 0x141e5c, (const struct nvkm_specmux[]) {
  47. { 0x3fff, 0, "unk0" },
  48. {}
  49. }, "pmfb0_subp3_pm_unk25c" },
  50. {}
  51. };
  52. static const struct nvkm_specsrc
  53. gk104_tex_sources[] = {
  54. { 0x5042c0, (const struct nvkm_specmux[]) {
  55. { 0xf, 0, "sel0", true },
  56. { 0x7, 8, "sel1", true },
  57. {}
  58. }, "pgraph_gpc0_tpc0_tex_pm_mux_c_d" },
  59. { 0x5042c8, (const struct nvkm_specmux[]) {
  60. { 0x1f, 0, "sel", true },
  61. {}
  62. }, "pgraph_gpc0_tpc0_tex_pm_unkc8" },
  63. { 0x5042b8, (const struct nvkm_specmux[]) {
  64. { 0xff, 0, "sel", true },
  65. {}
  66. }, "pgraph_gpc0_tpc0_tex_pm_unkb8" },
  67. {}
  68. };
  69. static const struct nvkm_specdom
  70. gk104_pm_hub[] = {
  71. { 0x60, (const struct nvkm_specsig[]) {
  72. { 0x47, "hub00_user_0" },
  73. {}
  74. }, &gf100_perfctr_func },
  75. { 0x40, (const struct nvkm_specsig[]) {
  76. { 0x27, "hub01_user_0" },
  77. {}
  78. }, &gf100_perfctr_func },
  79. { 0x60, (const struct nvkm_specsig[]) {
  80. { 0x47, "hub02_user_0" },
  81. {}
  82. }, &gf100_perfctr_func },
  83. { 0x60, (const struct nvkm_specsig[]) {
  84. { 0x47, "hub03_user_0" },
  85. {}
  86. }, &gf100_perfctr_func },
  87. { 0x40, (const struct nvkm_specsig[]) {
  88. { 0x03, "host_mmio_rd" },
  89. { 0x27, "hub04_user_0" },
  90. {}
  91. }, &gf100_perfctr_func },
  92. { 0x60, (const struct nvkm_specsig[]) {
  93. { 0x47, "hub05_user_0" },
  94. {}
  95. }, &gf100_perfctr_func },
  96. { 0xc0, (const struct nvkm_specsig[]) {
  97. { 0x74, "host_fb_rd3x" },
  98. { 0x75, "host_fb_rd3x_2" },
  99. { 0xa7, "hub06_user_0" },
  100. {}
  101. }, &gf100_perfctr_func },
  102. { 0x60, (const struct nvkm_specsig[]) {
  103. { 0x47, "hub07_user_0" },
  104. {}
  105. }, &gf100_perfctr_func },
  106. {}
  107. };
  108. static const struct nvkm_specdom
  109. gk104_pm_gpc[] = {
  110. { 0xe0, (const struct nvkm_specsig[]) {
  111. { 0xc7, "gpc00_user_0" },
  112. {}
  113. }, &gf100_perfctr_func },
  114. { 0x20, (const struct nvkm_specsig[]) {
  115. {}
  116. }, &gf100_perfctr_func },
  117. { 0x20, (const struct nvkm_specsig[]) {
  118. { 0x00, "gpc02_tex_00", gk104_tex_sources },
  119. { 0x01, "gpc02_tex_01", gk104_tex_sources },
  120. { 0x02, "gpc02_tex_02", gk104_tex_sources },
  121. { 0x03, "gpc02_tex_03", gk104_tex_sources },
  122. { 0x04, "gpc02_tex_04", gk104_tex_sources },
  123. { 0x05, "gpc02_tex_05", gk104_tex_sources },
  124. { 0x06, "gpc02_tex_06", gk104_tex_sources },
  125. { 0x07, "gpc02_tex_07", gk104_tex_sources },
  126. { 0x08, "gpc02_tex_08", gk104_tex_sources },
  127. { 0x0a, "gpc02_tex_0a", gk104_tex_sources },
  128. { 0x0b, "gpc02_tex_0b", gk104_tex_sources },
  129. { 0x0d, "gpc02_tex_0c", gk104_tex_sources },
  130. { 0x0c, "gpc02_tex_0d", gk104_tex_sources },
  131. { 0x0e, "gpc02_tex_0e", gk104_tex_sources },
  132. { 0x0f, "gpc02_tex_0f", gk104_tex_sources },
  133. { 0x10, "gpc02_tex_10", gk104_tex_sources },
  134. { 0x11, "gpc02_tex_11", gk104_tex_sources },
  135. { 0x12, "gpc02_tex_12", gk104_tex_sources },
  136. {}
  137. }, &gf100_perfctr_func },
  138. {}
  139. };
  140. static const struct nvkm_specdom
  141. gk104_pm_part[] = {
  142. { 0x60, (const struct nvkm_specsig[]) {
  143. { 0x00, "part00_pbfb_00", gf100_pbfb_sources },
  144. { 0x01, "part00_pbfb_01", gf100_pbfb_sources },
  145. { 0x0c, "part00_pmfb_00", gk104_pmfb_sources },
  146. { 0x0d, "part00_pmfb_01", gk104_pmfb_sources },
  147. { 0x0e, "part00_pmfb_02", gk104_pmfb_sources },
  148. { 0x0f, "part00_pmfb_03", gk104_pmfb_sources },
  149. { 0x10, "part00_pmfb_04", gk104_pmfb_sources },
  150. { 0x12, "part00_pmfb_05", gk104_pmfb_sources },
  151. { 0x15, "part00_pmfb_06", gk104_pmfb_sources },
  152. { 0x16, "part00_pmfb_07", gk104_pmfb_sources },
  153. { 0x18, "part00_pmfb_08", gk104_pmfb_sources },
  154. { 0x21, "part00_pmfb_09", gk104_pmfb_sources },
  155. { 0x25, "part00_pmfb_0a", gk104_pmfb_sources },
  156. { 0x26, "part00_pmfb_0b", gk104_pmfb_sources },
  157. { 0x27, "part00_pmfb_0c", gk104_pmfb_sources },
  158. { 0x47, "part00_user_0" },
  159. {}
  160. }, &gf100_perfctr_func },
  161. { 0x60, (const struct nvkm_specsig[]) {
  162. { 0x47, "part01_user_0" },
  163. {}
  164. }, &gf100_perfctr_func },
  165. {}
  166. };
  167. static const struct gf100_pm_func
  168. gk104_pm = {
  169. .doms_gpc = gk104_pm_gpc,
  170. .doms_hub = gk104_pm_hub,
  171. .doms_part = gk104_pm_part,
  172. };
  173. int
  174. gk104_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
  175. {
  176. return gf100_pm_new_(&gk104_pm, device, index, ppm);
  177. }