blob: a31e4103ecf6fa3759ffbfaf05c12cd9f5d38335 [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
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00007#include <platform_def.h>
8
Tony Xief6118cc2016-01-15 17:17:32 +08009#include <arch.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <lib/psci/psci.h>
11
Tony Xief6118cc2016-01-15 17:17:32 +080012#include <plat_private.h>
Tony Xief6118cc2016-01-15 17:17:32 +080013
14/*******************************************************************************
15 * This function returns the RockChip default topology tree information.
16 ******************************************************************************/
17const unsigned char *plat_get_power_domain_tree_desc(void)
18{
19 return rockchip_power_domain_tree_desc;
20}
21
22int plat_core_pos_by_mpidr(u_register_t mpidr)
23{
24 unsigned int cluster_id, cpu_id;
25
Tony Xie42e113e2016-07-16 11:16:51 +080026 cpu_id = mpidr & MPIDR_AFFLVL_MASK;
27 cluster_id = mpidr & MPIDR_CLUSTER_MASK;
Tony Xief6118cc2016-01-15 17:17:32 +080028
Tony Xie42e113e2016-07-16 11:16:51 +080029 cpu_id += (cluster_id >> PLAT_RK_CLST_TO_CPUID_SHIFT);
30
31 if (cpu_id >= PLATFORM_CORE_COUNT)
Tony Xief6118cc2016-01-15 17:17:32 +080032 return -1;
33
Tony Xie42e113e2016-07-16 11:16:51 +080034 return cpu_id;
Tony Xief6118cc2016-01-15 17:17:32 +080035}