From c39de268c9939282c2e47c932b9e2880c5ee9fe4 Mon Sep 17 00:00:00 2001 From: Besar Wicaksono Date: Thu, 20 Feb 2025 18:14:54 +0000 Subject: [PATCH] tegra: hwpm: os: linux: add explicit CONFTEST flag CONFTEST is NVIDIA internal and not available when building HWPM driver locally without NVIDIA build system. This patch introduces a new explicit config to enable/disable reference to CONFTEST. Bug 5120925 Change-Id: I669855f04186041661362cd578514b887128ef44 Signed-off-by: Besar Wicaksono Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3307050 Reviewed-by: svcacv Reviewed-by: Yifei Wan GVS: buildbot_gerritrpt Reviewed-by: Vasuki Shankar --- drivers/tegra/hwpm/Makefile | 5 ++++- drivers/tegra/hwpm/os/linux/driver.c | 2 +- drivers/tegra/hwpm/os/linux/mem_mgmt_utils.c | 3 ++- drivers/tegra/hwpm/os/linux/mem_mgmt_utils.h | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/tegra/hwpm/Makefile b/drivers/tegra/hwpm/Makefile index 24ba6b1..e212091 100644 --- a/drivers/tegra/hwpm/Makefile +++ b/drivers/tegra/hwpm/Makefile @@ -1,6 +1,6 @@ # -*- mode: makefile -*- # -# Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. 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"), @@ -43,7 +43,10 @@ ccflags-y += -DCONFIG_TEGRA_HWPM_OOT CONFIG_TEGRA_FUSE_UPSTREAM := y ccflags-y += -DCONFIG_TEGRA_FUSE_UPSTREAM +ifneq ($(NV_BUILD_SYSTEM_TYPE),) +ccflags-y += -DCONFIG_TEGRA_HWPM_CONFTEST ccflags-y += -I$(srctree.nvconftest) +endif else # CONFIG_TEGRA_OOT_MODULE != m NVHWPM_OBJ = y diff --git a/drivers/tegra/hwpm/os/linux/driver.c b/drivers/tegra/hwpm/os/linux/driver.c index a20e47b..c51a238 100644 --- a/drivers/tegra/hwpm/os/linux/driver.c +++ b/drivers/tegra/hwpm/os/linux/driver.c @@ -10,7 +10,7 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. */ -#ifdef CONFIG_TEGRA_HWPM_OOT +#if defined(CONFIG_TEGRA_HWPM_CONFTEST) && defined(CONFIG_TEGRA_HWPM_OOT) #include #endif diff --git a/drivers/tegra/hwpm/os/linux/mem_mgmt_utils.c b/drivers/tegra/hwpm/os/linux/mem_mgmt_utils.c index f772068..670d638 100644 --- a/drivers/tegra/hwpm/os/linux/mem_mgmt_utils.c +++ b/drivers/tegra/hwpm/os/linux/mem_mgmt_utils.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only // SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +#if defined(CONFIG_TEGRA_HWPM_CONFTEST) && defined(CONFIG_TEGRA_HWPM_OOT) #include - +#endif #include #include #include diff --git a/drivers/tegra/hwpm/os/linux/mem_mgmt_utils.h b/drivers/tegra/hwpm/os/linux/mem_mgmt_utils.h index ff3288d..8bed0f7 100644 --- a/drivers/tegra/hwpm/os/linux/mem_mgmt_utils.h +++ b/drivers/tegra/hwpm/os/linux/mem_mgmt_utils.h @@ -17,7 +17,7 @@ #ifndef TEGRA_HWPM_OS_LINUX_MEM_MGMT_UTILS_H #define TEGRA_HWPM_OS_LINUX_MEM_MGMT_UTILS_H -#ifdef CONFIG_TEGRA_HWPM_OOT +#if defined(CONFIG_TEGRA_HWPM_CONFTEST) && defined(CONFIG_TEGRA_HWPM_OOT) #include #endif