tegra: hwpm: add nvtherm enum

Add enum for NVTHERM ip and resource to
kernel driver and userspace library.

JIRA MSST-868

Change-Id: Iacb6e9c9205e4293af04e28f265dd535b6fd1783
Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3322825
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Yifei Wan <ywan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Besar Wicaksono
2025-03-20 00:21:34 +00:00
committed by mobile promotions
parent 7f1249c9e9
commit 8b415ed149
5 changed files with 22 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: MIT */ /* 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 * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * 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_HUB,
TEGRA_HWPM_IP_UCF_SCB, TEGRA_HWPM_IP_UCF_SCB,
TEGRA_HWPM_IP_CPU, TEGRA_HWPM_IP_CPU,
TEGRA_HWPM_IP_NVTHERM,
TERGA_HWPM_NUM_IPS 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_HUB] = "ucf_hub",
[TEGRA_HWPM_IP_UCF_SCB] = "ucf_scb", [TEGRA_HWPM_IP_UCF_SCB] = "ucf_scb",
[TEGRA_HWPM_IP_CPU] = "cpu", [TEGRA_HWPM_IP_CPU] = "cpu",
[TEGRA_HWPM_IP_NVTHERM] = "nvtherm",
[TERGA_HWPM_NUM_IPS] = "unknown", [TERGA_HWPM_NUM_IPS] = "unknown",
}; };
@@ -207,6 +209,7 @@ enum tegra_hwpm_resource_enum {
TEGRA_HWPM_RESOURCE_UCF_HUB, TEGRA_HWPM_RESOURCE_UCF_HUB,
TEGRA_HWPM_RESOURCE_UCF_SCB, TEGRA_HWPM_RESOURCE_UCF_SCB,
TEGRA_HWPM_RESOURCE_CPU, TEGRA_HWPM_RESOURCE_CPU,
TEGRA_HWPM_RESOURCE_NVTHERM,
TERGA_HWPM_NUM_RESOURCES TERGA_HWPM_NUM_RESOURCES
}; };

View File

@@ -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 * SPDX-License-Identifier: GPL-2.0-only
* *
* This program is free software; you can redistribute it and/or modify it * 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: case TEGRA_SOC_HWPM_IP_CPU:
ip_enum_idx = TEGRA_HWPM_IP_CPU; ip_enum_idx = TEGRA_HWPM_IP_CPU;
break; break;
case TEGRA_SOC_HWPM_IP_NVTHERM:
ip_enum_idx = TEGRA_HWPM_IP_NVTHERM;
break;
default: default:
tegra_hwpm_err(hwpm, tegra_hwpm_err(hwpm,
"Queried enum tegra_soc_hwpm_ip %d is invalid", "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: case TEGRA_SOC_HWPM_RESOURCE_CPU:
res_enum_idx = TEGRA_HWPM_RESOURCE_CPU; res_enum_idx = TEGRA_HWPM_RESOURCE_CPU;
break; break;
case TEGRA_SOC_HWPM_RESOURCE_NVTHERM:
res_enum_idx = TEGRA_HWPM_RESOURCE_NVTHERM;
break;
default: default:
tegra_hwpm_err(hwpm, tegra_hwpm_err(hwpm,
"Queried enum tegra_soc_hwpm_resource %d is invalid", "Queried enum tegra_soc_hwpm_resource %d is invalid",

View File

@@ -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 * SPDX-License-Identifier: GPL-2.0-only
* *
* This program is free software; you can redistribute it and/or modify it * 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_HUB,
TEGRA_SOC_HWPM_IP_UCF_SCB, TEGRA_SOC_HWPM_IP_UCF_SCB,
TEGRA_SOC_HWPM_IP_CPU, TEGRA_SOC_HWPM_IP_CPU,
TEGRA_SOC_HWPM_IP_NVTHERM,
TERGA_SOC_HWPM_NUM_IPS 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_HUB,
TEGRA_SOC_HWPM_RESOURCE_UCF_SCB, TEGRA_SOC_HWPM_RESOURCE_UCF_SCB,
TEGRA_SOC_HWPM_RESOURCE_CPU, TEGRA_SOC_HWPM_RESOURCE_CPU,
TEGRA_SOC_HWPM_RESOURCE_NVTHERM,
TERGA_SOC_HWPM_NUM_RESOURCES TERGA_SOC_HWPM_NUM_RESOURCES
}; };

View File

@@ -73,6 +73,7 @@ typedef enum {
NV_SOC_HWPM_IP_UCF_HUB, NV_SOC_HWPM_IP_UCF_HUB,
NV_SOC_HWPM_IP_UCF_SCB, NV_SOC_HWPM_IP_UCF_SCB,
NV_SOC_HWPM_IP_CPU, NV_SOC_HWPM_IP_CPU,
NV_SOC_HWPM_IP_NVTHERM,
NV_SOC_HWPM_NUM_IPS NV_SOC_HWPM_NUM_IPS
} nv_soc_hwpm_ip; } nv_soc_hwpm_ip;
@@ -135,6 +136,7 @@ typedef enum {
NV_SOC_HWPM_RESOURCE_UCF_HUB, NV_SOC_HWPM_RESOURCE_UCF_HUB,
NV_SOC_HWPM_RESOURCE_UCF_SCB, NV_SOC_HWPM_RESOURCE_UCF_SCB,
NV_SOC_HWPM_RESOURCE_CPU, NV_SOC_HWPM_RESOURCE_CPU,
NV_SOC_HWPM_RESOURCE_NVTHERM,
NV_SOC_HWPM_NUM_RESOURCES NV_SOC_HWPM_NUM_RESOURCES
} nv_soc_hwpm_resource; } nv_soc_hwpm_resource;

View File

@@ -121,6 +121,12 @@ static uint32_t get_ip_max_instances(
} }
break; break;
case TEGRA_SOC_HWPM_CHIP_ID_T410: case TEGRA_SOC_HWPM_CHIP_ID_T410:
switch (ip) {
case NV_SOC_HWPM_IP_NVTHERM:
return 1;
default:
break;
}
break; break;
default: default:
break; break;