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