summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/bus_gm20b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-04-06 17:16:10 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-25 13:15:40 -0400
commit2dbf961365822e38ac6b7266388fcfa503f6e52f (patch)
treed3ee4e3698b80c2d9a4174547c42e66098b63750 /drivers/gpu/nvgpu/gm20b/bus_gm20b.c
parent775c69af8cffbd3c11cda027a99ad9d588e09f95 (diff)
gpu: nvgpu: Move bus HAL to common
Move implementation of bus HAL to common/bus. Change-Id: Ia89350f9d94f3ccfd5500a340e6a677cd7d4cfaa Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1726337 GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/bus_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/bus_gm20b.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/bus_gm20b.c b/drivers/gpu/nvgpu/gm20b/bus_gm20b.c
deleted file mode 100644
index ca2a40bf..00000000
--- a/drivers/gpu/nvgpu/gm20b/bus_gm20b.c
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * GM20B MMU
3 *
4 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#include <nvgpu/timers.h>
26#include <nvgpu/bus.h>
27#include <nvgpu/mm.h>
28#include <nvgpu/enabled.h>
29
30#include "bus_gm20b.h"
31#include "gk20a/gk20a.h"
32#include "gk20a/bus_gk20a.h"
33
34#include <nvgpu/hw/gm20b/hw_bus_gm20b.h>
35
36int gm20b_bus_bar1_bind(struct gk20a *g, struct nvgpu_mem *bar1_inst)
37{
38 struct nvgpu_timeout timeout;
39 int err = 0;
40 u64 iova = nvgpu_inst_block_addr(g, bar1_inst);
41 u32 ptr_v = (u32)(iova >> bus_bar1_block_ptr_shift_v());
42
43 nvgpu_log_info(g, "bar1 inst block ptr: 0x%08x", ptr_v);
44
45 gk20a_writel(g, bus_bar1_block_r(),
46 nvgpu_aperture_mask(g, bar1_inst,
47 bus_bar1_block_target_sys_mem_ncoh_f(),
48 bus_bar1_block_target_sys_mem_coh_f(),
49 bus_bar1_block_target_vid_mem_f()) |
50 bus_bar1_block_mode_virtual_f() |
51 bus_bar1_block_ptr_f(ptr_v));
52 nvgpu_timeout_init(g, &timeout, 1000, NVGPU_TIMER_RETRY_TIMER);
53 do {
54 u32 val = gk20a_readl(g, bus_bind_status_r());
55 u32 pending = bus_bind_status_bar1_pending_v(val);
56 u32 outstanding = bus_bind_status_bar1_outstanding_v(val);
57 if (!pending && !outstanding)
58 break;
59
60 nvgpu_udelay(5);
61 } while (!nvgpu_timeout_expired(&timeout));
62
63 if (nvgpu_timeout_peek_expired(&timeout))
64 err = -EINVAL;
65
66 return err;
67}