mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-22 09:12:05 +03:00
tegra: hwpm: redo hwpm driver as OOT
Make HWPM driver as loadable kernel module. Separate common, linux and t234 specific files into separate objects. This will allow hwpm common files to be included in other projects. Jira THWPM-41 Bug 3583624 Change-Id: Ia7472122c71520076a1516c8e386cfe79862dd61 Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2683488 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Vasuki Shankar <vasukis@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
14d527e97a
commit
71664d7c99
160
Makefile
160
Makefile
@@ -2,149 +2,35 @@
|
||||
# Tegra SOC HWPM
|
||||
#
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
GCOV_PROFILE := y
|
||||
|
||||
ccflags-y += -I$(srctree.nvidia)/drivers/platform/tegra/hwpm
|
||||
ccflags-y += -I$(srctree.nvidia)/drivers/platform/tegra/hwpm/include
|
||||
ccflags-y += -I$(srctree.nvidia)/include
|
||||
ccflags-y += -I$(srctree.nvidia)/drivers/platform/tegra/hwpm/include
|
||||
ccflags-y += -I$(srctree.nvidia)/drivers/platform/tegra/hwpm
|
||||
|
||||
obj-$(CONFIG_DEBUG_FS) += os/linux/debugfs.o
|
||||
obj-y += os/linux/aperture_utils.o
|
||||
obj-y += os/linux/driver.o
|
||||
obj-y += os/linux/io_utils.o
|
||||
obj-y += os/linux/ip_utils.o
|
||||
obj-y += os/linux/ioctl.o
|
||||
obj-y += os/linux/kmem.o
|
||||
obj-y += os/linux/log.o
|
||||
obj-y += os/linux/timers.o
|
||||
obj-y += os/linux/mem_mgmt_utils.o
|
||||
obj-y += os/linux/regops_utils.o
|
||||
obj-y += os/linux/soc_utils.o
|
||||
# For OOT builds, set required config flags
|
||||
ifeq ($(CONFIG_TEGRA_OOT_MODULE),m)
|
||||
CONFIG_TEGRA_T234_HWPM = y
|
||||
ccflags-y += -DCONFIG_TEGRA_T234_HWPM
|
||||
NVHWPM_OBJ = m
|
||||
else
|
||||
NVHWPM_OBJ = y
|
||||
endif
|
||||
|
||||
obj-y += common/allowlist.o
|
||||
obj-y += common/aperture.o
|
||||
obj-y += common/ip.o
|
||||
obj-y += common/resource.o
|
||||
obj-y += common/init.o
|
||||
# Add required objects to nvhwpm object variable
|
||||
# Include common files
|
||||
include $(srctree.nvidia)/drivers/platform/tegra/hwpm/Makefile.common.sources
|
||||
nvhwpm-objs += ${nvhwpm-common-objs}
|
||||
|
||||
# Include linux files
|
||||
include $(srctree.nvidia)/drivers/platform/tegra/hwpm/Makefile.linux.sources
|
||||
nvhwpm-objs += ${nvhwpm-linux-objs}
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_T234_HWPM),y)
|
||||
|
||||
obj-y += hal/t234/t234_alist.o
|
||||
obj-y += hal/t234/t234_aperture.o
|
||||
obj-y += hal/t234/t234_interface.o
|
||||
obj-y += hal/t234/t234_ip.o
|
||||
obj-y += hal/t234/t234_mem_mgmt.o
|
||||
obj-y += hal/t234/t234_regops_allowlist.o
|
||||
obj-y += hal/t234/t234_resource.o
|
||||
|
||||
obj-y += hal/t234/ip/pma/t234_pma.o
|
||||
obj-y += hal/t234/ip/rtr/t234_rtr.o
|
||||
|
||||
#
|
||||
# Control IP config
|
||||
# To disable an IP config in compilation, add condition for both
|
||||
# IP config flag and IP specific .o file.
|
||||
#
|
||||
|
||||
#
|
||||
# One of the HWPM components is a perfmux. Perfmux registers belong to the
|
||||
# IP domain. There are 2 ways of accessing perfmux registers
|
||||
# - option 1: implement HWPM <-> IP interface. IP drivers register with HWPM
|
||||
# driver and share required function pointers
|
||||
# - option 2: map perfmux register address in HWPM driver
|
||||
# Option 1 is a preferred solution. However, IP drivers have yet to
|
||||
# implement the interface. Such IPs can be force enabled from HWPM driver
|
||||
# perspective. However, forcing an IP will enable all instances of the IP.
|
||||
# Hence, IP force enable should only be done on full chip config.
|
||||
# Note as power management API is not available, unpowergating the IP via
|
||||
# command line is required.
|
||||
#
|
||||
##define CONFIG_T234_HWPM_ALLOW_FORCE_ENABLE
|
||||
|
||||
#
|
||||
# Define a Minimal IP config flag
|
||||
# Enable only MSS_Channel, NVDLA and PVA IPs
|
||||
# When CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE is set to y.
|
||||
#
|
||||
CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE=y
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_ALLOW_FORCE_ENABLE
|
||||
# Include T234 files
|
||||
include $(srctree.nvidia)/drivers/platform/tegra/hwpm/Makefile.t234.sources
|
||||
nvhwpm-objs += ${nvhwpm-t234-objs}
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_GRHOST_NVDLA),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_NVDLA
|
||||
obj-y += hal/t234/ip/nvdla/t234_nvdla.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_GRHOST_PVA),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_PVA
|
||||
obj-y += hal/t234/ip/pva/t234_pva.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NV_TEGRA_MC),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_MSS_CHANNEL
|
||||
obj-y += hal/t234/ip/mss_channel/t234_mss_channel.o
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_DISPLAY
|
||||
obj-y += hal/t234/ip/display/t234_display.o
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_GRHOST_ISP),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_ISP
|
||||
obj-y += hal/t234/ip/isp/t234_isp.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NVETHERNET),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_MGBE
|
||||
obj-y += hal/t234/ip/mgbe/t234_mgbe.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NV_TEGRA_MC),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_MSS_ISO_NISO_HUBS
|
||||
obj-y += hal/t234/ip/mss_iso_niso_hubs/t234_mss_iso_niso_hubs.o
|
||||
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_MSS_MCF
|
||||
obj-y += hal/t234/ip/mss_mcf/t234_mss_mcf.o
|
||||
endif
|
||||
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_MSS_GPU_HUB
|
||||
obj-y += hal/t234/ip/mss_gpu_hub/t234_mss_gpu_hub.o
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_GRHOST_NVDEC),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_NVDEC
|
||||
obj-y += hal/t234/ip/nvdec/t234_nvdec.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_GRHOST_NVENC),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_NVENC
|
||||
obj-y += hal/t234/ip/nvenc/t234_nvenc.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_GRHOST_OFA),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_OFA
|
||||
obj-y += hal/t234/ip/ofa/t234_ofa.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PCIE_TEGRA194),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_PCIE
|
||||
obj-y += hal/t234/ip/pcie/t234_pcie.o
|
||||
endif
|
||||
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_SCF
|
||||
obj-y += hal/t234/ip/scf/t234_scf.o
|
||||
|
||||
ifeq ($(CONFIG_VIDEO_TEGRA_VI),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_VI
|
||||
obj-y += hal/t234/ip/vi/t234_vi.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_GRHOST_VIC),y)
|
||||
ccflags-y += -DCONFIG_T234_HWPM_IP_VIC
|
||||
obj-y += hal/t234/ip/vic/t234_vic.o
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
obj-${NVHWPM_OBJ} += nvhwpm.o
|
||||
|
||||
11
Makefile.common.sources
Normal file
11
Makefile.common.sources
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Tegra SOC HWPM Common sources
|
||||
#
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
nvhwpm-common-objs += common/allowlist.o
|
||||
nvhwpm-common-objs += common/aperture.o
|
||||
nvhwpm-common-objs += common/ip.o
|
||||
nvhwpm-common-objs += common/resource.o
|
||||
nvhwpm-common-objs += common/init.o
|
||||
21
Makefile.linux.sources
Normal file
21
Makefile.linux.sources
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# Tegra SOC HWPM Linux Sources
|
||||
#
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
nvhwpm-linux-objs += os/linux/aperture_utils.o
|
||||
nvhwpm-linux-objs += os/linux/driver.o
|
||||
nvhwpm-linux-objs += os/linux/io_utils.o
|
||||
nvhwpm-linux-objs += os/linux/ip_utils.o
|
||||
nvhwpm-linux-objs += os/linux/ioctl.o
|
||||
nvhwpm-linux-objs += os/linux/kmem.o
|
||||
nvhwpm-linux-objs += os/linux/log.o
|
||||
nvhwpm-linux-objs += os/linux/mem_mgmt_utils.o
|
||||
nvhwpm-linux-objs += os/linux/regops_utils.o
|
||||
nvhwpm-linux-objs += os/linux/timers.o
|
||||
nvhwpm-linux-objs += os/linux/soc_utils.o
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_FS),y)
|
||||
nvhwpm-linux-objs += os/linux/debugfs.o
|
||||
endif
|
||||
114
Makefile.t234.sources
Normal file
114
Makefile.t234.sources
Normal file
@@ -0,0 +1,114 @@
|
||||
#
|
||||
# Tegra SOC HWPM T234 sources
|
||||
#
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_T234_HWPM),y)
|
||||
nvhwpm-t234-objs += hal/t234/t234_alist.o
|
||||
nvhwpm-t234-objs += hal/t234/t234_aperture.o
|
||||
nvhwpm-t234-objs += hal/t234/t234_interface.o
|
||||
nvhwpm-t234-objs += hal/t234/t234_ip.o
|
||||
nvhwpm-t234-objs += hal/t234/t234_mem_mgmt.o
|
||||
nvhwpm-t234-objs += hal/t234/t234_regops_allowlist.o
|
||||
nvhwpm-t234-objs += hal/t234/t234_resource.o
|
||||
|
||||
#
|
||||
# Control IP config
|
||||
# To disable an IP config in compilation, add condition for both
|
||||
# IP config flag and IP specific .o file.
|
||||
#
|
||||
|
||||
#
|
||||
# RTR/PMA are HWPM IPs and can be enabled by default
|
||||
#
|
||||
nvhwpm-t234-objs += hal/t234/ip/rtr/t234_rtr.o
|
||||
nvhwpm-t234-objs += hal/t234/ip/pma/t234_pma.o
|
||||
|
||||
#
|
||||
# Define a Minimal IP config flag
|
||||
# Enable only MSS_Channel, NVDLA and PVA IPs
|
||||
# When CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE is set to y.
|
||||
#
|
||||
CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE=y
|
||||
|
||||
ifeq ($(CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE),y)
|
||||
ccflags-y += -DCONFIG_HWPM_ALLOW_FORCE_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
|
||||
|
||||
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
|
||||
|
||||
endif
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <hal/t234/t234_init.h>
|
||||
#ifdef CONFIG_TEGRA_NEXT1_HWPM
|
||||
#include <tegra_hwpm_next_init.h>
|
||||
#include <tegra_hwpm_next1_init.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ static const struct of_device_id tegra_soc_hwpm_of_match[] = {
|
||||
.compatible = "nvidia,t234-soc-hwpm",
|
||||
},
|
||||
#ifdef CONFIG_TEGRA_NEXT1_HWPM
|
||||
#include <os/linux/tegra_hwpm_next_linux.h>
|
||||
#include <os/linux/next1_driver.h>
|
||||
#endif
|
||||
{ },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user