0001
0002 #ifndef __NVIF_DEVICE_H__
0003 #define __NVIF_DEVICE_H__
0004
0005 #include <nvif/object.h>
0006 #include <nvif/cl0080.h>
0007 #include <nvif/user.h>
0008
0009 struct nvif_device {
0010 struct nvif_object object;
0011 struct nv_device_info_v0 info;
0012
0013 struct nvif_fifo_runlist {
0014 u64 engines;
0015 } *runlist;
0016 int runlists;
0017
0018 struct nvif_user user;
0019 };
0020
0021 int nvif_device_ctor(struct nvif_object *, const char *name, u32 handle,
0022 s32 oclass, void *, u32, struct nvif_device *);
0023 void nvif_device_dtor(struct nvif_device *);
0024 u64 nvif_device_time(struct nvif_device *);
0025
0026
0027 #include <subdev/bios.h>
0028 #include <subdev/fb.h>
0029 #include <subdev/bar.h>
0030 #include <subdev/gpio.h>
0031 #include <subdev/clk.h>
0032 #include <subdev/i2c.h>
0033 #include <subdev/timer.h>
0034 #include <subdev/therm.h>
0035 #include <subdev/pci.h>
0036
0037 #define nvxx_device(a) ({ \
0038 struct nvif_device *_device = (a); \
0039 struct { \
0040 struct nvkm_object object; \
0041 struct nvkm_device *device; \
0042 } *_udevice = _device->object.priv; \
0043 _udevice->device; \
0044 })
0045 #define nvxx_bios(a) nvxx_device(a)->bios
0046 #define nvxx_fb(a) nvxx_device(a)->fb
0047 #define nvxx_gpio(a) nvxx_device(a)->gpio
0048 #define nvxx_clk(a) nvxx_device(a)->clk
0049 #define nvxx_i2c(a) nvxx_device(a)->i2c
0050 #define nvxx_iccsense(a) nvxx_device(a)->iccsense
0051 #define nvxx_therm(a) nvxx_device(a)->therm
0052 #define nvxx_volt(a) nvxx_device(a)->volt
0053
0054 #include <engine/fifo.h>
0055 #include <engine/gr.h>
0056
0057 #define nvxx_gr(a) nvxx_device(a)->gr
0058 #endif