mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-22 17:30:40 +03:00
tegra: hwpm: Modify OS common code for HWPM RM
Modify the OS common code to be used by HWPM resource manager on QNX. Jira THWPM-54 Change-Id: I5e0e8258eececea1526e50e2efe18c79765b86b0 Signed-off-by: vasukis <vasukis@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2870342 Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com> Reviewed-by: Yogesh Solanke <ysolanke@nvidia.com> Tested-by: Seema Khowala <seemaj@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
b27a32e7f0
commit
ea6b4bcc07
@@ -146,6 +146,12 @@ struct tegra_hwpm_ip_ops {
|
|||||||
enum tegra_soc_hwpm_ip_reg_op reg_op,
|
enum tegra_soc_hwpm_ip_reg_op reg_op,
|
||||||
u32 inst_element_index, u64 reg_offset,
|
u32 inst_element_index, u64 reg_offset,
|
||||||
u32 *reg_data);
|
u32 *reg_data);
|
||||||
|
/*
|
||||||
|
* fd - is used to store the
|
||||||
|
* file descriptor of the IP devctl node
|
||||||
|
* in QNX
|
||||||
|
*/
|
||||||
|
int fd;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* There are 3 types of HWPM components/apertures */
|
/* There are 3 types of HWPM components/apertures */
|
||||||
|
|||||||
@@ -27,26 +27,7 @@
|
|||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
#include <os/linux/aperture_utils.h>
|
#include <os/linux/aperture_utils.h>
|
||||||
#else
|
#else
|
||||||
int tegra_hwpm_perfmon_reserve_impl(struct tegra_soc_hwpm *hwpm,
|
#include <os/qnx/aperture_utils.h>
|
||||||
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *perfmon)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
int tegra_hwpm_perfmux_reserve_impl(struct tegra_soc_hwpm *hwpm,
|
|
||||||
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *perfmux)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
int tegra_hwpm_perfmon_release_impl(struct tegra_soc_hwpm *hwpm,
|
|
||||||
struct hwpm_ip_aperture *perfmon)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
int tegra_hwpm_perfmux_release_impl(struct tegra_soc_hwpm *hwpm,
|
|
||||||
struct hwpm_ip_aperture *perfmux)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define tegra_hwpm_perfmon_reserve(hwpm, ip_inst, perfmon) \
|
#define tegra_hwpm_perfmon_reserve(hwpm, ip_inst, perfmon) \
|
||||||
|
|||||||
@@ -62,37 +62,7 @@ static inline u32 get_field(u32 input_data, u32 mask)
|
|||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
#include <os/linux/io_utils.h>
|
#include <os/linux/io_utils.h>
|
||||||
#else
|
#else
|
||||||
int tegra_hwpm_read_sticky_bits_impl(struct tegra_soc_hwpm *hwpm,
|
#include <os/qnx/io_utils.h>
|
||||||
u64 reg_base, u64 reg_offset, u32 *val)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int tegra_hwpm_readl_impl(struct tegra_soc_hwpm *hwpm,
|
|
||||||
struct hwpm_ip_aperture *aperture, u64 addr, u32 *val)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int tegra_hwpm_writel_impl(struct tegra_soc_hwpm *hwpm,
|
|
||||||
struct hwpm_ip_aperture *aperture, u64 addr, u32 val)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int tegra_hwpm_regops_readl_impl(struct tegra_soc_hwpm *hwpm,
|
|
||||||
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *aperture,
|
|
||||||
u64 addr, u32 *val)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int tegra_hwpm_regops_writel_impl(struct tegra_soc_hwpm *hwpm,
|
|
||||||
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *aperture,
|
|
||||||
u64 addr, u32 val)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define tegra_hwpm_read_sticky_bits(hwpm, reg_base, reg_offset, val) \
|
#define tegra_hwpm_read_sticky_bits(hwpm, reg_base, reg_offset, val) \
|
||||||
|
|||||||
@@ -26,14 +26,11 @@
|
|||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
#include <os/linux/ip_utils.h>
|
#include <os/linux/ip_utils.h>
|
||||||
#else
|
|
||||||
int tegra_hwpm_complete_ip_register_impl(struct tegra_soc_hwpm *hwpm)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define tegra_hwpm_complete_ip_register(hwpm) \
|
#define tegra_hwpm_complete_ip_register(hwpm) \
|
||||||
tegra_hwpm_complete_ip_register_impl(hwpm)
|
tegra_hwpm_complete_ip_register_impl(hwpm)
|
||||||
|
#else
|
||||||
|
#include <os/qnx/ip_utils.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* TEGRA_HWPM_IP_H */
|
#endif /* TEGRA_HWPM_IP_H */
|
||||||
|
|||||||
@@ -46,56 +46,23 @@ struct hwpm_soc_chip_info {
|
|||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
#include <os/linux/soc_utils.h>
|
#include <os/linux/soc_utils.h>
|
||||||
#else
|
#else
|
||||||
u32 tegra_hwpm_get_chip_id_impl(void)
|
#include <os/qnx/soc_utils.h>
|
||||||
{
|
#define CHIP_ID_UNKNOWN 0x0U
|
||||||
return 0U;
|
#define CHIP_ID_REV_UNKNOWN 0x0U
|
||||||
}
|
|
||||||
|
|
||||||
u32 tegra_hwpm_get_major_rev_impl(void)
|
#define PLAT_SI 0x0
|
||||||
{
|
#define PLAT_PRE_SI_QT 0x1
|
||||||
return 0U;
|
#define PLAT_PRE_SI_VDK 0x8
|
||||||
}
|
#define PLAT_PRE_SI_VSP 0x9
|
||||||
|
#define PLAT_INVALID 0xF
|
||||||
|
|
||||||
u32 tegra_hwpm_chip_get_revision_impl(void)
|
#define TEGRA_FUSE_PRODUCTION_MODE 0x0
|
||||||
{
|
|
||||||
return 0U;
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 tegra_hwpm_get_platform_impl(void)
|
struct hwpm_soc_chip_info {
|
||||||
{
|
u32 chip_id;
|
||||||
return 0U;
|
u32 chip_id_rev;
|
||||||
}
|
u32 platform;
|
||||||
|
};
|
||||||
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
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user