gpu: nvgpu: unit: fuse: re-enable FUSA tests

When the non-FUSA HALs were removed, the entire fuse unit test was
removed. However, some of the fuse HALs are used in the FUSA build, so
re-enable the FUSA tests, as appropriate.

JIRA NVGPU-3943

Change-Id: I6656940492102ace335672466592b22ed9ce95fd
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2194569
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2019-09-10 16:54:02 -04:00
committed by Alex Waterman
parent de9cb99b02
commit bf49996bd2
7 changed files with 152 additions and 8 deletions

View File

@@ -22,8 +22,12 @@
OBJS = nvgpu-fuse.o \
nvgpu-fuse-gm20b.o \
nvgpu-fuse-gp10b.o \
nvgpu-fuse-tu104.o
nvgpu-fuse-gp10b.o
ifeq ($(CONFIG_NVGPU_HAL_NON_FUSA),1)
OBJS += nvgpu-fuse-tu104.o
endif
MODULE = nvgpu-fuse
include ../Makefile.units

View File

@@ -53,6 +53,7 @@ struct fuse_test_args gm20b_init_args = {
.sec_fuse_addr = GM20B_FUSE_STATUS_OPT_PRIV_SEC_EN,
};
#ifdef CONFIG_NVGPU_HAL_NON_FUSA
int test_fuse_gm20b_check_sec(struct unit_module *m,
struct gk20a *g, void *__args)
{
@@ -174,6 +175,7 @@ int test_fuse_gm20b_check_non_sec(struct unit_module *m,
return ret;
}
#endif /* CONFIG_NVGPU_HAL_NON_FUSA */
int test_fuse_gm20b_basic_fuses(struct unit_module *m,
struct gk20a *g, void *__args)
@@ -218,6 +220,7 @@ int test_fuse_gm20b_basic_fuses(struct unit_module *m,
}
}
#ifdef CONFIG_NVGPU_HAL_NON_FUSA
nvgpu_posix_io_writel_reg_space(g, GM20B_FUSE_STATUS_OPT_GPC,
set);
/*
@@ -230,6 +233,7 @@ int test_fuse_gm20b_basic_fuses(struct unit_module *m,
__func__, val, set);
ret = UNIT_FAIL;
}
#endif
for (i = 0; i < GM20B_MAX_GPC_COUNT; i++) {
g->ops.fuse.fuse_ctrl_opt_tpc_gpc(g, i, set*i);

View File

@@ -28,6 +28,7 @@
#include <nvgpu/hal_init.h>
#include <nvgpu/enabled.h>
#include "nvgpu-fuse.h"
#include "nvgpu-fuse-priv.h"
#include "nvgpu-fuse-gp10b.h"
#include "nvgpu-fuse-gm20b.h"
@@ -35,6 +36,11 @@
#include "nvgpu-fuse-tu104.h"
#endif
#define NV_PMC_BOOT_0_ARCHITECTURE_GV110 (0x00000015 << \
NVGPU_GPU_ARCHITECTURE_SHIFT)
#define NV_PMC_BOOT_0_IMPLEMENTATION_B 0xB
/*
* Mock I/O
*/
@@ -106,8 +112,13 @@ int test_fuse_device_common_init(struct unit_module *m,
(void)nvgpu_posix_register_io(g, &test_reg_callbacks);
#ifdef CONFIG_NVGPU_HAL_NON_FUSA
g->params.gpu_arch = args->gpu_arch << NVGPU_GPU_ARCHITECTURE_SHIFT;
g->params.gpu_impl = args->gpu_impl;
#else
g->params.gpu_arch = NV_PMC_BOOT_0_ARCHITECTURE_GV110;
g->params.gpu_impl = NV_PMC_BOOT_0_IMPLEMENTATION_B;
#endif
nvgpu_posix_io_writel_reg_space(g, args->sec_fuse_addr, 0x0);
@@ -160,6 +171,7 @@ struct unit_module_test fuse_tests[] = {
UNIT_TEST(fuse_gm20b_init, test_fuse_device_common_init,
&gm20b_init_args, 0),
#ifdef CONFIG_NVGPU_HAL_NON_FUSA
UNIT_TEST(fuse_gm20b_check_sec, test_fuse_gm20b_check_sec, NULL, 0),
UNIT_TEST(fuse_gm20b_check_sec_invalid_gcplex,
test_fuse_gm20b_check_sec_invalid_gcplex,
@@ -173,6 +185,7 @@ struct unit_module_test fuse_tests[] = {
test_fuse_gm20b_check_non_sec,
NULL,
0),
#endif
UNIT_TEST(fuse_gm20b_basic_fuses, test_fuse_gm20b_basic_fuses, NULL, 0),
#ifdef CONFIG_NVGPU_SIM
UNIT_TEST(fuse_gm20b_check_fmodel, test_fuse_gm20b_check_fmodel, NULL, 0),

View File

@@ -0,0 +1,73 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef UNIT_NVGPU_FUSE_H
#define UNIT_NVGPU_FUSE_H
struct gk20a;
struct unit_module;
/** @addtogroup SWUTS-fuse
* @{
*
* Software Unit Test Specification for nvgpu-fuse
*/
/**
* Test specification for: test_fuse_device_common_init
*
* Description: Initialization required for before fuse tests for each GPU.
*
* Test Type: Other (Setup)
*
* Input: struct fuse_test_args passed via args param.
*
* Steps:
* - Setup g struct
* - Setup fuse ops
* - Setup mock I/O
*
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
* otherwise.
*/
static int test_fuse_device_common_init(struct unit_module *m,
struct gk20a *g, void *__args);
/**
* Test specification for: test_fuse_device_common_init
*
* Description: Initialization required for before fuse tests for each GPU.
*
* Test Type: Other (Cleanup)
*
* Input: struct fuse_test_args passed via args param.
*
* Steps:
* - Remove mock I/O
*
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
* otherwise.
*/
static int test_fuse_device_common_cleanup(struct unit_module *m,
struct gk20a *g, void *__args);
#endif /* UNIT_NVGPU_FUSE_H */