diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/Makefile | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hw_ltc_gp10b.h | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/ltc_gp10b.c | 47 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/ltc_gp10b.h | 19 |
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 | |||
11 | obj-$(CONFIG_GK20A) += \ | 11 | obj-$(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 | ||
16 | obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o | 17 | obj-$(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 | } |
497 | static inline u32 ltc_ltc0_lts0_tstg_info_1_r(void) | ||
498 | { | ||
499 | return 0x0014058c; | ||
500 | } | ||
501 | static inline u32 ltc_ltc0_lts0_tstg_info_1_slice_size_in_kb_v(u32 r) | ||
502 | { | ||
503 | return (r >> 0) & 0xffff; | ||
504 | } | ||
505 | static 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 | |||
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 | } | ||
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 | ||
16 | struct gpu_ops; | ||
17 | |||
18 | void gp10b_init_ltc(struct gpu_ops *gops); | ||
19 | #endif | ||