1 #ifndef __NVKM_ACR_PRIV_H__
2 #define __NVKM_ACR_PRIV_H__
3 #include <subdev/acr.h>
4 struct lsb_header_tail
;
8 int (*load
)(struct nvkm_acr
*, int version
,
9 const struct nvkm_acr_fwif
*);
10 const struct nvkm_acr_func
*func
;
13 int gm20b_acr_load(struct nvkm_acr
*, int, const struct nvkm_acr_fwif
*);
14 int gp102_acr_load(struct nvkm_acr
*, int, const struct nvkm_acr_fwif
*);
17 struct nvkm_acr_func
{
18 const struct nvkm_acr_hsf_fwif
*load
;
19 const struct nvkm_acr_hsf_fwif
*ahesasc
;
20 const struct nvkm_acr_hsf_fwif
*asb
;
21 const struct nvkm_acr_hsf_fwif
*unload
;
22 int (*wpr_parse
)(struct nvkm_acr
*);
23 u32 (*wpr_layout
)(struct nvkm_acr
*);
24 int (*wpr_alloc
)(struct nvkm_acr
*, u32 wpr_size
);
25 int (*wpr_build
)(struct nvkm_acr
*, struct nvkm_acr_lsf
*rtos
);
26 void (*wpr_patch
)(struct nvkm_acr
*, s64 adjust
);
27 void (*wpr_check
)(struct nvkm_acr
*, u64
*start
, u64
*limit
);
28 int (*init
)(struct nvkm_acr
*);
29 void (*fini
)(struct nvkm_acr
*);
32 int gm200_acr_wpr_parse(struct nvkm_acr
*);
33 u32
gm200_acr_wpr_layout(struct nvkm_acr
*);
34 int gm200_acr_wpr_build(struct nvkm_acr
*, struct nvkm_acr_lsf
*);
35 void gm200_acr_wpr_patch(struct nvkm_acr
*, s64
);
36 void gm200_acr_wpr_check(struct nvkm_acr
*, u64
*, u64
*);
37 void gm200_acr_wpr_build_lsb_tail(struct nvkm_acr_lsfw
*,
38 struct lsb_header_tail
*);
39 int gm200_acr_init(struct nvkm_acr
*);
41 int gm20b_acr_wpr_alloc(struct nvkm_acr
*, u32 wpr_size
);
43 int gp102_acr_wpr_parse(struct nvkm_acr
*);
44 u32
gp102_acr_wpr_layout(struct nvkm_acr
*);
45 int gp102_acr_wpr_alloc(struct nvkm_acr
*, u32 wpr_size
);
46 int gp102_acr_wpr_build(struct nvkm_acr
*, struct nvkm_acr_lsf
*);
47 int gp102_acr_wpr_build_lsb(struct nvkm_acr
*, struct nvkm_acr_lsfw
*);
48 void gp102_acr_wpr_patch(struct nvkm_acr
*, s64
);
50 struct nvkm_acr_hsfw
{
51 const struct nvkm_acr_hsf_func
*func
;
53 struct list_head head
;
77 struct nvkm_acr_hsf_fwif
{
79 int (*load
)(struct nvkm_acr
*, const char *bl
, const char *fw
,
80 const char *name
, int version
,
81 const struct nvkm_acr_hsf_fwif
*);
82 const struct nvkm_acr_hsf_func
*func
;
85 int nvkm_acr_hsfw_load(struct nvkm_acr
*, const char *, const char *,
86 const char *, int, const struct nvkm_acr_hsf_fwif
*);
87 void nvkm_acr_hsfw_del_all(struct nvkm_acr
*);
90 const struct nvkm_acr_hsf_func
*func
;
92 struct list_head head
;
105 struct nvkm_memory
*ucode
;
106 struct nvkm_vma
*vma
;
107 struct nvkm_falcon
*falcon
;
110 struct nvkm_acr_hsf_func
{
111 int (*load
)(struct nvkm_acr
*, struct nvkm_acr_hsfw
*);
112 int (*boot
)(struct nvkm_acr
*, struct nvkm_acr_hsf
*);
113 void (*bld
)(struct nvkm_acr
*, struct nvkm_acr_hsf
*);
116 int gm200_acr_hsfw_load(struct nvkm_acr
*, struct nvkm_acr_hsfw
*,
117 struct nvkm_falcon
*);
118 int gm200_acr_hsfw_boot(struct nvkm_acr
*, struct nvkm_acr_hsf
*,
119 u32 clear_intr
, u32 mbox0_ok
);
121 int gm200_acr_load_boot(struct nvkm_acr
*, struct nvkm_acr_hsf
*);
123 extern const struct nvkm_acr_hsf_func gm200_acr_unload_0
;
124 int gm200_acr_unload_load(struct nvkm_acr
*, struct nvkm_acr_hsfw
*);
125 int gm200_acr_unload_boot(struct nvkm_acr
*, struct nvkm_acr_hsf
*);
126 void gm200_acr_hsfw_bld(struct nvkm_acr
*, struct nvkm_acr_hsf
*);
128 extern const struct nvkm_acr_hsf_func gm20b_acr_load_0
;
130 int gp102_acr_load_load(struct nvkm_acr
*, struct nvkm_acr_hsfw
*);
132 extern const struct nvkm_acr_hsf_func gp108_acr_unload_0
;
133 void gp108_acr_hsfw_bld(struct nvkm_acr
*, struct nvkm_acr_hsf
*);
135 int nvkm_acr_new_(const struct nvkm_acr_fwif
*, struct nvkm_device
*, int,
137 int nvkm_acr_hsf_boot(struct nvkm_acr
*, const char *name
);
139 struct nvkm_acr_lsf
{
140 const struct nvkm_acr_lsf_func
*func
;
141 struct nvkm_falcon
*falcon
;
142 enum nvkm_acr_lsf_id id
;
143 struct list_head head
;
146 struct nvkm_acr_lsfw
*nvkm_acr_lsfw_add(const struct nvkm_acr_lsf_func
*,
147 struct nvkm_acr
*, struct nvkm_falcon
*,
148 enum nvkm_acr_lsf_id
);
149 void nvkm_acr_lsfw_del(struct nvkm_acr_lsfw
*);
150 void nvkm_acr_lsfw_del_all(struct nvkm_acr
*);