nv10.c 7.8 KB
Newer Older
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"
25 26

int
27
nv10_identify(struct nvkm_device *device)
28 29 30
{
	switch (device->chipset) {
	case 0x10:
31
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  nv10_gpio_oclass;
32
		device->oclass[NVDEV_SUBDEV_I2C    ] =  nv04_i2c_oclass;
33
		device->oclass[NVDEV_SUBDEV_CLK    ] = &nv04_clk_oclass;
34
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  nv10_devinit_oclass;
35
		device->oclass[NVDEV_SUBDEV_MC     ] =  nv04_mc_oclass;
36
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
37
		device->oclass[NVDEV_SUBDEV_FB     ] =  nv10_fb_oclass;
38
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv04_instmem_oclass;
39
		device->oclass[NVDEV_SUBDEV_MMU    ] = &nv04_mmu_oclass;
40
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
41
		device->oclass[NVDEV_ENGINE_GR     ] = &nv10_gr_oclass;
42
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
43 44
		break;
	case 0x15:
45
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  nv10_gpio_oclass;
46
		device->oclass[NVDEV_SUBDEV_I2C    ] =  nv04_i2c_oclass;
47
		device->oclass[NVDEV_SUBDEV_CLK    ] = &nv04_clk_oclass;
48
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  nv10_devinit_oclass;
49
		device->oclass[NVDEV_SUBDEV_MC     ] =  nv04_mc_oclass;
50
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
51
		device->oclass[NVDEV_SUBDEV_FB     ] =  nv10_fb_oclass;
52
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv04_instmem_oclass;
53
		device->oclass[NVDEV_SUBDEV_MMU    ] = &nv04_mmu_oclass;
54
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
55
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv10_fifo_oclass;
56
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
57
		device->oclass[NVDEV_ENGINE_GR     ] = &nv10_gr_oclass;
58
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
59 60
		break;
	case 0x16:
61
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  nv10_gpio_oclass;
62
		device->oclass[NVDEV_SUBDEV_I2C    ] =  nv04_i2c_oclass;
63
		device->oclass[NVDEV_SUBDEV_CLK    ] = &nv04_clk_oclass;
64
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  nv10_devinit_oclass;
65
		device->oclass[NVDEV_SUBDEV_MC     ] =  nv04_mc_oclass;
66
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
67
		device->oclass[NVDEV_SUBDEV_FB     ] =  nv10_fb_oclass;
68
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv04_instmem_oclass;
69
		device->oclass[NVDEV_SUBDEV_MMU    ] = &nv04_mmu_oclass;
70
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
71
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv10_fifo_oclass;
72
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
73
		device->oclass[NVDEV_ENGINE_GR     ] = &nv10_gr_oclass;
74
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
75 76
		break;
	case 0x1a:
77
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  nv10_gpio_oclass;
78
		device->oclass[NVDEV_SUBDEV_I2C    ] =  nv04_i2c_oclass;
79
		device->oclass[NVDEV_SUBDEV_CLK    ] = &nv04_clk_oclass;
80
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  nv1a_devinit_oclass;
81
		device->oclass[NVDEV_SUBDEV_MC     ] =  nv04_mc_oclass;
82
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
83
		device->oclass[NVDEV_SUBDEV_FB     ] =  nv1a_fb_oclass;
84
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv04_instmem_oclass;
85
		device->oclass[NVDEV_SUBDEV_MMU    ] = &nv04_mmu_oclass;
86
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
87
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv10_fifo_oclass;
88
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
89
		device->oclass[NVDEV_ENGINE_GR     ] = &nv10_gr_oclass;
90
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
91 92
		break;
	case 0x11:
93
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  nv10_gpio_oclass;
94
		device->oclass[NVDEV_SUBDEV_I2C    ] =  nv04_i2c_oclass;
95
		device->oclass[NVDEV_SUBDEV_CLK    ] = &nv04_clk_oclass;
96
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  nv10_devinit_oclass;
97
		device->oclass[NVDEV_SUBDEV_MC     ] =  nv04_mc_oclass;
98
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
99
		device->oclass[NVDEV_SUBDEV_FB     ] =  nv10_fb_oclass;
100
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv04_instmem_oclass;
101
		device->oclass[NVDEV_SUBDEV_MMU    ] = &nv04_mmu_oclass;
102
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
103
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv10_fifo_oclass;
104
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
105
		device->oclass[NVDEV_ENGINE_GR     ] = &nv10_gr_oclass;
106
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
107 108
		break;
	case 0x17:
109
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  nv10_gpio_oclass;
110
		device->oclass[NVDEV_SUBDEV_I2C    ] =  nv04_i2c_oclass;
111
		device->oclass[NVDEV_SUBDEV_CLK    ] = &nv04_clk_oclass;
112
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  nv10_devinit_oclass;
113
		device->oclass[NVDEV_SUBDEV_MC     ] =  nv04_mc_oclass;
114
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
115
		device->oclass[NVDEV_SUBDEV_FB     ] =  nv10_fb_oclass;
116
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv04_instmem_oclass;
117
		device->oclass[NVDEV_SUBDEV_MMU    ] = &nv04_mmu_oclass;
118
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
119
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv17_fifo_oclass;
120
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
121
		device->oclass[NVDEV_ENGINE_GR     ] = &nv10_gr_oclass;
122
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
123 124
		break;
	case 0x1f:
125
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  nv10_gpio_oclass;
126
		device->oclass[NVDEV_SUBDEV_I2C    ] =  nv04_i2c_oclass;
127
		device->oclass[NVDEV_SUBDEV_CLK    ] = &nv04_clk_oclass;
128
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  nv1a_devinit_oclass;
129
		device->oclass[NVDEV_SUBDEV_MC     ] =  nv04_mc_oclass;
130
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
131
		device->oclass[NVDEV_SUBDEV_FB     ] =  nv1a_fb_oclass;
132
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv04_instmem_oclass;
133
		device->oclass[NVDEV_SUBDEV_MMU    ] = &nv04_mmu_oclass;
134
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
135
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv17_fifo_oclass;
136
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
137
		device->oclass[NVDEV_ENGINE_GR     ] = &nv10_gr_oclass;
138
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
139 140
		break;
	case 0x18:
141
		device->oclass[NVDEV_SUBDEV_GPIO   ] =  nv10_gpio_oclass;
142
		device->oclass[NVDEV_SUBDEV_I2C    ] =  nv04_i2c_oclass;
143
		device->oclass[NVDEV_SUBDEV_CLK    ] = &nv04_clk_oclass;
144
		device->oclass[NVDEV_SUBDEV_DEVINIT] =  nv10_devinit_oclass;
145
		device->oclass[NVDEV_SUBDEV_MC     ] =  nv04_mc_oclass;
146
		device->oclass[NVDEV_SUBDEV_TIMER  ] = &nv04_timer_oclass;
147
		device->oclass[NVDEV_SUBDEV_FB     ] =  nv10_fb_oclass;
148
		device->oclass[NVDEV_SUBDEV_INSTMEM] =  nv04_instmem_oclass;
149
		device->oclass[NVDEV_SUBDEV_MMU    ] = &nv04_mmu_oclass;
150
		device->oclass[NVDEV_ENGINE_DMAOBJ ] =  nv04_dmaeng_oclass;
151
		device->oclass[NVDEV_ENGINE_FIFO   ] =  nv17_fifo_oclass;
152
		device->oclass[NVDEV_ENGINE_SW     ] =  nv10_sw_oclass;
153
		device->oclass[NVDEV_ENGINE_GR     ] = &nv10_gr_oclass;
154
		device->oclass[NVDEV_ENGINE_DISP   ] =  nv04_disp_oclass;
155 156 157 158 159 160 161
		break;
	default:
		return -EINVAL;
	}

	return 0;
}