1 /*
2  * Copyright (c) 2013-2016, 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 /*******************************************************************************
15  * This function returns the RockChip default topology tree information.
16  ******************************************************************************/
plat_get_power_domain_tree_desc(void)17 const unsigned char *plat_get_power_domain_tree_desc(void)
18 {
19 	return rockchip_power_domain_tree_desc;
20 }
21 
plat_core_pos_by_mpidr(u_register_t mpidr)22 int plat_core_pos_by_mpidr(u_register_t mpidr)
23 {
24 	unsigned int cluster_id, cpu_id;
25 
26 	cpu_id = mpidr & MPIDR_AFFLVL_MASK;
27 #ifdef PLAT_RK_MPIDR_CLUSTER_MASK
28 	cluster_id = mpidr & PLAT_RK_MPIDR_CLUSTER_MASK;
29 #else
30 	cluster_id = mpidr & MPIDR_CLUSTER_MASK;
31 #endif
32 
33 	cpu_id += (cluster_id >> PLAT_RK_CLST_TO_CPUID_SHIFT);
34 
35 	if (cpu_id >= PLATFORM_CORE_COUNT)
36 		return -1;
37 
38 	return cpu_id;
39 }
40