aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlexandre Courbot2015-07-09 16:33:01 +0900
committerTom Warren2015-08-06 10:50:03 -0700
commita38a3c4af4ed72a2ed6192203f8fe17ccdd2389f (patch)
tree71a0a327f8ca6b0bf1798aa08ec3e26659d11157 /arch
parent871d78ed1b906a79d8a6dad96a9f83dea7b9170f (diff)
ARM: tegra: enable GPU DT node when appropriate
T124/210 requires some specific configuration (VPR setup) to be performed by the bootloader before the GPU can be used. For this reason, the GPU node in the device tree is disabled by default. This patch enables the node if U-boot has performed VPR configuration. Boards enabled by this patch are T124's Jetson TK1 and Venice2 and T210's P2571. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Tom Warren <twarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/arch-tegra/gpu.h15
-rw-r--r--arch/arm/mach-tegra/gpu.c19
2 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-tegra/gpu.h b/arch/arm/include/asm/arch-tegra/gpu.h
index b347a21835f..52280f40ce3 100644
--- a/arch/arm/include/asm/arch-tegra/gpu.h
+++ b/arch/arm/include/asm/arch-tegra/gpu.h
@@ -25,3 +25,18 @@ static inline bool gpu_configured(void)
}
#endif /* CONFIG_TEGRA_GPU */
+
+#if defined(CONFIG_OF_LIBFDT)
+
+int gpu_enable_node(void *blob, const char *gpupath);
+
+#else /* CONFIG_OF_LIBFDT */
+
+static inline int gpu_enable_node(void *blob, const char *gpupath)
+{
+ return 0;
+}
+
+#endif /* CONFIG_OF_LIBFDT */
+
+#endif /* __ASM_ARCH_TEGRA_GPU_H */
diff --git a/arch/arm/mach-tegra/gpu.c b/arch/arm/mach-tegra/gpu.c
index b2fa50b5400..4ea046d3e5b 100644
--- a/arch/arm/mach-tegra/gpu.c
+++ b/arch/arm/mach-tegra/gpu.c
@@ -45,3 +45,22 @@ bool vpr_configured(void)
{
return _configured;
}
+
+#if defined(CONFIG_OF_LIBFDT)
+
+int gpu_enable_node(void *blob, const char *gpupath)
+{
+ int offset;
+
+ if (vpr_configured()) {
+ offset = fdt_path_offset(blob, gpupath);
+ if (offset > 0) {
+ fdt_status_okay(blob, offset);
+ debug("enabled GPU node %s\n", gpupath);
+ }
+ }
+
+ return 0;
+}
+
+#endif