xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/pci/gf106.c (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
1bec4961eSKarol Herbst /*
2bec4961eSKarol Herbst  * Copyright 2015 Karol Herbst <nouveau@karolherbst.de>
3bec4961eSKarol Herbst  *
4bec4961eSKarol Herbst  * Permission is hereby granted, free of charge, to any person obtaining a
5bec4961eSKarol Herbst  * copy of this software and associated documentation files (the "Software"),
6bec4961eSKarol Herbst  * to deal in the Software without restriction, including without limitation
7bec4961eSKarol Herbst  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8bec4961eSKarol Herbst  * and/or sell copies of the Software, and to permit persons to whom the
9bec4961eSKarol Herbst  * Software is furnished to do so, subject to the following conditions:
10bec4961eSKarol Herbst  *
11bec4961eSKarol Herbst  * The above copyright notice and this permission notice shall be included in
12bec4961eSKarol Herbst  * all copies or substantial portions of the Software.
13bec4961eSKarol Herbst  *
14bec4961eSKarol Herbst  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15bec4961eSKarol Herbst  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16bec4961eSKarol Herbst  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17bec4961eSKarol Herbst  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18bec4961eSKarol Herbst  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19bec4961eSKarol Herbst  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20bec4961eSKarol Herbst  * OTHER DEALINGS IN THE SOFTWARE.
21bec4961eSKarol Herbst  *
22bec4961eSKarol Herbst  * Authors: Karol Herbst <nouveau@karolherbst.de>
23bec4961eSKarol Herbst  */
24bec4961eSKarol Herbst #include "priv.h"
25bec4961eSKarol Herbst 
26bec4961eSKarol Herbst static const struct nvkm_pci_func
27bec4961eSKarol Herbst gf106_pci_func = {
28bec4961eSKarol Herbst 	.init = g84_pci_init,
29bec4961eSKarol Herbst 	.rd32 = nv40_pci_rd32,
30bec4961eSKarol Herbst 	.wr08 = nv40_pci_wr08,
31bec4961eSKarol Herbst 	.wr32 = nv40_pci_wr32,
32bec4961eSKarol Herbst 	.msi_rearm = nv40_pci_msi_rearm,
337c923844SKarol Herbst 
347c923844SKarol Herbst 	.pcie.init = gf100_pcie_init,
357c923844SKarol Herbst 	.pcie.set_link = gf100_pcie_set_link,
367c923844SKarol Herbst 
377c923844SKarol Herbst 	.pcie.max_speed = g84_pcie_max_speed,
387c923844SKarol Herbst 	.pcie.cur_speed = g84_pcie_cur_speed,
397c923844SKarol Herbst 
407c923844SKarol Herbst 	.pcie.set_version = gf100_pcie_set_version,
417c923844SKarol Herbst 	.pcie.version = gf100_pcie_version,
42725af748SKarol Herbst 	.pcie.version_supported = g92_pcie_version_supported,
43bec4961eSKarol Herbst };
44bec4961eSKarol Herbst 
45bec4961eSKarol Herbst int
gf106_pci_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_pci ** ppci)46*9b70cd54SBen Skeggs gf106_pci_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
47*9b70cd54SBen Skeggs 	      struct nvkm_pci **ppci)
48bec4961eSKarol Herbst {
49*9b70cd54SBen Skeggs 	return nvkm_pci_new_(&gf106_pci_func, device, type, inst, ppci);
50bec4961eSKarol Herbst }
51