gpu: nvgpu: ga10b: Support emulate mode

Add sysfs node to enable gpu emulate_mode and
pass the value to acr through acr descriptor struct.

Bug 3279344

Change-Id: I936b1dda84d7f4f3688237308223c019798bdce3
Signed-off-by: Mayur Poojary <mpoojary@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2591377
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mayur Poojary
2021-09-08 19:15:07 +05:30
committed by mobile promotions
parent 95c954cf9f
commit fe7368f8f4
5 changed files with 62 additions and 0 deletions

View File

@@ -25,6 +25,7 @@
#include <nvgpu/bug.h>
#include <nvgpu/dma.h>
#include <nvgpu/pmu.h>
#include <nvgpu/grmgr.h>
#ifdef CONFIG_NVGPU_LS_PMU
#include <nvgpu/pmu/fw.h>
#endif
@@ -154,6 +155,11 @@ static int ga10b_acr_patch_wpr_info_to_ucode(struct gk20a *g,
* Offset from the WPR region holding the wpr header
*/
acr_sysmem_desc->wpr_offset = WPR_OFFSET;
if (g->emulate_mode < EMULATE_MODE_MAX_CONFIG) {
acr_sysmem_desc->gpu_mode &= (~EMULATE_MODE_MASK);
acr_sysmem_desc->gpu_mode |= g->emulate_mode;
}
}
load:
/*

View File

@@ -775,6 +775,13 @@ struct flcn2_acr_desc {
u64 nonwpr_ucode_blob_start;
u64 ls_pmu_desc;
/**
* stores flag value to enable:
* emulate_mode 7:0 bit
* MIG mode 15:8 bit
*/
u32 gpu_mode;
};
/** @} */