gpu: nvgpu: Add gr_t19x support for gv11b ECC

This CL covers the following modification,
1) Added gr_t19x support for gv11b ECC
2) Modified the gp10b platform config for
    gv11b sysfs support

JIRA GPUT19X-85
JIRA GPUT19X-104
JIRA GPUT19X-100
JIRA GPUT19X-103

Bug 1825948
Bug 1825962
Bug 1775457

Change-Id: I0bf13f80a73cc2184147230d098e89a517554c01
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: http://git-master/r/1478952
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Lakshmanan M
2017-05-10 14:22:15 +05:30
committed by mobile promotions
parent 4d7711b076
commit b1d303685b
4 changed files with 97 additions and 57 deletions

View File

@@ -374,6 +374,10 @@ struct gr_gk20a {
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
struct gr_t18x t18x;
#endif
#ifdef CONFIG_TEGRA_19x_GPU
struct gr_t19x t19x;
#endif
u32 fbp_en_mask;
u32 *fbp_rop_l2_en_mask;
u32 no_of_sm;

View File

@@ -22,6 +22,12 @@
struct gpu_ops;
struct gr_gp10b_ecc_stat {
char **names;
u32 *counters;
struct hlist_node hash_node;
};
enum {
PASCAL_CHANNEL_GPFIFO_A = 0xC06F,
PASCAL_A = 0xC097,
@@ -45,12 +51,6 @@ int gr_gp10b_alloc_buffer(struct vm_gk20a *vm, size_t size,
struct nvgpu_mem *mem);
void gr_gp10b_create_sysfs(struct device *dev);
struct ecc_stat {
char **names;
u32 *counters;
struct hlist_node hash_node;
};
struct gr_t18x {
struct {
u32 preempt_image_size;
@@ -69,24 +69,24 @@ struct gr_t18x {
} ctx_vars;
struct {
struct ecc_stat sm_lrf_single_err_count;
struct ecc_stat sm_lrf_double_err_count;
struct gr_gp10b_ecc_stat sm_lrf_single_err_count;
struct gr_gp10b_ecc_stat sm_lrf_double_err_count;
struct ecc_stat sm_shm_sec_count;
struct ecc_stat sm_shm_sed_count;
struct ecc_stat sm_shm_ded_count;
struct gr_gp10b_ecc_stat sm_shm_sec_count;
struct gr_gp10b_ecc_stat sm_shm_sed_count;
struct gr_gp10b_ecc_stat sm_shm_ded_count;
struct ecc_stat tex_total_sec_pipe0_count;
struct ecc_stat tex_total_ded_pipe0_count;
struct ecc_stat tex_unique_sec_pipe0_count;
struct ecc_stat tex_unique_ded_pipe0_count;
struct ecc_stat tex_total_sec_pipe1_count;
struct ecc_stat tex_total_ded_pipe1_count;
struct ecc_stat tex_unique_sec_pipe1_count;
struct ecc_stat tex_unique_ded_pipe1_count;
struct gr_gp10b_ecc_stat tex_total_sec_pipe0_count;
struct gr_gp10b_ecc_stat tex_total_ded_pipe0_count;
struct gr_gp10b_ecc_stat tex_unique_sec_pipe0_count;
struct gr_gp10b_ecc_stat tex_unique_ded_pipe0_count;
struct gr_gp10b_ecc_stat tex_total_sec_pipe1_count;
struct gr_gp10b_ecc_stat tex_total_ded_pipe1_count;
struct gr_gp10b_ecc_stat tex_unique_sec_pipe1_count;
struct gr_gp10b_ecc_stat tex_unique_ded_pipe1_count;
struct ecc_stat l2_sec_count;
struct ecc_stat l2_ded_count;
struct gr_gp10b_ecc_stat l2_sec_count;
struct gr_gp10b_ecc_stat l2_ded_count;
} ecc_stats;
u32 fecs_feature_override_ecc_val;

View File

@@ -39,6 +39,7 @@
#include "platform_gk20a_tegra.h"
#include "gp10b/gp10b_sysfs.h"
#include "gp10b/platform_gp10b.h"
#include "platform_gp10b_tegra.h"
#include <nvgpu/hw/gp10b/hw_gr_gp10b.h>
#include <nvgpu/hw/gp10b/hw_ltc_gp10b.h>
@@ -181,7 +182,7 @@ static int gp10b_tegra_late_probe(struct device *dev)
return 0;
}
static int gp10b_tegra_remove(struct device *dev)
int gp10b_tegra_remove(struct device *dev)
{
gr_gp10b_remove_sysfs(dev);
/*Remove GP10B specific sysfs*/
@@ -483,7 +484,7 @@ static ssize_t ecc_stat_show(struct device *dev,
const char *ecc_stat_full_name = attr->attr.name;
const char *ecc_stat_base_name;
unsigned int hw_unit;
struct ecc_stat *ecc_stat;
struct gr_gp10b_ecc_stat *ecc_stat;
u32 hash_key;
if (sscanf(ecc_stat_full_name, "ltc%u", &hw_unit) == 1) {
@@ -508,10 +509,10 @@ static ssize_t ecc_stat_show(struct device *dev,
return snprintf(buf, PAGE_SIZE, "Error: No ECC stat found!\n");
}
static int ecc_stat_create(struct device *dev,
int gr_gp10b_ecc_stat_create(struct device *dev,
int is_l2,
char *ecc_stat_name,
struct ecc_stat *ecc_stat,
struct gr_gp10b_ecc_stat *ecc_stat,
struct device_attribute *dev_attr_array)
{
int error = 0;
@@ -569,9 +570,9 @@ static int ecc_stat_create(struct device *dev,
return error;
}
static void ecc_stat_remove(struct device *dev,
void gr_gp10b_ecc_stat_remove(struct device *dev,
int is_l2,
struct ecc_stat *ecc_stat,
struct gr_gp10b_ecc_stat *ecc_stat,
struct device_attribute *dev_attr_array)
{
struct gk20a *g = get_gk20a(dev);
@@ -612,80 +613,80 @@ void gr_gp10b_create_sysfs(struct device *dev)
if (g->gr.t18x.ecc_stats.sm_lrf_single_err_count.counters != NULL)
return;
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"sm_lrf_ecc_single_err_count",
&g->gr.t18x.ecc_stats.sm_lrf_single_err_count,
dev_attr_sm_lrf_ecc_single_err_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"sm_lrf_ecc_double_err_count",
&g->gr.t18x.ecc_stats.sm_lrf_double_err_count,
dev_attr_sm_lrf_ecc_double_err_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"sm_shm_ecc_sec_count",
&g->gr.t18x.ecc_stats.sm_shm_sec_count,
dev_attr_sm_shm_ecc_sec_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"sm_shm_ecc_sed_count",
&g->gr.t18x.ecc_stats.sm_shm_sed_count,
dev_attr_sm_shm_ecc_sed_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"sm_shm_ecc_ded_count",
&g->gr.t18x.ecc_stats.sm_shm_ded_count,
dev_attr_sm_shm_ecc_ded_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"tex_ecc_total_sec_pipe0_count",
&g->gr.t18x.ecc_stats.tex_total_sec_pipe0_count,
dev_attr_tex_ecc_total_sec_pipe0_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"tex_ecc_total_ded_pipe0_count",
&g->gr.t18x.ecc_stats.tex_total_ded_pipe0_count,
dev_attr_tex_ecc_total_ded_pipe0_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"tex_ecc_unique_sec_pipe0_count",
&g->gr.t18x.ecc_stats.tex_unique_sec_pipe0_count,
dev_attr_tex_ecc_unique_sec_pipe0_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"tex_ecc_unique_ded_pipe0_count",
&g->gr.t18x.ecc_stats.tex_unique_ded_pipe0_count,
dev_attr_tex_ecc_unique_ded_pipe0_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"tex_ecc_total_sec_pipe1_count",
&g->gr.t18x.ecc_stats.tex_total_sec_pipe1_count,
dev_attr_tex_ecc_total_sec_pipe1_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"tex_ecc_total_ded_pipe1_count",
&g->gr.t18x.ecc_stats.tex_total_ded_pipe1_count,
dev_attr_tex_ecc_total_ded_pipe1_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"tex_ecc_unique_sec_pipe1_count",
&g->gr.t18x.ecc_stats.tex_unique_sec_pipe1_count,
dev_attr_tex_ecc_unique_sec_pipe1_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
0,
"tex_ecc_unique_ded_pipe1_count",
&g->gr.t18x.ecc_stats.tex_unique_ded_pipe1_count,
dev_attr_tex_ecc_unique_ded_pipe1_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
1,
"lts0_ecc_sec_count",
&g->gr.t18x.ecc_stats.l2_sec_count,
dev_attr_l2_ecc_sec_count_array);
error |= ecc_stat_create(dev,
error |= gr_gp10b_ecc_stat_create(dev,
1,
"lts0_ecc_ded_count",
&g->gr.t18x.ecc_stats.l2_ded_count,
@@ -699,66 +700,66 @@ static void gr_gp10b_remove_sysfs(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.sm_lrf_single_err_count,
dev_attr_sm_lrf_ecc_single_err_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.sm_lrf_double_err_count,
dev_attr_sm_lrf_ecc_double_err_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.sm_shm_sec_count,
dev_attr_sm_shm_ecc_sec_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.sm_shm_sed_count,
dev_attr_sm_shm_ecc_sed_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.sm_shm_ded_count,
dev_attr_sm_shm_ecc_ded_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.tex_total_sec_pipe0_count,
dev_attr_tex_ecc_total_sec_pipe0_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.tex_total_ded_pipe0_count,
dev_attr_tex_ecc_total_ded_pipe0_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.tex_unique_sec_pipe0_count,
dev_attr_tex_ecc_unique_sec_pipe0_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.tex_unique_ded_pipe0_count,
dev_attr_tex_ecc_unique_ded_pipe0_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.tex_total_sec_pipe1_count,
dev_attr_tex_ecc_total_sec_pipe1_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.tex_total_ded_pipe1_count,
dev_attr_tex_ecc_total_ded_pipe1_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.tex_unique_sec_pipe1_count,
dev_attr_tex_ecc_unique_sec_pipe1_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
0,
&g->gr.t18x.ecc_stats.tex_unique_ded_pipe1_count,
dev_attr_tex_ecc_unique_ded_pipe1_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
1,
&g->gr.t18x.ecc_stats.l2_sec_count,
dev_attr_l2_ecc_sec_count_array);
ecc_stat_remove(dev,
gr_gp10b_ecc_stat_remove(dev,
1,
&g->gr.t18x.ecc_stats.l2_ded_count,
dev_attr_l2_ecc_ded_count_array);

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PLATFORM_GP10B_TEGRA_H_
#define _PLATFORM_GP10B_TEGRA_H_
#include "gp10b/gr_gp10b.h"
int gr_gp10b_ecc_stat_create(struct device *dev,
int is_l2,
char *ecc_stat_name,
struct gr_gp10b_ecc_stat *ecc_stat,
struct device_attribute *dev_attr_array);
void gr_gp10b_ecc_stat_remove(struct device *dev,
int is_l2,
struct gr_gp10b_ecc_stat *ecc_stat,
struct device_attribute *dev_attr_array);
int gp10b_tegra_remove(struct device *dev);
#endif