1 | /* $NetBSD: nouveau_engine_device_nv04.c,v 1.1.1.1 2014/08/06 12:36:24 riastradh Exp $ */ |
2 | |
3 | /* |
4 | * Copyright 2012 Red Hat Inc. |
5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), |
8 | * to deal in the Software without restriction, including without limitation |
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
10 | * and/or sell copies of the Software, and to permit persons to whom the |
11 | * Software is furnished to do so, subject to the following conditions: |
12 | * |
13 | * The above copyright notice and this permission notice shall be included in |
14 | * all copies or substantial portions of the Software. |
15 | * |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
19 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
22 | * OTHER DEALINGS IN THE SOFTWARE. |
23 | * |
24 | * Authors: Ben Skeggs |
25 | */ |
26 | |
27 | #include <sys/cdefs.h> |
28 | __KERNEL_RCSID(0, "$NetBSD: nouveau_engine_device_nv04.c,v 1.1.1.1 2014/08/06 12:36:24 riastradh Exp $" ); |
29 | |
30 | #include <subdev/bios.h> |
31 | #include <subdev/bus.h> |
32 | #include <subdev/i2c.h> |
33 | #include <subdev/clock.h> |
34 | #include <subdev/devinit.h> |
35 | #include <subdev/mc.h> |
36 | #include <subdev/timer.h> |
37 | #include <subdev/fb.h> |
38 | #include <subdev/instmem.h> |
39 | #include <subdev/vm.h> |
40 | |
41 | #include <engine/device.h> |
42 | #include <engine/dmaobj.h> |
43 | #include <engine/fifo.h> |
44 | #include <engine/software.h> |
45 | #include <engine/graph.h> |
46 | #include <engine/disp.h> |
47 | |
48 | int |
49 | nv04_identify(struct nouveau_device *device) |
50 | { |
51 | switch (device->chipset) { |
52 | case 0x04: |
53 | device->cname = "NV04" ; |
54 | device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; |
55 | device->oclass[NVDEV_SUBDEV_I2C ] = &nv04_i2c_oclass; |
56 | device->oclass[NVDEV_SUBDEV_CLOCK ] = &nv04_clock_oclass; |
57 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv04_devinit_oclass; |
58 | device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; |
59 | device->oclass[NVDEV_SUBDEV_BUS ] = nv04_bus_oclass; |
60 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
61 | device->oclass[NVDEV_SUBDEV_FB ] = nv04_fb_oclass; |
62 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv04_instmem_oclass; |
63 | device->oclass[NVDEV_SUBDEV_VM ] = &nv04_vmmgr_oclass; |
64 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nv04_dmaeng_oclass; |
65 | device->oclass[NVDEV_ENGINE_FIFO ] = nv04_fifo_oclass; |
66 | device->oclass[NVDEV_ENGINE_SW ] = nv04_software_oclass; |
67 | device->oclass[NVDEV_ENGINE_GR ] = &nv04_graph_oclass; |
68 | device->oclass[NVDEV_ENGINE_DISP ] = nv04_disp_oclass; |
69 | break; |
70 | case 0x05: |
71 | device->cname = "NV05" ; |
72 | device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; |
73 | device->oclass[NVDEV_SUBDEV_I2C ] = &nv04_i2c_oclass; |
74 | device->oclass[NVDEV_SUBDEV_CLOCK ] = &nv04_clock_oclass; |
75 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv05_devinit_oclass; |
76 | device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; |
77 | device->oclass[NVDEV_SUBDEV_BUS ] = nv04_bus_oclass; |
78 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
79 | device->oclass[NVDEV_SUBDEV_FB ] = nv04_fb_oclass; |
80 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv04_instmem_oclass; |
81 | device->oclass[NVDEV_SUBDEV_VM ] = &nv04_vmmgr_oclass; |
82 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nv04_dmaeng_oclass; |
83 | device->oclass[NVDEV_ENGINE_FIFO ] = nv04_fifo_oclass; |
84 | device->oclass[NVDEV_ENGINE_SW ] = nv04_software_oclass; |
85 | device->oclass[NVDEV_ENGINE_GR ] = &nv04_graph_oclass; |
86 | device->oclass[NVDEV_ENGINE_DISP ] = nv04_disp_oclass; |
87 | break; |
88 | default: |
89 | nv_fatal(device, "unknown RIVA chipset\n" ); |
90 | return -EINVAL; |
91 | } |
92 | |
93 | return 0; |
94 | } |
95 | |