gm100.c 5.9 KB
Newer Older
B
Ben Skeggs 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * Copyright 2012 Red Hat Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: Ben Skeggs
 */
24
#include "priv.h"
B
Ben Skeggs 已提交
25 26 27 28 29

#include <subdev/bios.h>
#include <subdev/bus.h>
#include <subdev/gpio.h>
#include <subdev/i2c.h>
30
#include <subdev/fuse.h>
31
#include <subdev/clk.h>
B
Ben Skeggs 已提交
32 33 34 35 36 37
#include <subdev/therm.h>
#include <subdev/mxm.h>
#include <subdev/devinit.h>
#include <subdev/mc.h>
#include <subdev/timer.h>
#include <subdev/fb.h>
38
#include <subdev/ltc.h>
B
Ben Skeggs 已提交
39 40
#include <subdev/ibus.h>
#include <subdev/instmem.h>
41
#include <subdev/mmu.h>
B
Ben Skeggs 已提交
42
#include <subdev/bar.h>
43
#include <subdev/pmu.h>
B
Ben Skeggs 已提交
44 45 46 47
#include <subdev/volt.h>

#include <engine/dmaobj.h>
#include <engine/fifo.h>
48
#include <engine/sw.h>
49
#include <engine/gr.h>
B
Ben Skeggs 已提交
50
#include <engine/disp.h>
51
#include <engine/ce.h>
B
Ben Skeggs 已提交
52
#include <engine/bsp.h>
53
#include <engine/msvld.h>
54
#include <engine/mspdec.h>
55
#include <engine/msppp.h>
56
#include <engine/pm.h>
B
Ben Skeggs 已提交
57 58

int
59
gm100_identify(struct nvkm_device *device)
B
Ben Skeggs 已提交
60 61 62 63
{
	switch (device->chipset) {
	case 0x117:
		device->cname = "GM107";
64
		device->oclass[NVDEV_SUBDEV_VBIOS  ] = &nvkm_bios_oclass;
65
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  gk104_gpio_oclass;
66
		device->oclass[NVDEV_SUBDEV_I2C    ] =  gf110_i2c_oclass;
67
		device->oclass[NVDEV_SUBDEV_FUSE   ] = &gm107_fuse_oclass;
68
		device->oclass[NVDEV_SUBDEV_CLK    ] = &gk104_clk_oclass;
69
		device->oclass[NVDEV_SUBDEV_THERM  ] = &gm107_therm_oclass;
B
Ben Skeggs 已提交
70 71
		device->oclass[NVDEV_SUBDEV_MXM    ] = &nv50_mxm_oclass;
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  gm107_devinit_oclass;
72
		device->oclass[NVDEV_SUBDEV_MC     ] =  gk20a_mc_oclass;
73
		device->oclass[NVDEV_SUBDEV_BUS    ] =  gf100_bus_oclass;
B
Ben Skeggs 已提交
74 75
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &gk20a_timer_oclass;
		device->oclass[NVDEV_SUBDEV_FB     ] =  gm107_fb_oclass;
76
		device->oclass[NVDEV_SUBDEV_LTC    ] =  gm107_ltc_oclass;
77
		device->oclass[NVDEV_SUBDEV_IBUS   ] = &gk104_ibus_oclass;
B
Ben Skeggs 已提交
78
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv50_instmem_oclass;
79
		device->oclass[NVDEV_SUBDEV_MMU    ] = &gf100_mmu_oclass;
80
		device->oclass[NVDEV_SUBDEV_BAR    ] = &gf100_bar_oclass;
81
		device->oclass[NVDEV_SUBDEV_PMU    ] =  gk208_pmu_oclass;
82 83

#if 0
B
Ben Skeggs 已提交
84 85
		device->oclass[NVDEV_SUBDEV_VOLT   ] = &nv40_volt_oclass;
#endif
86
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  gf110_dmaeng_oclass;
87
		device->oclass[NVDEV_ENGINE_FIFO   ] =  gk208_fifo_oclass;
88
		device->oclass[NVDEV_ENGINE_SW     ] =  gf100_sw_oclass;
89
		device->oclass[NVDEV_ENGINE_GR     ] =  gm107_gr_oclass;
B
Ben Skeggs 已提交
90
		device->oclass[NVDEV_ENGINE_DISP   ] =  gm107_disp_oclass;
91
		device->oclass[NVDEV_ENGINE_CE0    ] = &gk104_ce0_oclass;
B
Ben Skeggs 已提交
92
#if 0
93
		device->oclass[NVDEV_ENGINE_CE1    ] = &gk104_ce1_oclass;
B
Ben Skeggs 已提交
94
#endif
95
		device->oclass[NVDEV_ENGINE_CE2    ] = &gk104_ce2_oclass;
B
Ben Skeggs 已提交
96
#if 0
97
		device->oclass[NVDEV_ENGINE_MSVLD  ] = &gk104_msvld_oclass;
98
		device->oclass[NVDEV_ENGINE_MSPDEC ] = &gk104_mspdec_oclass;
99
		device->oclass[NVDEV_ENGINE_MSPPP  ] = &gf100_msppp_oclass;
B
Ben Skeggs 已提交
100 101 102 103
#endif
		break;
	case 0x124:
		device->cname = "GM204";
104
		device->oclass[NVDEV_SUBDEV_VBIOS  ] = &nvkm_bios_oclass;
105
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  gk104_gpio_oclass;
B
Ben Skeggs 已提交
106 107 108 109
		device->oclass[NVDEV_SUBDEV_I2C    ] =  gm204_i2c_oclass;
		device->oclass[NVDEV_SUBDEV_FUSE   ] = &gm107_fuse_oclass;
#if 0
		/* looks to be some non-trivial changes */
110
		device->oclass[NVDEV_SUBDEV_CLK    ] = &gk104_clk_oclass;
B
Ben Skeggs 已提交
111 112 113 114 115 116
		/* priv ring says no to 0x10eb14 writes */
		device->oclass[NVDEV_SUBDEV_THERM  ] = &gm107_therm_oclass;
#endif
		device->oclass[NVDEV_SUBDEV_MXM    ] = &nv50_mxm_oclass;
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  gm204_devinit_oclass;
		device->oclass[NVDEV_SUBDEV_MC     ] =  gk20a_mc_oclass;
117
		device->oclass[NVDEV_SUBDEV_BUS    ] =  gf100_bus_oclass;
B
Ben Skeggs 已提交
118 119 120
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &gk20a_timer_oclass;
		device->oclass[NVDEV_SUBDEV_FB     ] =  gm107_fb_oclass;
		device->oclass[NVDEV_SUBDEV_LTC    ] =  gm107_ltc_oclass;
121
		device->oclass[NVDEV_SUBDEV_IBUS   ] = &gk104_ibus_oclass;
B
Ben Skeggs 已提交
122
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv50_instmem_oclass;
123
		device->oclass[NVDEV_SUBDEV_MMU    ] = &gf100_mmu_oclass;
124
		device->oclass[NVDEV_SUBDEV_BAR    ] = &gf100_bar_oclass;
125
		device->oclass[NVDEV_SUBDEV_PMU    ] =  gk208_pmu_oclass;
B
Ben Skeggs 已提交
126 127 128
#if 0
		device->oclass[NVDEV_SUBDEV_VOLT   ] = &nv40_volt_oclass;
#endif
129
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  gf110_dmaeng_oclass;
B
Ben Skeggs 已提交
130
#if 0
131
		device->oclass[NVDEV_ENGINE_FIFO   ] =  gk208_fifo_oclass;
132
		device->oclass[NVDEV_ENGINE_SW     ] =  gf100_sw_oclass;
133
		device->oclass[NVDEV_ENGINE_GR     ] =  gm107_gr_oclass;
B
Ben Skeggs 已提交
134 135 136
#endif
		device->oclass[NVDEV_ENGINE_DISP   ] =  gm204_disp_oclass;
#if 0
137 138 139
		device->oclass[NVDEV_ENGINE_CE0    ] = &gm204_ce0_oclass;
		device->oclass[NVDEV_ENGINE_CE1    ] = &gm204_ce1_oclass;
		device->oclass[NVDEV_ENGINE_CE2    ] = &gm204_ce2_oclass;
140
		device->oclass[NVDEV_ENGINE_MSVLD  ] = &gk104_msvld_oclass;
141
		device->oclass[NVDEV_ENGINE_MSPDEC ] = &gk104_mspdec_oclass;
142
		device->oclass[NVDEV_ENGINE_MSPPP  ] = &gf100_msppp_oclass;
B
Ben Skeggs 已提交
143 144 145 146 147 148 149 150 151
#endif
		break;
	default:
		nv_fatal(device, "unknown Maxwell chipset\n");
		return -EINVAL;
	}

	return 0;
}