2019-06-19 20:13:43 -04:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
2014-08-10 04:10:21 +10:00
|
|
|
#ifndef __NVIF_DEVICE_H__
|
|
|
|
|
#define __NVIF_DEVICE_H__
|
|
|
|
|
|
2015-01-13 22:13:14 +10:00
|
|
|
#include <nvif/object.h>
|
2015-11-08 12:23:16 +10:00
|
|
|
#include <nvif/cl0080.h>
|
2018-05-08 20:39:48 +10:00
|
|
|
#include <nvif/user.h>
|
2014-08-10 04:10:21 +10:00
|
|
|
|
|
|
|
|
struct nvif_device {
|
2015-08-20 14:54:15 +10:00
|
|
|
struct nvif_object object;
|
2014-08-10 04:10:21 +10:00
|
|
|
struct nv_device_info_v0 info;
|
2018-05-08 20:39:46 +10:00
|
|
|
|
|
|
|
|
struct nvif_fifo_runlist {
|
|
|
|
|
u64 engines;
|
|
|
|
|
} *runlist;
|
|
|
|
|
int runlists;
|
2018-05-08 20:39:48 +10:00
|
|
|
|
|
|
|
|
struct nvif_user user;
|
2014-08-10 04:10:21 +10:00
|
|
|
};
|
|
|
|
|
|
2020-03-30 13:49:05 +10:00
|
|
|
int nvif_device_ctor(struct nvif_object *, const char *name, u32 handle,
|
|
|
|
|
s32 oclass, void *, u32, struct nvif_device *);
|
|
|
|
|
void nvif_device_dtor(struct nvif_device *);
|
2015-08-20 14:54:10 +10:00
|
|
|
u64 nvif_device_time(struct nvif_device *);
|
|
|
|
|
|
2014-08-10 04:10:21 +10:00
|
|
|
/*XXX*/
|
|
|
|
|
#include <subdev/bios.h>
|
|
|
|
|
#include <subdev/fb.h>
|
|
|
|
|
#include <subdev/bar.h>
|
|
|
|
|
#include <subdev/gpio.h>
|
2015-01-13 23:37:38 +10:00
|
|
|
#include <subdev/clk.h>
|
2014-08-10 04:10:21 +10:00
|
|
|
#include <subdev/i2c.h>
|
|
|
|
|
#include <subdev/timer.h>
|
|
|
|
|
#include <subdev/therm.h>
|
2015-08-20 14:54:23 +10:00
|
|
|
#include <subdev/pci.h>
|
2014-08-10 04:10:21 +10:00
|
|
|
|
2015-08-20 14:54:15 +10:00
|
|
|
#define nvxx_device(a) ({ \
|
|
|
|
|
struct nvif_device *_device = (a); \
|
2015-08-20 14:54:22 +10:00
|
|
|
struct { \
|
|
|
|
|
struct nvkm_object object; \
|
|
|
|
|
struct nvkm_device *device; \
|
|
|
|
|
} *_udevice = _device->object.priv; \
|
|
|
|
|
_udevice->device; \
|
2015-08-20 14:54:15 +10:00
|
|
|
})
|
2015-08-20 14:54:20 +10:00
|
|
|
#define nvxx_bios(a) nvxx_device(a)->bios
|
2015-08-20 14:54:20 +10:00
|
|
|
#define nvxx_fb(a) nvxx_device(a)->fb
|
2015-08-20 14:54:20 +10:00
|
|
|
#define nvxx_gpio(a) nvxx_device(a)->gpio
|
2015-08-20 14:54:20 +10:00
|
|
|
#define nvxx_clk(a) nvxx_device(a)->clk
|
2015-08-20 14:54:20 +10:00
|
|
|
#define nvxx_i2c(a) nvxx_device(a)->i2c
|
2016-02-18 20:10:19 +01:00
|
|
|
#define nvxx_iccsense(a) nvxx_device(a)->iccsense
|
2015-08-20 14:54:21 +10:00
|
|
|
#define nvxx_therm(a) nvxx_device(a)->therm
|
2015-09-20 14:40:27 +02:00
|
|
|
#define nvxx_volt(a) nvxx_device(a)->volt
|
2014-08-10 04:10:21 +10:00
|
|
|
|
|
|
|
|
#include <engine/fifo.h>
|
2015-01-14 12:02:28 +10:00
|
|
|
#include <engine/gr.h>
|
2014-08-10 04:10:21 +10:00
|
|
|
|
2015-08-20 14:54:19 +10:00
|
|
|
#define nvxx_gr(a) nvxx_device(a)->gr
|
2014-08-10 04:10:21 +10:00
|
|
|
#endif
|