diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/Makefile | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gp10b.c | 110 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gp10b.h | 26 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hw_fuse_gp10b.h | 10 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h | 32 |
6 files changed, 182 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index e5ed32d4..13d52f84 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile | |||
@@ -17,7 +17,8 @@ nvgpu-y += \ | |||
17 | $(nvgpu-t18x)/gp10b/cde_gp10b.o \ | 17 | $(nvgpu-t18x)/gp10b/cde_gp10b.o \ |
18 | $(nvgpu-t18x)/gp10b/therm_gp10b.o \ | 18 | $(nvgpu-t18x)/gp10b/therm_gp10b.o \ |
19 | $(nvgpu-t18x)/gp10b/fecs_trace_gp10b.o \ | 19 | $(nvgpu-t18x)/gp10b/fecs_trace_gp10b.o \ |
20 | $(nvgpu-t18x)/gp10b/gp10b_sysfs.o | 20 | $(nvgpu-t18x)/gp10b/gp10b_sysfs.o \ |
21 | $(nvgpu-t18x)/gp10b/gp10b.o | ||
21 | 22 | ||
22 | nvgpu-$(CONFIG_TEGRA_GK20A) += $(nvgpu-t18x)/gp10b/platform_gp10b_tegra.o | 23 | nvgpu-$(CONFIG_TEGRA_GK20A) += $(nvgpu-t18x)/gp10b/platform_gp10b_tegra.o |
23 | 24 | ||
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b.c b/drivers/gpu/nvgpu/gp10b/gp10b.c new file mode 100644 index 00000000..a541dda3 --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/gp10b.c | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * GP10B Graphics | ||
3 | * | ||
4 | * Copyright (c) 2016, 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 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #include "gk20a/gk20a.h" | ||
20 | #include "hw_fuse_gp10b.h" | ||
21 | #include "hw_gr_gp10b.h" | ||
22 | |||
23 | static u64 gp10b_detect_ecc_enabled_units(struct gk20a *g) | ||
24 | { | ||
25 | u64 ecc_enabled_units = 0; | ||
26 | u32 opt_ecc_en = gk20a_readl(g, fuse_opt_ecc_en_r()); | ||
27 | u32 opt_feature_fuses_override_disable = | ||
28 | gk20a_readl(g, | ||
29 | fuse_opt_feature_fuses_override_disable_r()); | ||
30 | u32 fecs_feature_override_ecc = | ||
31 | gk20a_readl(g, | ||
32 | gr_fecs_feature_override_ecc_r()); | ||
33 | |||
34 | if (opt_feature_fuses_override_disable) { | ||
35 | if (opt_ecc_en) | ||
36 | ecc_enabled_units = NVGPU_GPU_FLAGS_ALL_ECC_ENABLED; | ||
37 | else | ||
38 | ecc_enabled_units = 0; | ||
39 | } else { | ||
40 | /* SM LRF */ | ||
41 | if (gr_fecs_feature_override_ecc_sm_lrf_override_v( | ||
42 | fecs_feature_override_ecc)) { | ||
43 | if (gr_fecs_feature_override_ecc_sm_lrf_v( | ||
44 | fecs_feature_override_ecc)) { | ||
45 | ecc_enabled_units |= | ||
46 | NVGPU_GPU_FLAGS_ECC_ENABLED_SM_LRF; | ||
47 | } | ||
48 | } else { | ||
49 | if (opt_ecc_en) { | ||
50 | ecc_enabled_units |= | ||
51 | NVGPU_GPU_FLAGS_ECC_ENABLED_SM_LRF; | ||
52 | } | ||
53 | } | ||
54 | |||
55 | /* SM SHM */ | ||
56 | if (gr_fecs_feature_override_ecc_sm_shm_override_v( | ||
57 | fecs_feature_override_ecc)) { | ||
58 | if (gr_fecs_feature_override_ecc_sm_shm_v( | ||
59 | fecs_feature_override_ecc)) { | ||
60 | ecc_enabled_units |= | ||
61 | NVGPU_GPU_FLAGS_ECC_ENABLED_SM_SHM; | ||
62 | } | ||
63 | } else { | ||
64 | if (opt_ecc_en) { | ||
65 | ecc_enabled_units |= | ||
66 | NVGPU_GPU_FLAGS_ECC_ENABLED_SM_SHM; | ||
67 | } | ||
68 | } | ||
69 | |||
70 | /* TEX */ | ||
71 | if (gr_fecs_feature_override_ecc_tex_override_v( | ||
72 | fecs_feature_override_ecc)) { | ||
73 | if (gr_fecs_feature_override_ecc_tex_v( | ||
74 | fecs_feature_override_ecc)) { | ||
75 | ecc_enabled_units |= | ||
76 | NVGPU_GPU_FLAGS_ECC_ENABLED_TEX; | ||
77 | } | ||
78 | } else { | ||
79 | if (opt_ecc_en) { | ||
80 | ecc_enabled_units |= | ||
81 | NVGPU_GPU_FLAGS_ECC_ENABLED_TEX; | ||
82 | } | ||
83 | } | ||
84 | |||
85 | /* LTC */ | ||
86 | if (gr_fecs_feature_override_ecc_ltc_override_v( | ||
87 | fecs_feature_override_ecc)) { | ||
88 | if (gr_fecs_feature_override_ecc_ltc_v( | ||
89 | fecs_feature_override_ecc)) { | ||
90 | ecc_enabled_units |= | ||
91 | NVGPU_GPU_FLAGS_ECC_ENABLED_LTC; | ||
92 | } | ||
93 | } else { | ||
94 | if (opt_ecc_en) { | ||
95 | ecc_enabled_units |= | ||
96 | NVGPU_GPU_FLAGS_ECC_ENABLED_LTC; | ||
97 | } | ||
98 | } | ||
99 | } | ||
100 | |||
101 | return ecc_enabled_units; | ||
102 | } | ||
103 | |||
104 | int gp10b_init_gpu_characteristics(struct gk20a *g) | ||
105 | { | ||
106 | gk20a_init_gpu_characteristics(g); | ||
107 | g->gpu_characteristics.flags |= gp10b_detect_ecc_enabled_units(g); | ||
108 | |||
109 | return 0; | ||
110 | } | ||
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b.h b/drivers/gpu/nvgpu/gp10b/gp10b.h new file mode 100644 index 00000000..263f3cbe --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/gp10b.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * GP10B Graphics | ||
3 | * | ||
4 | * Copyright (c) 2016, 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 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifndef GP10B_H | ||
20 | #define GP10B_H | ||
21 | |||
22 | #include "gk20a/gk20a.h" | ||
23 | |||
24 | int gp10b_init_gpu_characteristics(struct gk20a *g); | ||
25 | |||
26 | #endif /* GP10B_H */ | ||
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 4f67cb09..427936c7 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -41,6 +41,8 @@ | |||
41 | #include "gm20b/clk_gm20b.h" | 41 | #include "gm20b/clk_gm20b.h" |
42 | #include <linux/tegra-fuse.h> | 42 | #include <linux/tegra-fuse.h> |
43 | 43 | ||
44 | #include "gp10b.h" | ||
45 | |||
44 | #define FUSE_OPT_PRIV_SEC_EN_0 0x264 | 46 | #define FUSE_OPT_PRIV_SEC_EN_0 0x264 |
45 | #define PRIV_SECURITY_ENABLED 0x01 | 47 | #define PRIV_SECURITY_ENABLED 0x01 |
46 | 48 | ||
@@ -153,6 +155,7 @@ int gp10b_init_hal(struct gk20a *g) | |||
153 | gp10b_init_cde_ops(gops); | 155 | gp10b_init_cde_ops(gops); |
154 | gp10b_init_therm_ops(gops); | 156 | gp10b_init_therm_ops(gops); |
155 | gops->name = "gp10b"; | 157 | gops->name = "gp10b"; |
158 | gops->chip_init_gpu_characteristics = gp10b_init_gpu_characteristics; | ||
156 | 159 | ||
157 | c->twod_class = FERMI_TWOD_A; | 160 | c->twod_class = FERMI_TWOD_A; |
158 | c->threed_class = PASCAL_A; | 161 | c->threed_class = PASCAL_A; |
diff --git a/drivers/gpu/nvgpu/gp10b/hw_fuse_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_fuse_gp10b.h index b6b68718..ae524ce5 100644 --- a/drivers/gpu/nvgpu/gp10b/hw_fuse_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/hw_fuse_gp10b.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 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, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -126,4 +126,12 @@ static inline u32 fuse_status_opt_fbp_idx_v(u32 r, u32 i) | |||
126 | { | 126 | { |
127 | return (r >> (0 + i*0)) & 0x1; | 127 | return (r >> (0 + i*0)) & 0x1; |
128 | } | 128 | } |
129 | static inline u32 fuse_opt_ecc_en_r(void) | ||
130 | { | ||
131 | return 0x00021228; | ||
132 | } | ||
133 | static inline u32 fuse_opt_feature_fuses_override_disable_r(void) | ||
134 | { | ||
135 | return 0x000213f0; | ||
136 | } | ||
129 | #endif | 137 | #endif |
diff --git a/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h index 26578bb5..b3fd704b 100644 --- a/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/hw_gr_gp10b.h | |||
@@ -1486,6 +1486,38 @@ static inline u32 gr_fecs_feature_override_ecc_r(void) | |||
1486 | { | 1486 | { |
1487 | return 0x00409658; | 1487 | return 0x00409658; |
1488 | } | 1488 | } |
1489 | static inline u32 gr_fecs_feature_override_ecc_sm_lrf_override_v(u32 r) | ||
1490 | { | ||
1491 | return (r >> 3) & 0x1; | ||
1492 | } | ||
1493 | static inline u32 gr_fecs_feature_override_ecc_sm_shm_override_v(u32 r) | ||
1494 | { | ||
1495 | return (r >> 7) & 0x1; | ||
1496 | } | ||
1497 | static inline u32 gr_fecs_feature_override_ecc_tex_override_v(u32 r) | ||
1498 | { | ||
1499 | return (r >> 11) & 0x1; | ||
1500 | } | ||
1501 | static inline u32 gr_fecs_feature_override_ecc_ltc_override_v(u32 r) | ||
1502 | { | ||
1503 | return (r >> 15) & 0x1; | ||
1504 | } | ||
1505 | static inline u32 gr_fecs_feature_override_ecc_sm_lrf_v(u32 r) | ||
1506 | { | ||
1507 | return (r >> 0) & 0x1; | ||
1508 | } | ||
1509 | static inline u32 gr_fecs_feature_override_ecc_sm_shm_v(u32 r) | ||
1510 | { | ||
1511 | return (r >> 4) & 0x1; | ||
1512 | } | ||
1513 | static inline u32 gr_fecs_feature_override_ecc_tex_v(u32 r) | ||
1514 | { | ||
1515 | return (r >> 8) & 0x1; | ||
1516 | } | ||
1517 | static inline u32 gr_fecs_feature_override_ecc_ltc_v(u32 r) | ||
1518 | { | ||
1519 | return (r >> 12) & 0x1; | ||
1520 | } | ||
1489 | static inline u32 gr_gpc0_gpccs_ctxsw_idlestate_r(void) | 1521 | static inline u32 gr_gpc0_gpccs_ctxsw_idlestate_r(void) |
1490 | { | 1522 | { |
1491 | return 0x00502420; | 1523 | return 0x00502420; |