xref: /linux/drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110b.c (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1b8bf04e1SBen Skeggs /*
2b8bf04e1SBen Skeggs  * Copyright 2013 Red Hat Inc.
3b8bf04e1SBen Skeggs  *
4b8bf04e1SBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
5b8bf04e1SBen Skeggs  * copy of this software and associated documentation files (the "Software"),
6b8bf04e1SBen Skeggs  * to deal in the Software without restriction, including without limitation
7b8bf04e1SBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8b8bf04e1SBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
9b8bf04e1SBen Skeggs  * Software is furnished to do so, subject to the following conditions:
10b8bf04e1SBen Skeggs  *
11b8bf04e1SBen Skeggs  * The above copyright notice and this permission notice shall be included in
12b8bf04e1SBen Skeggs  * all copies or substantial portions of the Software.
13b8bf04e1SBen Skeggs  *
14b8bf04e1SBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15b8bf04e1SBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16b8bf04e1SBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17b8bf04e1SBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18b8bf04e1SBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19b8bf04e1SBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20b8bf04e1SBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
21b8bf04e1SBen Skeggs  *
22b8bf04e1SBen Skeggs  * Authors: Ben Skeggs <bskeggs@redhat.com>
23b8bf04e1SBen Skeggs  */
24e3c71eb2SBen Skeggs #include "gf100.h"
25e3c71eb2SBen Skeggs #include "ctxgf100.h"
26b8bf04e1SBen Skeggs 
2727f3d6cfSBen Skeggs #include <nvif/class.h>
2827f3d6cfSBen Skeggs 
29b8bf04e1SBen Skeggs /*******************************************************************************
30b8bf04e1SBen Skeggs  * PGRAPH register lists
31b8bf04e1SBen Skeggs  ******************************************************************************/
32b8bf04e1SBen Skeggs 
33e3c71eb2SBen Skeggs static const struct gf100_gr_init
34b8bf04e1SBen Skeggs gk110b_gr_init_l1c_0[] = {
35b8bf04e1SBen Skeggs 	{ 0x419c98,   1, 0x04, 0x00000000 },
36b8bf04e1SBen Skeggs 	{ 0x419ca8,   1, 0x04, 0x00000000 },
37b8bf04e1SBen Skeggs 	{ 0x419cb0,   1, 0x04, 0x09000000 },
38b8bf04e1SBen Skeggs 	{ 0x419cb4,   1, 0x04, 0x00000000 },
39b8bf04e1SBen Skeggs 	{ 0x419cb8,   1, 0x04, 0x00b08bea },
40b8bf04e1SBen Skeggs 	{ 0x419c84,   1, 0x04, 0x00010384 },
41b8bf04e1SBen Skeggs 	{ 0x419cbc,   1, 0x04, 0x281b3646 },
42b8bf04e1SBen Skeggs 	{ 0x419cc0,   2, 0x04, 0x00000000 },
43b8bf04e1SBen Skeggs 	{ 0x419c80,   1, 0x04, 0x00020230 },
44b8bf04e1SBen Skeggs 	{ 0x419ccc,   2, 0x04, 0x00000000 },
45b8bf04e1SBen Skeggs 	{}
46b8bf04e1SBen Skeggs };
47b8bf04e1SBen Skeggs 
48e3c71eb2SBen Skeggs static const struct gf100_gr_init
49b8bf04e1SBen Skeggs gk110b_gr_init_sm_0[] = {
50b8bf04e1SBen Skeggs 	{ 0x419e00,   1, 0x04, 0x00000080 },
51b8bf04e1SBen Skeggs 	{ 0x419ea0,   1, 0x04, 0x00000000 },
52b8bf04e1SBen Skeggs 	{ 0x419ee4,   1, 0x04, 0x00000000 },
53b8bf04e1SBen Skeggs 	{ 0x419ea4,   1, 0x04, 0x00000100 },
54b8bf04e1SBen Skeggs 	{ 0x419ea8,   1, 0x04, 0x00000000 },
55b8bf04e1SBen Skeggs 	{ 0x419eb4,   1, 0x04, 0x00000000 },
56b8bf04e1SBen Skeggs 	{ 0x419ebc,   2, 0x04, 0x00000000 },
57b8bf04e1SBen Skeggs 	{ 0x419edc,   1, 0x04, 0x00000000 },
58b8bf04e1SBen Skeggs 	{ 0x419f00,   1, 0x04, 0x00000000 },
59b8bf04e1SBen Skeggs 	{ 0x419ed0,   1, 0x04, 0x00002616 },
60b8bf04e1SBen Skeggs 	{ 0x419f74,   1, 0x04, 0x00015555 },
61b8bf04e1SBen Skeggs 	{ 0x419f80,   4, 0x04, 0x00000000 },
62b8bf04e1SBen Skeggs 	{}
63b8bf04e1SBen Skeggs };
64b8bf04e1SBen Skeggs 
65e3c71eb2SBen Skeggs static const struct gf100_gr_pack
66b8bf04e1SBen Skeggs gk110b_gr_pack_mmio[] = {
67e3c71eb2SBen Skeggs 	{ gk104_gr_init_main_0 },
68e3c71eb2SBen Skeggs 	{ gk110_gr_init_fe_0 },
69e3c71eb2SBen Skeggs 	{ gf100_gr_init_pri_0 },
70e3c71eb2SBen Skeggs 	{ gf100_gr_init_rstr2d_0 },
71e3c71eb2SBen Skeggs 	{ gf119_gr_init_pd_0 },
72e3c71eb2SBen Skeggs 	{ gk110_gr_init_ds_0 },
73e3c71eb2SBen Skeggs 	{ gf100_gr_init_scc_0 },
74e3c71eb2SBen Skeggs 	{ gk110_gr_init_sked_0 },
75e3c71eb2SBen Skeggs 	{ gk110_gr_init_cwd_0 },
76e3c71eb2SBen Skeggs 	{ gf119_gr_init_prop_0 },
77e3c71eb2SBen Skeggs 	{ gf108_gr_init_gpc_unk_0 },
78e3c71eb2SBen Skeggs 	{ gf100_gr_init_setup_0 },
79e3c71eb2SBen Skeggs 	{ gf100_gr_init_crstr_0 },
80e3c71eb2SBen Skeggs 	{ gf108_gr_init_setup_1 },
81e3c71eb2SBen Skeggs 	{ gf100_gr_init_zcull_0 },
82e3c71eb2SBen Skeggs 	{ gf119_gr_init_gpm_0 },
83e3c71eb2SBen Skeggs 	{ gk110_gr_init_gpc_unk_1 },
84e3c71eb2SBen Skeggs 	{ gf100_gr_init_gcc_0 },
85191e3232SBen Skeggs 	{ gk104_gr_init_gpc_unk_2 },
86e3c71eb2SBen Skeggs 	{ gk104_gr_init_tpccs_0 },
87e3c71eb2SBen Skeggs 	{ gk110_gr_init_tex_0 },
88e3c71eb2SBen Skeggs 	{ gk104_gr_init_pe_0 },
89b8bf04e1SBen Skeggs 	{ gk110b_gr_init_l1c_0 },
90e3c71eb2SBen Skeggs 	{ gf100_gr_init_mpc_0 },
91b8bf04e1SBen Skeggs 	{ gk110b_gr_init_sm_0 },
92e3c71eb2SBen Skeggs 	{ gf117_gr_init_pes_0 },
93e3c71eb2SBen Skeggs 	{ gf117_gr_init_wwdx_0 },
94e3c71eb2SBen Skeggs 	{ gf117_gr_init_cbm_0 },
95e3c71eb2SBen Skeggs 	{ gk104_gr_init_be_0 },
96e3c71eb2SBen Skeggs 	{ gf100_gr_init_fe_1 },
97b8bf04e1SBen Skeggs 	{}
98b8bf04e1SBen Skeggs };
99b8bf04e1SBen Skeggs 
100b8bf04e1SBen Skeggs /*******************************************************************************
101b8bf04e1SBen Skeggs  * PGRAPH engine/subdev functions
102b8bf04e1SBen Skeggs  ******************************************************************************/
103b8bf04e1SBen Skeggs 
10427f3d6cfSBen Skeggs static const struct gf100_gr_func
10527f3d6cfSBen Skeggs gk110b_gr = {
1065f6474a4SBen Skeggs 	.oneinit_tiles = gf100_gr_oneinit_tiles,
107068cae74SBen Skeggs 	.oneinit_sm_id = gf100_gr_oneinit_sm_id,
108525230cbSBen Skeggs 	.init = gf100_gr_init,
109223eaf4bSBen Skeggs 	.init_gpc_mmu = gf100_gr_init_gpc_mmu,
1102fe5ff63SBen Skeggs 	.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
11102917aa3SBen Skeggs 	.init_zcull = gf117_gr_init_zcull,
112bfd27f39SBen Skeggs 	.init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
11387ac331eSBen Skeggs 	.init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
1142585a1b1SBen Skeggs 	.init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
1150a5b9730SBen Skeggs 	.init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
1160feab025SBen Skeggs 	.init_419cc0 = gf100_gr_init_419cc0,
1170a84a513SBen Skeggs 	.init_419eb4 = gk110_gr_init_419eb4,
118a00ecf22SBen Skeggs 	.init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
119f3ef80c0SBen Skeggs 	.init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
1204615e9b4SBen Skeggs 	.init_shader_exceptions = gf100_gr_init_shader_exceptions,
121b6d93fa7SBen Skeggs 	.init_rop_exceptions = gf100_gr_init_rop_exceptions,
122*1a344688SBen Skeggs 	.init_exception2 = gf100_gr_init_exception2,
12304547482SBen Skeggs 	.init_400054 = gf100_gr_init_400054,
1245c05a589SBen Skeggs 	.trap_mp = gf100_gr_trap_mp,
125c85ee6caSBen Skeggs 	.mmio = gk110b_gr_pack_mmio,
126c85ee6caSBen Skeggs 	.fecs.ucode = &gk110_gr_fecs_ucode,
127be99d041SBen Skeggs 	.fecs.reset = gf100_gr_fecs_reset,
128c85ee6caSBen Skeggs 	.gpccs.ucode = &gk110_gr_gpccs_ucode,
12964cb5a31SBen Skeggs 	.rops = gf100_gr_rops,
130c85ee6caSBen Skeggs 	.ppc_nr = 2,
13127f3d6cfSBen Skeggs 	.grctx = &gk110b_grctx,
132e9d03335SBen Skeggs 	.zbc = &gf100_gr_zbc,
13327f3d6cfSBen Skeggs 	.sclass = {
13427f3d6cfSBen Skeggs 		{ -1, -1, FERMI_TWOD_A },
13527f3d6cfSBen Skeggs 		{ -1, -1, KEPLER_INLINE_TO_MEMORY_B },
13627f3d6cfSBen Skeggs 		{ -1, -1, KEPLER_B, &gf100_fermi },
13727f3d6cfSBen Skeggs 		{ -1, -1, KEPLER_COMPUTE_B },
13827f3d6cfSBen Skeggs 		{}
13927f3d6cfSBen Skeggs 	}
14027f3d6cfSBen Skeggs };
14127f3d6cfSBen Skeggs 
142ef16dc27SBen Skeggs static const struct gf100_gr_fwif
143ef16dc27SBen Skeggs gk110b_gr_fwif[] = {
144ef16dc27SBen Skeggs 	{ -1, gf100_gr_load, &gk110b_gr },
145ef16dc27SBen Skeggs 	{ -1, gf100_gr_nofw, &gk110b_gr },
146ef16dc27SBen Skeggs 	{}
147ef16dc27SBen Skeggs };
148ef16dc27SBen Skeggs 
149c85ee6caSBen Skeggs int
gk110b_gr_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_gr ** pgr)150864d37c3SBen Skeggs gk110b_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
151864d37c3SBen Skeggs 	      struct nvkm_gr **pgr)
152c85ee6caSBen Skeggs {
153864d37c3SBen Skeggs 	return gf100_gr_new_(gk110b_gr_fwif, device, type, inst, pgr);
154c85ee6caSBen Skeggs }
155