Commit 9719047b authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/device: namespace + nvidia gpu names (no binary change)

The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver.  This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a56866a9
...@@ -50,7 +50,7 @@ void nvif_device_ref(struct nvif_device *, struct nvif_device **); ...@@ -50,7 +50,7 @@ void nvif_device_ref(struct nvif_device *, struct nvif_device **);
#define nvxx_wait_cb(a,b,c) nv_wait_cb(nvxx_timer(a), (b), (c)) #define nvxx_wait_cb(a,b,c) nv_wait_cb(nvxx_timer(a), (b), (c))
#define nvxx_therm(a) nouveau_therm(nvxx_device(a)) #define nvxx_therm(a) nouveau_therm(nvxx_device(a))
#include <engine/device.h> #include <core/device.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/gr.h> #include <engine/gr.h>
#include <engine/sw.h> #include <engine/sw.h>
......
...@@ -84,4 +84,18 @@ nv_device_resource_len(struct nvkm_device *device, unsigned int bar); ...@@ -84,4 +84,18 @@ nv_device_resource_len(struct nvkm_device *device, unsigned int bar);
int int
nv_device_get_irq(struct nvkm_device *device, bool stall); nv_device_get_irq(struct nvkm_device *device, bool stall);
struct platform_device;
enum nv_bus_type {
NVKM_BUS_PCI,
NVKM_BUS_PLATFORM,
};
#define nvkm_device_create(p,t,n,s,c,d,u) \
nvkm_device_create_((void *)(p), (t), (n), (s), (c), (d), \
sizeof(**u), (void **)u)
int nvkm_device_create_(void *, enum nv_bus_type type, u64 name,
const char *sname, const char *cfg, const char *dbg,
int, void **);
#endif #endif
...@@ -253,5 +253,7 @@ ...@@ -253,5 +253,7 @@
#define nouveau_gr nvkm_gr #define nouveau_gr nvkm_gr
#define nouveau_sw nvkm_sw #define nouveau_sw nvkm_sw
#define nouveau_sw_chan nvkm_sw_chan #define nouveau_sw_chan nvkm_sw_chan
#define nouveau_device_create nvkm_device_create
#define nouveau_device_create_ nvkm_device_create_
#endif #endif
...@@ -318,7 +318,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev, ...@@ -318,7 +318,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
remove_conflicting_framebuffers(aper, "nouveaufb", boot); remove_conflicting_framebuffers(aper, "nouveaufb", boot);
kfree(aper); kfree(aper);
ret = nouveau_device_create(pdev, NOUVEAU_BUS_PCI, ret = nouveau_device_create(pdev, NVKM_BUS_PCI,
nouveau_pci_name(pdev), pci_name(pdev), nouveau_pci_name(pdev), pci_name(pdev),
nouveau_config, nouveau_debug, &device); nouveau_config, nouveau_debug, &device);
if (ret) if (ret)
...@@ -1056,7 +1056,7 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size, ...@@ -1056,7 +1056,7 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size,
struct drm_device *drm; struct drm_device *drm;
int err; int err;
err = nouveau_device_create_(pdev, NOUVEAU_BUS_PLATFORM, err = nouveau_device_create_(pdev, NVKM_BUS_PLATFORM,
nouveau_platform_name(pdev), nouveau_platform_name(pdev),
dev_name(&pdev->dev), nouveau_config, dev_name(&pdev->dev), nouveau_config,
nouveau_debug, size, pobject); nouveau_debug, size, pobject);
......
...@@ -7,6 +7,6 @@ nvkm-y += nvkm/engine/device/nv20.o ...@@ -7,6 +7,6 @@ nvkm-y += nvkm/engine/device/nv20.o
nvkm-y += nvkm/engine/device/nv30.o nvkm-y += nvkm/engine/device/nv30.o
nvkm-y += nvkm/engine/device/nv40.o nvkm-y += nvkm/engine/device/nv40.o
nvkm-y += nvkm/engine/device/nv50.o nvkm-y += nvkm/engine/device/nv50.o
nvkm-y += nvkm/engine/device/nvc0.o nvkm-y += nvkm/engine/device/gf100.o
nvkm-y += nvkm/engine/device/nve0.o nvkm-y += nvkm/engine/device/gk104.o
nvkm-y += nvkm/engine/device/gm100.o nvkm-y += nvkm/engine/device/gm100.o
...@@ -21,14 +21,15 @@ ...@@ -21,14 +21,15 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "acpi.h" #include "acpi.h"
#include <core/device.h>
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
static int static int
nvkm_acpi_ntfy(struct notifier_block *nb, unsigned long val, void *data) nvkm_acpi_ntfy(struct notifier_block *nb, unsigned long val, void *data)
{ {
struct nouveau_device *device = struct nvkm_device *device =
container_of(nb, typeof(*device), acpi.nb); container_of(nb, typeof(*device), acpi.nb);
struct acpi_bus_event *info = data; struct acpi_bus_event *info = data;
...@@ -40,7 +41,7 @@ nvkm_acpi_ntfy(struct notifier_block *nb, unsigned long val, void *data) ...@@ -40,7 +41,7 @@ nvkm_acpi_ntfy(struct notifier_block *nb, unsigned long val, void *data)
#endif #endif
int int
nvkm_acpi_fini(struct nouveau_device *device, bool suspend) nvkm_acpi_fini(struct nvkm_device *device, bool suspend)
{ {
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
unregister_acpi_notifier(&device->acpi.nb); unregister_acpi_notifier(&device->acpi.nb);
...@@ -49,7 +50,7 @@ nvkm_acpi_fini(struct nouveau_device *device, bool suspend) ...@@ -49,7 +50,7 @@ nvkm_acpi_fini(struct nouveau_device *device, bool suspend)
} }
int int
nvkm_acpi_init(struct nouveau_device *device) nvkm_acpi_init(struct nvkm_device *device)
{ {
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
device->acpi.nb.notifier_call = nvkm_acpi_ntfy; device->acpi.nb.notifier_call = nvkm_acpi_ntfy;
......
#ifndef __NVKM_DEVICE_ACPI_H__ #ifndef __NVKM_DEVICE_ACPI_H__
#define __NVKM_DEVICE_ACPI_H__ #define __NVKM_DEVICE_ACPI_H__
#include <core/os.h>
struct nvkm_device;
#include <engine/device.h> int nvkm_acpi_init(struct nvkm_device *);
int nvkm_acpi_fini(struct nvkm_device *, bool);
int nvkm_acpi_init(struct nouveau_device *);
int nvkm_acpi_fini(struct nouveau_device *, bool);
#endif #endif
...@@ -21,29 +21,27 @@ ...@@ -21,29 +21,27 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include "acpi.h"
#include <core/notify.h>
#include <core/object.h>
#include <core/device.h>
#include <core/client.h> #include <core/client.h>
#include <core/option.h> #include <core/option.h>
#include <nvif/unpack.h> #include <core/notify.h>
#include <nvif/class.h> #include <core/parent.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/fb.h> #include <subdev/fb.h>
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include "priv.h" #include <nvif/class.h>
#include "acpi.h" #include <nvif/unpack.h>
static DEFINE_MUTEX(nv_devices_mutex); static DEFINE_MUTEX(nv_devices_mutex);
static LIST_HEAD(nv_devices); static LIST_HEAD(nv_devices);
struct nouveau_device * struct nvkm_device *
nouveau_device_find(u64 name) nvkm_device_find(u64 name)
{ {
struct nouveau_device *device, *match = NULL; struct nvkm_device *device, *match = NULL;
mutex_lock(&nv_devices_mutex); mutex_lock(&nv_devices_mutex);
list_for_each_entry(device, &nv_devices, head) { list_for_each_entry(device, &nv_devices, head) {
if (device->handle == name) { if (device->handle == name) {
...@@ -56,9 +54,9 @@ nouveau_device_find(u64 name) ...@@ -56,9 +54,9 @@ nouveau_device_find(u64 name)
} }
int int
nouveau_device_list(u64 *name, int size) nvkm_device_list(u64 *name, int size)
{ {
struct nouveau_device *device; struct nvkm_device *device;
int nr = 0; int nr = 0;
mutex_lock(&nv_devices_mutex); mutex_lock(&nv_devices_mutex);
list_for_each_entry(device, &nv_devices, head) { list_for_each_entry(device, &nv_devices, head) {
...@@ -70,20 +68,20 @@ nouveau_device_list(u64 *name, int size) ...@@ -70,20 +68,20 @@ nouveau_device_list(u64 *name, int size)
} }
/****************************************************************************** /******************************************************************************
* nouveau_devobj (0x0080): class implementation * nvkm_devobj (0x0080): class implementation
*****************************************************************************/ *****************************************************************************/
struct nouveau_devobj { struct nvkm_devobj {
struct nouveau_parent base; struct nvkm_parent base;
struct nouveau_object *subdev[NVDEV_SUBDEV_NR]; struct nvkm_object *subdev[NVDEV_SUBDEV_NR];
}; };
static int static int
nouveau_devobj_info(struct nouveau_object *object, void *data, u32 size) nvkm_devobj_info(struct nvkm_object *object, void *data, u32 size)
{ {
struct nouveau_device *device = nv_device(object); struct nvkm_device *device = nv_device(object);
struct nouveau_fb *pfb = nouveau_fb(device); struct nvkm_fb *pfb = nvkm_fb(device);
struct nouveau_instmem *imem = nouveau_instmem(device); struct nvkm_instmem *imem = nvkm_instmem(device);
union { union {
struct nv_device_info_v0 v0; struct nv_device_info_v0 v0;
} *args = data; } *args = data;
...@@ -148,12 +146,11 @@ nouveau_devobj_info(struct nouveau_object *object, void *data, u32 size) ...@@ -148,12 +146,11 @@ nouveau_devobj_info(struct nouveau_object *object, void *data, u32 size)
} }
static int static int
nouveau_devobj_mthd(struct nouveau_object *object, u32 mthd, nvkm_devobj_mthd(struct nvkm_object *object, u32 mthd, void *data, u32 size)
void *data, u32 size)
{ {
switch (mthd) { switch (mthd) {
case NV_DEVICE_V0_INFO: case NV_DEVICE_V0_INFO:
return nouveau_devobj_info(object, data, size); return nvkm_devobj_info(object, data, size);
default: default:
break; break;
} }
...@@ -161,45 +158,45 @@ nouveau_devobj_mthd(struct nouveau_object *object, u32 mthd, ...@@ -161,45 +158,45 @@ nouveau_devobj_mthd(struct nouveau_object *object, u32 mthd,
} }
static u8 static u8
nouveau_devobj_rd08(struct nouveau_object *object, u64 addr) nvkm_devobj_rd08(struct nvkm_object *object, u64 addr)
{ {
return nv_rd08(object->engine, addr); return nv_rd08(object->engine, addr);
} }
static u16 static u16
nouveau_devobj_rd16(struct nouveau_object *object, u64 addr) nvkm_devobj_rd16(struct nvkm_object *object, u64 addr)
{ {
return nv_rd16(object->engine, addr); return nv_rd16(object->engine, addr);
} }
static u32 static u32
nouveau_devobj_rd32(struct nouveau_object *object, u64 addr) nvkm_devobj_rd32(struct nvkm_object *object, u64 addr)
{ {
return nv_rd32(object->engine, addr); return nv_rd32(object->engine, addr);
} }
static void static void
nouveau_devobj_wr08(struct nouveau_object *object, u64 addr, u8 data) nvkm_devobj_wr08(struct nvkm_object *object, u64 addr, u8 data)
{ {
nv_wr08(object->engine, addr, data); nv_wr08(object->engine, addr, data);
} }
static void static void
nouveau_devobj_wr16(struct nouveau_object *object, u64 addr, u16 data) nvkm_devobj_wr16(struct nvkm_object *object, u64 addr, u16 data)
{ {
nv_wr16(object->engine, addr, data); nv_wr16(object->engine, addr, data);
} }
static void static void
nouveau_devobj_wr32(struct nouveau_object *object, u64 addr, u32 data) nvkm_devobj_wr32(struct nvkm_object *object, u64 addr, u32 data)
{ {
nv_wr32(object->engine, addr, data); nv_wr32(object->engine, addr, data);
} }
static int static int
nouveau_devobj_map(struct nouveau_object *object, u64 *addr, u32 *size) nvkm_devobj_map(struct nvkm_object *object, u64 *addr, u32 *size)
{ {
struct nouveau_device *device = nv_device(object); struct nvkm_device *device = nv_device(object);
*addr = nv_device_resource_start(device, 0); *addr = nv_device_resource_start(device, 0);
*size = nv_device_resource_len(device, 0); *size = nv_device_resource_len(device, 0);
return 0; return 0;
...@@ -248,47 +245,46 @@ static const u64 disable_map[] = { ...@@ -248,47 +245,46 @@ static const u64 disable_map[] = {
}; };
static void static void
nouveau_devobj_dtor(struct nouveau_object *object) nvkm_devobj_dtor(struct nvkm_object *object)
{ {
struct nouveau_devobj *devobj = (void *)object; struct nvkm_devobj *devobj = (void *)object;
int i; int i;
for (i = NVDEV_SUBDEV_NR - 1; i >= 0; i--) for (i = NVDEV_SUBDEV_NR - 1; i >= 0; i--)
nouveau_object_ref(NULL, &devobj->subdev[i]); nvkm_object_ref(NULL, &devobj->subdev[i]);
nouveau_parent_destroy(&devobj->base); nvkm_parent_destroy(&devobj->base);
} }
static struct nouveau_oclass static struct nvkm_oclass
nouveau_devobj_oclass_super = { nvkm_devobj_oclass_super = {
.handle = NV_DEVICE, .handle = NV_DEVICE,
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.dtor = nouveau_devobj_dtor, .dtor = nvkm_devobj_dtor,
.init = _nouveau_parent_init, .init = _nvkm_parent_init,
.fini = _nouveau_parent_fini, .fini = _nvkm_parent_fini,
.mthd = nouveau_devobj_mthd, .mthd = nvkm_devobj_mthd,
.map = nouveau_devobj_map, .map = nvkm_devobj_map,
.rd08 = nouveau_devobj_rd08, .rd08 = nvkm_devobj_rd08,
.rd16 = nouveau_devobj_rd16, .rd16 = nvkm_devobj_rd16,
.rd32 = nouveau_devobj_rd32, .rd32 = nvkm_devobj_rd32,
.wr08 = nouveau_devobj_wr08, .wr08 = nvkm_devobj_wr08,
.wr16 = nouveau_devobj_wr16, .wr16 = nvkm_devobj_wr16,
.wr32 = nouveau_devobj_wr32, .wr32 = nvkm_devobj_wr32,
} }
}; };
static int static int
nouveau_devobj_ctor(struct nouveau_object *parent, nvkm_devobj_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_object *engine, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_object **pobject)
struct nouveau_object **pobject)
{ {
union { union {
struct nv_device_v0 v0; struct nv_device_v0 v0;
} *args = data; } *args = data;
struct nouveau_client *client = nv_client(parent); struct nvkm_client *client = nv_client(parent);
struct nouveau_device *device; struct nvkm_device *device;
struct nouveau_devobj *devobj; struct nvkm_devobj *devobj;
u32 boot0, strap; u32 boot0, strap;
u64 disable, mmio_base, mmio_size; u64 disable, mmio_base, mmio_size;
void __iomem *map; void __iomem *map;
...@@ -305,22 +301,22 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -305,22 +301,22 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
/* give priviledged clients register access */ /* give priviledged clients register access */
if (client->super) if (client->super)
oclass = &nouveau_devobj_oclass_super; oclass = &nvkm_devobj_oclass_super;
/* find the device subdev that matches what the client requested */ /* find the device subdev that matches what the client requested */
device = nv_device(client->device); device = nv_device(client->device);
if (args->v0.device != ~0) { if (args->v0.device != ~0) {
device = nouveau_device_find(args->v0.device); device = nvkm_device_find(args->v0.device);
if (!device) if (!device)
return -ENODEV; return -ENODEV;
} }
ret = nouveau_parent_create(parent, nv_object(device), oclass, 0, ret = nvkm_parent_create(parent, nv_object(device), oclass, 0,
nouveau_control_oclass, nvkm_control_oclass,
(1ULL << NVDEV_ENGINE_DMAOBJ) | (1ULL << NVDEV_ENGINE_DMAOBJ) |
(1ULL << NVDEV_ENGINE_FIFO) | (1ULL << NVDEV_ENGINE_FIFO) |
(1ULL << NVDEV_ENGINE_DISP) | (1ULL << NVDEV_ENGINE_DISP) |
(1ULL << NVDEV_ENGINE_PM ), &devobj); (1ULL << NVDEV_ENGINE_PM), &devobj);
*pobject = nv_object(devobj); *pobject = nv_object(devobj);
if (ret) if (ret)
return ret; return ret;
...@@ -403,8 +399,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -403,8 +399,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
case NV_30: ret = nv30_identify(device); break; case NV_30: ret = nv30_identify(device); break;
case NV_40: ret = nv40_identify(device); break; case NV_40: ret = nv40_identify(device); break;
case NV_50: ret = nv50_identify(device); break; case NV_50: ret = nv50_identify(device); break;
case NV_C0: ret = nvc0_identify(device); break; case NV_C0: ret = gf100_identify(device); break;
case NV_E0: ret = nve0_identify(device); break; case NV_E0: ret = gk104_identify(device); break;
case GM100: ret = gm100_identify(device); break; case GM100: ret = gm100_identify(device); break;
default: default:
ret = -EINVAL; ret = -EINVAL;
...@@ -439,7 +435,7 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -439,7 +435,7 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
} else } else
if ( (args->v0.disable & NV_DEVICE_V0_DISABLE_IDENTIFY)) { if ( (args->v0.disable & NV_DEVICE_V0_DISABLE_IDENTIFY)) {
device->cname = "NULL"; device->cname = "NULL";
device->oclass[NVDEV_SUBDEV_VBIOS] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS] = &nvkm_bios_oclass;
} }
if (!(args->v0.disable & NV_DEVICE_V0_DISABLE_MMIO) && if (!(args->v0.disable & NV_DEVICE_V0_DISABLE_MMIO) &&
...@@ -457,14 +453,12 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -457,14 +453,12 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
continue; continue;
if (device->subdev[i]) { if (device->subdev[i]) {
nouveau_object_ref(device->subdev[i], nvkm_object_ref(device->subdev[i], &devobj->subdev[i]);
&devobj->subdev[i]);
continue; continue;
} }
ret = nouveau_object_ctor(nv_object(device), NULL, ret = nvkm_object_ctor(nv_object(device), NULL, oclass,
oclass, NULL, i, NULL, i, &devobj->subdev[i]);
&devobj->subdev[i]);
if (ret == -ENODEV) if (ret == -ENODEV)
continue; continue;
if (ret) if (ret)
...@@ -482,15 +476,15 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -482,15 +476,15 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
* subdev in turn as they're created. * subdev in turn as they're created.
*/ */
while (i >= NVDEV_SUBDEV_DEVINIT_LAST && c <= i) { while (i >= NVDEV_SUBDEV_DEVINIT_LAST && c <= i) {
struct nouveau_object *subdev = devobj->subdev[c++]; struct nvkm_object *subdev = devobj->subdev[c++];
if (subdev && !nv_iclass(subdev, NV_ENGINE_CLASS)) { if (subdev && !nv_iclass(subdev, NV_ENGINE_CLASS)) {
ret = nouveau_object_inc(subdev); ret = nvkm_object_inc(subdev);
if (ret) if (ret)
return ret; return ret;
atomic_dec(&nv_object(device)->usecount); atomic_dec(&nv_object(device)->usecount);
} else } else
if (subdev) { if (subdev) {
nouveau_subdev_reset(subdev); nvkm_subdev_reset(subdev);
} }
} }
} }
...@@ -498,23 +492,23 @@ nouveau_devobj_ctor(struct nouveau_object *parent, ...@@ -498,23 +492,23 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
return 0; return 0;
} }
static struct nouveau_ofuncs static struct nvkm_ofuncs
nouveau_devobj_ofuncs = { nvkm_devobj_ofuncs = {
.ctor = nouveau_devobj_ctor, .ctor = nvkm_devobj_ctor,
.dtor = nouveau_devobj_dtor, .dtor = nvkm_devobj_dtor,
.init = _nouveau_parent_init, .init = _nvkm_parent_init,
.fini = _nouveau_parent_fini, .fini = _nvkm_parent_fini,
.mthd = nouveau_devobj_mthd, .mthd = nvkm_devobj_mthd,
}; };
/****************************************************************************** /******************************************************************************
* nouveau_device: engine functions * nvkm_device: engine functions
*****************************************************************************/ *****************************************************************************/
struct nouveau_device * struct nvkm_device *
nv_device(void *obj) nv_device(void *obj)
{ {
struct nouveau_object *device = nv_object(obj); struct nvkm_object *device = nv_object(obj);
if (device->engine == NULL) { if (device->engine == NULL) {
while (device && device->parent) while (device && device->parent)
device = device->parent; device = device->parent;
...@@ -530,14 +524,14 @@ nv_device(void *obj) ...@@ -530,14 +524,14 @@ nv_device(void *obj)
return (void *)device; return (void *)device;
} }
static struct nouveau_oclass static struct nvkm_oclass
nouveau_device_sclass[] = { nvkm_device_sclass[] = {
{ 0x0080, &nouveau_devobj_ofuncs }, { 0x0080, &nvkm_devobj_ofuncs },
{} {}
}; };
static int static int
nouveau_device_event_ctor(struct nouveau_object *object, void *data, u32 size, nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size,
struct nvkm_notify *notify) struct nvkm_notify *notify)
{ {
if (!WARN_ON(size != 0)) { if (!WARN_ON(size != 0)) {
...@@ -550,21 +544,21 @@ nouveau_device_event_ctor(struct nouveau_object *object, void *data, u32 size, ...@@ -550,21 +544,21 @@ nouveau_device_event_ctor(struct nouveau_object *object, void *data, u32 size,
} }
static const struct nvkm_event_func static const struct nvkm_event_func
nouveau_device_event_func = { nvkm_device_event_func = {
.ctor = nouveau_device_event_ctor, .ctor = nvkm_device_event_ctor,
}; };
static int static int
nouveau_device_fini(struct nouveau_object *object, bool suspend) nvkm_device_fini(struct nvkm_object *object, bool suspend)
{ {
struct nouveau_device *device = (void *)object; struct nvkm_device *device = (void *)object;
struct nouveau_object *subdev; struct nvkm_object *subdev;
int ret, i; int ret, i;
for (i = NVDEV_SUBDEV_NR - 1; i >= 0; i--) { for (i = NVDEV_SUBDEV_NR - 1; i >= 0; i--) {
if ((subdev = device->subdev[i])) { if ((subdev = device->subdev[i])) {
if (!nv_iclass(subdev, NV_ENGINE_CLASS)) { if (!nv_iclass(subdev, NV_ENGINE_CLASS)) {
ret = nouveau_object_dec(subdev, suspend); ret = nvkm_object_dec(subdev, suspend);
if (ret && suspend) if (ret && suspend)
goto fail; goto fail;
} }
...@@ -576,7 +570,7 @@ nouveau_device_fini(struct nouveau_object *object, bool suspend) ...@@ -576,7 +570,7 @@ nouveau_device_fini(struct nouveau_object *object, bool suspend)
for (; ret && i < NVDEV_SUBDEV_NR; i++) { for (; ret && i < NVDEV_SUBDEV_NR; i++) {
if ((subdev = device->subdev[i])) { if ((subdev = device->subdev[i])) {
if (!nv_iclass(subdev, NV_ENGINE_CLASS)) { if (!nv_iclass(subdev, NV_ENGINE_CLASS)) {
ret = nouveau_object_inc(subdev); ret = nvkm_object_inc(subdev);
if (ret) { if (ret) {
/* XXX */ /* XXX */
} }
...@@ -588,10 +582,10 @@ nouveau_device_fini(struct nouveau_object *object, bool suspend) ...@@ -588,10 +582,10 @@ nouveau_device_fini(struct nouveau_object *object, bool suspend)
} }
static int static int
nouveau_device_init(struct nouveau_object *object) nvkm_device_init(struct nvkm_object *object)
{ {
struct nouveau_device *device = (void *)object; struct nvkm_device *device = (void *)object;
struct nouveau_object *subdev; struct nvkm_object *subdev;
int ret, i = 0; int ret, i = 0;
ret = nvkm_acpi_init(device); ret = nvkm_acpi_init(device);
...@@ -601,11 +595,11 @@ nouveau_device_init(struct nouveau_object *object) ...@@ -601,11 +595,11 @@ nouveau_device_init(struct nouveau_object *object)
for (i = 0; i < NVDEV_SUBDEV_NR; i++) { for (i = 0; i < NVDEV_SUBDEV_NR; i++) {
if ((subdev = device->subdev[i])) { if ((subdev = device->subdev[i])) {
if (!nv_iclass(subdev, NV_ENGINE_CLASS)) { if (!nv_iclass(subdev, NV_ENGINE_CLASS)) {
ret = nouveau_object_inc(subdev); ret = nvkm_object_inc(subdev);
if (ret) if (ret)
goto fail; goto fail;
} else { } else {
nouveau_subdev_reset(subdev); nvkm_subdev_reset(subdev);
} }
} }
} }
...@@ -615,7 +609,7 @@ nouveau_device_init(struct nouveau_object *object) ...@@ -615,7 +609,7 @@ nouveau_device_init(struct nouveau_object *object)
for (--i; ret && i >= 0; i--) { for (--i; ret && i >= 0; i--) {
if ((subdev = device->subdev[i])) { if ((subdev = device->subdev[i])) {
if (!nv_iclass(subdev, NV_ENGINE_CLASS)) if (!nv_iclass(subdev, NV_ENGINE_CLASS))
nouveau_object_dec(subdev, false); nvkm_object_dec(subdev, false);
} }
} }
...@@ -625,9 +619,9 @@ nouveau_device_init(struct nouveau_object *object) ...@@ -625,9 +619,9 @@ nouveau_device_init(struct nouveau_object *object)
} }
static void static void
nouveau_device_dtor(struct nouveau_object *object) nvkm_device_dtor(struct nvkm_object *object)
{ {
struct nouveau_device *device = (void *)object; struct nvkm_device *device = (void *)object;
nvkm_event_fini(&device->event); nvkm_event_fini(&device->event);
...@@ -638,11 +632,11 @@ nouveau_device_dtor(struct nouveau_object *object) ...@@ -638,11 +632,11 @@ nouveau_device_dtor(struct nouveau_object *object)
if (nv_subdev(device)->mmio) if (nv_subdev(device)->mmio)
iounmap(nv_subdev(device)->mmio); iounmap(nv_subdev(device)->mmio);
nouveau_engine_destroy(&device->engine); nvkm_engine_destroy(&device->engine);
} }
resource_size_t resource_size_t
nv_device_resource_start(struct nouveau_device *device, unsigned int bar) nv_device_resource_start(struct nvkm_device *device, unsigned int bar)
{ {
if (nv_device_is_pci(device)) { if (nv_device_is_pci(device)) {
return pci_resource_start(device->pdev, bar); return pci_resource_start(device->pdev, bar);
...@@ -657,7 +651,7 @@ nv_device_resource_start(struct nouveau_device *device, unsigned int bar) ...@@ -657,7 +651,7 @@ nv_device_resource_start(struct nouveau_device *device, unsigned int bar)
} }
resource_size_t resource_size_t
nv_device_resource_len(struct nouveau_device *device, unsigned int bar) nv_device_resource_len(struct nvkm_device *device, unsigned int bar)
{ {
if (nv_device_is_pci(device)) { if (nv_device_is_pci(device)) {
return pci_resource_len(device->pdev, bar); return pci_resource_len(device->pdev, bar);
...@@ -672,7 +666,7 @@ nv_device_resource_len(struct nouveau_device *device, unsigned int bar) ...@@ -672,7 +666,7 @@ nv_device_resource_len(struct nouveau_device *device, unsigned int bar)
} }
int int
nv_device_get_irq(struct nouveau_device *device, bool stall) nv_device_get_irq(struct nvkm_device *device, bool stall)
{ {
if (nv_device_is_pci(device)) { if (nv_device_is_pci(device)) {
return device->pdev->irq; return device->pdev->irq;
...@@ -682,22 +676,22 @@ nv_device_get_irq(struct nouveau_device *device, bool stall) ...@@ -682,22 +676,22 @@ nv_device_get_irq(struct nouveau_device *device, bool stall)
} }
} }
static struct nouveau_oclass static struct nvkm_oclass
nouveau_device_oclass = { nvkm_device_oclass = {
.handle = NV_ENGINE(DEVICE, 0x00), .handle = NV_ENGINE(DEVICE, 0x00),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.dtor = nouveau_device_dtor, .dtor = nvkm_device_dtor,
.init = nouveau_device_init, .init = nvkm_device_init,
.fini = nouveau_device_fini, .fini = nvkm_device_fini,
}, },
}; };
int int
nouveau_device_create_(void *dev, enum nv_bus_type type, u64 name, nvkm_device_create_(void *dev, enum nv_bus_type type, u64 name,
const char *sname, const char *cfg, const char *dbg, const char *sname, const char *cfg, const char *dbg,
int length, void **pobject) int length, void **pobject)
{ {
struct nouveau_device *device; struct nvkm_device *device;
int ret = -EEXIST; int ret = -EEXIST;
mutex_lock(&nv_devices_mutex); mutex_lock(&nv_devices_mutex);
...@@ -706,17 +700,17 @@ nouveau_device_create_(void *dev, enum nv_bus_type type, u64 name, ...@@ -706,17 +700,17 @@ nouveau_device_create_(void *dev, enum nv_bus_type type, u64 name,
goto done; goto done;
} }
ret = nouveau_engine_create_(NULL, NULL, &nouveau_device_oclass, true, ret = nvkm_engine_create_(NULL, NULL, &nvkm_device_oclass, true,
"DEVICE", "device", length, pobject); "DEVICE", "device", length, pobject);
device = *pobject; device = *pobject;
if (ret) if (ret)
goto done; goto done;
switch (type) { switch (type) {
case NOUVEAU_BUS_PCI: case NVKM_BUS_PCI:
device->pdev = dev; device->pdev = dev;
break; break;
case NOUVEAU_BUS_PLATFORM: case NVKM_BUS_PLATFORM:
device->platformdev = dev; device->platformdev = dev;
break; break;
} }
...@@ -725,12 +719,11 @@ nouveau_device_create_(void *dev, enum nv_bus_type type, u64 name, ...@@ -725,12 +719,11 @@ nouveau_device_create_(void *dev, enum nv_bus_type type, u64 name,
device->dbgopt = dbg; device->dbgopt = dbg;
device->name = sname; device->name = sname;
nv_subdev(device)->debug = nouveau_dbgopt(device->dbgopt, "DEVICE"); nv_subdev(device)->debug = nvkm_dbgopt(device->dbgopt, "DEVICE");
nv_engine(device)->sclass = nouveau_device_sclass; nv_engine(device)->sclass = nvkm_device_sclass;
list_add(&device->head, &nv_devices); list_add(&device->head, &nv_devices);
ret = nvkm_event_init(&nouveau_device_event_func, 1, 1, ret = nvkm_event_init(&nvkm_device_event_func, 1, 1, &device->event);
&device->event);
done: done:
mutex_unlock(&nv_devices_mutex); mutex_unlock(&nv_devices_mutex);
return ret; return ret;
......
...@@ -21,25 +21,22 @@ ...@@ -21,25 +21,22 @@
* *
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include "priv.h"
#include <core/client.h> #include <core/client.h>
#include <core/object.h>
#include <nvif/unpack.h>
#include <nvif/class.h>
#include <nvif/ioctl.h>
#include <subdev/clk.h> #include <subdev/clk.h>
#include "priv.h" #include <nvif/class.h>
#include <nvif/ioctl.h>
#include <nvif/unpack.h>
static int static int
nouveau_control_mthd_pstate_info(struct nouveau_object *object, nvkm_control_mthd_pstate_info(struct nvkm_object *object, void *data, u32 size)
void *data, u32 size)
{ {
union { union {
struct nvif_control_pstate_info_v0 v0; struct nvif_control_pstate_info_v0 v0;
} *args = data; } *args = data;
struct nouveau_clk *clk = nouveau_clk(object); struct nvkm_clk *clk = nvkm_clk(object);
int ret; int ret;
nv_ioctl(object, "control pstate info size %d\n", size); nv_ioctl(object, "control pstate info size %d\n", size);
...@@ -67,16 +64,15 @@ nouveau_control_mthd_pstate_info(struct nouveau_object *object, ...@@ -67,16 +64,15 @@ nouveau_control_mthd_pstate_info(struct nouveau_object *object,
} }
static int static int
nouveau_control_mthd_pstate_attr(struct nouveau_object *object, nvkm_control_mthd_pstate_attr(struct nvkm_object *object, void *data, u32 size)
void *data, u32 size)
{ {
union { union {
struct nvif_control_pstate_attr_v0 v0; struct nvif_control_pstate_attr_v0 v0;
} *args = data; } *args = data;
struct nouveau_clk *clk = nouveau_clk(object); struct nvkm_clk *clk = nvkm_clk(object);
struct nouveau_domain *domain; struct nvkm_domain *domain;
struct nouveau_pstate *pstate; struct nvkm_pstate *pstate;
struct nouveau_cstate *cstate; struct nvkm_cstate *cstate;
int i = 0, j = -1; int i = 0, j = -1;
u32 lo, hi; u32 lo, hi;
int ret; int ret;
...@@ -141,13 +137,12 @@ nouveau_control_mthd_pstate_attr(struct nouveau_object *object, ...@@ -141,13 +137,12 @@ nouveau_control_mthd_pstate_attr(struct nouveau_object *object,
} }
static int static int
nouveau_control_mthd_pstate_user(struct nouveau_object *object, nvkm_control_mthd_pstate_user(struct nvkm_object *object, void *data, u32 size)
void *data, u32 size)
{ {
union { union {
struct nvif_control_pstate_user_v0 v0; struct nvif_control_pstate_user_v0 v0;
} *args = data; } *args = data;
struct nouveau_clk *clk = nouveau_clk(object); struct nvkm_clk *clk = nvkm_clk(object);
int ret; int ret;
nv_ioctl(object, "control pstate user size %d\n", size); nv_ioctl(object, "control pstate user size %d\n", size);
...@@ -161,45 +156,44 @@ nouveau_control_mthd_pstate_user(struct nouveau_object *object, ...@@ -161,45 +156,44 @@ nouveau_control_mthd_pstate_user(struct nouveau_object *object,
return ret; return ret;
if (args->v0.pwrsrc >= 0) { if (args->v0.pwrsrc >= 0) {
ret |= nouveau_clk_ustate(clk, args->v0.ustate, args->v0.pwrsrc); ret |= nvkm_clk_ustate(clk, args->v0.ustate, args->v0.pwrsrc);
} else { } else {
ret |= nouveau_clk_ustate(clk, args->v0.ustate, 0); ret |= nvkm_clk_ustate(clk, args->v0.ustate, 0);
ret |= nouveau_clk_ustate(clk, args->v0.ustate, 1); ret |= nvkm_clk_ustate(clk, args->v0.ustate, 1);
} }
return ret; return ret;
} }
static int static int
nouveau_control_mthd(struct nouveau_object *object, u32 mthd, nvkm_control_mthd(struct nvkm_object *object, u32 mthd, void *data, u32 size)
void *data, u32 size)
{ {
switch (mthd) { switch (mthd) {
case NVIF_CONTROL_PSTATE_INFO: case NVIF_CONTROL_PSTATE_INFO:
return nouveau_control_mthd_pstate_info(object, data, size); return nvkm_control_mthd_pstate_info(object, data, size);
case NVIF_CONTROL_PSTATE_ATTR: case NVIF_CONTROL_PSTATE_ATTR:
return nouveau_control_mthd_pstate_attr(object, data, size); return nvkm_control_mthd_pstate_attr(object, data, size);
case NVIF_CONTROL_PSTATE_USER: case NVIF_CONTROL_PSTATE_USER:
return nouveau_control_mthd_pstate_user(object, data, size); return nvkm_control_mthd_pstate_user(object, data, size);
default: default:
break; break;
} }
return -EINVAL; return -EINVAL;
} }
static struct nouveau_ofuncs static struct nvkm_ofuncs
nouveau_control_ofuncs = { nvkm_control_ofuncs = {
.ctor = _nouveau_object_ctor, .ctor = _nvkm_object_ctor,
.dtor = nouveau_object_destroy, .dtor = nvkm_object_destroy,
.init = nouveau_object_init, .init = nvkm_object_init,
.fini = nouveau_object_fini, .fini = nvkm_object_fini,
.mthd = nouveau_control_mthd, .mthd = nvkm_control_mthd,
}; };
struct nouveau_oclass struct nvkm_oclass
nouveau_control_oclass[] = { nvkm_control_oclass[] = {
{ .handle = NVIF_IOCTL_NEW_V0_CONTROL, { .handle = NVIF_IOCTL_NEW_V0_CONTROL,
.ofuncs = &nouveau_control_ofuncs .ofuncs = &nvkm_control_ofuncs
}, },
{} {}
}; };
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -42,7 +43,6 @@ ...@@ -42,7 +43,6 @@
#include <subdev/pmu.h> #include <subdev/pmu.h>
#include <subdev/volt.h> #include <subdev/volt.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -56,12 +56,12 @@ ...@@ -56,12 +56,12 @@
#include <engine/pm.h> #include <engine/pm.h>
int int
nvc0_identify(struct nouveau_device *device) gf100_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0xc0: case 0xc0:
device->cname = "GF100"; device->cname = "GF100";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -94,7 +94,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -94,7 +94,7 @@ nvc0_identify(struct nouveau_device *device)
break; break;
case 0xc4: case 0xc4:
device->cname = "GF104"; device->cname = "GF104";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -127,7 +127,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -127,7 +127,7 @@ nvc0_identify(struct nouveau_device *device)
break; break;
case 0xc3: case 0xc3:
device->cname = "GF106"; device->cname = "GF106";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -159,7 +159,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -159,7 +159,7 @@ nvc0_identify(struct nouveau_device *device)
break; break;
case 0xce: case 0xce:
device->cname = "GF114"; device->cname = "GF114";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -192,7 +192,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -192,7 +192,7 @@ nvc0_identify(struct nouveau_device *device)
break; break;
case 0xcf: case 0xcf:
device->cname = "GF116"; device->cname = "GF116";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -224,7 +224,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -224,7 +224,7 @@ nvc0_identify(struct nouveau_device *device)
break; break;
case 0xc1: case 0xc1:
device->cname = "GF108"; device->cname = "GF108";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -256,7 +256,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -256,7 +256,7 @@ nvc0_identify(struct nouveau_device *device)
break; break;
case 0xc8: case 0xc8:
device->cname = "GF110"; device->cname = "GF110";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -289,7 +289,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -289,7 +289,7 @@ nvc0_identify(struct nouveau_device *device)
break; break;
case 0xd9: case 0xd9:
device->cname = "GF119"; device->cname = "GF119";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gf110_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gf110_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gf110_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gf110_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -321,7 +321,7 @@ nvc0_identify(struct nouveau_device *device) ...@@ -321,7 +321,7 @@ nvc0_identify(struct nouveau_device *device)
break; break;
case 0xd7: case 0xd7:
device->cname = "GF117"; device->cname = "GF117";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gf110_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gf110_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gf117_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gf117_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -355,4 +355,4 @@ nvc0_identify(struct nouveau_device *device) ...@@ -355,4 +355,4 @@ nvc0_identify(struct nouveau_device *device)
} }
return 0; return 0;
} }
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -42,7 +43,6 @@ ...@@ -42,7 +43,6 @@
#include <subdev/pmu.h> #include <subdev/pmu.h>
#include <subdev/volt.h> #include <subdev/volt.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -56,12 +56,12 @@ ...@@ -56,12 +56,12 @@
#include <engine/pm.h> #include <engine/pm.h>
int int
nve0_identify(struct nouveau_device *device) gk104_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0xe4: case 0xe4:
device->cname = "GK104"; device->cname = "GK104";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -95,7 +95,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -95,7 +95,7 @@ nve0_identify(struct nouveau_device *device)
break; break;
case 0xe7: case 0xe7:
device->cname = "GK107"; device->cname = "GK107";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -129,7 +129,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -129,7 +129,7 @@ nve0_identify(struct nouveau_device *device)
break; break;
case 0xe6: case 0xe6:
device->cname = "GK106"; device->cname = "GK106";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -185,7 +185,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -185,7 +185,7 @@ nve0_identify(struct nouveau_device *device)
break; break;
case 0xf0: case 0xf0:
device->cname = "GK110"; device->cname = "GK110";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -219,7 +219,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -219,7 +219,7 @@ nve0_identify(struct nouveau_device *device)
break; break;
case 0xf1: case 0xf1:
device->cname = "GK110B"; device->cname = "GK110B";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gf110_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gf110_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -253,7 +253,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -253,7 +253,7 @@ nve0_identify(struct nouveau_device *device)
break; break;
case 0x106: case 0x106:
device->cname = "GK208B"; device->cname = "GK208B";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
...@@ -286,7 +286,7 @@ nve0_identify(struct nouveau_device *device) ...@@ -286,7 +286,7 @@ nve0_identify(struct nouveau_device *device)
break; break;
case 0x108: case 0x108:
device->cname = "GK208"; device->cname = "GK208";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gk104_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -42,7 +43,6 @@ ...@@ -42,7 +43,6 @@
#include <subdev/pmu.h> #include <subdev/pmu.h>
#include <subdev/volt.h> #include <subdev/volt.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -56,12 +56,12 @@ ...@@ -56,12 +56,12 @@
#include <engine/pm.h> #include <engine/pm.h>
int int
gm100_identify(struct nouveau_device *device) gm100_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0x117: case 0x117:
device->cname = "GM107"; device->cname = "GM107";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gf110_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gf110_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gm107_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gm107_fuse_oclass;
...@@ -101,7 +101,7 @@ gm100_identify(struct nouveau_device *device) ...@@ -101,7 +101,7 @@ gm100_identify(struct nouveau_device *device)
break; break;
case 0x124: case 0x124:
device->cname = "GM204"; device->cname = "GM204";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = gk104_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = gm204_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = gm204_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gm107_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gm107_fuse_oclass;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -33,7 +34,6 @@ ...@@ -33,7 +34,6 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/mmu.h> #include <subdev/mmu.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -41,12 +41,12 @@ ...@@ -41,12 +41,12 @@
#include <engine/disp.h> #include <engine/disp.h>
int int
nv04_identify(struct nouveau_device *device) nv04_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0x04: case 0x04:
device->cname = "NV04"; device->cname = "NV04";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv04_devinit_oclass; device->oclass[NVDEV_SUBDEV_DEVINIT] = nv04_devinit_oclass;
...@@ -64,7 +64,7 @@ nv04_identify(struct nouveau_device *device) ...@@ -64,7 +64,7 @@ nv04_identify(struct nouveau_device *device)
break; break;
case 0x05: case 0x05:
device->cname = "NV05"; device->cname = "NV05";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv05_devinit_oclass; device->oclass[NVDEV_SUBDEV_DEVINIT] = nv05_devinit_oclass;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -34,7 +35,6 @@ ...@@ -34,7 +35,6 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/mmu.h> #include <subdev/mmu.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
#include <engine/disp.h> #include <engine/disp.h>
int int
nv10_identify(struct nouveau_device *device) nv10_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0x10: case 0x10:
device->cname = "NV10"; device->cname = "NV10";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -64,7 +64,7 @@ nv10_identify(struct nouveau_device *device) ...@@ -64,7 +64,7 @@ nv10_identify(struct nouveau_device *device)
break; break;
case 0x15: case 0x15:
device->cname = "NV15"; device->cname = "NV15";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -83,7 +83,7 @@ nv10_identify(struct nouveau_device *device) ...@@ -83,7 +83,7 @@ nv10_identify(struct nouveau_device *device)
break; break;
case 0x16: case 0x16:
device->cname = "NV16"; device->cname = "NV16";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -102,7 +102,7 @@ nv10_identify(struct nouveau_device *device) ...@@ -102,7 +102,7 @@ nv10_identify(struct nouveau_device *device)
break; break;
case 0x1a: case 0x1a:
device->cname = "nForce"; device->cname = "nForce";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -121,7 +121,7 @@ nv10_identify(struct nouveau_device *device) ...@@ -121,7 +121,7 @@ nv10_identify(struct nouveau_device *device)
break; break;
case 0x11: case 0x11:
device->cname = "NV11"; device->cname = "NV11";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -140,7 +140,7 @@ nv10_identify(struct nouveau_device *device) ...@@ -140,7 +140,7 @@ nv10_identify(struct nouveau_device *device)
break; break;
case 0x17: case 0x17:
device->cname = "NV17"; device->cname = "NV17";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -159,7 +159,7 @@ nv10_identify(struct nouveau_device *device) ...@@ -159,7 +159,7 @@ nv10_identify(struct nouveau_device *device)
break; break;
case 0x1f: case 0x1f:
device->cname = "nForce2"; device->cname = "nForce2";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -178,7 +178,7 @@ nv10_identify(struct nouveau_device *device) ...@@ -178,7 +178,7 @@ nv10_identify(struct nouveau_device *device)
break; break;
case 0x18: case 0x18:
device->cname = "NV18"; device->cname = "NV18";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -35,7 +36,6 @@ ...@@ -35,7 +36,6 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/mmu.h> #include <subdev/mmu.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -43,12 +43,12 @@ ...@@ -43,12 +43,12 @@
#include <engine/disp.h> #include <engine/disp.h>
int int
nv20_identify(struct nouveau_device *device) nv20_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0x20: case 0x20:
device->cname = "NV20"; device->cname = "NV20";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -67,7 +67,7 @@ nv20_identify(struct nouveau_device *device) ...@@ -67,7 +67,7 @@ nv20_identify(struct nouveau_device *device)
break; break;
case 0x25: case 0x25:
device->cname = "NV25"; device->cname = "NV25";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -86,7 +86,7 @@ nv20_identify(struct nouveau_device *device) ...@@ -86,7 +86,7 @@ nv20_identify(struct nouveau_device *device)
break; break;
case 0x28: case 0x28:
device->cname = "NV28"; device->cname = "NV28";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -105,7 +105,7 @@ nv20_identify(struct nouveau_device *device) ...@@ -105,7 +105,7 @@ nv20_identify(struct nouveau_device *device)
break; break;
case 0x2a: case 0x2a:
device->cname = "NV2A"; device->cname = "NV2A";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -34,7 +35,6 @@ ...@@ -34,7 +35,6 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/mmu.h> #include <subdev/mmu.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -43,12 +43,12 @@ ...@@ -43,12 +43,12 @@
#include <engine/disp.h> #include <engine/disp.h>
int int
nv30_identify(struct nouveau_device *device) nv30_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0x30: case 0x30:
device->cname = "NV30"; device->cname = "NV30";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -67,7 +67,7 @@ nv30_identify(struct nouveau_device *device) ...@@ -67,7 +67,7 @@ nv30_identify(struct nouveau_device *device)
break; break;
case 0x35: case 0x35:
device->cname = "NV35"; device->cname = "NV35";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -86,7 +86,7 @@ nv30_identify(struct nouveau_device *device) ...@@ -86,7 +86,7 @@ nv30_identify(struct nouveau_device *device)
break; break;
case 0x31: case 0x31:
device->cname = "NV31"; device->cname = "NV31";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -106,7 +106,7 @@ nv30_identify(struct nouveau_device *device) ...@@ -106,7 +106,7 @@ nv30_identify(struct nouveau_device *device)
break; break;
case 0x36: case 0x36:
device->cname = "NV36"; device->cname = "NV36";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
...@@ -126,7 +126,7 @@ nv30_identify(struct nouveau_device *device) ...@@ -126,7 +126,7 @@ nv30_identify(struct nouveau_device *device)
break; break;
case 0x34: case 0x34:
device->cname = "NV34"; device->cname = "NV34";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv04_clk_oclass;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -37,7 +38,6 @@ ...@@ -37,7 +38,6 @@
#include <subdev/mmu.h> #include <subdev/mmu.h>
#include <subdev/volt.h> #include <subdev/volt.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -47,12 +47,12 @@ ...@@ -47,12 +47,12 @@
#include <engine/pm.h> #include <engine/pm.h>
int int
nv40_identify(struct nouveau_device *device) nv40_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0x40: case 0x40:
device->cname = "NV40"; device->cname = "NV40";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -75,7 +75,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -75,7 +75,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x41: case 0x41:
device->cname = "NV41"; device->cname = "NV41";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -98,7 +98,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -98,7 +98,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x42: case 0x42:
device->cname = "NV42"; device->cname = "NV42";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -121,7 +121,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -121,7 +121,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x43: case 0x43:
device->cname = "NV43"; device->cname = "NV43";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -144,7 +144,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -144,7 +144,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x45: case 0x45:
device->cname = "NV45"; device->cname = "NV45";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -167,7 +167,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -167,7 +167,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x47: case 0x47:
device->cname = "G70"; device->cname = "G70";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -190,7 +190,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -190,7 +190,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x49: case 0x49:
device->cname = "G71"; device->cname = "G71";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -213,7 +213,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -213,7 +213,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x4b: case 0x4b:
device->cname = "G73"; device->cname = "G73";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -236,7 +236,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -236,7 +236,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x44: case 0x44:
device->cname = "NV44"; device->cname = "NV44";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -259,7 +259,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -259,7 +259,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x46: case 0x46:
device->cname = "G72"; device->cname = "G72";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -282,7 +282,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -282,7 +282,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x4a: case 0x4a:
device->cname = "NV44A"; device->cname = "NV44A";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -305,7 +305,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -305,7 +305,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x4c: case 0x4c:
device->cname = "C61"; device->cname = "C61";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -328,7 +328,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -328,7 +328,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x4e: case 0x4e:
device->cname = "C51"; device->cname = "C51";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv4e_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv4e_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -351,7 +351,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -351,7 +351,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x63: case 0x63:
device->cname = "C73"; device->cname = "C73";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -374,7 +374,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -374,7 +374,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x67: case 0x67:
device->cname = "C67"; device->cname = "C67";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
...@@ -397,7 +397,7 @@ nv40_identify(struct nouveau_device *device) ...@@ -397,7 +397,7 @@ nv40_identify(struct nouveau_device *device)
break; break;
case 0x68: case 0x68:
device->cname = "C68"; device->cname = "C68";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass; device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
...@@ -40,7 +41,6 @@ ...@@ -40,7 +41,6 @@
#include <subdev/pmu.h> #include <subdev/pmu.h>
#include <subdev/volt.h> #include <subdev/volt.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/sw.h> #include <engine/sw.h>
...@@ -58,12 +58,12 @@ ...@@ -58,12 +58,12 @@
#include <engine/pm.h> #include <engine/pm.h>
int int
nv50_identify(struct nouveau_device *device) nv50_identify(struct nvkm_device *device)
{ {
switch (device->chipset) { switch (device->chipset) {
case 0x50: case 0x50:
device->cname = "G80"; device->cname = "G80";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv50_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv50_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -89,7 +89,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -89,7 +89,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0x84: case 0x84:
device->cname = "G84"; device->cname = "G84";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv50_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv50_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -118,7 +118,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -118,7 +118,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0x86: case 0x86:
device->cname = "G86"; device->cname = "G86";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv50_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv50_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -147,7 +147,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -147,7 +147,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0x92: case 0x92:
device->cname = "G92"; device->cname = "G92";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nv50_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv50_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -176,7 +176,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -176,7 +176,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0x94: case 0x94:
device->cname = "G94"; device->cname = "G94";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -205,7 +205,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -205,7 +205,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0x96: case 0x96:
device->cname = "G96"; device->cname = "G96";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -234,7 +234,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -234,7 +234,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0x98: case 0x98:
device->cname = "G98"; device->cname = "G98";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -263,7 +263,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -263,7 +263,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0xa0: case 0xa0:
device->cname = "G200"; device->cname = "G200";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv50_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -292,7 +292,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -292,7 +292,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0xaa: case 0xaa:
device->cname = "MCP77/MCP78"; device->cname = "MCP77/MCP78";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -321,7 +321,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -321,7 +321,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0xac: case 0xac:
device->cname = "MCP79/MCP7A"; device->cname = "MCP79/MCP7A";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -350,7 +350,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -350,7 +350,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0xa3: case 0xa3:
device->cname = "GT215"; device->cname = "GT215";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -381,7 +381,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -381,7 +381,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0xa5: case 0xa5:
device->cname = "GT216"; device->cname = "GT216";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -411,7 +411,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -411,7 +411,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0xa8: case 0xa8:
device->cname = "GT218"; device->cname = "GT218";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
...@@ -441,7 +441,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -441,7 +441,7 @@ nv50_identify(struct nouveau_device *device)
break; break;
case 0xaf: case 0xaf:
device->cname = "MCP89"; device->cname = "MCP89";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nvkm_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = g94_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = g94_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
......
#ifndef __NVKM_DEVICE_PRIV_H__ #ifndef __NVKM_DEVICE_PRIV_H__
#define __NVKM_DEVICE_PRIV_H__ #define __NVKM_DEVICE_PRIV_H__
#include <core/device.h>
#include <engine/device.h> extern struct nvkm_oclass nvkm_control_oclass[];
extern struct nouveau_oclass nouveau_control_oclass[];
int nv04_identify(struct nvkm_device *);
int nv10_identify(struct nvkm_device *);
int nv20_identify(struct nvkm_device *);
int nv30_identify(struct nvkm_device *);
int nv40_identify(struct nvkm_device *);
int nv50_identify(struct nvkm_device *);
int gf100_identify(struct nvkm_device *);
int gk104_identify(struct nvkm_device *);
int gm100_identify(struct nvkm_device *);
#endif #endif
#ifndef __NV40_GR_H__ #ifndef __NV40_GR_H__
#define __NV40_GR_H__ #define __NV40_GR_H__
#include <engine/gr.h> #include <engine/gr.h>
#include <engine/device.h>
#include <core/device.h>
struct nvkm_gpuobj; struct nvkm_gpuobj;
/* returns 1 if device is one of the nv4x using the 0x4497 object class, /* returns 1 if device is one of the nv4x using the 0x4497 object class,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment