| 1 | /* $NetBSD: nouveau_engine_device_nv20.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_nv20.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/gpio.h> |
| 33 | #include <subdev/i2c.h> |
| 34 | #include <subdev/clock.h> |
| 35 | #include <subdev/therm.h> |
| 36 | #include <subdev/devinit.h> |
| 37 | #include <subdev/mc.h> |
| 38 | #include <subdev/timer.h> |
| 39 | #include <subdev/fb.h> |
| 40 | #include <subdev/instmem.h> |
| 41 | #include <subdev/vm.h> |
| 42 | |
| 43 | #include <engine/device.h> |
| 44 | #include <engine/dmaobj.h> |
| 45 | #include <engine/fifo.h> |
| 46 | #include <engine/software.h> |
| 47 | #include <engine/graph.h> |
| 48 | #include <engine/disp.h> |
| 49 | |
| 50 | int |
| 51 | nv20_identify(struct nouveau_device *device) |
| 52 | { |
| 53 | switch (device->chipset) { |
| 54 | case 0x20: |
| 55 | device->cname = "NV20" ; |
| 56 | device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; |
| 57 | device->oclass[NVDEV_SUBDEV_GPIO ] = &nv10_gpio_oclass; |
| 58 | device->oclass[NVDEV_SUBDEV_I2C ] = &nv04_i2c_oclass; |
| 59 | device->oclass[NVDEV_SUBDEV_CLOCK ] = &nv04_clock_oclass; |
| 60 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass; |
| 61 | device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; |
| 62 | device->oclass[NVDEV_SUBDEV_BUS ] = nv04_bus_oclass; |
| 63 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| 64 | device->oclass[NVDEV_SUBDEV_FB ] = nv20_fb_oclass; |
| 65 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv04_instmem_oclass; |
| 66 | device->oclass[NVDEV_SUBDEV_VM ] = &nv04_vmmgr_oclass; |
| 67 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nv04_dmaeng_oclass; |
| 68 | device->oclass[NVDEV_ENGINE_FIFO ] = nv17_fifo_oclass; |
| 69 | device->oclass[NVDEV_ENGINE_SW ] = nv10_software_oclass; |
| 70 | device->oclass[NVDEV_ENGINE_GR ] = &nv20_graph_oclass; |
| 71 | device->oclass[NVDEV_ENGINE_DISP ] = nv04_disp_oclass; |
| 72 | break; |
| 73 | case 0x25: |
| 74 | device->cname = "NV25" ; |
| 75 | device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; |
| 76 | device->oclass[NVDEV_SUBDEV_GPIO ] = &nv10_gpio_oclass; |
| 77 | device->oclass[NVDEV_SUBDEV_I2C ] = &nv04_i2c_oclass; |
| 78 | device->oclass[NVDEV_SUBDEV_CLOCK ] = &nv04_clock_oclass; |
| 79 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass; |
| 80 | device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; |
| 81 | device->oclass[NVDEV_SUBDEV_BUS ] = nv04_bus_oclass; |
| 82 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| 83 | device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass; |
| 84 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv04_instmem_oclass; |
| 85 | device->oclass[NVDEV_SUBDEV_VM ] = &nv04_vmmgr_oclass; |
| 86 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nv04_dmaeng_oclass; |
| 87 | device->oclass[NVDEV_ENGINE_FIFO ] = nv17_fifo_oclass; |
| 88 | device->oclass[NVDEV_ENGINE_SW ] = nv10_software_oclass; |
| 89 | device->oclass[NVDEV_ENGINE_GR ] = &nv25_graph_oclass; |
| 90 | device->oclass[NVDEV_ENGINE_DISP ] = nv04_disp_oclass; |
| 91 | break; |
| 92 | case 0x28: |
| 93 | device->cname = "NV28" ; |
| 94 | device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; |
| 95 | device->oclass[NVDEV_SUBDEV_GPIO ] = &nv10_gpio_oclass; |
| 96 | device->oclass[NVDEV_SUBDEV_I2C ] = &nv04_i2c_oclass; |
| 97 | device->oclass[NVDEV_SUBDEV_CLOCK ] = &nv04_clock_oclass; |
| 98 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass; |
| 99 | device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; |
| 100 | device->oclass[NVDEV_SUBDEV_BUS ] = nv04_bus_oclass; |
| 101 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| 102 | device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass; |
| 103 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv04_instmem_oclass; |
| 104 | device->oclass[NVDEV_SUBDEV_VM ] = &nv04_vmmgr_oclass; |
| 105 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nv04_dmaeng_oclass; |
| 106 | device->oclass[NVDEV_ENGINE_FIFO ] = nv17_fifo_oclass; |
| 107 | device->oclass[NVDEV_ENGINE_SW ] = nv10_software_oclass; |
| 108 | device->oclass[NVDEV_ENGINE_GR ] = &nv25_graph_oclass; |
| 109 | device->oclass[NVDEV_ENGINE_DISP ] = nv04_disp_oclass; |
| 110 | break; |
| 111 | case 0x2a: |
| 112 | device->cname = "NV2A" ; |
| 113 | device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; |
| 114 | device->oclass[NVDEV_SUBDEV_GPIO ] = &nv10_gpio_oclass; |
| 115 | device->oclass[NVDEV_SUBDEV_I2C ] = &nv04_i2c_oclass; |
| 116 | device->oclass[NVDEV_SUBDEV_CLOCK ] = &nv04_clock_oclass; |
| 117 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass; |
| 118 | device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; |
| 119 | device->oclass[NVDEV_SUBDEV_BUS ] = nv04_bus_oclass; |
| 120 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| 121 | device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass; |
| 122 | device->oclass[NVDEV_SUBDEV_INSTMEM] = nv04_instmem_oclass; |
| 123 | device->oclass[NVDEV_SUBDEV_VM ] = &nv04_vmmgr_oclass; |
| 124 | device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nv04_dmaeng_oclass; |
| 125 | device->oclass[NVDEV_ENGINE_FIFO ] = nv17_fifo_oclass; |
| 126 | device->oclass[NVDEV_ENGINE_SW ] = nv10_software_oclass; |
| 127 | device->oclass[NVDEV_ENGINE_GR ] = &nv2a_graph_oclass; |
| 128 | device->oclass[NVDEV_ENGINE_DISP ] = nv04_disp_oclass; |
| 129 | break; |
| 130 | default: |
| 131 | nv_fatal(device, "unknown Kelvin chipset\n" ); |
| 132 | return -EINVAL; |
| 133 | } |
| 134 | |
| 135 | return 0; |
| 136 | } |
| 137 | |