diff --git a/drivers/tegra/hwpm/include/tegra_hwpm.h b/drivers/tegra/hwpm/include/tegra_hwpm.h index ca6e7d1..63b19e4 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: MIT */ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2025 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"), @@ -104,6 +104,7 @@ enum tegra_hwpm_ip_enum { TEGRA_HWPM_IP_UCF_HUB, TEGRA_HWPM_IP_UCF_SCB, TEGRA_HWPM_IP_CPU, + TEGRA_HWPM_IP_NVTHERM, TERGA_HWPM_NUM_IPS }; @@ -152,6 +153,7 @@ static inline const char *tegra_hwpm_ip_string(enum tegra_hwpm_ip_enum ip_enum) [TEGRA_HWPM_IP_UCF_HUB] = "ucf_hub", [TEGRA_HWPM_IP_UCF_SCB] = "ucf_scb", [TEGRA_HWPM_IP_CPU] = "cpu", + [TEGRA_HWPM_IP_NVTHERM] = "nvtherm", [TERGA_HWPM_NUM_IPS] = "unknown", }; @@ -207,6 +209,7 @@ enum tegra_hwpm_resource_enum { TEGRA_HWPM_RESOURCE_UCF_HUB, TEGRA_HWPM_RESOURCE_UCF_SCB, TEGRA_HWPM_RESOURCE_CPU, + TEGRA_HWPM_RESOURCE_NVTHERM, TERGA_HWPM_NUM_RESOURCES }; diff --git a/drivers/tegra/hwpm/os/linux/ip_utils.c b/drivers/tegra/hwpm/os/linux/ip_utils.c index 2b81eef..c3b11ba 100644 --- a/drivers/tegra/hwpm/os/linux/ip_utils.c +++ b/drivers/tegra/hwpm/os/linux/ip_utils.c @@ -1,4 +1,4 @@ -/* SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +/* SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: GPL-2.0-only * * This program is free software; you can redistribute it and/or modify it @@ -147,6 +147,9 @@ static u32 tegra_hwpm_translate_soc_hwpm_ip(struct tegra_soc_hwpm *hwpm, case TEGRA_SOC_HWPM_IP_CPU: ip_enum_idx = TEGRA_HWPM_IP_CPU; break; + case TEGRA_SOC_HWPM_IP_NVTHERM: + ip_enum_idx = TEGRA_HWPM_IP_NVTHERM; + break; default: tegra_hwpm_err(hwpm, "Queried enum tegra_soc_hwpm_ip %d is invalid", @@ -312,6 +315,9 @@ u32 tegra_hwpm_translate_soc_hwpm_resource(struct tegra_soc_hwpm *hwpm, case TEGRA_SOC_HWPM_RESOURCE_CPU: res_enum_idx = TEGRA_HWPM_RESOURCE_CPU; break; + case TEGRA_SOC_HWPM_RESOURCE_NVTHERM: + res_enum_idx = TEGRA_HWPM_RESOURCE_NVTHERM; + break; default: tegra_hwpm_err(hwpm, "Queried enum tegra_soc_hwpm_resource %d is invalid", diff --git a/include/uapi/linux/tegra-soc-hwpm-uapi.h b/include/uapi/linux/tegra-soc-hwpm-uapi.h index 27f0770..fd55184 100644 --- a/include/uapi/linux/tegra-soc-hwpm-uapi.h +++ b/include/uapi/linux/tegra-soc-hwpm-uapi.h @@ -1,4 +1,4 @@ -/* SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +/* SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: GPL-2.0-only * * This program is free software; you can redistribute it and/or modify it @@ -62,6 +62,7 @@ enum tegra_soc_hwpm_ip { TEGRA_SOC_HWPM_IP_UCF_HUB, TEGRA_SOC_HWPM_IP_UCF_SCB, TEGRA_SOC_HWPM_IP_CPU, + TEGRA_SOC_HWPM_IP_NVTHERM, TERGA_SOC_HWPM_NUM_IPS }; @@ -149,6 +150,7 @@ enum tegra_soc_hwpm_resource { TEGRA_SOC_HWPM_RESOURCE_UCF_HUB, TEGRA_SOC_HWPM_RESOURCE_UCF_SCB, TEGRA_SOC_HWPM_RESOURCE_CPU, + TEGRA_SOC_HWPM_RESOURCE_NVTHERM, TERGA_SOC_HWPM_NUM_RESOURCES }; diff --git a/libnvsochwpm/include/nv_soc_hwpm.h b/libnvsochwpm/include/nv_soc_hwpm.h index 65d2e5b..2baee0c 100644 --- a/libnvsochwpm/include/nv_soc_hwpm.h +++ b/libnvsochwpm/include/nv_soc_hwpm.h @@ -73,6 +73,7 @@ typedef enum { NV_SOC_HWPM_IP_UCF_HUB, NV_SOC_HWPM_IP_UCF_SCB, NV_SOC_HWPM_IP_CPU, + NV_SOC_HWPM_IP_NVTHERM, NV_SOC_HWPM_NUM_IPS } nv_soc_hwpm_ip; @@ -135,6 +136,7 @@ typedef enum { NV_SOC_HWPM_RESOURCE_UCF_HUB, NV_SOC_HWPM_RESOURCE_UCF_SCB, NV_SOC_HWPM_RESOURCE_CPU, + NV_SOC_HWPM_RESOURCE_NVTHERM, NV_SOC_HWPM_NUM_RESOURCES } nv_soc_hwpm_resource; diff --git a/libnvsochwpm/os/lnx/nv_soc_hwpm_lnx.c b/libnvsochwpm/os/lnx/nv_soc_hwpm_lnx.c index 9714512..d432e3e 100644 --- a/libnvsochwpm/os/lnx/nv_soc_hwpm_lnx.c +++ b/libnvsochwpm/os/lnx/nv_soc_hwpm_lnx.c @@ -121,6 +121,12 @@ static uint32_t get_ip_max_instances( } break; case TEGRA_SOC_HWPM_CHIP_ID_T410: + switch (ip) { + case NV_SOC_HWPM_IP_NVTHERM: + return 1; + default: + break; + } break; default: break;