From 1bbda26d7d1050a30bc39d4896704018f01ade84 Mon Sep 17 00:00:00 2001 From: vasukis Date: Tue, 3 Jan 2023 20:27:40 +0000 Subject: [PATCH] tegra: hwpm: Add C2C IP support Add C2C enum in HWPM IP/Resource lists for internal and userspace perusal. Update translate enum function accordingly. Jira THWPM-72 Bug 3910198 Change-Id: I1b0ad91345bdf302b3f9b4b7e171bb3f4cc7b2b5 Signed-off-by: vasukis (cherry picked from commit 721aef448cf00878764f87dfc48241fb055c49b2) Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2853212 Tested-by: Vedashree Vidwans Reviewed-by: Vedashree Vidwans Reviewed-by: Seema Khowala GVS: Gerrit_Virtual_Submit --- drivers/tegra/hwpm/include/tegra_hwpm.h | 4 +++- drivers/tegra/hwpm/os/linux/ip_utils.c | 8 +++++++- include/uapi/linux/tegra-soc-hwpm-uapi.h | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/tegra/hwpm/include/tegra_hwpm.h b/drivers/tegra/hwpm/include/tegra_hwpm.h index e8df843..6d7ce89 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -58,6 +58,7 @@ enum tegra_hwpm_ip_enum { TEGRA_HWPM_IP_MSS_ISO_NISO_HUBS, TEGRA_HWPM_IP_MSS_MCF, TEGRA_HWPM_IP_APE, + TEGRA_HWPM_IP_C2C, TERGA_HWPM_NUM_IPS }; @@ -86,6 +87,7 @@ enum tegra_hwpm_resource_enum { TEGRA_HWPM_RESOURCE_PMA, TEGRA_HWPM_RESOURCE_CMD_SLICE_RTR, TEGRA_HWPM_RESOURCE_APE, + TEGRA_HWPM_RESOURCE_C2C, 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 e822e52..f206dcc 100644 --- a/drivers/tegra/hwpm/os/linux/ip_utils.c +++ b/drivers/tegra/hwpm/os/linux/ip_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -84,6 +84,9 @@ static u32 tegra_hwpm_translate_soc_hwpm_ip(struct tegra_soc_hwpm *hwpm, case TEGRA_SOC_HWPM_IP_APE: ip_enum_idx = TEGRA_HWPM_IP_APE; break; + case TEGRA_SOC_HWPM_IP_C2C: + ip_enum_idx = TEGRA_HWPM_IP_C2C; + break; default: tegra_hwpm_err(hwpm, "Queried enum tegra_soc_hwpm_ip %d is invalid", @@ -186,6 +189,9 @@ u32 tegra_hwpm_translate_soc_hwpm_resource(struct tegra_soc_hwpm *hwpm, case TEGRA_SOC_HWPM_RESOURCE_APE: res_enum_idx = TEGRA_HWPM_RESOURCE_APE; break; + case TEGRA_SOC_HWPM_RESOURCE_C2C: + res_enum_idx = TEGRA_HWPM_RESOURCE_C2C; + 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 1be1607..8a6ea42 100644 --- a/include/uapi/linux/tegra-soc-hwpm-uapi.h +++ b/include/uapi/linux/tegra-soc-hwpm-uapi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -44,6 +44,7 @@ enum tegra_soc_hwpm_ip { TEGRA_SOC_HWPM_IP_MSS_ISO_NISO_HUBS, TEGRA_SOC_HWPM_IP_MSS_MCF, TEGRA_SOC_HWPM_IP_APE, + TEGRA_SOC_HWPM_IP_C2C, TERGA_SOC_HWPM_NUM_IPS }; @@ -110,7 +111,7 @@ enum tegra_soc_hwpm_resource { */ TEGRA_SOC_HWPM_RESOURCE_CMD_SLICE_RTR, TEGRA_SOC_HWPM_RESOURCE_APE, - + TEGRA_SOC_HWPM_RESOURCE_C2C, TERGA_SOC_HWPM_NUM_RESOURCES };