diff --git a/drivers/tegra/hwpm/Makefile b/drivers/tegra/hwpm/Makefile index 6a9b460..d953a6b 100644 --- a/drivers/tegra/hwpm/Makefile +++ b/drivers/tegra/hwpm/Makefile @@ -1,4 +1,24 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. +# -*- mode: makefile -*- +# +# Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. # # Tegra SOC HWPM # @@ -30,7 +50,11 @@ ccflags-y += -I$(srctree.hwpm)/include ccflags-y += -I$(srctree.hwpm)/drivers/tegra/hwpm/include ccflags-y += -I$(srctree.hwpm)/drivers/tegra/hwpm -ifeq ($(or $(NV_BUILD_CONFIGURATION_IS_SAFETY),$(CONFIG_TEGRA_LINUX_PROD)),1) +ifeq ($(CONFIG_TEGRA_LINUX_PROD),1) +nvhwpm-objs := tegra_hwpm_mock.o +else ifeq ($(NV_BUILD_CONFIGURATION_IS_SAFETY),1) +nvhwpm-objs := tegra_hwpm_mock.o +else ifneq ($(CONFIG_ARCH_TEGRA),y) nvhwpm-objs := tegra_hwpm_mock.o else # Add required objects to nvhwpm object variable diff --git a/drivers/tegra/hwpm/Makefile.hwpm.sources b/drivers/tegra/hwpm/Makefile.hwpm.sources index 5f6e8f9..df114ef 100644 --- a/drivers/tegra/hwpm/Makefile.hwpm.sources +++ b/drivers/tegra/hwpm/Makefile.hwpm.sources @@ -1,4 +1,24 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. +# -*- mode: makefile -*- +# +# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. # # Tegra SOC HWPM Sources # @@ -24,9 +44,11 @@ else srctree.hwpm-next := ${NV_SOURCE}/kernel/hwpm-next endif ifneq ($(origin srctree.hwpm-next), undefined) +ifneq ($(wildcard ${srctree.hwpm-next}/drivers/tegra/Makefile.hwpm-next.sources),) include ${srctree.hwpm-next}/drivers/tegra/Makefile.hwpm-next.sources nvhwpm-objs += ${nvhwpm-next-objs} endif +endif endif # CONFIG_TEGRA_OOT_MODULE @@ -51,14 +73,11 @@ nvhwpm-objs += ${nvhwpm-t234-objs} endif # TH500 HWPM is only supported with BaseOS as an OOT module. -ifeq ($(CONFIG_TEGRA_OOT_MODULE),m) # also check BaseOS build here -CONFIG_TEGRA_TH500_HWPM := y +# Check for TH500 HWPM config flag defined in BaseOS +ifeq ($(CONFIG_TEGRA_TH500_HWPM),y) ccflags-y += -DCONFIG_TEGRA_TH500_HWPM -ifeq ($(CONFIG_TEGRA_TH500_HWPM),y) # Include TH500 files include ${srctree.hwpm}/drivers/tegra/hwpm/Makefile.th500.sources nvhwpm-objs += ${nvhwpm-th500-objs} endif - -endif # CONFIG_TEGRA_OOT_MODULE diff --git a/drivers/tegra/hwpm/include/tegra_hwpm_log.h b/drivers/tegra/hwpm/include/tegra_hwpm_log.h index d669208..43e7e7f 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm_log.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm_log.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: MIT */ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -75,6 +75,8 @@ enum tegra_soc_hwpm_log_type { #define hwpm_dbg_driver_release BIT(16) /* Kmem debug prints */ #define hwpm_dbg_kmem BIT(17) +/* Active debug prints */ +#define hwpm_dbg_active BIT(18) #ifdef __KERNEL__