1f83d1c31SBen Skeggs /*
2f83d1c31SBen Skeggs * Copyright 2021 Red Hat Inc.
3f83d1c31SBen Skeggs *
4f83d1c31SBen Skeggs * Permission is hereby granted, free of charge, to any person obtaining a
5f83d1c31SBen Skeggs * copy of this software and associated documentation files (the "Software"),
6f83d1c31SBen Skeggs * to deal in the Software without restriction, including without limitation
7f83d1c31SBen Skeggs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8f83d1c31SBen Skeggs * and/or sell copies of the Software, and to permit persons to whom the
9f83d1c31SBen Skeggs * Software is furnished to do so, subject to the following conditions:
10f83d1c31SBen Skeggs *
11f83d1c31SBen Skeggs * The above copyright notice and this permission notice shall be included in
12f83d1c31SBen Skeggs * all copies or substantial portions of the Software.
13f83d1c31SBen Skeggs *
14f83d1c31SBen Skeggs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15f83d1c31SBen Skeggs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16f83d1c31SBen Skeggs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17f83d1c31SBen Skeggs * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18f83d1c31SBen Skeggs * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19f83d1c31SBen Skeggs * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20f83d1c31SBen Skeggs * OTHER DEALINGS IN THE SOFTWARE.
21f83d1c31SBen Skeggs */
22f83d1c31SBen Skeggs #include "priv.h"
23f83d1c31SBen Skeggs
2458c3d3c8SBen Skeggs #include <nvif/class.h>
2558c3d3c8SBen Skeggs
26*e6507380SBen Skeggs static const struct nvkm_intr_data
27*e6507380SBen Skeggs ga100_vfn_intrs[] = {
28*e6507380SBen Skeggs { NVKM_ENGINE_DISP , 0, 4, 0x04000000, true },
29*e6507380SBen Skeggs { NVKM_SUBDEV_GPIO , 0, 4, 0x00200000, true },
30*e6507380SBen Skeggs { NVKM_SUBDEV_I2C , 0, 4, 0x00200000, true },
31*e6507380SBen Skeggs { NVKM_SUBDEV_PRIVRING, 0, 4, 0x40000000, true },
32*e6507380SBen Skeggs {}
33*e6507380SBen Skeggs };
34*e6507380SBen Skeggs
35f83d1c31SBen Skeggs static const struct nvkm_vfn_func
36f83d1c31SBen Skeggs ga100_vfn = {
37*e6507380SBen Skeggs .intr = &tu102_vfn_intr,
38*e6507380SBen Skeggs .intrs = ga100_vfn_intrs,
3958c3d3c8SBen Skeggs .user = { 0x030000, 0x010000, { -1, -1, AMPERE_USERMODE_A } },
40f83d1c31SBen Skeggs };
41f83d1c31SBen Skeggs
42f83d1c31SBen Skeggs int
ga100_vfn_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_vfn ** pvfn)43f83d1c31SBen Skeggs ga100_vfn_new(struct nvkm_device *device,
44f83d1c31SBen Skeggs enum nvkm_subdev_type type, int inst, struct nvkm_vfn **pvfn)
45f83d1c31SBen Skeggs {
46f83d1c31SBen Skeggs return nvkm_vfn_new_(&ga100_vfn, device, type, inst, 0xb80000, pvfn);
47f83d1c31SBen Skeggs }
48