xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm107.c (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
1e2ca4e7dSBen Skeggs /*
2e2ca4e7dSBen Skeggs  * Copyright 2013 Red Hat Inc.
3e2ca4e7dSBen Skeggs  *
4e2ca4e7dSBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
5e2ca4e7dSBen Skeggs  * copy of this software and associated documentation files (the "Software"),
6e2ca4e7dSBen Skeggs  * to deal in the Software without restriction, including without limitation
7e2ca4e7dSBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8e2ca4e7dSBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
9e2ca4e7dSBen Skeggs  * Software is furnished to do so, subject to the following conditions:
10e2ca4e7dSBen Skeggs  *
11e2ca4e7dSBen Skeggs  * The above copyright notice and this permission notice shall be included in
12e2ca4e7dSBen Skeggs  * all copies or substantial portions of the Software.
13e2ca4e7dSBen Skeggs  *
14e2ca4e7dSBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15e2ca4e7dSBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16e2ca4e7dSBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17e2ca4e7dSBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18e2ca4e7dSBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19e2ca4e7dSBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20e2ca4e7dSBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
21e2ca4e7dSBen Skeggs  *
22e2ca4e7dSBen Skeggs  * Authors: Ben Skeggs
23e2ca4e7dSBen Skeggs  */
24e2ca4e7dSBen Skeggs #include "priv.h"
25e2ca4e7dSBen Skeggs #define gk208_pmu_code gm107_pmu_code
26e2ca4e7dSBen Skeggs #define gk208_pmu_data gm107_pmu_data
27e2ca4e7dSBen Skeggs #include "fuc/gk208.fuc5.h"
28e2ca4e7dSBen Skeggs 
29e2ca4e7dSBen Skeggs static const struct nvkm_pmu_func
30e2ca4e7dSBen Skeggs gm107_pmu = {
312952a2b4SBen Skeggs 	.flcn = &gt215_pmu_flcn,
32e2ca4e7dSBen Skeggs 	.code.data = gm107_pmu_code,
33e2ca4e7dSBen Skeggs 	.code.size = sizeof(gm107_pmu_code),
34e2ca4e7dSBen Skeggs 	.data.data = gm107_pmu_data,
35e2ca4e7dSBen Skeggs 	.data.size = sizeof(gm107_pmu_data),
366b1277c8SBen Skeggs 	.enabled = gf100_pmu_enabled,
37715e7d26SBen Skeggs 	.reset = gf100_pmu_reset,
38da7d2062SBen Skeggs 	.init = gt215_pmu_init,
39da7d2062SBen Skeggs 	.fini = gt215_pmu_fini,
40da7d2062SBen Skeggs 	.intr = gt215_pmu_intr,
41da7d2062SBen Skeggs 	.send = gt215_pmu_send,
42da7d2062SBen Skeggs 	.recv = gt215_pmu_recv,
43e2ca4e7dSBen Skeggs };
44e2ca4e7dSBen Skeggs 
45989863d7SBen Skeggs static const struct nvkm_pmu_fwif
46989863d7SBen Skeggs gm107_pmu_fwif[] = {
47989863d7SBen Skeggs 	{ -1, gf100_pmu_nofw, &gm107_pmu },
48989863d7SBen Skeggs 	{}
49989863d7SBen Skeggs };
50989863d7SBen Skeggs 
51e2ca4e7dSBen Skeggs int
gm107_pmu_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_pmu ** ppmu)52*e4b15b4cSBen Skeggs gm107_pmu_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
53*e4b15b4cSBen Skeggs 	      struct nvkm_pmu **ppmu)
54e2ca4e7dSBen Skeggs {
55*e4b15b4cSBen Skeggs 	return nvkm_pmu_new_(gm107_pmu_fwif, device, type, inst, ppmu);
56e2ca4e7dSBen Skeggs }
57