gpu: nvgpu: unit test for common-io

This patch covers unit test for nvgpu_writel_check().

Jira NVGPU-4810

Change-Id: I173afd59a9e8fe9e647f260a70012f2c7c2d02f9
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2293538
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Prateek sethi
2020-02-12 15:24:54 +05:30
committed by Alex Waterman
parent 406913dc42
commit a9f3890ad6
10 changed files with 238 additions and 1 deletions

View File

@@ -0,0 +1,58 @@
/*
* Copyright (c) 2020, 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.
*/
/**
* @addtogroup SWUTS-io
* @{
*
* Software Unit Test Specification for common_io
*/
#ifndef __UNIT_COMMON_IO_H__
#define __UNIT_COMMON_IO_H__
/**
* Test specification for test_writel_check
*
* Description: Write value v to reg and read it back.
*
* Test Type: Feature
*
* Targets: nvgpu_writel_check
*
* Inputs: None
*
* Steps:
* Initialize address space and register io callbacks.
* Call nvgpu_writel_check with value 0. Here read and write value will be
* different as read callback always returns NVGPU_READ_VAL.
* Call nvgpu_writel_check with value NVGPU_READ_VAL. Here read and write value
* will be same as read callback always returns NVGPU_READ_VAL.
*
* Output:
* The test returns PASS only as target nvgpu_writel_check() always returns
* void.
*
*/
int test_writel_check(struct unit_module *m, struct gk20a *g, void *args);
#endif /* __UNIT_COMMON_IO_H__ */