From 4e98b53944eac672e4638e9fc667249a207a7872 Mon Sep 17 00:00:00 2001 From: mpoojary Date: Tue, 11 Jan 2022 12:22:51 +0000 Subject: [PATCH] gpu: nvgpu: ga10b: Update ga10b_is_pmu_supported Update ga10b_is_pmu_supported function to add support for pre-si platforms along with silicon. JIRA NVGPU-4701 Change-Id: If7eec7753c01135c9c9c20d49278b3f1fe9332ae Signed-off-by: mpoojary Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2652871 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/hal/pmu/pmu_ga10b.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/hal/pmu/pmu_ga10b.c b/drivers/gpu/nvgpu/hal/pmu/pmu_ga10b.c index 0cf738bd2..418de2a20 100644 --- a/drivers/gpu/nvgpu/hal/pmu/pmu_ga10b.c +++ b/drivers/gpu/nvgpu/hal/pmu/pmu_ga10b.c @@ -38,7 +38,18 @@ bool ga10b_is_pmu_supported(struct gk20a *g) { (void)g; #ifdef CONFIG_NVGPU_LS_PMU - return nvgpu_platform_is_simulation(g) ? false : true; + if (nvgpu_platform_is_silicon(g)) { + return true; + } else { + /* Pre-Si platforms */ + if (nvgpu_is_enabled(g, NVGPU_SEC_PRIVSECURITY)) { + /* Security is enabled - PMU is supported. */ + return true; + } else { + /* NS PMU is not supported */ + return false; + } + } #else /* set to false to disable LS PMU ucode support */ return false;