1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include "mem.h"
25#include "vmm.h"
26
27#include <nvif/class.h>
28
29const u8 *
30nv50_mmu_kind(struct nvkm_mmu *base, int *count, u8 *invalid)
31{
32
33
34
35
36
37
38
39
40 static const u8
41 kind[128] = {
42 0x01, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
43 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
44 0x01, 0x01, 0x01, 0x01, 0x7f, 0x7f, 0x7f, 0x7f,
45 0x02, 0x02, 0x02, 0x02, 0x7f, 0x7f, 0x7f, 0x7f,
46 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x7f,
47 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x7f,
48 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
49 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
50 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02,
51 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x7f, 0x7f,
52 0x7f, 0x7f, 0x7f, 0x7f, 0x01, 0x01, 0x01, 0x7f,
53 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
54 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x7f,
55 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
56 0x01, 0x7f, 0x02, 0x7f, 0x01, 0x7f, 0x02, 0x7f,
57 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x7f, 0x7f
58 };
59 *count = ARRAY_SIZE(kind);
60 *invalid = 0x7f;
61 return kind;
62}
63
64static const struct nvkm_mmu_func
65nv50_mmu = {
66 .dma_bits = 40,
67 .mmu = {{ -1, -1, NVIF_CLASS_MMU_NV50}},
68 .mem = {{ -1, 0, NVIF_CLASS_MEM_NV50}, nv50_mem_new, nv50_mem_map },
69 .vmm = {{ -1, -1, NVIF_CLASS_VMM_NV50}, nv50_vmm_new, false, 0x1400 },
70 .kind = nv50_mmu_kind,
71};
72
73int
74nv50_mmu_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
75 struct nvkm_mmu **pmmu)
76{
77 return nvkm_mmu_new_(&nv50_mmu, device, type, inst, pmmu);
78}
79