tegra: hwpm: add hwpm-next, k5.10 support

Kernel 5.10 support
- Use code from HWPM repo with kernel 5.10 builds.
- Add HWPM source files as built-in driver as IP drivers like PVA,
DLA are built-in and dependent on HWPM for IP registration.

HWPM next chips support
- Currently, only HWPM code in the current (public) repo is included in
compilation on TOT. This patch includes Makefile from HWPM next repo for
next/future chips.

Jira THWPM-69

Change-Id: I8f2bbcabf0c01f2b2cbc722c481a1fe83490c76b
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2921358
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2023-06-14 09:21:41 -07:00
committed by mobile promotions
parent 808f5666a0
commit 034993b547
4 changed files with 53 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
config TEGRA_SOC_HWPM
tristate "Tegra SOC HWPM driver"
default m
bool "Tegra SOC HWPM driver"
default y
help
The SOC HWPM driver enables performance monitoring for various Tegra
IPs.

View File

@@ -6,6 +6,7 @@
GCOV_PROFILE := y
ifeq ($(origin srctree.hwpm), undefined)
# Set HWPM source repo path
srctree.hwpm := $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))/../../..
endif
@@ -15,10 +16,10 @@ ccflags-y += -DCONFIG_TEGRA_SOC_HWPM
CONFIG_TEGRA_T234_HWPM := y
ccflags-y += -DCONFIG_TEGRA_T234_HWPM
NVHWPM_OBJ = m
# For OOT builds, set required config flags
ifeq ($(CONFIG_TEGRA_OOT_MODULE),m)
NVHWPM_OBJ = m
CONFIG_TEGRA_HWPM_OOT := y
ccflags-y += -DCONFIG_TEGRA_HWPM_OOT
@@ -30,7 +31,8 @@ LINUXINCLUDE += -I$(srctree.hwpm)/drivers/tegra/hwpm/include
LINUXINCLUDE += -I$(srctree.hwpm)/drivers/tegra/hwpm
else
ccflags-y += -I$(srctree.nvidia)/include
NVHWPM_OBJ = y
ccflags-y += -I$(srctree.hwpm)/include
ccflags-y += -I$(srctree.hwpm)/drivers/tegra/hwpm/include
ccflags-y += -I$(srctree.hwpm)/drivers/tegra/hwpm
@@ -42,7 +44,7 @@ nvhwpm-y := tegra_hwpm_mock.o
else
# Add required objects to nvhwpm object variable
include $(srctree.hwpm)/drivers/tegra/hwpm/Makefile.sources
include $(srctree.hwpm)/drivers/tegra/hwpm/Makefile.hwpm.sources
endif

View File

@@ -0,0 +1,45 @@
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Tegra SOC HWPM Sources
#
ifeq ($(CONFIG_TEGRA_OOT_MODULE),m)
srctree.hwpm-next := ${srctree.hwpm}
# Include next sources only if Makefile.hwpm-next.sources exists
ifneq ($(wildcard ${srctree.hwpm-next}/drivers/tegra/hwpm/Makefile.hwpm-next.sources),)
include ${srctree.hwpm-next}/drivers/tegra/hwpm/Makefile.hwpm-next.sources
nvhwpm-objs += ${nvhwpm-next-objs}
endif
else # Non-OOT kernel
ifeq ($(origin NV_SOURCE), undefined)
ifeq ($(origin TEGRA_TOP), undefined)
# No reference to hwpm-next repo
else
srctree.hwpm-next := ${TEGRA_TOP}/kernel/hwpm-next
endif
else
srctree.hwpm-next := ${NV_SOURCE}/kernel/hwpm-next
endif
ifneq ($(origin srctree.hwpm-next), undefined)
include ${srctree.hwpm-next}/drivers/tegra/Makefile.hwpm-next.sources
nvhwpm-objs += ${nvhwpm-next-objs}
endif
endif
# Include common files
include ${srctree.hwpm}/drivers/tegra/hwpm/Makefile.common.sources
nvhwpm-objs += ${nvhwpm-common-objs}
# Include linux files
include ${srctree.hwpm}/drivers/tegra/hwpm/Makefile.linux.sources
nvhwpm-objs += ${nvhwpm-linux-objs}
ifeq ($(CONFIG_TEGRA_T234_HWPM),y)
# Include T234 files
include ${srctree.hwpm}/drivers/tegra/hwpm/Makefile.t234.sources
nvhwpm-objs += ${nvhwpm-t234-objs}
endif

View File

@@ -1,18 +0,0 @@
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Tegra SOC HWPM Sources
#
# Include common files
include $(srctree.hwpm)/drivers/tegra/hwpm/Makefile.common.sources
nvhwpm-objs += ${nvhwpm-common-objs}
# Include linux files
include $(srctree.hwpm)/drivers/tegra/hwpm/Makefile.linux.sources
nvhwpm-objs += ${nvhwpm-linux-objs}
ifeq ($(CONFIG_TEGRA_T234_HWPM),y)
# Include T234 files
include $(srctree.hwpm)/drivers/tegra/hwpm/Makefile.t234.sources
nvhwpm-objs += ${nvhwpm-t234-objs}
endif