1c39f472eSBen Skeggs /*
2c39f472eSBen Skeggs  * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
3c39f472eSBen Skeggs  *
4c39f472eSBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
5c39f472eSBen Skeggs  * copy of this software and associated documentation files (the "Software"),
6c39f472eSBen Skeggs  * to deal in the Software without restriction, including without limitation
7c39f472eSBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8c39f472eSBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
9c39f472eSBen Skeggs  * Software is furnished to do so, subject to the following conditions:
10c39f472eSBen Skeggs  *
11c39f472eSBen Skeggs  * The above copyright notice and this permission notice shall be included in
12c39f472eSBen Skeggs  * all copies or substantial portions of the Software.
13c39f472eSBen Skeggs  *
14c39f472eSBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15c39f472eSBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16c39f472eSBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17c39f472eSBen Skeggs  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18c39f472eSBen Skeggs  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19c39f472eSBen Skeggs  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20c39f472eSBen Skeggs  * DEALINGS IN THE SOFTWARE.
21c39f472eSBen Skeggs  */
2232932281SBen Skeggs #include "gf100.h"
2332932281SBen Skeggs 
2432932281SBen Skeggs static const struct nvkm_bar_func
2532932281SBen Skeggs gk20a_bar_func = {
2632932281SBen Skeggs 	.dtor = gf100_bar_dtor,
2732932281SBen Skeggs 	.oneinit = gf100_bar_oneinit,
287313cfa4SBen Skeggs 	.bar1.init = gf100_bar_bar1_init,
297313cfa4SBen Skeggs 	.bar1.wait = gf100_bar_bar1_wait,
30570889dcSBen Skeggs 	.bar1.vmm = gf100_bar_bar1_vmm,
3132932281SBen Skeggs 	.flush = g84_bar_flush,
3232932281SBen Skeggs };
33c39f472eSBen Skeggs 
34c39f472eSBen Skeggs int
gk20a_bar_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_bar ** pbar)35*917b24a3SBen Skeggs gk20a_bar_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
36*917b24a3SBen Skeggs 	      struct nvkm_bar **pbar)
37c39f472eSBen Skeggs {
38*917b24a3SBen Skeggs 	int ret = gf100_bar_new_(&gk20a_bar_func, device, type, inst, pbar);
3932932281SBen Skeggs 	if (ret == 0)
4032932281SBen Skeggs 		(*pbar)->iomap_uncached = true;
41c39f472eSBen Skeggs 	return ret;
42c39f472eSBen Skeggs }
43