diff --git a/drivers/tegra/hwpm/include/tegra_hwpm.h b/drivers/tegra/hwpm/include/tegra_hwpm.h index af6e4e6..e468dad 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm.h @@ -146,6 +146,12 @@ struct tegra_hwpm_ip_ops { enum tegra_soc_hwpm_ip_reg_op reg_op, u32 inst_element_index, u64 reg_offset, 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 */ diff --git a/drivers/tegra/hwpm/include/tegra_hwpm_aperture.h b/drivers/tegra/hwpm/include/tegra_hwpm_aperture.h index 9f6e50f..a9314d6 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm_aperture.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm_aperture.h @@ -27,26 +27,7 @@ #ifdef __KERNEL__ #include #else -int tegra_hwpm_perfmon_reserve_impl(struct tegra_soc_hwpm *hwpm, - 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; -} +#include #endif #define tegra_hwpm_perfmon_reserve(hwpm, ip_inst, perfmon) \ diff --git a/drivers/tegra/hwpm/include/tegra_hwpm_io.h b/drivers/tegra/hwpm/include/tegra_hwpm_io.h index f4a8af7..8096b9f 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm_io.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm_io.h @@ -62,37 +62,7 @@ static inline u32 get_field(u32 input_data, u32 mask) #ifdef __KERNEL__ #include #else -int tegra_hwpm_read_sticky_bits_impl(struct tegra_soc_hwpm *hwpm, - 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; -} +#include #endif #define tegra_hwpm_read_sticky_bits(hwpm, reg_base, reg_offset, val) \ diff --git a/drivers/tegra/hwpm/include/tegra_hwpm_ip.h b/drivers/tegra/hwpm/include/tegra_hwpm_ip.h index a6408ec..5c92154 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm_ip.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm_ip.h @@ -26,14 +26,11 @@ #ifdef __KERNEL__ #include -#else -int tegra_hwpm_complete_ip_register_impl(struct tegra_soc_hwpm *hwpm) -{ - return -EINVAL; -} -#endif #define tegra_hwpm_complete_ip_register(hwpm) \ tegra_hwpm_complete_ip_register_impl(hwpm) +#else +#include +#endif #endif /* TEGRA_HWPM_IP_H */ diff --git a/drivers/tegra/hwpm/include/tegra_hwpm_soc.h b/drivers/tegra/hwpm/include/tegra_hwpm_soc.h index ff3f9c9..93fe615 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm_soc.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm_soc.h @@ -46,56 +46,23 @@ struct hwpm_soc_chip_info { #ifdef __KERNEL__ #include #else -u32 tegra_hwpm_get_chip_id_impl(void) -{ - return 0U; -} +#include +#define CHIP_ID_UNKNOWN 0x0U +#define CHIP_ID_REV_UNKNOWN 0x0U -u32 tegra_hwpm_get_major_rev_impl(void) -{ - return 0U; -} +#define PLAT_SI 0x0 +#define PLAT_PRE_SI_QT 0x1 +#define PLAT_PRE_SI_VDK 0x8 +#define PLAT_PRE_SI_VSP 0x9 +#define PLAT_INVALID 0xF -u32 tegra_hwpm_chip_get_revision_impl(void) -{ - return 0U; -} +#define TEGRA_FUSE_PRODUCTION_MODE 0x0 -u32 tegra_hwpm_get_platform_impl(void) -{ - return 0U; -} - -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; -} +struct hwpm_soc_chip_info { + u32 chip_id; + u32 chip_id_rev; + u32 platform; +}; #endif