diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/ltc_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/ltc_gp10b.c | 47 |
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 | |||
22 | static 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 | |||
42 | void 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 | } | ||