Hou Zhiqiang | dae0277 | 2016-06-28 20:18:16 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 NXP Semiconductor, Inc. |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <asm/psci.h> |
macro.wave.z@gmail.com | 05725ed | 2016-12-08 11:58:25 +0800 | [diff] [blame] | 9 | #include <asm/system.h> |
Hou Zhiqiang | dae0277 | 2016-06-28 20:18:16 +0800 | [diff] [blame] | 10 | #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT |
| 11 | #include <asm/armv8/sec_firmware.h> |
| 12 | #endif |
| 13 | |
| 14 | int psci_update_dt(void *fdt) |
| 15 | { |
| 16 | #ifdef CONFIG_MP |
Hou Zhiqiang | 6be115d | 2017-01-16 17:31:48 +0800 | [diff] [blame] | 17 | #if defined(CONFIG_ARMV8_PSCI) || defined(CONFIG_SEC_FIRMWARE_ARMV8_PSCI) |
macro.wave.z@gmail.com | 05725ed | 2016-12-08 11:58:25 +0800 | [diff] [blame] | 18 | |
Hou Zhiqiang | dae0277 | 2016-06-28 20:18:16 +0800 | [diff] [blame] | 19 | #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT |
| 20 | /* |
| 21 | * If the PSCI in SEC Firmware didn't work, avoid to update the |
| 22 | * device node of PSCI. But still return 0 instead of an error |
| 23 | * number to support detecting PSCI dynamically and then switching |
| 24 | * the SMP boot method between PSCI and spin-table. |
| 25 | */ |
| 26 | if (sec_firmware_support_psci_version() == 0xffffffff) |
| 27 | return 0; |
| 28 | #endif |
| 29 | fdt_psci(fdt); |
macro.wave.z@gmail.com | 05725ed | 2016-12-08 11:58:25 +0800 | [diff] [blame] | 30 | |
| 31 | #if defined(CONFIG_ARMV8_PSCI) && !defined(CONFIG_ARMV8_SECURE_BASE) |
| 32 | /* secure code lives in RAM, keep it alive */ |
| 33 | fdt_add_mem_rsv(fdt, (unsigned long)__secure_start, |
| 34 | __secure_end - __secure_start); |
| 35 | #endif |
| 36 | |
Hou Zhiqiang | dae0277 | 2016-06-28 20:18:16 +0800 | [diff] [blame] | 37 | #endif |
| 38 | #endif |
| 39 | return 0; |
| 40 | } |