From 6b78463b8aaf5bab8437b9c66809094159032b9e Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Tue, 30 May 2023 22:13:26 +0000 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2918870 (cherry picked from commit 91d75567c0eed669cd97f7169c06fcf2353bd89d) Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2928930 GVS: Gerrit_Virtual_Submit Reviewed-by: Vasuki Shankar Reviewed-by: Seema Khowala --- drivers/tegra/hwpm/Makefile.t234.sources | 24 ------------------------ drivers/tegra/hwpm/os/linux/soc_utils.c | 7 +++++++ 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/tegra/hwpm/Makefile.t234.sources b/drivers/tegra/hwpm/Makefile.t234.sources index 1802bad..48ff7b8 100644 --- a/drivers/tegra/hwpm/Makefile.t234.sources +++ b/drivers/tegra/hwpm/Makefile.t234.sources @@ -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 diff --git a/drivers/tegra/hwpm/os/linux/soc_utils.c b/drivers/tegra/hwpm/os/linux/soc_utils.c index e863bbb..171370d 100644 --- a/drivers/tegra/hwpm/os/linux/soc_utils.c +++ b/drivers/tegra/hwpm/os/linux/soc_utils.c @@ -25,6 +25,9 @@ #include #if defined(CONFIG_TEGRA_HWPM_OOT) +#ifdef CONFIG_SOC_TEGRA_PLATFORM_HELPER +#include +#endif #if defined(CONFIG_TEGRA_NEXT1_HWPM) #include #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 */