diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/Makefile | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/device/nve0.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/subdev/pwr.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/pwr/base.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/pwr/gk104.c | 69 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/pwr/priv.h | 2 |
6 files changed, 86 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile index 8b307e143632..8f0dd8e32e19 100644 --- a/drivers/gpu/drm/nouveau/Makefile +++ b/drivers/gpu/drm/nouveau/Makefile | |||
@@ -169,6 +169,7 @@ nouveau-y += core/subdev/pwr/memx.o | |||
169 | nouveau-y += core/subdev/pwr/nva3.o | 169 | nouveau-y += core/subdev/pwr/nva3.o |
170 | nouveau-y += core/subdev/pwr/nvc0.o | 170 | nouveau-y += core/subdev/pwr/nvc0.o |
171 | nouveau-y += core/subdev/pwr/nvd0.o | 171 | nouveau-y += core/subdev/pwr/nvd0.o |
172 | nouveau-y += core/subdev/pwr/gk104.o | ||
172 | nouveau-y += core/subdev/pwr/nv108.o | 173 | nouveau-y += core/subdev/pwr/nv108.o |
173 | nouveau-y += core/subdev/therm/base.o | 174 | nouveau-y += core/subdev/therm/base.o |
174 | nouveau-y += core/subdev/therm/fan.o | 175 | nouveau-y += core/subdev/therm/fan.o |
diff --git a/drivers/gpu/drm/nouveau/core/engine/device/nve0.c b/drivers/gpu/drm/nouveau/core/engine/device/nve0.c index e8958048f415..7298438f91d1 100644 --- a/drivers/gpu/drm/nouveau/core/engine/device/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/device/nve0.c | |||
@@ -75,7 +75,7 @@ nve0_identify(struct nouveau_device *device) | |||
75 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; | 75 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; |
76 | device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass; | 76 | device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass; |
77 | device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass; | 77 | device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass; |
78 | device->oclass[NVDEV_SUBDEV_PWR ] = nvd0_pwr_oclass; | 78 | device->oclass[NVDEV_SUBDEV_PWR ] = gk104_pwr_oclass; |
79 | device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass; | 79 | device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass; |
80 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvd0_dmaeng_oclass; | 80 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvd0_dmaeng_oclass; |
81 | device->oclass[NVDEV_ENGINE_FIFO ] = nve0_fifo_oclass; | 81 | device->oclass[NVDEV_ENGINE_FIFO ] = nve0_fifo_oclass; |
@@ -141,7 +141,7 @@ nve0_identify(struct nouveau_device *device) | |||
141 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; | 141 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; |
142 | device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass; | 142 | device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass; |
143 | device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass; | 143 | device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass; |
144 | device->oclass[NVDEV_SUBDEV_PWR ] = nvd0_pwr_oclass; | 144 | device->oclass[NVDEV_SUBDEV_PWR ] = gk104_pwr_oclass; |
145 | device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass; | 145 | device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass; |
146 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvd0_dmaeng_oclass; | 146 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvd0_dmaeng_oclass; |
147 | device->oclass[NVDEV_ENGINE_FIFO ] = nve0_fifo_oclass; | 147 | device->oclass[NVDEV_ENGINE_FIFO ] = nve0_fifo_oclass; |
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/pwr.h b/drivers/gpu/drm/nouveau/core/include/subdev/pwr.h index edf11182eab2..f73feec151db 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/pwr.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/pwr.h | |||
@@ -23,7 +23,8 @@ struct nouveau_pwr { | |||
23 | u32 data[2]; | 23 | u32 data[2]; |
24 | } recv; | 24 | } recv; |
25 | 25 | ||
26 | int (*message)(struct nouveau_pwr *, u32[2], u32, u32, u32, u32); | 26 | int (*message)(struct nouveau_pwr *, u32[2], u32, u32, u32, u32); |
27 | void (*pgob)(struct nouveau_pwr *, bool); | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | static inline struct nouveau_pwr * | 30 | static inline struct nouveau_pwr * |
@@ -35,6 +36,7 @@ nouveau_pwr(void *obj) | |||
35 | extern struct nouveau_oclass *nva3_pwr_oclass; | 36 | extern struct nouveau_oclass *nva3_pwr_oclass; |
36 | extern struct nouveau_oclass *nvc0_pwr_oclass; | 37 | extern struct nouveau_oclass *nvc0_pwr_oclass; |
37 | extern struct nouveau_oclass *nvd0_pwr_oclass; | 38 | extern struct nouveau_oclass *nvd0_pwr_oclass; |
39 | extern struct nouveau_oclass *gk104_pwr_oclass; | ||
38 | extern struct nouveau_oclass *nv108_pwr_oclass; | 40 | extern struct nouveau_oclass *nv108_pwr_oclass; |
39 | 41 | ||
40 | /* interface to MEMX process running on PPWR */ | 42 | /* interface to MEMX process running on PPWR */ |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/pwr/base.c b/drivers/gpu/drm/nouveau/core/subdev/pwr/base.c index 12baf8151698..69f1f34f6931 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/pwr/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/pwr/base.c | |||
@@ -26,6 +26,14 @@ | |||
26 | 26 | ||
27 | #include "priv.h" | 27 | #include "priv.h" |
28 | 28 | ||
29 | static void | ||
30 | nouveau_pwr_pgob(struct nouveau_pwr *ppwr, bool enable) | ||
31 | { | ||
32 | const struct nvkm_pwr_impl *impl = (void *)nv_oclass(ppwr); | ||
33 | if (impl->pgob) | ||
34 | impl->pgob(ppwr, enable); | ||
35 | } | ||
36 | |||
29 | static int | 37 | static int |
30 | nouveau_pwr_send(struct nouveau_pwr *ppwr, u32 reply[2], | 38 | nouveau_pwr_send(struct nouveau_pwr *ppwr, u32 reply[2], |
31 | u32 process, u32 message, u32 data0, u32 data1) | 39 | u32 process, u32 message, u32 data0, u32 data1) |
@@ -188,6 +196,7 @@ _nouveau_pwr_init(struct nouveau_object *object) | |||
188 | 196 | ||
189 | nv_subdev(ppwr)->intr = nouveau_pwr_intr; | 197 | nv_subdev(ppwr)->intr = nouveau_pwr_intr; |
190 | ppwr->message = nouveau_pwr_send; | 198 | ppwr->message = nouveau_pwr_send; |
199 | ppwr->pgob = nouveau_pwr_pgob; | ||
191 | 200 | ||
192 | /* prevent previous ucode from running, wait for idle, reset */ | 201 | /* prevent previous ucode from running, wait for idle, reset */ |
193 | nv_wr32(ppwr, 0x10a014, 0x0000ffff); /* INTR_EN_CLR = ALL */ | 202 | nv_wr32(ppwr, 0x10a014, 0x0000ffff); /* INTR_EN_CLR = ALL */ |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/pwr/gk104.c b/drivers/gpu/drm/nouveau/core/subdev/pwr/gk104.c new file mode 100644 index 000000000000..d76612999b9f --- /dev/null +++ b/drivers/gpu/drm/nouveau/core/subdev/pwr/gk104.c | |||
@@ -0,0 +1,69 @@ | |||
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 | |||
25 | #include "priv.h" | ||
26 | |||
27 | #define nvd0_pwr_code gk104_pwr_code | ||
28 | #define nvd0_pwr_data gk104_pwr_data | ||
29 | #include "fuc/nvd0.fuc.h" | ||
30 | |||
31 | static void | ||
32 | gk104_pwr_pgob(struct nouveau_pwr *ppwr, bool enable) | ||
33 | { | ||
34 | nv_mask(ppwr, 0x000200, 0x00001000, 0x00000000); | ||
35 | nv_rd32(ppwr, 0x000200); | ||
36 | nv_mask(ppwr, 0x000200, 0x08000000, 0x08000000); | ||
37 | msleep(50); | ||
38 | |||
39 | nv_mask(ppwr, 0x10a78c, 0x00000002, 0x00000002); | ||
40 | nv_mask(ppwr, 0x10a78c, 0x00000001, 0x00000001); | ||
41 | nv_mask(ppwr, 0x10a78c, 0x00000001, 0x00000000); | ||
42 | |||
43 | nv_mask(ppwr, 0x020004, 0xc0000000, enable ? 0xc0000000 : 0x40000000); | ||
44 | msleep(50); | ||
45 | |||
46 | nv_mask(ppwr, 0x10a78c, 0x00000002, 0x00000000); | ||
47 | nv_mask(ppwr, 0x10a78c, 0x00000001, 0x00000001); | ||
48 | nv_mask(ppwr, 0x10a78c, 0x00000001, 0x00000000); | ||
49 | |||
50 | nv_mask(ppwr, 0x000200, 0x08000000, 0x00000000); | ||
51 | nv_mask(ppwr, 0x000200, 0x00001000, 0x00001000); | ||
52 | nv_rd32(ppwr, 0x000200); | ||
53 | } | ||
54 | |||
55 | struct nouveau_oclass * | ||
56 | gk104_pwr_oclass = &(struct nvkm_pwr_impl) { | ||
57 | .base.handle = NV_SUBDEV(PWR, 0xe4), | ||
58 | .base.ofuncs = &(struct nouveau_ofuncs) { | ||
59 | .ctor = _nouveau_pwr_ctor, | ||
60 | .dtor = _nouveau_pwr_dtor, | ||
61 | .init = _nouveau_pwr_init, | ||
62 | .fini = _nouveau_pwr_fini, | ||
63 | }, | ||
64 | .code.data = gk104_pwr_code, | ||
65 | .code.size = sizeof(gk104_pwr_code), | ||
66 | .data.data = gk104_pwr_data, | ||
67 | .data.size = sizeof(gk104_pwr_data), | ||
68 | .pgob = gk104_pwr_pgob, | ||
69 | }.base; | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/pwr/priv.h b/drivers/gpu/drm/nouveau/core/subdev/pwr/priv.h index ddc614f9a99d..3814a341db32 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/pwr/priv.h +++ b/drivers/gpu/drm/nouveau/core/subdev/pwr/priv.h | |||
@@ -37,6 +37,8 @@ struct nvkm_pwr_impl { | |||
37 | u32 *data; | 37 | u32 *data; |
38 | u32 size; | 38 | u32 size; |
39 | } data; | 39 | } data; |
40 | |||
41 | void (*pgob)(struct nouveau_pwr *, bool); | ||
40 | }; | 42 | }; |
41 | 43 | ||
42 | #endif | 44 | #endif |