forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
....@@ -31,6 +31,8 @@
3131 #include <subdev/mmu.h>
3232 #include <engine/falcon.h>
3333
34
+struct nvkm_acr_lsfw;
35
+
3436 #define GPC_MAX 32
3537 #define TPC_MAX_PER_GPC 8
3638 #define TPC_MAX (GPC_MAX * TPC_MAX_PER_GPC)
....@@ -55,11 +57,6 @@
5557 int buffer;
5658 };
5759
58
-struct gf100_gr_fuc {
59
- u32 *data;
60
- u32 size;
61
-};
62
-
6360 struct gf100_gr_zbc_color {
6461 u32 format;
6562 u32 ds[4];
....@@ -82,22 +79,31 @@
8279 const struct gf100_gr_func *func;
8380 struct nvkm_gr base;
8481
85
- struct nvkm_falcon *fecs;
86
- struct nvkm_falcon *gpccs;
87
- struct gf100_gr_fuc fuc409c;
88
- struct gf100_gr_fuc fuc409d;
89
- struct gf100_gr_fuc fuc41ac;
90
- struct gf100_gr_fuc fuc41ad;
82
+ struct {
83
+ struct nvkm_falcon falcon;
84
+ struct nvkm_blob inst;
85
+ struct nvkm_blob data;
86
+
87
+ struct mutex mutex;
88
+ u32 disable;
89
+ } fecs;
90
+
91
+ struct {
92
+ struct nvkm_falcon falcon;
93
+ struct nvkm_blob inst;
94
+ struct nvkm_blob data;
95
+ } gpccs;
96
+
9197 bool firmware;
9298
9399 /*
94100 * Used if the register packs are loaded from NVIDIA fw instead of
95101 * using hardcoded arrays. To be allocated with vzalloc().
96102 */
97
- struct gf100_gr_pack *fuc_sw_nonctx;
98
- struct gf100_gr_pack *fuc_sw_ctx;
99
- struct gf100_gr_pack *fuc_bundle;
100
- struct gf100_gr_pack *fuc_method;
103
+ struct gf100_gr_pack *sw_nonctx;
104
+ struct gf100_gr_pack *sw_ctx;
105
+ struct gf100_gr_pack *bundle;
106
+ struct gf100_gr_pack *method;
101107
102108 struct gf100_gr_zbc_color zbc_color[NVKM_LTC_MAX_ZBC_CNT];
103109 struct gf100_gr_zbc_depth zbc_depth[NVKM_LTC_MAX_ZBC_CNT];
....@@ -128,13 +134,11 @@
128134 struct gf100_gr_mmio mmio_list[4096/8];
129135 u32 size;
130136 u32 *data;
137
+ u32 size_zcull;
138
+ u32 size_pm;
131139 };
132140
133
-int gf100_gr_ctor(const struct gf100_gr_func *, struct nvkm_device *,
134
- int, struct gf100_gr *);
135
-int gf100_gr_new_(const struct gf100_gr_func *, struct nvkm_device *,
136
- int, struct nvkm_gr **);
137
-void *gf100_gr_dtor(struct nvkm_gr *);
141
+int gf100_gr_fecs_bind_pointer(struct gf100_gr *, u32 inst);
138142
139143 struct gf100_gr_func_zbc {
140144 void (*clear_color)(struct gf100_gr *, int zbc);
....@@ -145,7 +149,6 @@
145149 };
146150
147151 struct gf100_gr_func {
148
- void (*dtor)(struct gf100_gr *);
149152 void (*oneinit_tiles)(struct gf100_gr *);
150153 void (*oneinit_sm_id)(struct gf100_gr *);
151154 int (*init)(struct gf100_gr *);
....@@ -159,6 +162,7 @@
159162 void (*init_rop_active_fbps)(struct gf100_gr *);
160163 void (*init_bios_2)(struct gf100_gr *);
161164 void (*init_swdx_pes_mask)(struct gf100_gr *);
165
+ void (*init_fs)(struct gf100_gr *);
162166 void (*init_fecs_exceptions)(struct gf100_gr *);
163167 void (*init_ds_hww_esr_2)(struct gf100_gr *);
164168 void (*init_40601c)(struct gf100_gr *);
....@@ -205,6 +209,7 @@
205209 void gf100_gr_init_tex_hww_esr(struct gf100_gr *, int, int);
206210 void gf100_gr_init_shader_exceptions(struct gf100_gr *, int, int);
207211 void gf100_gr_init_400054(struct gf100_gr *);
212
+void gf100_gr_init_num_tpc_per_gpc(struct gf100_gr *, bool, bool);
208213 extern const struct gf100_gr_func_zbc gf100_gr_zbc;
209214
210215 void gf117_gr_init_zcull(struct gf100_gr *);
....@@ -233,9 +238,17 @@
233238 void gp100_gr_init_shader_exceptions(struct gf100_gr *, int, int);
234239 void gp100_gr_zbc_clear_color(struct gf100_gr *, int);
235240 void gp100_gr_zbc_clear_depth(struct gf100_gr *, int);
241
+extern const struct gf100_gr_func_zbc gp100_gr_zbc;
236242
237243 void gp102_gr_init_swdx_pes_mask(struct gf100_gr *);
238244 extern const struct gf100_gr_func_zbc gp102_gr_zbc;
245
+
246
+extern const struct gf100_gr_func gp107_gr;
247
+
248
+void gv100_gr_init_419bd8(struct gf100_gr *);
249
+void gv100_gr_init_504430(struct gf100_gr *, int, int);
250
+void gv100_gr_init_shader_exceptions(struct gf100_gr *, int, int);
251
+void gv100_gr_trap_mp(struct gf100_gr *, int, int);
239252
240253 #define gf100_gr_chan(p) container_of((p), struct gf100_gr_chan, object)
241254 #include <core/object.h>
....@@ -257,9 +270,6 @@
257270
258271 void gf100_gr_ctxctl_debug(struct gf100_gr *);
259272
260
-void gf100_gr_dtor_fw(struct gf100_gr_fuc *);
261
-int gf100_gr_ctor_fw(struct gf100_gr *, const char *,
262
- struct gf100_gr_fuc *);
263273 u64 gf100_gr_units(struct nvkm_gr *);
264274 void gf100_gr_zbc_init(struct gf100_gr *);
265275
....@@ -282,8 +292,8 @@
282292 for (init = pack->init; init && init->count; init++)
283293
284294 struct gf100_gr_ucode {
285
- struct gf100_gr_fuc code;
286
- struct gf100_gr_fuc data;
295
+ struct nvkm_blob code;
296
+ struct nvkm_blob data;
287297 };
288298
289299 extern struct gf100_gr_ucode gf100_gr_fecs_ucode;
....@@ -297,17 +307,6 @@
297307 void gf100_gr_icmd(struct gf100_gr *, const struct gf100_gr_pack *);
298308 void gf100_gr_mthd(struct gf100_gr *, const struct gf100_gr_pack *);
299309 int gf100_gr_init_ctxctl(struct gf100_gr *);
300
-
301
-/* external bundles loading functions */
302
-int gk20a_gr_av_to_init(struct gf100_gr *, const char *,
303
- struct gf100_gr_pack **);
304
-int gk20a_gr_aiv_to_init(struct gf100_gr *, const char *,
305
- struct gf100_gr_pack **);
306
-int gk20a_gr_av_to_method(struct gf100_gr *, const char *,
307
- struct gf100_gr_pack **);
308
-
309
-int gm200_gr_new_(const struct gf100_gr_func *, struct nvkm_device *, int,
310
- struct nvkm_gr **);
311310
312311 /* register init value lists */
313312
....@@ -391,4 +390,32 @@
391390 void gm107_gr_init_bios(struct gf100_gr *);
392391
393392 void gm200_gr_init_gpc_mmu(struct gf100_gr *);
393
+
394
+struct gf100_gr_fwif {
395
+ int version;
396
+ int (*load)(struct gf100_gr *, int ver, const struct gf100_gr_fwif *);
397
+ const struct gf100_gr_func *func;
398
+ const struct nvkm_acr_lsf_func *fecs;
399
+ const struct nvkm_acr_lsf_func *gpccs;
400
+};
401
+
402
+int gf100_gr_load(struct gf100_gr *, int, const struct gf100_gr_fwif *);
403
+int gf100_gr_nofw(struct gf100_gr *, int, const struct gf100_gr_fwif *);
404
+
405
+int gk20a_gr_load_sw(struct gf100_gr *, const char *path, int ver);
406
+
407
+int gm200_gr_nofw(struct gf100_gr *, int, const struct gf100_gr_fwif *);
408
+int gm200_gr_load(struct gf100_gr *, int, const struct gf100_gr_fwif *);
409
+extern const struct nvkm_acr_lsf_func gm200_gr_gpccs_acr;
410
+extern const struct nvkm_acr_lsf_func gm200_gr_fecs_acr;
411
+
412
+extern const struct nvkm_acr_lsf_func gm20b_gr_fecs_acr;
413
+void gm20b_gr_acr_bld_write(struct nvkm_acr *, u32, struct nvkm_acr_lsfw *);
414
+void gm20b_gr_acr_bld_patch(struct nvkm_acr *, u32, s64);
415
+
416
+extern const struct nvkm_acr_lsf_func gp108_gr_gpccs_acr;
417
+extern const struct nvkm_acr_lsf_func gp108_gr_fecs_acr;
418
+
419
+int gf100_gr_new_(const struct gf100_gr_fwif *, struct nvkm_device *, int,
420
+ struct nvkm_gr **);
394421 #endif