mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: unit: add SWUTS docs for fuse test
This adds the SWUTS documentation for the fuse unit test. Also, the gm20b header had declared some undefined tests, so those are removed. JIRA NVGPU-3943 Change-Id: I7530471df30ed95007f820c875b6cb55486e1777 Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2194568 Reviewed-by: Thomas Fleury <tfleury@nvidia.com> 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:
committed by
Alex Waterman
parent
acc77b6ff4
commit
de9cb99b02
@@ -35,6 +35,7 @@
|
||||
* - @ref SWUTS-interface-atomic
|
||||
* - @ref SWUTS-mm-nvgpu-mem
|
||||
* - @ref SWUTS-mm-vm
|
||||
* - @ref SWUTS-fuse
|
||||
* - @ref SWUTS-sdl
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
INPUT += ../../../userspace/SWUTS.h
|
||||
INPUT += ../../../userspace/units/enabled/nvgpu-enabled.h
|
||||
INPUT += ../../../userspace/units/fuse/nvgpu-fuse.h
|
||||
INPUT += ../../../userspace/units/fuse/nvgpu-fuse-gm20b.h
|
||||
INPUT += ../../../userspace/units/fuse/nvgpu-fuse-gp10b.h
|
||||
INPUT += ../../../userspace/units/init/nvgpu-init.h
|
||||
INPUT += ../../../userspace/units/interface/atomic/atomic.h
|
||||
INPUT += ../../../userspace/units/mm/nvgpu_mem/nvgpu_mem.h
|
||||
|
||||
@@ -53,10 +53,6 @@ struct fuse_test_args gm20b_init_args = {
|
||||
.sec_fuse_addr = GM20B_FUSE_STATUS_OPT_PRIV_SEC_EN,
|
||||
};
|
||||
|
||||
/*
|
||||
* Verify fuse API check_priv_security() when security fuse is enabled.
|
||||
* Tests with secure debug enabled and disabled.
|
||||
*/
|
||||
int test_fuse_gm20b_check_sec(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -97,9 +93,6 @@ int test_fuse_gm20b_check_sec(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify fuse API check_priv_security() handles an error from reading gcplex
|
||||
*/
|
||||
int test_fuse_gm20b_check_gcplex_fail(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -119,10 +112,6 @@ int test_fuse_gm20b_check_gcplex_fail(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify fuse API check_priv_security() handles invalid gcplex configurations
|
||||
* of WPR and VPR bits.
|
||||
*/
|
||||
int test_fuse_gm20b_check_sec_invalid_gcplex(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -157,10 +146,6 @@ int test_fuse_gm20b_check_sec_invalid_gcplex(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Verify fuse API check_priv_security() when security fuse is enabled.
|
||||
*/
|
||||
int test_fuse_gm20b_check_non_sec(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -190,7 +175,6 @@ int test_fuse_gm20b_check_non_sec(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Verify fuse reads for basic value return APIs */
|
||||
int test_fuse_gm20b_basic_fuses(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
|
||||
@@ -23,22 +23,126 @@
|
||||
#ifndef __UNIT_NVGPU_FUSE_GM20B_H__
|
||||
#define __UNIT_NVGPU_FUSE_GM20B_H__
|
||||
|
||||
struct gk20a;
|
||||
struct unit_module;
|
||||
|
||||
/** @addtogroup SWUTS-fuse
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern struct fuse_test_args gm20b_init_args;
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gm20b_check_sec
|
||||
*
|
||||
* Description: Verify fuse API check_priv_security() when security fuse is
|
||||
* enabled.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Setup the security regs appropriately.
|
||||
* - Call the fuse API check_priv_security().
|
||||
* - Verify Security flags are enabled/disabled correctly.
|
||||
* - Repeat above steps for ACR enabled and disabled.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gm20b_check_sec(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gm20b_check_gcplex_fail
|
||||
*
|
||||
* Description: Verify fuse API check_priv_security() handles an error from
|
||||
* reading gcplex.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Override HAL for reading gcplex so it returns an error.
|
||||
* - Call the fuse API check_priv_security(), which will read gcplex, and verify
|
||||
* an error is returned.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gm20b_check_gcplex_fail(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gm20b_check_sec_invalid_gcplex
|
||||
*
|
||||
* Description: Verify fuse API check_priv_security() handles invalid gcplex
|
||||
* configurations of WPR and VPR bits.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Override HAL for reading gcplex so the WPR/VPR configuration can be
|
||||
* overwritten.
|
||||
* - Enable Security fuse.
|
||||
* - Write an invalid WPR/VPR configuration into the gcplex override by using
|
||||
* the overridden HAL.
|
||||
* - Call the fuse API check_priv_security() and verify an error is returned.
|
||||
* - Repeat the previous 2 steps for all invalid combinations of WPR/VPR
|
||||
* configurations.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gm20b_check_sec_invalid_gcplex(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
int test_fuse_gm20b_ecc(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
int test_fuse_gm20b_feature_override_disable(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gm20b_check_non_sec
|
||||
*
|
||||
* Description: Verify fuse API check_priv_security() when security fuse is
|
||||
* disabled.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Disable Security fuse.
|
||||
* - Call the fuse API check_priv_security().
|
||||
* - Verify correct security flags are disabled.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gm20b_check_non_sec(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gm20b_basic_fuses
|
||||
*
|
||||
* Description: Verify fuse reads for basic value-return APIs.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - For each fuse API that returns the value of the fuse, do the following:
|
||||
* - Write valid values to the fuse register in the mock IO.
|
||||
* - Call the API to read fuse.
|
||||
* - Verify the correct value is returned.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gm20b_basic_fuses(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
#ifdef CONFIG_NVGPU_SIM
|
||||
int test_fuse_gm20b_check_fmodel(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
@@ -45,10 +45,6 @@ struct fuse_test_args gp10b_init_args = {
|
||||
.sec_fuse_addr = GP10B_FUSE_OPT_PRIV_SEC_EN,
|
||||
};
|
||||
|
||||
/*
|
||||
* Verify fuse API check_priv_security() when security fuse is enabled.
|
||||
* Tests with secure debug enabled and disabled.
|
||||
*/
|
||||
int test_fuse_gp10b_check_sec(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -88,9 +84,6 @@ int test_fuse_gp10b_check_sec(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify fuse API check_priv_security() handles an error from reading gcplex
|
||||
*/
|
||||
int test_fuse_gp10b_check_gcplex_fail(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -110,10 +103,6 @@ int test_fuse_gp10b_check_gcplex_fail(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify fuse API check_priv_security() handles invalid gcplex configurations
|
||||
* of WPR and VPR bits.
|
||||
*/
|
||||
int test_fuse_gp10b_check_sec_invalid_gcplex(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -148,9 +137,6 @@ int test_fuse_gp10b_check_sec_invalid_gcplex(struct unit_module *m,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Verify fuse API check_priv_security() when security fuse is enabled.
|
||||
*/
|
||||
int test_fuse_gp10b_check_non_sec(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -179,7 +165,6 @@ int test_fuse_gp10b_check_non_sec(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Verify fuse reports ECC enable correctly */
|
||||
int test_fuse_gp10b_ecc(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
@@ -207,7 +192,6 @@ int test_fuse_gp10b_ecc(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Verify fuse reports feature override correctly */
|
||||
int test_fuse_gp10b_feature_override_disable(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
|
||||
@@ -23,20 +23,146 @@
|
||||
#ifndef __UNIT_NVGPU_FUSE_GP10B_H__
|
||||
#define __UNIT_NVGPU_FUSE_GP10B_H__
|
||||
|
||||
struct gk20a;
|
||||
struct unit_module;
|
||||
|
||||
/** @addtogroup SWUTS-fuse
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern struct fuse_test_args gp10b_init_args;
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gp10b_check_sec
|
||||
*
|
||||
* Description: Verify fuse API check_priv_security() when security fuse is
|
||||
* enabled.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Setup the security regs appropriately.
|
||||
* - Call the fuse API check_priv_security().
|
||||
* - Verify Security flags are enabled/disabled correctly.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gp10b_check_sec(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gp10b_check_gcplex_fail
|
||||
*
|
||||
* Description: Verify fuse API check_priv_security() handles an error from
|
||||
* reading gcplex.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Override HAL for reading gcplex so it returns an error.
|
||||
* - Call the fuse API check_priv_security(), which will read gcplex, and verify
|
||||
* an error is returned.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gp10b_check_gcplex_fail(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gp10b_check_sec_invalid_gcplex
|
||||
*
|
||||
* Description: Verify fuse API check_priv_security() handles invalid gcplex
|
||||
* configurations of WPR and VPR bits.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Override HAL for reading gcplex so the WPR/VPR configuration can be
|
||||
* overwritten.
|
||||
* - Enable Security fuse.
|
||||
* - Write an invalid WPR/VPR configuration into the gcplex override by using
|
||||
* the overridden HAL.
|
||||
* - Call the fuse API check_priv_security() and verify an error is returned.
|
||||
* - Repeat the previous 2 steps for all invalid combinations of WPR/VPR
|
||||
* configurations.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gp10b_check_sec_invalid_gcplex(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gp10b_check_non_sec
|
||||
*
|
||||
* Description: Verify fuse API check_priv_security() when security fuse is
|
||||
* disabled.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Disable Security fuse.
|
||||
* - Call the fuse API check_priv_security().
|
||||
* - Verify correct security flags are disabled.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gp10b_check_non_sec(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gp10b_ecc
|
||||
*
|
||||
* Description: Verify fuse reports ECC enable correctly.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Disable ECC fuse.
|
||||
* - Verify API is_opt_ecc_enable() returns false.
|
||||
* - Enable ECC fuse.
|
||||
* - Verify API is_opt_ecc_enable() returns true.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gp10b_ecc(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
/**
|
||||
* Test specification for: test_fuse_gp10b_feature_override_disable
|
||||
*
|
||||
* Description: Verify fuse reports Feature Override enable correctly.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: test_fuse_device_common_init() must be called for this GPU.
|
||||
*
|
||||
* Steps:
|
||||
* - Disable Feature Override fuse.
|
||||
* - Verify API is_opt_feature_override_disable() returns false.
|
||||
* - Enable Feature Override fuse.
|
||||
* - Verify API is_opt_feature_override_disable() returns true.
|
||||
*
|
||||
* Output: Returns SUCCESS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_fuse_gp10b_feature_override_disable(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
#ifdef CONFIG_NVGPU_SIM
|
||||
int test_fuse_gp10b_check_fmodel(struct unit_module *m,
|
||||
struct gk20a *g, void *__args);
|
||||
|
||||
@@ -89,14 +89,8 @@ int read_gcplex_config_fuse_fail(struct gk20a *g, u32 *val)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialization for this unit test.
|
||||
* Setup g struct
|
||||
* Setup fuse ops
|
||||
* Setup mock I/O
|
||||
*/
|
||||
static int test_fuse_device_common_init(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
int test_fuse_device_common_init(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
int ret = UNIT_SUCCESS;
|
||||
int result;
|
||||
@@ -129,7 +123,7 @@ static int test_fuse_device_common_init(struct unit_module *m,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int test_fuse_device_common_cleanup(struct unit_module *m,
|
||||
int test_fuse_device_common_cleanup(struct unit_module *m,
|
||||
struct gk20a *g, void *__args)
|
||||
{
|
||||
struct fuse_test_args *args = (struct fuse_test_args *)__args;
|
||||
|
||||
Reference in New Issue
Block a user