1d91ccec6SBen Skeggs /*
2d91ccec6SBen Skeggs * Copyright 2016 Red Hat Inc.
3d91ccec6SBen Skeggs *
4d91ccec6SBen Skeggs * Permission is hereby granted, free of charge, to any person obtaining a
5d91ccec6SBen Skeggs * copy of this software and associated documentation files (the "Software"),
6d91ccec6SBen Skeggs * to deal in the Software without restriction, including without limitation
7d91ccec6SBen Skeggs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8d91ccec6SBen Skeggs * and/or sell copies of the Software, and to permit persons to whom the
9d91ccec6SBen Skeggs * Software is furnished to do so, subject to the following conditions:
10d91ccec6SBen Skeggs *
11d91ccec6SBen Skeggs * The above copyright notice and this permission notice shall be included in
12d91ccec6SBen Skeggs * all copies or substantial portions of the Software.
13d91ccec6SBen Skeggs *
14d91ccec6SBen Skeggs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15d91ccec6SBen Skeggs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16d91ccec6SBen Skeggs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17d91ccec6SBen Skeggs * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18d91ccec6SBen Skeggs * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19d91ccec6SBen Skeggs * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20d91ccec6SBen Skeggs * OTHER DEALINGS IN THE SOFTWARE.
21d91ccec6SBen Skeggs *
22d91ccec6SBen Skeggs * Authors: Ben Skeggs <bskeggs@redhat.com>
23d91ccec6SBen Skeggs */
24d91ccec6SBen Skeggs #include "priv.h"
25d91ccec6SBen Skeggs
26f15cde64SBen Skeggs static const struct nvkm_falcon_func
27f15cde64SBen Skeggs gp102_pmu_flcn = {
28f15cde64SBen Skeggs .disable = gm200_flcn_disable,
29f15cde64SBen Skeggs .enable = gm200_flcn_enable,
30f15cde64SBen Skeggs .reset_eng = gp102_flcn_reset_eng,
31f15cde64SBen Skeggs .reset_wait_mem_scrubbing = gm200_flcn_reset_wait_mem_scrubbing,
32f15cde64SBen Skeggs .debug = 0xc08,
33*2541626cSBen Skeggs .bind_inst = gm200_pmu_flcn_bind_inst,
34*2541626cSBen Skeggs .bind_stat = gm200_flcn_bind_stat,
35*2541626cSBen Skeggs .imem_pio = &gm200_flcn_imem_pio,
36*2541626cSBen Skeggs .dmem_pio = &gm200_flcn_dmem_pio,
37f15cde64SBen Skeggs .start = nvkm_falcon_v1_start,
38f15cde64SBen Skeggs .cmdq = { 0x4a0, 0x4b0, 4 },
39f15cde64SBen Skeggs .msgq = { 0x4c8, 0x4cc, 0 },
40f15cde64SBen Skeggs };
41d91ccec6SBen Skeggs
42d91ccec6SBen Skeggs static const struct nvkm_pmu_func
43d91ccec6SBen Skeggs gp102_pmu = {
44f15cde64SBen Skeggs .flcn = &gp102_pmu_flcn,
45d91ccec6SBen Skeggs };
46d91ccec6SBen Skeggs
47989863d7SBen Skeggs static const struct nvkm_pmu_fwif
48989863d7SBen Skeggs gp102_pmu_fwif[] = {
4938fd546bSBen Skeggs { -1, gm200_pmu_nofw, &gp102_pmu },
50989863d7SBen Skeggs {}
51989863d7SBen Skeggs };
52989863d7SBen Skeggs
53d91ccec6SBen Skeggs int
gp102_pmu_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_pmu ** ppmu)54e4b15b4cSBen Skeggs gp102_pmu_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
55e4b15b4cSBen Skeggs struct nvkm_pmu **ppmu)
56d91ccec6SBen Skeggs {
57e4b15b4cSBen Skeggs return nvkm_pmu_new_(gp102_pmu_fwif, device, type, inst, ppmu);
58d91ccec6SBen Skeggs }
59