xref: /openbmc/u-boot/arch/arm/mach-tegra/dt-setup.c (revision ae485b54)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (c) 2010-2016, NVIDIA CORPORATION.
4  */
5 
6 #include <common.h>
7 #include <asm/arch-tegra/gpu.h>
8 
9 /*
10  * This function is called right before the kernel is booted. "blob" is the
11  * device tree that will be passed to the kernel.
12  */
13 int ft_system_setup(void *blob, bd_t *bd)
14 {
15 	const char *gpu_compats[] = {
16 #if defined(CONFIG_TEGRA124)
17 		"nvidia,gk20a",
18 #endif
19 #if defined(CONFIG_TEGRA210)
20 		"nvidia,gm20b",
21 #endif
22 	};
23 	int i, ret;
24 
25 	/* Enable GPU node if GPU setup has been performed */
26 	for (i = 0; i < ARRAY_SIZE(gpu_compats); i++) {
27 		ret = tegra_gpu_enable_node(blob, gpu_compats[i]);
28 		if (ret)
29 			return ret;
30 	}
31 
32 	return 0;
33 }
34