Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Stephen Warren | 9889862 | 2016-08-08 10:38:34 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2010-2016, NVIDIA CORPORATION. |
Stephen Warren | 9889862 | 2016-08-08 10:38:34 -0600 | [diff] [blame] | 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 | } |