]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: tegra: enable GPU DT node when appropriate
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 9 Jul 2015 07:33:01 +0000 (16:33 +0900)
committerTom Warren <twarren@nvidia.com>
Thu, 6 Aug 2015 17:50:03 +0000 (10:50 -0700)
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>
arch/arm/include/asm/arch-tegra/gpu.h
arch/arm/mach-tegra/gpu.c
board/nvidia/jetson-tk1/jetson-tk1.c
board/nvidia/p2571/p2571.c
board/nvidia/venice2/venice2.c
include/configs/jetson-tk1.h
include/configs/p2571.h
include/configs/venice2.h

index b347a21835f56fc5f034489825a1157174db5feb..52280f40ce313c1414e0df2ce325da02c46e763d 100644 (file)
@@ -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 */
index b2fa50b5400e23fbcaba3bc39dd975926016a8e4..4ea046d3e5b654d61c47d05a4f58c01a3389f837 100644 (file)
@@ -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
index 52425a8f6dea2622496c27d14b007c9a2103d385..3c21767ce4daa070200585394e5f96ed105ade6b 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <asm/arch-tegra/gpu.h>
 
 #include "pinmux-config-jetson-tk1.h"
 
@@ -79,3 +80,10 @@ int board_eth_init(bd_t *bis)
        return pci_eth_init(bis);
 }
 #endif /* PCI */
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+       gpu_enable_node(blob, "/gpu@0,57000000");
+
+       return 0;
+}
index d80a7d0d3e319277b86610b0503a2b1ce03a9d4a..d33e4d12b2faaf2346983f060e2b6d55e3f06e66 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/arch/pinmux.h>
 #include <asm/gpio.h>
 #include "max77620_init.h"
+#include <asm/arch-tegra/gpu.h>
 #include "pinmux-config-p2571.h"
 
 void pin_mux_mmc(void)
@@ -61,3 +62,9 @@ void start_cpu_fan(void)
        gpio_request(GPIO_PE4, "FAN_VDD");
        gpio_direction_output(GPIO_PE4, 1);
 }
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+       gpu_enable_node(blob, "/gpu@0,57000000");
+       return 0;
+}
index c56ef129d6c7a5138994e1e3e213a5dd63d30010..3e2b9a7745e9542a212c14c1cb4ef9cc3beca22c 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <asm/arch-tegra/gpu.h>
 #include "pinmux-config-venice2.h"
 
 /*
@@ -27,3 +28,10 @@ void pinmux_init(void)
        pinmux_config_drvgrp_table(venice2_drvgrps,
                                   ARRAY_SIZE(venice2_drvgrps));
 }
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+       gpu_enable_node(blob, "/gpu@0,57000000");
+
+       return 0;
+}
index 55ef5f8cc6ca4bec5b66a973df0a5cf76c499df9..def0ab4121ce1ada052c33017647d5b813757790 100644 (file)
@@ -79,4 +79,6 @@
 #define CONFIG_ARMV7_SECURE_BASE               0xfff00000
 #define CONFIG_ARMV7_SECURE_RESERVE_SIZE       0x00100000
 
+#define CONFIG_OF_BOARD_SETUP
+
 #endif /* __CONFIG_H */
index b22117bfdf485a918dac8226bee04a294bef22c1..54427ad42980fb89ddfabd4eb103687c19ecf3fa 100644 (file)
@@ -65,5 +65,6 @@
 #include "tegra-common-post.h"
 
 #define COUNTER_FREQUENCY      38400000
+#define CONFIG_OF_BOARD_SETUP
 
 #endif /* _P2571_H */
index 2c43f3ebede593564fb95bc6a2b341b008a28b78..8b1189e7c4b883e11b9ca2b2dd7d4764aa0a56ed 100644 (file)
@@ -61,4 +61,6 @@
 #include "tegra-common-usb-gadget.h"
 #include "tegra-common-post.h"
 
+#define CONFIG_OF_BOARD_SETUP
+
 #endif /* __CONFIG_H */