diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ltc_common.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ltc_common.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ltc_common.c b/drivers/gpu/nvgpu/gk20a/ltc_common.c index 9d534b7b..e0ab3f9b 100644 --- a/drivers/gpu/nvgpu/gk20a/ltc_common.c +++ b/drivers/gpu/nvgpu/gk20a/ltc_common.c | |||
@@ -24,65 +24,6 @@ | |||
24 | #include "gk20a.h" | 24 | #include "gk20a.h" |
25 | #include "gr_gk20a.h" | 25 | #include "gr_gk20a.h" |
26 | 26 | ||
27 | static int gk20a_determine_L2_size_bytes(struct gk20a *g) | ||
28 | { | ||
29 | const u32 gpuid = GK20A_GPUID(g->gpu_characteristics.arch, | ||
30 | g->gpu_characteristics.impl); | ||
31 | u32 lts_per_ltc; | ||
32 | u32 ways; | ||
33 | u32 sets; | ||
34 | u32 bytes_per_line; | ||
35 | u32 active_ltcs; | ||
36 | u32 cache_size; | ||
37 | |||
38 | u32 tmp; | ||
39 | u32 active_sets_value; | ||
40 | |||
41 | tmp = gk20a_readl(g, ltc_ltc0_lts0_tstg_cfg1_r()); | ||
42 | ways = hweight32(ltc_ltc0_lts0_tstg_cfg1_active_ways_v(tmp)); | ||
43 | |||
44 | active_sets_value = ltc_ltc0_lts0_tstg_cfg1_active_sets_v(tmp); | ||
45 | if (active_sets_value == ltc_ltc0_lts0_tstg_cfg1_active_sets_all_v()) { | ||
46 | sets = 64; | ||
47 | } else if (active_sets_value == | ||
48 | ltc_ltc0_lts0_tstg_cfg1_active_sets_half_v()) { | ||
49 | sets = 32; | ||
50 | } else if (active_sets_value == | ||
51 | ltc_ltc0_lts0_tstg_cfg1_active_sets_quarter_v()) { | ||
52 | sets = 16; | ||
53 | } else { | ||
54 | dev_err(dev_from_gk20a(g), | ||
55 | "Unknown constant %u for active sets", | ||
56 | (unsigned)active_sets_value); | ||
57 | sets = 0; | ||
58 | } | ||
59 | |||
60 | active_ltcs = g->gr.num_fbps; | ||
61 | |||
62 | /* chip-specific values */ | ||
63 | switch (gpuid) { | ||
64 | case GK20A_GPUID_GK20A: | ||
65 | lts_per_ltc = 1; | ||
66 | bytes_per_line = 128; | ||
67 | break; | ||
68 | |||
69 | case GK20A_GPUID_GM20B: | ||
70 | lts_per_ltc = 2; | ||
71 | bytes_per_line = 128; | ||
72 | break; | ||
73 | |||
74 | default: | ||
75 | dev_err(dev_from_gk20a(g), "Unknown GPU id 0x%02x\n", | ||
76 | (unsigned)gpuid); | ||
77 | lts_per_ltc = 0; | ||
78 | bytes_per_line = 0; | ||
79 | } | ||
80 | |||
81 | cache_size = active_ltcs * lts_per_ltc * ways * sets * bytes_per_line; | ||
82 | |||
83 | return cache_size; | ||
84 | } | ||
85 | |||
86 | /* | 27 | /* |
87 | * Set the maximum number of ways that can have the "EVIST_LAST" class. | 28 | * Set the maximum number of ways that can have the "EVIST_LAST" class. |
88 | */ | 29 | */ |