mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-24 10:13:00 +03:00
Currently, linux specific SOC functions below are used in HWPM driver. - find type of platform/config - read fuse registers - read device info In order to make HWPM OS agnostic, add wrappers for SOC functions and/or move code to os folder. Jira THWPM-59 Change-Id: I8a7e824f3cffe7ae5c7e977b4b6690eb180958e4 Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2743372 Reviewed-by: Seema Khowala <seemaj@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
72 lines
1.7 KiB
C
72 lines
1.7 KiB
C
/*
|
|
* Copyright (c) 2022, 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,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*/
|
|
|
|
#ifndef TEGRA_HWPM_SOC_H
|
|
#define TEGRA_HWPM_SOC_H
|
|
|
|
#ifdef __KERNEL__
|
|
#include <os/linux/soc_utils.h>
|
|
#else
|
|
bool tegra_hwpm_is_platform_simulation_impl(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool tegra_hwpm_is_platform_vsp_impl(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool tegra_hwpm_is_platform_silicon_impl(void)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool tegra_hwpm_is_hypervisor_mode_impl(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
int tegra_hwpm_fuse_readl_impl(struct tegra_soc_hwpm *hwpm,
|
|
u64 reg_offset, u32 *val)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
int tegra_hwpm_fuse_readl_prod_mode_impl(struct tegra_soc_hwpm *hwpm, u32 *val)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
#endif
|
|
|
|
#define tegra_hwpm_is_platform_simulation() \
|
|
tegra_hwpm_is_platform_simulation_impl()
|
|
|
|
#define tegra_hwpm_is_platform_vsp() \
|
|
tegra_hwpm_is_platform_vsp_impl()
|
|
|
|
#define tegra_hwpm_is_platform_silicon() \
|
|
tegra_hwpm_is_platform_silicon_impl()
|
|
|
|
#define tegra_hwpm_is_hypervisor_mode() \
|
|
tegra_hwpm_is_hypervisor_mode_impl()
|
|
|
|
#define tegra_hwpm_fuse_readl(hwpm, reg_offset, val) \
|
|
tegra_hwpm_fuse_readl_impl(hwpm, reg_offset, val)
|
|
|
|
#define tegra_hwpm_fuse_readl_prod_mode(hwpm, val) \
|
|
tegra_hwpm_fuse_readl_prod_mode_impl(hwpm, val)
|
|
|
|
#endif /* TEGRA_HWPM_SOC_H */
|