mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-11 13:56:30 +00:00
d9b6f58efd
In current Linux kernel Tegra DT files, 64-bit addresses are represented in unit addresses as a pair of comma-separated 32-bit values. Apparently this is no longer the correct representation for simple busses, and the unit address should be represented as a single 64-bit value. If this is changed in the DTs, arm/arm/mach-tegra/board2.c:ft_system_setup() will no longer be able to find and enable the GPU node, since it looks up the node by name. Fix that function to enable nodes based on their compatible value rather than their node name. This will work no matter what the node name is, i.e for DTs both before and after any rename operation. Cc: Thierry Reding <treding@nvidia.com> Cc: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
52 lines
1 KiB
C
52 lines
1 KiB
C
/*
|
|
* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0
|
|
*/
|
|
|
|
/* Tegra vpr routines */
|
|
|
|
#include <common.h>
|
|
#include <asm/io.h>
|
|
#include <asm/arch/tegra.h>
|
|
#include <asm/arch/mc.h>
|
|
|
|
#include <fdt_support.h>
|
|
|
|
static bool _configured;
|
|
|
|
void tegra_gpu_config(void)
|
|
{
|
|
struct mc_ctlr *mc = (struct mc_ctlr *)NV_PA_MC_BASE;
|
|
|
|
/* Turn VPR off */
|
|
writel(0, &mc->mc_video_protect_size_mb);
|
|
writel(TEGRA_MC_VIDEO_PROTECT_REG_WRITE_ACCESS_DISABLED,
|
|
&mc->mc_video_protect_reg_ctrl);
|
|
/* read back to ensure the write went through */
|
|
readl(&mc->mc_video_protect_reg_ctrl);
|
|
|
|
debug("configured VPR\n");
|
|
|
|
_configured = true;
|
|
}
|
|
|
|
#if defined(CONFIG_OF_LIBFDT)
|
|
|
|
int tegra_gpu_enable_node(void *blob, const char *compat)
|
|
{
|
|
int offset;
|
|
|
|
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;
|
|
}
|
|
|
|
#endif
|