Jorge Ramirez-Ortiz | a29d9a6 | 2017-06-28 10:11:31 +0200 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | 6766bb1 | 2018-10-26 11:12:31 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. |
Jorge Ramirez-Ortiz | a29d9a6 | 2017-06-28 10:11:31 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 7 | #include <platform_def.h> |
| 8 | |
Jorge Ramirez-Ortiz | a29d9a6 | 2017-06-28 10:11:31 +0200 | [diff] [blame] | 9 | #include <arch.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <lib/psci/psci.h> |
| 11 | |
Antonio Nino Diaz | 6766bb1 | 2018-10-26 11:12:31 +0100 | [diff] [blame] | 12 | #include "plat_private.h" |
Jorge Ramirez-Ortiz | a29d9a6 | 2017-06-28 10:11:31 +0200 | [diff] [blame] | 13 | |
| 14 | const unsigned char hisi_power_domain_tree_desc[] = { |
| 15 | PLATFORM_CLUSTER_COUNT, |
| 16 | PLATFORM_CORE_COUNT, |
| 17 | }; |
| 18 | |
| 19 | const unsigned char *plat_get_power_domain_tree_desc(void) |
| 20 | { |
| 21 | return hisi_power_domain_tree_desc; |
| 22 | } |
| 23 | |
| 24 | int plat_core_pos_by_mpidr(u_register_t mpidr) |
| 25 | { |
| 26 | if (mpidr & MPIDR_CLUSTER_MASK) |
| 27 | return -1; |
| 28 | |
| 29 | if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) |
| 30 | return -1; |
| 31 | |
Antonio Nino Diaz | 6766bb1 | 2018-10-26 11:12:31 +0100 | [diff] [blame] | 32 | return poplar_calc_core_pos(mpidr); |
Jorge Ramirez-Ortiz | a29d9a6 | 2017-06-28 10:11:31 +0200 | [diff] [blame] | 33 | } |