blob: 49d063cf5746c2086bb04628fec02e00905b3c9c [file] [log] [blame]
Tony Xief6118cc2016-01-15 17:17:32 +08001/*
2 * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Tony Xief6118cc2016-01-15 17:17:32 +08005 */
6
7#include <arch.h>
Tony Xief6118cc2016-01-15 17:17:32 +08008#include <plat_private.h>
Isla Mitchelle3631462017-07-14 10:46:32 +01009#include <platform_def.h>
Tony Xief6118cc2016-01-15 17:17:32 +080010#include <psci.h>
11
12/*******************************************************************************
13 * This function returns the RockChip default topology tree information.
14 ******************************************************************************/
15const unsigned char *plat_get_power_domain_tree_desc(void)
16{
17 return rockchip_power_domain_tree_desc;
18}
19
20int plat_core_pos_by_mpidr(u_register_t mpidr)
21{
22 unsigned int cluster_id, cpu_id;
23
Tony Xie42e113e2016-07-16 11:16:51 +080024 cpu_id = mpidr & MPIDR_AFFLVL_MASK;
25 cluster_id = mpidr & MPIDR_CLUSTER_MASK;
Tony Xief6118cc2016-01-15 17:17:32 +080026
Tony Xie42e113e2016-07-16 11:16:51 +080027 cpu_id += (cluster_id >> PLAT_RK_CLST_TO_CPUID_SHIFT);
28
29 if (cpu_id >= PLATFORM_CORE_COUNT)
Tony Xief6118cc2016-01-15 17:17:32 +080030 return -1;
31
Tony Xie42e113e2016-07-16 11:16:51 +080032 return cpu_id;
Tony Xief6118cc2016-01-15 17:17:32 +080033}