mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: unit: SWUTS for common.gr
Add SWUTS documentation for the common.gr unit. JIRA NVGPU-4292 Change-Id: I4e46221504ea1480b44f44926d5d4e146e1ac05b Signed-off-by: Vinod G <vinodg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2223747 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@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:
@@ -32,3 +32,4 @@ INPUT += ../../../userspace/units/posix/sizes/posix-sizes.h
|
||||
INPUT += ../../../userspace/units/posix/thread/posix-thread.h
|
||||
INPUT += ../../../userspace/units/posix/timers/posix-timers.h
|
||||
INPUT += ../../../userspace/units/acr/nvgpu-acr.h
|
||||
INPUT += ../../../userspace/units/gr/nvgpu-gr.h
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <nvgpu/posix/io.h>
|
||||
#include <nvgpu/gk20a.h>
|
||||
#include <nvgpu/hal_init.h>
|
||||
#include <nvgpu/gr/gr.h>
|
||||
#include <nvgpu/gr/gr_falcon.h>
|
||||
|
||||
@@ -38,6 +39,10 @@
|
||||
#include "nvgpu-gr.h"
|
||||
#include "nvgpu-gr-gv11b.h"
|
||||
|
||||
#define NV_PMC_BOOT_0_ARCHITECTURE_GV110 (0x00000015 << \
|
||||
NVGPU_GPU_ARCHITECTURE_SHIFT)
|
||||
#define NV_PMC_BOOT_0_IMPLEMENTATION_B 0xB
|
||||
|
||||
int test_gr_init_setup(struct unit_module *m, struct gk20a *g, void *args)
|
||||
{
|
||||
int err;
|
||||
@@ -47,7 +52,20 @@ int test_gr_init_setup(struct unit_module *m, struct gk20a *g, void *args)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
gv11b_init_hal(g);
|
||||
/*
|
||||
* HAL init parameters for gv11b
|
||||
*/
|
||||
g->params.gpu_arch = NV_PMC_BOOT_0_ARCHITECTURE_GV110;
|
||||
g->params.gpu_impl = NV_PMC_BOOT_0_IMPLEMENTATION_B;
|
||||
|
||||
/*
|
||||
* HAL init required for getting
|
||||
* the falcon ops initialized.
|
||||
*/
|
||||
err = nvgpu_init_hal(g);
|
||||
if (err != 0) {
|
||||
unit_return_fail(m, "nvgpu_init_hal failed\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate gr unit
|
||||
|
||||
@@ -27,40 +27,129 @@
|
||||
struct gk20a;
|
||||
struct unit_module;
|
||||
|
||||
/** @addtogroup SWUTS-common-gr
|
||||
* @{
|
||||
*
|
||||
* Software Unit Test Specification for common.gr
|
||||
*/
|
||||
|
||||
/**
|
||||
* Allocate and add needed register spaces
|
||||
* Initialize gv11b hal
|
||||
* Allocate memory for gr unit
|
||||
* Test specification for: test_gr_init_setup
|
||||
*
|
||||
* Description: Setup common.gr unit.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: None
|
||||
*
|
||||
* Steps:
|
||||
* Initialize the test environment for common.gr unit testing:
|
||||
* Setup gv11b register spaces for hals to read emulated values.
|
||||
* Register read/write IO callbacks.
|
||||
* Setup init parameters to setup gv11b arch.
|
||||
* Initialize hal to setup the hal functions.
|
||||
* Call nvgpu_gr_alloc to allocate common.gr unit struct.
|
||||
*
|
||||
* Output: Returns PASS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_gr_init_setup(struct unit_module *m, struct gk20a *g, void *args);
|
||||
|
||||
/**
|
||||
* Delete the memory for gr unit
|
||||
* Delete and remove the register spaces
|
||||
* Test specification for: test_gr_remove_setup
|
||||
*
|
||||
* Description: Remove common.gr unit setup.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: None
|
||||
*
|
||||
* Steps:
|
||||
* Delete and remove the gv11b register spaces.
|
||||
* Delete the memory for common.gr unit.
|
||||
*
|
||||
* Output: Returns PASS
|
||||
*/
|
||||
int test_gr_remove_setup(struct unit_module *m, struct gk20a *g, void *args);
|
||||
|
||||
/**
|
||||
* call init_prepare functions to GR driver for
|
||||
* nvgpu_gr_prepare_sw and nvgpu_gr_enable_hw
|
||||
* Test specification for: test_gr_init_prepare
|
||||
*
|
||||
* Description: Prepare common.gr unit.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: None
|
||||
*
|
||||
* Steps:
|
||||
* Call nvgpu_gr_prepare_sw and nvgpu_gr_enable_hw which helps
|
||||
* to initialize the s/w and enable h/w for GR engine.
|
||||
*
|
||||
* Output: Returns PASS
|
||||
*/
|
||||
int test_gr_init_prepare(struct unit_module *m, struct gk20a *g, void *args);
|
||||
|
||||
/**
|
||||
* Override falcon.load_ctxsw_ucode hal and call
|
||||
* nvgpu_gr_falcon_init_ctxsw_ucode.
|
||||
* Initialize ltc and mm units
|
||||
* Call nvgpu_gr_init_support driver function
|
||||
* Test specification for: test_gr_init_support
|
||||
*
|
||||
* Description: Initialize common.gr unit.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: None
|
||||
*
|
||||
* Steps:
|
||||
* Call nvgpu_gr_init.
|
||||
* Call g->ops.ltc.init_ltc_support & g->ops.mm.init_mm_support.
|
||||
* Override g->ops.gr.falcon.load_ctxsw_ucode function.
|
||||
* Call g->ops.chip_init_gpu_characteristics
|
||||
* Call nvgpu_gr_init_support
|
||||
* Call g->ops.gr.ecc.ecc_init_support
|
||||
*
|
||||
* Output: Returns PASS if the steps above were executed successfully. FAIL
|
||||
* otherwise.
|
||||
*/
|
||||
int test_gr_init_support(struct unit_module *m, struct gk20a *g, void *args);
|
||||
|
||||
/**
|
||||
* Support nvgpu_gr_suspend driver function
|
||||
*/
|
||||
/**
|
||||
* Test specification for: test_gr_suspend
|
||||
*
|
||||
* Description: Suspend common.gr unit.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: None
|
||||
*
|
||||
* Steps:
|
||||
* Call nvgpu_gr_suspend.
|
||||
*
|
||||
* Output: Returns PASS
|
||||
*/
|
||||
int test_gr_suspend(struct unit_module *m, struct gk20a *g, void *args);
|
||||
|
||||
/**
|
||||
* Support nvgpu_gr_remove_support driver function
|
||||
*/
|
||||
/**
|
||||
* Test specification for: test_gr_remove_support
|
||||
*
|
||||
* Description: Remove common.gr unit support.
|
||||
*
|
||||
* Test Type: Feature based
|
||||
*
|
||||
* Input: None
|
||||
*
|
||||
* Steps:
|
||||
* Call nvgpu_gr_remove_support.
|
||||
*
|
||||
* Output: Returns PASS
|
||||
*/
|
||||
int test_gr_remove_support(struct unit_module *m, struct gk20a *g, void *args);
|
||||
#endif /* UNIT_NVGPU_GR_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user