| .. | .. |
|---|
| 31 | 31 | #include <subdev/mmu.h> |
|---|
| 32 | 32 | #include <engine/falcon.h> |
|---|
| 33 | 33 | |
|---|
| 34 | +struct nvkm_acr_lsfw; |
|---|
| 35 | + |
|---|
| 34 | 36 | #define GPC_MAX 32 |
|---|
| 35 | 37 | #define TPC_MAX_PER_GPC 8 |
|---|
| 36 | 38 | #define TPC_MAX (GPC_MAX * TPC_MAX_PER_GPC) |
|---|
| .. | .. |
|---|
| 55 | 57 | int buffer; |
|---|
| 56 | 58 | }; |
|---|
| 57 | 59 | |
|---|
| 58 | | -struct gf100_gr_fuc { |
|---|
| 59 | | - u32 *data; |
|---|
| 60 | | - u32 size; |
|---|
| 61 | | -}; |
|---|
| 62 | | - |
|---|
| 63 | 60 | struct gf100_gr_zbc_color { |
|---|
| 64 | 61 | u32 format; |
|---|
| 65 | 62 | u32 ds[4]; |
|---|
| .. | .. |
|---|
| 82 | 79 | const struct gf100_gr_func *func; |
|---|
| 83 | 80 | struct nvkm_gr base; |
|---|
| 84 | 81 | |
|---|
| 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 | + |
|---|
| 91 | 97 | bool firmware; |
|---|
| 92 | 98 | |
|---|
| 93 | 99 | /* |
|---|
| 94 | 100 | * Used if the register packs are loaded from NVIDIA fw instead of |
|---|
| 95 | 101 | * using hardcoded arrays. To be allocated with vzalloc(). |
|---|
| 96 | 102 | */ |
|---|
| 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; |
|---|
| 101 | 107 | |
|---|
| 102 | 108 | struct gf100_gr_zbc_color zbc_color[NVKM_LTC_MAX_ZBC_CNT]; |
|---|
| 103 | 109 | struct gf100_gr_zbc_depth zbc_depth[NVKM_LTC_MAX_ZBC_CNT]; |
|---|
| .. | .. |
|---|
| 128 | 134 | struct gf100_gr_mmio mmio_list[4096/8]; |
|---|
| 129 | 135 | u32 size; |
|---|
| 130 | 136 | u32 *data; |
|---|
| 137 | + u32 size_zcull; |
|---|
| 138 | + u32 size_pm; |
|---|
| 131 | 139 | }; |
|---|
| 132 | 140 | |
|---|
| 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); |
|---|
| 138 | 142 | |
|---|
| 139 | 143 | struct gf100_gr_func_zbc { |
|---|
| 140 | 144 | void (*clear_color)(struct gf100_gr *, int zbc); |
|---|
| .. | .. |
|---|
| 145 | 149 | }; |
|---|
| 146 | 150 | |
|---|
| 147 | 151 | struct gf100_gr_func { |
|---|
| 148 | | - void (*dtor)(struct gf100_gr *); |
|---|
| 149 | 152 | void (*oneinit_tiles)(struct gf100_gr *); |
|---|
| 150 | 153 | void (*oneinit_sm_id)(struct gf100_gr *); |
|---|
| 151 | 154 | int (*init)(struct gf100_gr *); |
|---|
| .. | .. |
|---|
| 159 | 162 | void (*init_rop_active_fbps)(struct gf100_gr *); |
|---|
| 160 | 163 | void (*init_bios_2)(struct gf100_gr *); |
|---|
| 161 | 164 | void (*init_swdx_pes_mask)(struct gf100_gr *); |
|---|
| 165 | + void (*init_fs)(struct gf100_gr *); |
|---|
| 162 | 166 | void (*init_fecs_exceptions)(struct gf100_gr *); |
|---|
| 163 | 167 | void (*init_ds_hww_esr_2)(struct gf100_gr *); |
|---|
| 164 | 168 | void (*init_40601c)(struct gf100_gr *); |
|---|
| .. | .. |
|---|
| 205 | 209 | void gf100_gr_init_tex_hww_esr(struct gf100_gr *, int, int); |
|---|
| 206 | 210 | void gf100_gr_init_shader_exceptions(struct gf100_gr *, int, int); |
|---|
| 207 | 211 | void gf100_gr_init_400054(struct gf100_gr *); |
|---|
| 212 | +void gf100_gr_init_num_tpc_per_gpc(struct gf100_gr *, bool, bool); |
|---|
| 208 | 213 | extern const struct gf100_gr_func_zbc gf100_gr_zbc; |
|---|
| 209 | 214 | |
|---|
| 210 | 215 | void gf117_gr_init_zcull(struct gf100_gr *); |
|---|
| .. | .. |
|---|
| 233 | 238 | void gp100_gr_init_shader_exceptions(struct gf100_gr *, int, int); |
|---|
| 234 | 239 | void gp100_gr_zbc_clear_color(struct gf100_gr *, int); |
|---|
| 235 | 240 | void gp100_gr_zbc_clear_depth(struct gf100_gr *, int); |
|---|
| 241 | +extern const struct gf100_gr_func_zbc gp100_gr_zbc; |
|---|
| 236 | 242 | |
|---|
| 237 | 243 | void gp102_gr_init_swdx_pes_mask(struct gf100_gr *); |
|---|
| 238 | 244 | 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); |
|---|
| 239 | 252 | |
|---|
| 240 | 253 | #define gf100_gr_chan(p) container_of((p), struct gf100_gr_chan, object) |
|---|
| 241 | 254 | #include <core/object.h> |
|---|
| .. | .. |
|---|
| 257 | 270 | |
|---|
| 258 | 271 | void gf100_gr_ctxctl_debug(struct gf100_gr *); |
|---|
| 259 | 272 | |
|---|
| 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 *); |
|---|
| 263 | 273 | u64 gf100_gr_units(struct nvkm_gr *); |
|---|
| 264 | 274 | void gf100_gr_zbc_init(struct gf100_gr *); |
|---|
| 265 | 275 | |
|---|
| .. | .. |
|---|
| 282 | 292 | for (init = pack->init; init && init->count; init++) |
|---|
| 283 | 293 | |
|---|
| 284 | 294 | 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; |
|---|
| 287 | 297 | }; |
|---|
| 288 | 298 | |
|---|
| 289 | 299 | extern struct gf100_gr_ucode gf100_gr_fecs_ucode; |
|---|
| .. | .. |
|---|
| 297 | 307 | void gf100_gr_icmd(struct gf100_gr *, const struct gf100_gr_pack *); |
|---|
| 298 | 308 | void gf100_gr_mthd(struct gf100_gr *, const struct gf100_gr_pack *); |
|---|
| 299 | 309 | 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 **); |
|---|
| 311 | 310 | |
|---|
| 312 | 311 | /* register init value lists */ |
|---|
| 313 | 312 | |
|---|
| .. | .. |
|---|
| 391 | 390 | void gm107_gr_init_bios(struct gf100_gr *); |
|---|
| 392 | 391 | |
|---|
| 393 | 392 | 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 **); |
|---|
| 394 | 421 | #endif |
|---|