tegra: hwpm: next4: Add next4 chip support

Add HWPM driver support for Next4 chip.

Jira MSST-821

Signed-off-by: vasukis <vasukis@nvidia.com>
Change-Id: Idc9c99653fa814a24fcab22735ae258f6f1a3f1c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3250030
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Besar Wicaksono <bwicaksono@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
This commit is contained in:
vasukis
2024-11-15 23:32:05 +00:00
committed by mobile promotions
parent f4b7bb9ead
commit cda058bccc
3 changed files with 30 additions and 0 deletions

View File

@@ -37,6 +37,10 @@
#include <tegra_hwpm_next1_init.h>
#endif
#ifdef CONFIG_TEGRA_NEXT4_HWPM
#include <tegra_hwpm_next4_init.h>
#endif
static int tegra_hwpm_init_chip_ip_structures(struct tegra_soc_hwpm *hwpm,
u32 chip_id, u32 chip_id_rev)
{
@@ -86,6 +90,20 @@ static int tegra_hwpm_init_chip_ip_structures(struct tegra_soc_hwpm *hwpm,
break;
}
break;
#endif
#ifdef CONFIG_TEGRA_NEXT4_HWPM
case 0x41:
switch (chip_id_rev) {
case 0x0:
err = tegra_hwpm_next4_init_chip_ip_structures(
hwpm, chip_id, chip_id_rev);
break;
default:
tegra_hwpm_err(hwpm, "Chip 0x%x rev 0x%x not supported",
chip_id, chip_id_rev);
break;
}
break;
#endif
default:
tegra_hwpm_err(hwpm, "Chip 0x%x not supported", chip_id);

View File

@@ -45,6 +45,9 @@ static const struct of_device_id tegra_soc_hwpm_of_match[] = {
},
#ifdef CONFIG_TEGRA_NEXT1_HWPM
#include <os/linux/next1_driver.h>
#endif
#ifdef CONFIG_TEGRA_NEXT4_HWPM
#include <os/linux/next4_driver.h>
#endif
{ },
};

View File

@@ -31,6 +31,9 @@
#if defined(CONFIG_TEGRA_NEXT1_HWPM)
#include <os/linux/next1_soc_utils.h>
#endif
#if defined(CONFIG_TEGRA_NEXT4_HWPM)
#include <os/linux/next4_soc_utils.h>
#endif
static struct hwpm_soc_chip_info chip_info = {
.chip_id = CHIP_ID_UNKNOWN,
@@ -113,6 +116,12 @@ int tegra_hwpm_init_chip_info(struct tegra_hwpm_os_linux *hwpm_linux)
}
#endif
#if defined(CONFIG_TEGRA_NEXT4_HWPM)
if (tegra_hwpm_next4_get_chip_compatible(&chip_info) == 0) {
goto complete;
}
#endif
return -ENODEV;
complete:
chip_info_initialized = true;