X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=arch%2Farm%2Fmach-tegra%2Fgpu.c;h=74b64a620c5f65ef7ab33afb64d40cfc0beb8420;hb=1154541a528ac8bacdbdaccdb177dc64985fe7cb;hp=4ea046d3e5b654d61c47d05a4f58c01a3389f837;hpb=7c0e5d865ff0b86dfce492b656238919c659d756;p=u-boot diff --git a/arch/arm/mach-tegra/gpu.c b/arch/arm/mach-tegra/gpu.c index 4ea046d3e5..74b64a620c 100644 --- a/arch/arm/mach-tegra/gpu.c +++ b/arch/arm/mach-tegra/gpu.c @@ -1,17 +1,7 @@ /* * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * SPDX-License-Identifier: GPL-2.0 */ /* Tegra vpr routines */ @@ -25,7 +15,7 @@ static bool _configured; -void config_gpu(void) +void tegra_gpu_config(void) { struct mc_ctlr *mc = (struct mc_ctlr *)NV_PA_MC_BASE; @@ -41,23 +31,19 @@ void config_gpu(void) _configured = true; } -bool vpr_configured(void) -{ - return _configured; -} - #if defined(CONFIG_OF_LIBFDT) -int gpu_enable_node(void *blob, const char *gpupath) +int tegra_gpu_enable_node(void *blob, const char *compat) { 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); - } + if (!_configured) + return 0; + + offset = fdt_node_offset_by_compatible(blob, -1, compat); + while (offset != -FDT_ERR_NOTFOUND) { + fdt_status_okay(blob, offset); + offset = fdt_node_offset_by_compatible(blob, offset, compat); } return 0;