12ffa64ebSBen Skeggs /*
22ffa64ebSBen Skeggs * Copyright 2017 Red Hat Inc.
32ffa64ebSBen Skeggs *
42ffa64ebSBen Skeggs * Permission is hereby granted, free of charge, to any person obtaining a
52ffa64ebSBen Skeggs * copy of this software and associated documentation files (the "Software"),
62ffa64ebSBen Skeggs * to deal in the Software without restriction, including without limitation
72ffa64ebSBen Skeggs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
82ffa64ebSBen Skeggs * and/or sell copies of the Software, and to permit persons to whom the
92ffa64ebSBen Skeggs * Software is furnished to do so, subject to the following conditions:
102ffa64ebSBen Skeggs *
112ffa64ebSBen Skeggs * The above copyright notice and this permission notice shall be included in
122ffa64ebSBen Skeggs * all copies or substantial portions of the Software.
132ffa64ebSBen Skeggs *
142ffa64ebSBen Skeggs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152ffa64ebSBen Skeggs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
162ffa64ebSBen Skeggs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
172ffa64ebSBen Skeggs * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
182ffa64ebSBen Skeggs * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
192ffa64ebSBen Skeggs * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
202ffa64ebSBen Skeggs * OTHER DEALINGS IN THE SOFTWARE.
212ffa64ebSBen Skeggs */
222ffa64ebSBen Skeggs #include "vmm.h"
232ffa64ebSBen Skeggs
242ffa64ebSBen Skeggs static const struct nvkm_vmm_func
252ffa64ebSBen Skeggs mcp77_vmm = {
262ffa64ebSBen Skeggs .join = nv50_vmm_join,
272ffa64ebSBen Skeggs .part = nv50_vmm_part,
282ffa64ebSBen Skeggs .valid = nv50_vmm_valid,
292ffa64ebSBen Skeggs .flush = nv50_vmm_flush,
302ffa64ebSBen Skeggs .page_block = 1 << 29,
312ffa64ebSBen Skeggs .page = {
322ffa64ebSBen Skeggs { 16, &nv50_vmm_desc_16[0], NVKM_VMM_PAGE_xVxx },
332ffa64ebSBen Skeggs { 12, &nv50_vmm_desc_12[0], NVKM_VMM_PAGE_xVHx },
342ffa64ebSBen Skeggs {}
352ffa64ebSBen Skeggs }
362ffa64ebSBen Skeggs };
372ffa64ebSBen Skeggs
382ffa64ebSBen Skeggs int
mcp77_vmm_new(struct nvkm_mmu * mmu,bool managed,u64 addr,u64 size,void * argv,u32 argc,struct lock_class_key * key,const char * name,struct nvkm_vmm ** pvmm)39*2606f291SBen Skeggs mcp77_vmm_new(struct nvkm_mmu *mmu, bool managed, u64 addr, u64 size,
40*2606f291SBen Skeggs void *argv, u32 argc, struct lock_class_key *key,
41*2606f291SBen Skeggs const char *name, struct nvkm_vmm **pvmm)
422ffa64ebSBen Skeggs {
43*2606f291SBen Skeggs return nv04_vmm_new_(&mcp77_vmm, mmu, 0, managed, addr, size,
442ffa64ebSBen Skeggs argv, argc, key, name, pvmm);
452ffa64ebSBen Skeggs }
46