170433b90SBen Skeggs /*
270433b90SBen Skeggs  * Copyright 2017 Red Hat Inc.
370433b90SBen Skeggs  *
470433b90SBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
570433b90SBen Skeggs  * copy of this software and associated documentation files (the "Software"),
670433b90SBen Skeggs  * to deal in the Software without restriction, including without limitation
770433b90SBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
870433b90SBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
970433b90SBen Skeggs  * Software is furnished to do so, subject to the following conditions:
1070433b90SBen Skeggs  *
1170433b90SBen Skeggs  * The above copyright notice and this permission notice shall be included in
1270433b90SBen Skeggs  * all copies or substantial portions of the Software.
1370433b90SBen Skeggs  *
1470433b90SBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1570433b90SBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1670433b90SBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1770433b90SBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1870433b90SBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1970433b90SBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2070433b90SBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
2170433b90SBen Skeggs  */
2270433b90SBen Skeggs #include "gf100.h"
2370433b90SBen Skeggs 
2470433b90SBen Skeggs static const struct nvkm_bar_func
2570433b90SBen Skeggs gm20b_bar_func = {
2670433b90SBen Skeggs 	.dtor = gf100_bar_dtor,
2770433b90SBen Skeggs 	.oneinit = gf100_bar_oneinit,
2870433b90SBen Skeggs 	.bar1.init = gf100_bar_bar1_init,
2970433b90SBen Skeggs 	.bar1.wait = gm107_bar_bar1_wait,
3070433b90SBen Skeggs 	.bar1.vmm = gf100_bar_bar1_vmm,
3170433b90SBen Skeggs 	.flush = g84_bar_flush,
3270433b90SBen Skeggs };
3370433b90SBen Skeggs 
3470433b90SBen Skeggs int
gm20b_bar_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_bar ** pbar)35*917b24a3SBen Skeggs gm20b_bar_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
36*917b24a3SBen Skeggs 	      struct nvkm_bar **pbar)
3770433b90SBen Skeggs {
38*917b24a3SBen Skeggs 	int ret = gf100_bar_new_(&gm20b_bar_func, device, type, inst, pbar);
3970433b90SBen Skeggs 	if (ret == 0)
4070433b90SBen Skeggs 		(*pbar)->iomap_uncached = true;
4170433b90SBen Skeggs 	return ret;
4270433b90SBen Skeggs }
43