1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include "vmm.h"
23
24#include <core/memory.h>
25
26int
27gk20a_vmm_aper(enum nvkm_memory_target target)
28{
29 switch (target) {
30 case NVKM_MEM_TARGET_NCOH: return 0;
31 default:
32 return -EINVAL;
33 }
34}
35
36static const struct nvkm_vmm_func
37gk20a_vmm_17 = {
38 .join = gf100_vmm_join,
39 .part = gf100_vmm_part,
40 .aper = gf100_vmm_aper,
41 .valid = gf100_vmm_valid,
42 .flush = gf100_vmm_flush,
43 .page = {
44 { 17, &gk104_vmm_desc_17_17[0], NVKM_VMM_PAGE_xxHC },
45 { 12, &gk104_vmm_desc_17_12[0], NVKM_VMM_PAGE_xxHx },
46 {}
47 }
48};
49
50static const struct nvkm_vmm_func
51gk20a_vmm_16 = {
52 .join = gf100_vmm_join,
53 .part = gf100_vmm_part,
54 .aper = gf100_vmm_aper,
55 .valid = gf100_vmm_valid,
56 .flush = gf100_vmm_flush,
57 .page = {
58 { 16, &gk104_vmm_desc_16_16[0], NVKM_VMM_PAGE_xxHC },
59 { 12, &gk104_vmm_desc_16_12[0], NVKM_VMM_PAGE_xxHx },
60 {}
61 }
62};
63
64int
65gk20a_vmm_new(struct nvkm_mmu *mmu, u64 addr, u64 size, void *argv, u32 argc,
66 struct lock_class_key *key, const char *name,
67 struct nvkm_vmm **pvmm)
68{
69 return gf100_vmm_new_(&gk20a_vmm_16, &gk20a_vmm_17, mmu, addr,
70 size, argv, argc, key, name, pvmm);
71}
72