summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-11-13 06:30:52 -0500
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:02 -0500
commit7918de1c1b05ae126f830588de1cac533ef1c0cf (patch)
treee2fa71e20e864f8465aff292f9f15777a13c9ce2 /drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
parent68ad020887e93c2eb7f1bdf4fc83ec747397033a (diff)
gpu: nvgpu: gp10b: Implement L2 query
Bug 1567274 Change-Id: I0b8eaebc0949e70f6d8bfbb101048a3d95bec5e3 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/602858 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/ltc_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/ltc_gp10b.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
new file mode 100644
index 00000000..9f5c16ba
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
@@ -0,0 +1,47 @@
1/*
2 * GP10B L2
3 *
4 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#include <linux/types.h>
17
18#include "gk20a/gk20a.h"
19#include "gm20b/ltc_gm20b.h"
20#include "hw_ltc_gp10b.h"
21
22static int gp10b_determine_L2_size_bytes(struct gk20a *g)
23{
24 u32 tmp;
25 int ret;
26
27 gk20a_dbg_fn("");
28
29 tmp = gk20a_readl(g, ltc_ltc0_lts0_tstg_info_1_r());
30
31 ret = g->ltc_count *
32 ltc_ltc0_lts0_tstg_info_1_slice_size_in_kb_v(tmp) *
33 ltc_ltc0_lts0_tstg_info_1_slices_per_l2_v(tmp);
34
35 gk20a_dbg(gpu_dbg_info, "L2 size: %d\n", ret);
36
37 gk20a_dbg_fn("done");
38
39 return ret;
40}
41
42void gp10b_init_ltc(struct gpu_ops *gops)
43{
44 gm20b_init_ltc(gops);
45
46 gops->ltc.determine_L2_size_bytes = gp10b_determine_L2_size_bytes;
47}