summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--drivers/gpu/nvgpu/gp10b/Makefile1
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c5
-rw-r--r--drivers/gpu/nvgpu/gp10b/hw_ltc_gp10b.h12
-rw-r--r--drivers/gpu/nvgpu/gp10b/ltc_gp10b.c47
-rw-r--r--drivers/gpu/nvgpu/gp10b/ltc_gp10b.h19
5 files changed, 81 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/Makefile b/drivers/gpu/nvgpu/gp10b/Makefile
index 193efee0..4ecf761a 100644
--- a/drivers/gpu/nvgpu/gp10b/Makefile
+++ b/drivers/gpu/nvgpu/gp10b/Makefile
@@ -11,6 +11,7 @@ ccflags-$(CONFIG_GK20A) += -Wno-multichar
11obj-$(CONFIG_GK20A) += \ 11obj-$(CONFIG_GK20A) += \
12 gr_gp10b.o \ 12 gr_gp10b.o \
13 mc_gp10b.o \ 13 mc_gp10b.o \
14 ltc_gp10b.o \
14 hal_gp10b.o 15 hal_gp10b.o
15 16
16obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o 17obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 067c9bf4..5ef64e1f 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -22,9 +22,9 @@
22 22
23#include "gp10b/gr_gp10b.h" 23#include "gp10b/gr_gp10b.h"
24#include "gp10b/mc_gp10b.h" 24#include "gp10b/mc_gp10b.h"
25#include "gp10b/ltc_gp10b.h"
25 26
26#include "gm20b/gr_gm20b.h" 27#include "gm20b/gr_gm20b.h"
27#include "gm20b/ltc_gm20b.h"
28#include "gm20b/fb_gm20b.h" 28#include "gm20b/fb_gm20b.h"
29#include "gm20b/gm20b_gating_reglist.h" 29#include "gm20b/gm20b_gating_reglist.h"
30#include "gm20b/fifo_gm20b.h" 30#include "gm20b/fifo_gm20b.h"
@@ -89,9 +89,8 @@ int gp10b_init_hal(struct gk20a *g)
89 89
90 *gops = gp10b_ops; 90 *gops = gp10b_ops;
91 gp10b_init_mc(gops); 91 gp10b_init_mc(gops);
92 gm20b_init_ltc(gops);
93 gp10b_init_gr(gops); 92 gp10b_init_gr(gops);
94 gm20b_init_ltc(gops); 93 gp10b_init_ltc(gops);
95 gm20b_init_fb(gops); 94 gm20b_init_fb(gops);
96 gm20b_init_fifo(gops); 95 gm20b_init_fifo(gops);
97 gm20b_init_gr_ctx(gops); 96 gm20b_init_gr_ctx(gops);
diff --git a/drivers/gpu/nvgpu/gp10b/hw_ltc_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_ltc_gp10b.h
index 45bb1d42..32683dc2 100644
--- a/drivers/gpu/nvgpu/gp10b/hw_ltc_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/hw_ltc_gp10b.h
@@ -494,4 +494,16 @@ static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_f(void)
494{ 494{
495 return 0x1; 495 return 0x1;
496} 496}
497static inline u32 ltc_ltc0_lts0_tstg_info_1_r(void)
498{
499 return 0x0014058c;
500}
501static inline u32 ltc_ltc0_lts0_tstg_info_1_slice_size_in_kb_v(u32 r)
502{
503 return (r >> 0) & 0xffff;
504}
505static inline u32 ltc_ltc0_lts0_tstg_info_1_slices_per_l2_v(u32 r)
506{
507 return (r >> 16) & 0x1f;
508}
497#endif 509#endif
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}
diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.h b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.h
new file mode 100644
index 00000000..7408348e
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13
14#ifndef LTC_GP10B_H
15#define LTC_GP10B_H
16struct gpu_ops;
17
18void gp10b_init_ltc(struct gpu_ops *gops);
19#endif