1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include "ctxgf100.h"
23#include "gf100.h"
24
25#include <subdev/mc.h>
26
27static void
28gk20a_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
29{
30 struct nvkm_device *device = gr->base.engine.subdev.device;
31 const struct gf100_grctx_func *grctx = gr->func->grctx;
32 u32 idle_timeout;
33 int i;
34
35 gf100_gr_mmio(gr, gr->fuc_sw_ctx);
36
37 gf100_gr_wait_idle(gr);
38
39 idle_timeout = nvkm_mask(device, 0x404154, 0xffffffff, 0x00000000);
40
41 grctx->attrib(info);
42
43 grctx->unkn(gr);
44
45 gf100_grctx_generate_tpcid(gr);
46 gf100_grctx_generate_r406028(gr);
47 gk104_grctx_generate_r418bb8(gr);
48 gf100_grctx_generate_r406800(gr);
49
50 for (i = 0; i < 8; i++)
51 nvkm_wr32(device, 0x4064d0 + (i * 0x04), 0x00000000);
52
53 nvkm_wr32(device, 0x405b00, (gr->tpc_total << 8) | gr->gpc_nr);
54
55 nvkm_mask(device, 0x5044b0, 0x08000000, 0x08000000);
56
57 gf100_gr_wait_idle(gr);
58
59 nvkm_wr32(device, 0x404154, idle_timeout);
60 gf100_gr_wait_idle(gr);
61
62 gf100_gr_mthd(gr, gr->fuc_method);
63 gf100_gr_wait_idle(gr);
64
65 gf100_gr_icmd(gr, gr->fuc_bundle);
66 grctx->pagepool(info);
67 grctx->bundle(info);
68}
69
70const struct gf100_grctx_func
71gk20a_grctx = {
72 .main = gk20a_grctx_generate_main,
73 .unkn = gk104_grctx_generate_unkn,
74 .bundle = gk104_grctx_generate_bundle,
75 .bundle_size = 0x1800,
76 .bundle_min_gpm_fifo_depth = 0x62,
77 .bundle_token_limit = 0x100,
78 .pagepool = gk104_grctx_generate_pagepool,
79 .pagepool_size = 0x8000,
80 .attrib = gf117_grctx_generate_attrib,
81 .attrib_nr_max = 0x240,
82 .attrib_nr = 0x240,
83 .alpha_nr_max = 0x648 + (0x648 / 2),
84 .alpha_nr = 0x648,
85};
86