1 #ifndef __NVKM_FALCON_H__
2 #define __NVKM_FALCON_H__
3 #define nvkm_falcon(p) container_of((p), struct nvkm_falcon, engine)
4 #include <core/engine.h>
5 struct nvkm_fifo_chan;
6 
7 struct nvkm_falcon {
8 	const struct nvkm_falcon_func *func;
9 	struct nvkm_engine engine;
10 
11 	u32 addr;
12 	u8  version;
13 	u8  secret;
14 
15 	struct nvkm_memory *core;
16 	bool external;
17 
18 	struct {
19 		u32 limit;
20 		u32 *data;
21 		u32  size;
22 	} code;
23 
24 	struct {
25 		u32 limit;
26 		u32 *data;
27 		u32  size;
28 	} data;
29 };
30 
31 int nvkm_falcon_new_(const struct nvkm_falcon_func *, struct nvkm_device *,
32 		     int index, bool enable, u32 addr, struct nvkm_engine **);
33 
34 struct nvkm_falcon_func {
35 	struct {
36 		u32 *data;
37 		u32  size;
38 	} code;
39 	struct {
40 		u32 *data;
41 		u32  size;
42 	} data;
43 	u32 pmc_enable;
44 	void (*init)(struct nvkm_falcon *);
45 	void (*intr)(struct nvkm_falcon *, struct nvkm_fifo_chan *);
46 	struct nvkm_sclass sclass[];
47 };
48 #endif
49