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