1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
6 /* Tegra vpr routines */
11 #include <asm/arch/tegra.h>
12 #include <asm/arch/mc.h>
13 #include <asm/arch-tegra/ap.h>
15 #include <fdt_support.h>
17 static bool _configured;
19 void tegra_gpu_config(void)
21 struct mc_ctlr *mc = (struct mc_ctlr *)NV_PA_MC_BASE;
23 #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
24 if (!tegra_cpu_is_non_secure())
28 writel(0, &mc->mc_video_protect_size_mb);
29 writel(TEGRA_MC_VIDEO_PROTECT_REG_WRITE_ACCESS_DISABLED,
30 &mc->mc_video_protect_reg_ctrl);
31 /* read back to ensure the write went through */
32 readl(&mc->mc_video_protect_reg_ctrl);
35 debug("configured VPR\n");
40 #if defined(CONFIG_OF_LIBFDT)
42 int tegra_gpu_enable_node(void *blob, const char *compat)
49 offset = fdt_node_offset_by_compatible(blob, -1, compat);
50 while (offset != -FDT_ERR_NOTFOUND) {
51 fdt_status_okay(blob, offset);
52 offset = fdt_node_offset_by_compatible(blob, offset, compat);