blob: e453a52135d7bfccd79eae845ee60b00a5786d41 [file] [log] [blame]
Ben Skeggs3f204642014-02-24 11:28:37 +10001/*
2 * Copyright 2012 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Ben Skeggs
23 */
24
25#include <subdev/bios.h>
26#include <subdev/bus.h>
27#include <subdev/gpio.h>
28#include <subdev/i2c.h>
Martin Peres3ca6cd42014-08-26 00:26:38 +020029#include <subdev/fuse.h>
Ben Skeggsf3867f42015-01-13 23:37:38 +100030#include <subdev/clk.h>
Ben Skeggs3f204642014-02-24 11:28:37 +100031#include <subdev/therm.h>
32#include <subdev/mxm.h>
33#include <subdev/devinit.h>
34#include <subdev/mc.h>
35#include <subdev/timer.h>
36#include <subdev/fb.h>
Ben Skeggs95484b52014-08-10 04:10:28 +100037#include <subdev/ltc.h>
Ben Skeggs3f204642014-02-24 11:28:37 +100038#include <subdev/ibus.h>
39#include <subdev/instmem.h>
40#include <subdev/vm.h>
41#include <subdev/bar.h>
42#include <subdev/pwr.h>
43#include <subdev/volt.h>
44
45#include <engine/device.h>
46#include <engine/dmaobj.h>
47#include <engine/fifo.h>
48#include <engine/software.h>
49#include <engine/graph.h>
50#include <engine/disp.h>
51#include <engine/copy.h>
52#include <engine/bsp.h>
53#include <engine/vp.h>
54#include <engine/ppp.h>
55#include <engine/perfmon.h>
56
57int
58gm100_identify(struct nouveau_device *device)
59{
60 switch (device->chipset) {
61 case 0x117:
62 device->cname = "GM107";
63 device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
Ben Skeggsd93174e2014-05-12 14:18:06 +100064 device->oclass[NVDEV_SUBDEV_GPIO ] = nve0_gpio_oclass;
Ben Skeggsc26fe842014-05-13 13:59:26 +100065 device->oclass[NVDEV_SUBDEV_I2C ] = nvd0_i2c_oclass;
Martin Peres3ca6cd42014-08-26 00:26:38 +020066 device->oclass[NVDEV_SUBDEV_FUSE ] = &gm107_fuse_oclass;
Ben Skeggsf3867f42015-01-13 23:37:38 +100067 device->oclass[NVDEV_SUBDEV_CLK ] = &nve0_clk_oclass;
Martin Peres808a1882014-08-17 17:33:08 +020068 device->oclass[NVDEV_SUBDEV_THERM ] = &gm107_therm_oclass;
Ben Skeggs3f204642014-02-24 11:28:37 +100069 device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
70 device->oclass[NVDEV_SUBDEV_DEVINIT] = gm107_devinit_oclass;
Ben Skeggs7d155da2014-06-12 22:15:21 +100071 device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
Ben Skeggs3f204642014-02-24 11:28:37 +100072 device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass;
73 device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass;
74 device->oclass[NVDEV_SUBDEV_FB ] = gm107_fb_oclass;
Ben Skeggs95484b52014-08-10 04:10:28 +100075 device->oclass[NVDEV_SUBDEV_LTC ] = gm107_ltc_oclass;
Ben Skeggs3f204642014-02-24 11:28:37 +100076 device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
77 device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
78 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass;
79 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass;
Ben Skeggsadec9bc2014-06-12 18:31:32 +100080 device->oclass[NVDEV_SUBDEV_PWR ] = nv108_pwr_oclass;
Martin Peres2a5e5fa2014-08-17 17:33:09 +020081
82#if 0
Ben Skeggs3f204642014-02-24 11:28:37 +100083 device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass;
84#endif
Ben Skeggsbc985402014-08-10 04:10:24 +100085 device->oclass[NVDEV_ENGINE_DMAOBJ ] = nvd0_dmaeng_oclass;
Ben Skeggs3f204642014-02-24 11:28:37 +100086 device->oclass[NVDEV_ENGINE_FIFO ] = nv108_fifo_oclass;
87 device->oclass[NVDEV_ENGINE_SW ] = nvc0_software_oclass;
Ben Skeggs6f1e9b92014-03-04 11:00:41 +100088 device->oclass[NVDEV_ENGINE_GR ] = gm107_graph_oclass;
Ben Skeggs3f204642014-02-24 11:28:37 +100089 device->oclass[NVDEV_ENGINE_DISP ] = gm107_disp_oclass;
90 device->oclass[NVDEV_ENGINE_COPY0 ] = &nve0_copy0_oclass;
91#if 0
92 device->oclass[NVDEV_ENGINE_COPY1 ] = &nve0_copy1_oclass;
93#endif
94 device->oclass[NVDEV_ENGINE_COPY2 ] = &nve0_copy2_oclass;
95#if 0
96 device->oclass[NVDEV_ENGINE_BSP ] = &nve0_bsp_oclass;
97 device->oclass[NVDEV_ENGINE_VP ] = &nve0_vp_oclass;
98 device->oclass[NVDEV_ENGINE_PPP ] = &nvc0_ppp_oclass;
99#endif
100 break;
Ben Skeggs083dba02014-08-18 14:02:14 +1000101 case 0x124:
102 device->cname = "GM204";
103 device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
104 device->oclass[NVDEV_SUBDEV_GPIO ] = nve0_gpio_oclass;
105 device->oclass[NVDEV_SUBDEV_I2C ] = gm204_i2c_oclass;
106 device->oclass[NVDEV_SUBDEV_FUSE ] = &gm107_fuse_oclass;
107#if 0
108 /* looks to be some non-trivial changes */
Ben Skeggsf3867f42015-01-13 23:37:38 +1000109 device->oclass[NVDEV_SUBDEV_CLK ] = &nve0_clk_oclass;
Ben Skeggs083dba02014-08-18 14:02:14 +1000110 /* priv ring says no to 0x10eb14 writes */
111 device->oclass[NVDEV_SUBDEV_THERM ] = &gm107_therm_oclass;
112#endif
113 device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
114 device->oclass[NVDEV_SUBDEV_DEVINIT] = gm204_devinit_oclass;
115 device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
116 device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass;
117 device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass;
118 device->oclass[NVDEV_SUBDEV_FB ] = gm107_fb_oclass;
119 device->oclass[NVDEV_SUBDEV_LTC ] = gm107_ltc_oclass;
120 device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
121 device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
122 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass;
123 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass;
124 device->oclass[NVDEV_SUBDEV_PWR ] = nv108_pwr_oclass;
125#if 0
126 device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass;
127#endif
128 device->oclass[NVDEV_ENGINE_DMAOBJ ] = nvd0_dmaeng_oclass;
129#if 0
130 device->oclass[NVDEV_ENGINE_FIFO ] = nv108_fifo_oclass;
131 device->oclass[NVDEV_ENGINE_SW ] = nvc0_software_oclass;
132 device->oclass[NVDEV_ENGINE_GR ] = gm107_graph_oclass;
133#endif
134 device->oclass[NVDEV_ENGINE_DISP ] = gm204_disp_oclass;
135#if 0
136 device->oclass[NVDEV_ENGINE_COPY0 ] = &gm204_copy0_oclass;
137 device->oclass[NVDEV_ENGINE_COPY1 ] = &gm204_copy1_oclass;
138 device->oclass[NVDEV_ENGINE_COPY2 ] = &gm204_copy2_oclass;
139 device->oclass[NVDEV_ENGINE_BSP ] = &nve0_bsp_oclass;
140 device->oclass[NVDEV_ENGINE_VP ] = &nve0_vp_oclass;
141 device->oclass[NVDEV_ENGINE_PPP ] = &nvc0_ppp_oclass;
142#endif
143 break;
Ben Skeggs3f204642014-02-24 11:28:37 +1000144 default:
145 nv_fatal(device, "unknown Maxwell chipset\n");
146 return -EINVAL;
147 }
148
149 return 0;
150}