gpu: nvgpu: unit: Add more test to gr ecc unit

Add test for FUSES_OVERRIDE support and FECS_FEATURE_OVERRIDE
support in gr ecc unit

Jira NVGPU-4095

Change-Id: Icaaaae009109c5249026bbdcef7b67f2a0d471ac
Signed-off-by: vinodg <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2210430
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
vinodg
2019-10-02 17:58:41 -07:00
committed by Alex Waterman
parent f73da1dfe5
commit babdf69f8b
2 changed files with 42 additions and 0 deletions

View File

@@ -1623,6 +1623,11 @@
"test_level": 0,
"unit": "nvgpu_gr_init"
},
{
"test": "gr_ecc_features",
"test_level": 0,
"unit": "nvgpu_gr_init"
},
{
"test": "gr_remove_support",
"test_level": 0,

View File

@@ -30,15 +30,52 @@
#include <nvgpu/gk20a.h>
#include <nvgpu/gr/gr.h>
#include <nvgpu/hw/gv11b/hw_fuse_gv11b.h>
#include <nvgpu/hw/gv11b/hw_gr_gv11b.h>
#include "common/gr/gr_priv.h"
#include "../nvgpu-gr.h"
#define GR_TEST_FUSES_OVERRIDE_DISABLE_TRUE 0x1U
#define GR_TEST_FUSES_OVERRIDE_DISABLE_FALSE 0x0U
#define GR_TEST_FECS_FEATURE_OVERRIDE_ECC 0x00909999
#define GR_TEST_FECS_FEATURE_OVERRIDE_ECC1 0x0000000F
static int test_gr_init_ecc_features(struct unit_module *m,
struct gk20a *g, void *args)
{
nvgpu_posix_io_writel_reg_space(g,
fuse_opt_feature_fuses_override_disable_r(),
GR_TEST_FUSES_OVERRIDE_DISABLE_TRUE);
g->ops.gr.ecc.detect(g);
nvgpu_posix_io_writel_reg_space(g,
fuse_opt_feature_fuses_override_disable_r(),
GR_TEST_FUSES_OVERRIDE_DISABLE_FALSE);
/* set fecs ecc override */
nvgpu_posix_io_writel_reg_space(g,
gr_fecs_feature_override_ecc_r(),
GR_TEST_FECS_FEATURE_OVERRIDE_ECC);
nvgpu_posix_io_writel_reg_space(g,
gr_fecs_feature_override_ecc_1_r(),
GR_TEST_FECS_FEATURE_OVERRIDE_ECC1);
g->ops.gr.ecc.detect(g);
return UNIT_SUCCESS;
}
struct unit_module_test nvgpu_gr_init_tests[] = {
UNIT_TEST(gr_init_setup, test_gr_init_setup, NULL, 0),
UNIT_TEST(gr_init_prepare, test_gr_init_prepare, NULL, 0),
UNIT_TEST(gr_init_support, test_gr_init_support, NULL, 0),
UNIT_TEST(gr_suspend, test_gr_suspend, NULL, 0),
UNIT_TEST(gr_ecc_features, test_gr_init_ecc_features, NULL, 0),
UNIT_TEST(gr_remove_support, test_gr_remove_support, NULL, 0),
UNIT_TEST(gr_remove_setup, test_gr_remove_setup, NULL, 0),
};