tegra: hwpm: add wrapper for soc functions

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>
This commit is contained in:
Vedashree Vidwans
2022-07-11 16:06:58 -07:00
committed by mobile promotions
parent 74dee85a03
commit ed6dd8af44
9 changed files with 199 additions and 42 deletions

View File

@@ -22,15 +22,15 @@
#include <linux/string.h>
#include <linux/of_address.h>
#include <linux/dma-buf.h>
#include <soc/tegra/fuse.h>
#include <uapi/linux/tegra-soc-hwpm-uapi.h>
#include <tegra_hwpm_mem_mgmt.h>
#include <tegra_hwpm_log.h>
#include <tegra_hwpm.h>
#include <tegra_hwpm_io.h>
#include <tegra_hwpm_ip.h>
#include <tegra_hwpm.h>
#include <tegra_hwpm_log.h>
#include <tegra_hwpm_soc.h>
#include <tegra_hwpm_common.h>
#include <tegra_hwpm_mem_mgmt.h>
#include <os/linux/regops_utils.h>
#define LA_CLK_RATE 625000000UL
@@ -391,7 +391,7 @@ static int tegra_hwpm_open(struct inode *inode, struct file *filp)
return -EAGAIN;
}
if (tegra_platform_is_silicon()) {
if (tegra_hwpm_is_platform_silicon()) {
ret = reset_control_assert(hwpm->hwpm_rst);
if (ret < 0) {
tegra_hwpm_err(hwpm, "hwpm reset assert failed");
@@ -527,7 +527,7 @@ static int tegra_hwpm_release(struct inode *inode, struct file *filp)
goto fail;
}
if (tegra_platform_is_silicon()) {
if (tegra_hwpm_is_platform_silicon()) {
ret = reset_control_assert(hwpm->hwpm_rst);
if (ret < 0) {
tegra_hwpm_err(hwpm, "hwpm reset assert failed");