ARM: tegra: simplify GPU setup
authorAlexandre Courbot <acourbot@nvidia.com>
Mon, 19 Oct 2015 04:57:02 +0000 (13:57 +0900)
committerTom Warren <twarren@nvidia.com>
Thu, 12 Nov 2015 16:21:07 +0000 (09:21 -0700)
Enable the GPU node in the system-wide ft_system_setup() hook instead of
the board-specific ft_board_hook(). This allows us to enable GPU per SoC
generation instead of per-board as we did initially.

Reported-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/mach-tegra/board2.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/tegra-common.h
include/configs/venice2.h

index 8ecc67459a1080846dbdb6cf81c4615765a4092d..ff9e77cfa3a372f6ae206998324a999cb0b360fb 100644 (file)
@@ -403,3 +403,23 @@ ulong board_get_usable_ram_top(ulong total_size)
 {
        return CONFIG_SYS_SDRAM_BASE + usable_ram_size_below_4g();
 }
+
+/*
+ * This function is called right before the kernel is booted. "blob" is the
+ * device tree that will be passed to the kernel.
+ */
+int ft_system_setup(void *blob, bd_t *bd)
+{
+       const char *gpu_path =
+#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA210)
+               "/gpu@0,57000000";
+#else
+               NULL;
+#endif
+
+       /* Enable GPU node if GPU setup has been performed */
+       if (gpu_path != NULL)
+               return gpu_enable_node(blob, gpu_path);
+
+       return 0;
+}
index 3c21767ce4daa070200585394e5f96ed105ade6b..52425a8f6dea2622496c27d14b007c9a2103d385 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch-tegra/gpu.h>
 
 #include "pinmux-config-jetson-tk1.h"
 
@@ -80,10 +79,3 @@ 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 d33e4d12b2faaf2346983f060e2b6d55e3f06e66..d80a7d0d3e319277b86610b0503a2b1ce03a9d4a 100644 (file)
@@ -11,7 +11,6 @@
 #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)
@@ -62,9 +61,3 @@ 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 3e2b9a7745e9542a212c14c1cb4ef9cc3beca22c..c56ef129d6c7a5138994e1e3e213a5dd63d30010 100644 (file)
@@ -8,7 +8,6 @@
 #include <common.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch-tegra/gpu.h>
 #include "pinmux-config-venice2.h"
 
 /*
@@ -28,10 +27,3 @@ 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 e87a01047d30093fb8f3830adc9193117a3cad8c..f63957ab92fd330959989c2265c4cf23d1b7397f 100644 (file)
@@ -78,6 +78,4 @@
 #define CONFIG_ARMV7_SECURE_BASE               0xfff00000
 #define CONFIG_ARMV7_SECURE_RESERVE_SIZE       0x00100000
 
-#define CONFIG_OF_BOARD_SETUP
-
 #endif /* __CONFIG_H */
index c65d3e5fcbc16d10df64a6892af878de855dd63f..a5de411121b02e8572f1ace931fa3e3f4c6251fa 100644 (file)
@@ -60,6 +60,4 @@
 #include "tegra-common-usb-gadget.h"
 #include "tegra-common-post.h"
 
-#define CONFIG_OF_BOARD_SETUP
-
 #endif /* _P2571_H */
index a005e6a2acca044266bde28d0ea1bc590e60e652..32cc39bbe3db47aac73b19ac5db4adb891a4a199 100644 (file)
 #define CONFIG_FAT_WRITE
 #endif
 
+#define CONFIG_OF_SYSTEM_SETUP
+
 #endif /* _TEGRA_COMMON_H_ */
index 0fc8cf7674d1d3ac8f4d106821e39f88ecf11a4c..a374cd948849f7f69fd8863439d0c1bed5235c54 100644 (file)
@@ -60,6 +60,4 @@
 #include "tegra-common-usb-gadget.h"
 #include "tegra-common-post.h"
 
-#define CONFIG_OF_BOARD_SETUP
-
 #endif /* __CONFIG_H */