1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_SEC2_PRIV_H__
3 #define __NVKM_SEC2_PRIV_H__
4 #include <engine/sec2.h>
5 struct nvkm_acr_lsfw;
6 
7 struct nvkm_sec2_func {
8 	const struct nvkm_falcon_func *flcn;
9 	u8 unit_unload;
10 	u8 unit_acr;
11 	struct nvkm_intr *(*intr_vector)(struct nvkm_sec2 *, enum nvkm_intr_type *);
12 	irqreturn_t (*intr)(struct nvkm_inth *);
13 	int (*initmsg)(struct nvkm_sec2 *);
14 };
15 
16 irqreturn_t gp102_sec2_intr(struct nvkm_inth *);
17 int gp102_sec2_initmsg(struct nvkm_sec2 *);
18 
19 struct nvkm_sec2_fwif {
20 	int version;
21 	int (*load)(struct nvkm_sec2 *, int ver, const struct nvkm_sec2_fwif *);
22 	const struct nvkm_sec2_func *func;
23 	const struct nvkm_acr_lsf_func *acr;
24 };
25 
26 int gp102_sec2_nofw(struct nvkm_sec2 *, int, const struct nvkm_sec2_fwif *);
27 int gp102_sec2_load(struct nvkm_sec2 *, int, const struct nvkm_sec2_fwif *);
28 extern const struct nvkm_sec2_func gp102_sec2;
29 extern const struct nvkm_acr_lsf_func gp102_sec2_acr_1;
30 void gp102_sec2_acr_bld_write_1(struct nvkm_acr *, u32, struct nvkm_acr_lsfw *);
31 void gp102_sec2_acr_bld_patch_1(struct nvkm_acr *, u32, s64);
32 
33 int nvkm_sec2_new_(const struct nvkm_sec2_fwif *, struct nvkm_device *, enum nvkm_subdev_type,
34 		   int, u32 addr, struct nvkm_sec2 **);
35 #endif
36