NVIDIA: SAUCE: memory: tegra: Skip SID override on HV

BugLink: https://bugs.launchpad.net/bugs/2072591

HV has blocked access to MC registers.
SID override programming is required on L4T.
Add a function to check if HV is present and skip SID override
programming in that case.

http://nvbugs/4062998

Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Prathamesh Shete <pshete@nvidia.com>
Tested-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jacob Martin <jacob.martin@canonical.com>
Acked-by: Noah Wager <noah.wager@canonical.com>
Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
Ashish Mhetre
2023-05-12 10:49:26 +00:00
committed by Noah Wager
parent 3dbe65baaa
commit 57018372b4
3 changed files with 32 additions and 0 deletions
+6
View File
@@ -12,6 +12,7 @@
#include <linux/platform_device.h>
#include <soc/tegra/mc.h>
#include <soc/tegra/tegra-platform-helper.h>
#if defined(CONFIG_ARCH_TEGRA_186_SOC)
#include <dt-bindings/memory/tegra186-mc.h>
@@ -121,6 +122,11 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
if (!tegra_dev_iommu_get_stream_id(dev, &sid))
return 0;
if (tegra_is_hypervisor_mode() == true) {
pr_debug("MC register access not allowed in Guest Linux\n");
return 0;
}
while (!of_parse_phandle_with_args(dev->of_node, "interconnects", "#interconnect-cells",
index, &args)) {
if (args.np == mc->dev->of_node && args.args_count != 0) {
+7
View File
@@ -170,3 +170,10 @@ config SOC_TEGRA_CBB
Support for handling error from Tegra Control Backbone(CBB).
This driver handles the errors from CBB and prints debug
information about the failed transactions.
config SOC_TEGRA_PLATFORM_HELPER
def_bool y
help
This config enables support of the platform helpers APIs which can
be used by the out-tree. If this config is y then the helper APIs
are available else not.
+19
View File
@@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
*/
#ifndef TEGRA_PLATFORM_HELPER_H
#define TEGRA_PLATFORM_HELPER_H
static inline bool tegra_is_hypervisor_mode(void)
{
#ifdef CONFIG_OF
return of_property_read_bool(of_chosen,
"nvidia,tegra-hypervisor-mode");
#else
return false;
#endif
}
#endif /* TEGRA_PLATFORM_HELPER_H */