mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: cond. compile with CONFIG_NV_TEGRA_MC
Protect tegra MC code under the config flag CONFIG_NV_TEGRA_MC. Bug 2834141 Change-Id: Ibb883ca69ea26467f095aca22552b1ad20279cd9 Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2306434 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Alex Waterman
parent
1f6dfb54d1
commit
f91495c41d
@@ -26,7 +26,11 @@
|
||||
#include <linux/tegra_soctherm.h>
|
||||
#endif
|
||||
#include <linux/platform/tegra/common.h>
|
||||
|
||||
#ifdef CONFIG_NV_TEGRA_MC
|
||||
#include <linux/platform/tegra/mc.h>
|
||||
#endif /* CONFIG_NV_TEGRA_MC */
|
||||
|
||||
#include <linux/clk/tegra.h>
|
||||
|
||||
#if defined(CONFIG_COMMON_CLK) && defined(CONFIG_TEGRA_DVFS)
|
||||
@@ -322,6 +326,7 @@ static int gm20b_tegra_railgate(struct device *dev)
|
||||
struct gk20a_platform *platform = dev_get_drvdata(dev);
|
||||
int ret = 0;
|
||||
|
||||
#ifdef CONFIG_NV_TEGRA_MC
|
||||
#ifdef CONFIG_TEGRA_DVFS
|
||||
if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL) ||
|
||||
!tegra_dvfs_is_rail_up(platform->gpu_rail))
|
||||
@@ -371,6 +376,10 @@ static int gm20b_tegra_railgate(struct device *dev)
|
||||
|
||||
return 0;
|
||||
|
||||
#else
|
||||
ret = -ENOTSUP;
|
||||
#endif /* CONFIG_NV_TEGRA_MC */
|
||||
|
||||
err_power_off:
|
||||
nvgpu_err(platform->g, "Could not railgate GPU");
|
||||
return ret;
|
||||
@@ -453,12 +462,14 @@ static int gm20b_tegra_unrailgate(struct device *dev)
|
||||
platform->reset_deassert(dev);
|
||||
clk_enable(platform->clk_reset);
|
||||
|
||||
#ifdef CONFIG_NV_TEGRA_MC
|
||||
/* Flush MC after boot/railgate/SC7 */
|
||||
tegra_mc_flush(MC_CLIENT_GPU);
|
||||
|
||||
udelay(10);
|
||||
|
||||
tegra_mc_flush_done(MC_CLIENT_GPU);
|
||||
#endif
|
||||
|
||||
udelay(10);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user