hwpm: Disable setting fs_info for hypervisor

Set the floorsweeping information for IPs only
if the configuration is non Hypervisor. Force
enable IPs are only valid for native-Linux config.
On hypervisor config, a driver is allowed to only
remap addresses owned by the device node.
Thus, ioremap of perfmux addresses is not allowed
in hypervisor configuration. Add check to prevent
force enable IPs and ioremap in hypervisor
configuration.

JIRA THWPM-45

Change-Id: I8fe6d3c4984c66be5a117e0cc2164ea20a5374cb
Signed-off-by: vasukis <vasukis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2674003
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
vasukis
2022-02-22 15:06:25 -06:00
committed by mobile promotions
parent 778356e12d
commit 09ca7098e4
3 changed files with 158 additions and 135 deletions

View File

@@ -469,6 +469,10 @@ int t234_hwpm_init_fs_info(struct tegra_soc_hwpm *hwpm)
tegra_hwpm_fn(hwpm, " ");
if (tegra_platform_is_vsp()) {
/* Modules enabled only in L4T and not hypervisor config*/
/* As HWPM support on hypervisor is pushed to mainline*/
/* The below IPs are disabled on hypervisor currently */
if (!is_tegra_hypervisor_mode()) {
/* Static IP instances as per VSP netlist */
/* MSS CHANNEL: vsp has single instance available */
ret = t234_hwpm_set_fs_info(hwpm, addr_map_mc0_base_r(),
@@ -485,7 +489,12 @@ int t234_hwpm_init_fs_info(struct tegra_soc_hwpm *hwpm)
goto fail;
}
}
}
if (tegra_platform_is_silicon()) {
/* Modules enabled only in L4T and not hypervisor config*/
/* As HWPM support on hypervisor is pushed to mainline*/
/* The below IPs are disabled on hypervisor currently */
if (!is_tegra_hypervisor_mode()) {
/* Static IP instances corresponding to silicon */
/* VI */
/*ret = t234_hwpm_set_fs_info(hwpm, addr_map_vi_thi_base_r(),
@@ -622,6 +631,7 @@ int t234_hwpm_init_fs_info(struct tegra_soc_hwpm *hwpm)
goto fail;
}
}
}
tegra_hwpm_dbg(hwpm, hwpm_verbose, "IP floorsweep info:");
for (i = 0U; i < T234_HWPM_IP_MAX; i++) {

View File

@@ -18,6 +18,7 @@
#include <linux/device.h>
#include <linux/cdev.h>
#include <linux/delay.h>
#include <soc/tegra/fuse.h>
#include <uapi/linux/tegra-soc-hwpm-uapi.h>

View File

@@ -83,6 +83,12 @@ static u32 ip_readl(struct tegra_soc_hwpm *hwpm,
u64 reg_addr = tegra_hwpm_safe_add_u64(
aperture->start_abs_pa, offset);
if (is_tegra_hypervisor_mode()) {
tegra_hwpm_err(hwpm,
"Fallback method not implemented on hypervisor config");
return 0U;
}
ptr = ioremap(reg_addr, 0x4);
if (!ptr) {
tegra_hwpm_err(hwpm,
@@ -131,6 +137,12 @@ static void ip_writel(struct tegra_soc_hwpm *hwpm,
u64 reg_addr = tegra_hwpm_safe_add_u64(
aperture->start_abs_pa, offset);
if (is_tegra_hypervisor_mode()) {
tegra_hwpm_err(hwpm,
"Fallback method not implemented on hypervisor config");
return;
}
ptr = ioremap(reg_addr, 0x4);
if (!ptr) {
tegra_hwpm_err(hwpm,