Files
linux-hwpm/drivers/tegra/hwpm/Makefile.t234.sources
Vedashree Vidwans 7a89f70da6 tegra: hwpm: t234: decouple force IP, minimal cfg
- HWPM driver requires to know if an IP is available for performance
measurements. The ideal way is for IP driver registration with HWPM
driver. This way IP driver can share required power management and
register access function pointers.
- For IPs that do not have registration mechanism implemented, a
workaround to set an IP enabled is implemented in the HWPM driver.
- In the recent releases, MSS channel, PVA and DLA IPs are the only PORs
for production builds. Currently, this is acheived using the combination
of minimal build and force enable flags.
- However, this implementation limits the number of enabled IPs on TOT
to only minimal expected ones.
- This patch modifies the force enable IP logic implementation to make
force enable and minimal IP flag definition more clear.
- CONFIG_T234_HWPM_ALLOW_FORCE_ENABLE should be used to purposely enable
IPs that do not have registration mechanism implemented. This flag is
used for POR or non-POR IPs. Ideally, all IPs should implement HWPM
registration and force enable flag should not be required.
- CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE should be used to implement logic
for POR IPs. In other words, if CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE is
not defined, non-POR IPs should be included in the builds. This patch
sets MINIMAL IP config only for external non-safety builds.

- Fix include t234_perfmon_device_index.h error in t234_mss_mcf.c file.
- Add missing device index for PVA perfmon C0.

Jira THWPM-41

Change-Id: I20651eac14b6d42e5bf3cc5164d1f64ec208dc04
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2818735
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-02-08 03:15:53 -08:00

132 lines
3.9 KiB
Makefile

#
# Tegra SOC HWPM T234 sources
#
# SPDX-License-Identifier: GPL-2.0
ifeq ($(CONFIG_TEGRA_T234_HWPM),y)
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
#
# 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 the preferred solution. However, IP drivers have yet to
# implement the interface. Such IPs can be force enabled from HWPM driver
# perspective (option 2). Marking an IP available forcefully requires the user
# to unpowergate the IP before running any HWPM experiments.
#
# Enable CONFIG_T234_HWPM_ALLOW_FORCE_ENABLE for internal builds.
# Note: We should work towards removing force enable flag dependency.
#
ifeq ($(NV_BUILD_CONFIGURATION_IS_EXTERNAL),0)
ccflags-y += -DCONFIG_T234_HWPM_ALLOW_FORCE_ENABLE
endif
#
# Currently, PVA, DLA and MSS channel are the IPs supported
# for performance metrics in external builds.
# Define CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE flag.
#
ifeq ($(NV_BUILD_CONFIGURATION_IS_EXTERNAL),1)
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
endif