tegra: hwpm: include all ip files

The config flags defined in Kconfig file are not available/used with
OOT kernel builds. To support all kernel versions, HWPM compiles
independent of CONFIG_TEGRA_SOC_HWPM flag. This also applies to
IP config flags which are not supported as well. Hence,
include HWPM IP files irrespective of the IP config flag status.

For OOT builds, use tegra_is_hypervisor_mode() instead of using
static function defined in HWPM driver.

Bug 4061775

Change-Id: Ifab4ad5c7c652a4ad17820a82b363e92280fdd1a
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2918870
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2023-05-30 22:13:26 +00:00
committed by mobile promotions
parent c0fd0eff25
commit 91d75567c0
2 changed files with 7 additions and 24 deletions

View File

@@ -52,79 +52,55 @@ CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE=y
ccflags-y += -DCONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE
endif
ifeq ($(CONFIG_TEGRA_GRHOST_NVDLA),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_NVDLA
nvhwpm-t234-objs += hal/t234/ip/nvdla/t234_nvdla.o
endif
ifeq ($(CONFIG_TEGRA_GRHOST_PVA),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_PVA
nvhwpm-t234-objs += hal/t234/ip/pva/t234_pva.o
endif
ifeq ($(CONFIG_NV_TEGRA_MC),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_MSS_CHANNEL
nvhwpm-t234-objs += hal/t234/ip/mss_channel/t234_mss_channel.o
endif
# Include other IPs if minimal build is not enabled.
ifneq ($(CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_DISPLAY
nvhwpm-t234-objs += hal/t234/ip/display/t234_display.o
ifeq ($(CONFIG_TEGRA_GRHOST_ISP),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_ISP
nvhwpm-t234-objs += hal/t234/ip/isp/t234_isp.o
endif
ifeq ($(CONFIG_NVETHERNET),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_MGBE
nvhwpm-t234-objs += hal/t234/ip/mgbe/t234_mgbe.o
endif
ifeq ($(CONFIG_NV_TEGRA_MC),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_MSS_ISO_NISO_HUBS
nvhwpm-t234-objs += hal/t234/ip/mss_iso_niso_hubs/t234_mss_iso_niso_hubs.o
ccflags-y += -DCONFIG_T234_HWPM_IP_MSS_MCF
nvhwpm-t234-objs += hal/t234/ip/mss_mcf/t234_mss_mcf.o
endif
ccflags-y += -DCONFIG_T234_HWPM_IP_MSS_GPU_HUB
nvhwpm-t234-objs += hal/t234/ip/mss_gpu_hub/t234_mss_gpu_hub.o
ifeq ($(CONFIG_TEGRA_GRHOST_NVDEC),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_NVDEC
nvhwpm-t234-objs += hal/t234/ip/nvdec/t234_nvdec.o
endif
ifeq ($(CONFIG_TEGRA_GRHOST_NVENC),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_NVENC
nvhwpm-t234-objs += hal/t234/ip/nvenc/t234_nvenc.o
endif
ifeq ($(CONFIG_TEGRA_GRHOST_OFA),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_OFA
nvhwpm-t234-objs += hal/t234/ip/ofa/t234_ofa.o
endif
ifeq ($(CONFIG_PCIE_TEGRA194),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_PCIE
nvhwpm-t234-objs += hal/t234/ip/pcie/t234_pcie.o
endif
ccflags-y += -DCONFIG_T234_HWPM_IP_SCF
nvhwpm-t234-objs += hal/t234/ip/scf/t234_scf.o
ifeq ($(CONFIG_VIDEO_TEGRA_VI),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_VI
nvhwpm-t234-objs += hal/t234/ip/vi/t234_vi.o
endif
ifeq ($(CONFIG_TEGRA_GRHOST_VIC),y)
ccflags-y += -DCONFIG_T234_HWPM_IP_VIC
nvhwpm-t234-objs += hal/t234/ip/vic/t234_vic.o
endif
endif

View File

@@ -25,6 +25,9 @@
#include <os/linux/driver.h>
#if defined(CONFIG_TEGRA_HWPM_OOT)
#ifdef CONFIG_SOC_TEGRA_PLATFORM_HELPER
#include <soc/tegra/tegra-platform-helper.h>
#endif
#if defined(CONFIG_TEGRA_NEXT1_HWPM)
#include <os/linux/next1_soc_utils.h>
#endif
@@ -139,7 +142,11 @@ bool tegra_hwpm_is_platform_vsp_impl(void)
bool tegra_hwpm_is_hypervisor_mode_impl(void)
{
#ifdef CONFIG_SOC_TEGRA_PLATFORM_HELPER
return tegra_is_hypervisor_mode();
#else
return false;
#endif
}
#else /* !CONFIG_TEGRA_HWPM_OOT */