2 * Copyright 2013 Red Hat Inc.
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:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
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.
26 static const struct nvkm_specdom
28 { 0x60, (const struct nvkm_specsig[]) {
29 { 0x47, "hub00_user_0" },
31 }, &gf100_perfctr_func },
32 { 0x40, (const struct nvkm_specsig[]) {
33 { 0x27, "hub01_user_0" },
35 }, &gf100_perfctr_func },
36 { 0x60, (const struct nvkm_specsig[]) {
37 { 0x47, "hub02_user_0" },
39 }, &gf100_perfctr_func },
40 { 0x60, (const struct nvkm_specsig[]) {
41 { 0x47, "hub03_user_0" },
43 }, &gf100_perfctr_func },
44 { 0x40, (const struct nvkm_specsig[]) {
45 { 0x03, "host_mmio_rd" },
46 { 0x27, "hub04_user_0" },
48 }, &gf100_perfctr_func },
49 { 0x60, (const struct nvkm_specsig[]) {
50 { 0x47, "hub05_user_0" },
52 }, &gf100_perfctr_func },
53 { 0xc0, (const struct nvkm_specsig[]) {
54 { 0x74, "host_fb_rd3x" },
55 { 0x75, "host_fb_rd3x_2" },
56 { 0xa7, "hub06_user_0" },
58 }, &gf100_perfctr_func },
59 { 0x60, (const struct nvkm_specsig[]) {
60 { 0x47, "hub07_user_0" },
62 }, &gf100_perfctr_func },
66 static const struct nvkm_specdom
68 { 0xe0, (const struct nvkm_specsig[]) {
69 { 0xc7, "gpc00_user_0" },
71 }, &gf100_perfctr_func },
75 static const struct nvkm_specdom
77 { 0x60, (const struct nvkm_specsig[]) {
78 { 0x47, "part00_user_0" },
80 }, &gf100_perfctr_func },
81 { 0x60, (const struct nvkm_specsig[]) {
82 { 0x47, "part01_user_0" },
84 }, &gf100_perfctr_func },
89 gk104_pm_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
90 struct nvkm_oclass *oclass, void *data, u32 size,
91 struct nvkm_object **pobject)
93 struct gf100_pm_priv *priv;
97 ret = nvkm_pm_create(parent, engine, oclass, &priv);
98 *pobject = nv_object(priv);
103 ret = nvkm_perfdom_new(&priv->base, "pwr", 0, 0, 0, 0, gk104_pm_pwr);
108 ret = nvkm_perfdom_new(&priv->base, "hub", 0, 0x1b0000, 0, 0x200,
114 mask = (1 << nv_rd32(priv, 0x022430)) - 1;
115 mask &= ~nv_rd32(priv, 0x022504);
116 mask &= ~nv_rd32(priv, 0x022584);
118 ret = nvkm_perfdom_new(&priv->base, "gpc", mask, 0x180000,
119 0x1000, 0x200, gk104_pm_gpc);
124 mask = (1 << nv_rd32(priv, 0x022438)) - 1;
125 mask &= ~nv_rd32(priv, 0x022548);
126 mask &= ~nv_rd32(priv, 0x0225c8);
128 ret = nvkm_perfdom_new(&priv->base, "part", mask, 0x1a0000,
129 0x1000, 0x200, gk104_pm_part);
133 nv_engine(priv)->cclass = &nvkm_pm_cclass;
134 nv_engine(priv)->sclass = nvkm_pm_sclass;
141 .handle = NV_ENGINE(PM, 0xe0),
142 .ofuncs = &(struct nvkm_ofuncs) {
143 .ctor = gk104_pm_ctor,
144 .dtor = _nvkm_pm_dtor,
145 .init = _nvkm_pm_init,
146 .fini = gf100_pm_fini,