2 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 /* Tegra vpr routines */
21 #include <asm/arch/tegra.h>
22 #include <asm/arch/mc.h>
24 #include <fdt_support.h>
26 static bool _configured;
30 struct mc_ctlr *mc = (struct mc_ctlr *)NV_PA_MC_BASE;
33 writel(0, &mc->mc_video_protect_size_mb);
34 writel(TEGRA_MC_VIDEO_PROTECT_REG_WRITE_ACCESS_DISABLED,
35 &mc->mc_video_protect_reg_ctrl);
36 /* read back to ensure the write went through */
37 readl(&mc->mc_video_protect_reg_ctrl);
39 debug("configured VPR\n");
44 bool vpr_configured(void)
49 #if defined(CONFIG_OF_LIBFDT)
51 int gpu_enable_node(void *blob, const char *gpupath)
55 if (vpr_configured()) {
56 offset = fdt_path_offset(blob, gpupath);
58 fdt_status_okay(blob, offset);
59 debug("enabled GPU node %s\n", gpupath);