]> git.ipfire.org Git - thirdparty/u-boot.git/blame - arch/arm/cpu/armv8/cpu-dt.c
Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
[thirdparty/u-boot.git] / arch / arm / cpu / armv8 / cpu-dt.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
45684ae3
HZ
2/*
3 * Copyright 2016 NXP Semiconductor, Inc.
45684ae3
HZ
4 */
5
d678a59d 6#include <common.h>
90526e9f 7#include <asm/cache.h>
45684ae3 8#include <asm/psci.h>
9a561753 9#include <asm/system.h>
45684ae3 10#include <asm/armv8/sec_firmware.h>
eb217200 11#include <linux/libfdt.h>
45684ae3 12
eb217200 13__weak int psci_update_dt(void *fdt)
45684ae3 14{
45684ae3
HZ
15 /*
16 * If the PSCI in SEC Firmware didn't work, avoid to update the
17 * device node of PSCI. But still return 0 instead of an error
18 * number to support detecting PSCI dynamically and then switching
19 * the SMP boot method between PSCI and spin-table.
20 */
eb217200
MW
21 if (CONFIG_IS_ENABLED(SEC_FIRMWARE_ARMV8_PSCI) &&
22 sec_firmware_support_psci_version() == PSCI_INVALID_VER)
45684ae3 23 return 0;
eb217200 24
45684ae3 25 fdt_psci(fdt);
9a561753 26
27#if defined(CONFIG_ARMV8_PSCI) && !defined(CONFIG_ARMV8_SECURE_BASE)
28 /* secure code lives in RAM, keep it alive */
29 fdt_add_mem_rsv(fdt, (unsigned long)__secure_start,
30 __secure_end - __secure_start);
31#endif
32
45684ae3
HZ
33 return 0;
34}