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