1b2c4ef70SBen Skeggs /*
2b2c4ef70SBen Skeggs * Copyright 2017 Red Hat Inc.
3b2c4ef70SBen Skeggs *
4b2c4ef70SBen Skeggs * Permission is hereby granted, free of charge, to any person obtaining a
5b2c4ef70SBen Skeggs * copy of this software and associated documentation files (the "Software"),
6b2c4ef70SBen Skeggs * to deal in the Software without restriction, including without limitation
7b2c4ef70SBen Skeggs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8b2c4ef70SBen Skeggs * and/or sell copies of the Software, and to permit persons to whom the
9b2c4ef70SBen Skeggs * Software is furnished to do so, subject to the following conditions:
10b2c4ef70SBen Skeggs *
11b2c4ef70SBen Skeggs * The above copyright notice and this permission notice shall be included in
12b2c4ef70SBen Skeggs * all copies or substantial portions of the Software.
13b2c4ef70SBen Skeggs *
14b2c4ef70SBen Skeggs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15b2c4ef70SBen Skeggs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16b2c4ef70SBen Skeggs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17b2c4ef70SBen Skeggs * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18b2c4ef70SBen Skeggs * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19b2c4ef70SBen Skeggs * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20b2c4ef70SBen Skeggs * OTHER DEALINGS IN THE SOFTWARE.
21b2c4ef70SBen Skeggs *
22b2c4ef70SBen Skeggs * Authors: Ben Skeggs <bskeggs@redhat.com>
23b2c4ef70SBen Skeggs */
24b2c4ef70SBen Skeggs #include "gf100.h"
25b2c4ef70SBen Skeggs #include "ctxgf100.h"
26b2c4ef70SBen Skeggs
27b2c4ef70SBen Skeggs #include <nvif/class.h>
28b2c4ef70SBen Skeggs
29a096ff19SBen Skeggs const struct gf100_gr_func
30b2c4ef70SBen Skeggs gp107_gr = {
315f6474a4SBen Skeggs .oneinit_tiles = gm200_gr_oneinit_tiles,
32068cae74SBen Skeggs .oneinit_sm_id = gm200_gr_oneinit_sm_id,
33525230cbSBen Skeggs .init = gf100_gr_init,
34b2c4ef70SBen Skeggs .init_gpc_mmu = gm200_gr_init_gpc_mmu,
352fe5ff63SBen Skeggs .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
3602917aa3SBen Skeggs .init_zcull = gf117_gr_init_zcull,
37bfd27f39SBen Skeggs .init_num_active_ltcs = gm200_gr_init_num_active_ltcs,
38b2c4ef70SBen Skeggs .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
39b2c4ef70SBen Skeggs .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask,
402585a1b1SBen Skeggs .init_fecs_exceptions = gp100_gr_init_fecs_exceptions,
413ac72e98SBen Skeggs .init_ds_hww_esr_2 = gm200_gr_init_ds_hww_esr_2,
420a5b9730SBen Skeggs .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
430feab025SBen Skeggs .init_419cc0 = gf100_gr_init_419cc0,
44dff30dbdSBen Skeggs .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
45f3ef80c0SBen Skeggs .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
46ab4d49a3SBen Skeggs .init_504430 = gm107_gr_init_504430,
474615e9b4SBen Skeggs .init_shader_exceptions = gp100_gr_init_shader_exceptions,
48b6d93fa7SBen Skeggs .init_rop_exceptions = gf100_gr_init_rop_exceptions,
49*1a344688SBen Skeggs .init_exception2 = gf100_gr_init_exception2,
505c05a589SBen Skeggs .trap_mp = gf100_gr_trap_mp,
51be99d041SBen Skeggs .fecs.reset = gf100_gr_fecs_reset,
52b2c4ef70SBen Skeggs .rops = gm200_gr_rops,
53fc360764SBen Skeggs .gpc_nr = 2,
54fc360764SBen Skeggs .tpc_nr = 3,
55b2c4ef70SBen Skeggs .ppc_nr = 1,
56b2c4ef70SBen Skeggs .grctx = &gp107_grctx,
574b2c71edSBen Skeggs .zbc = &gp102_gr_zbc,
58b2c4ef70SBen Skeggs .sclass = {
59b2c4ef70SBen Skeggs { -1, -1, FERMI_TWOD_A },
60b2c4ef70SBen Skeggs { -1, -1, KEPLER_INLINE_TO_MEMORY_B },
61b2c4ef70SBen Skeggs { -1, -1, PASCAL_B, &gf100_fermi },
62b2c4ef70SBen Skeggs { -1, -1, PASCAL_COMPUTE_B },
63b2c4ef70SBen Skeggs {}
64b2c4ef70SBen Skeggs }
65b2c4ef70SBen Skeggs };
66b2c4ef70SBen Skeggs
67ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/fecs_bl.bin");
68ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/fecs_inst.bin");
69ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/fecs_data.bin");
70ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/fecs_sig.bin");
71ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/gpccs_bl.bin");
72ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/gpccs_inst.bin");
73ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/gpccs_data.bin");
74ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/gpccs_sig.bin");
75ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/sw_ctx.bin");
76ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/sw_nonctx.bin");
77ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/sw_bundle_init.bin");
78ef16dc27SBen Skeggs MODULE_FIRMWARE("nvidia/gp107/gr/sw_method_init.bin");
79ef16dc27SBen Skeggs
80ef16dc27SBen Skeggs static const struct gf100_gr_fwif
81ef16dc27SBen Skeggs gp107_gr_fwif[] = {
82ef16dc27SBen Skeggs { 0, gm200_gr_load, &gp107_gr, &gm200_gr_fecs_acr, &gm200_gr_gpccs_acr },
83b9c246adSBen Skeggs { -1, gm200_gr_nofw },
84ef16dc27SBen Skeggs {}
85ef16dc27SBen Skeggs };
86ef16dc27SBen Skeggs
87b2c4ef70SBen Skeggs int
gp107_gr_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_gr ** pgr)88864d37c3SBen Skeggs gp107_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
89b2c4ef70SBen Skeggs {
90864d37c3SBen Skeggs return gf100_gr_new_(gp107_gr_fwif, device, type, inst, pgr);
91b2c4ef70SBen Skeggs }
92