xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gp100.c (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
145aa4d07SBen Skeggs /*
245aa4d07SBen Skeggs  * Copyright 2015 Red Hat Inc.
345aa4d07SBen Skeggs  *
445aa4d07SBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
545aa4d07SBen Skeggs  * copy of this software and associated documentation files (the "Software"),
645aa4d07SBen Skeggs  * to deal in the Software without restriction, including without limitation
745aa4d07SBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
845aa4d07SBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
945aa4d07SBen Skeggs  * Software is furnished to do so, subject to the following conditions:
1045aa4d07SBen Skeggs  *
1145aa4d07SBen Skeggs  * The above copyright notice and this permission notice shall be included in
1245aa4d07SBen Skeggs  * all copies or substantial portions of the Software.
1345aa4d07SBen Skeggs  *
1445aa4d07SBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1545aa4d07SBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1645aa4d07SBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1745aa4d07SBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1845aa4d07SBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1945aa4d07SBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2045aa4d07SBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
2145aa4d07SBen Skeggs  *
2245aa4d07SBen Skeggs  * Authors: Ben Skeggs <bskeggs@redhat.com>
2345aa4d07SBen Skeggs  */
2445aa4d07SBen Skeggs #include "priv.h"
2545aa4d07SBen Skeggs 
2645aa4d07SBen Skeggs static void
gp100_pci_msi_rearm(struct nvkm_pci * pci)2745aa4d07SBen Skeggs gp100_pci_msi_rearm(struct nvkm_pci *pci)
2845aa4d07SBen Skeggs {
2945aa4d07SBen Skeggs 	nvkm_pci_wr32(pci, 0x0704, 0x00000000);
3045aa4d07SBen Skeggs }
3145aa4d07SBen Skeggs 
3245aa4d07SBen Skeggs static const struct nvkm_pci_func
3345aa4d07SBen Skeggs gp100_pci_func = {
3445aa4d07SBen Skeggs 	.rd32 = nv40_pci_rd32,
3545aa4d07SBen Skeggs 	.wr08 = nv40_pci_wr08,
3645aa4d07SBen Skeggs 	.wr32 = nv40_pci_wr32,
3745aa4d07SBen Skeggs 	.msi_rearm = gp100_pci_msi_rearm,
3845aa4d07SBen Skeggs };
3945aa4d07SBen Skeggs 
4045aa4d07SBen Skeggs int
gp100_pci_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_pci ** ppci)41*9b70cd54SBen Skeggs gp100_pci_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
42*9b70cd54SBen Skeggs 	      struct nvkm_pci **ppci)
4345aa4d07SBen Skeggs {
44*9b70cd54SBen Skeggs 	return nvkm_pci_new_(&gp100_pci_func, device, type, inst, ppci);
4545aa4d07SBen Skeggs }
46