1 /*
2  * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <platform_def.h>
8 
9 #include <arch.h>
10 #include <lib/psci/psci.h>
11 
12 #include "plat_private.h"
13 
14 const unsigned char hisi_power_domain_tree_desc[] = {
15 	PLATFORM_CLUSTER_COUNT,
16 	PLATFORM_CORE_COUNT,
17 };
18 
plat_get_power_domain_tree_desc(void)19 const unsigned char *plat_get_power_domain_tree_desc(void)
20 {
21 	return hisi_power_domain_tree_desc;
22 }
23 
plat_core_pos_by_mpidr(u_register_t mpidr)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 
32 	return poplar_calc_core_pos(mpidr);
33 }
34