tegra: hwpm: t264: Merge t264-hwpm files to hwpm

Merge the T264 private source code to hwpm common code.
This is done after T264 source code can be made public.

Bug 4856428
Bug 4943517

Signed-off-by: vasukis <vasukis@nvidia.com>
Change-Id: Ie830c5465f32f49978cb465d68785ab3dbaee984
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3219865
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
This commit is contained in:
vasukis
2024-09-26 23:19:43 +00:00
committed by mobile promotions
parent b8a884d226
commit bb4b1def61
43 changed files with 11081 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2022-2024 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,
@@ -31,9 +31,6 @@
#if defined(CONFIG_TEGRA_NEXT1_HWPM)
#include <os/linux/next1_soc_utils.h>
#endif
#if defined(CONFIG_TEGRA_NEXT3_HWPM)
#include <os/linux/next3_soc_utils.h>
#endif
static struct hwpm_soc_chip_info chip_info = {
.chip_id = CHIP_ID_UNKNOWN,
@@ -56,6 +53,12 @@ const struct hwpm_soc_chip_info th500_chip_info = {
};
#endif
const struct hwpm_soc_chip_info t264_soc_chip_info = {
.chip_id = 0x26,
.chip_id_rev = 0x4,
.platform = PLAT_SI,
};
/* This function should be invoked only once before retrieving soc chip info */
int tegra_hwpm_init_chip_info(struct tegra_hwpm_os_linux *hwpm_linux)
{
@@ -96,13 +99,16 @@ int tegra_hwpm_init_chip_info(struct tegra_hwpm_os_linux *hwpm_linux)
goto complete;
}
#endif /* CONFIG_ACPI */
#if defined(CONFIG_TEGRA_NEXT1_HWPM)
if (tegra_hwpm_next1_get_chip_compatible(&chip_info) == 0) {
if (of_machine_is_compatible("nvidia,tegra264")) {
chip_info.chip_id = t264_soc_chip_info.chip_id;
chip_info.chip_id_rev = t264_soc_chip_info.chip_id_rev;
chip_info.platform = t264_soc_chip_info.platform;
goto complete;
}
#endif
#if defined(CONFIG_TEGRA_NEXT3_HWPM)
if (tegra_hwpm_next3_get_chip_compatible(&chip_info) == 0) {
#if defined(CONFIG_TEGRA_NEXT1_HWPM)
if (tegra_hwpm_next1_get_chip_compatible(&chip_info) == 0) {
goto complete;
}
#endif