2016-01-15 09:17:32 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.
|
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2016-01-15 09:17:32 +00:00
|
|
|
*/
|
|
|
|
|
2018-12-14 00:18:21 +00:00
|
|
|
#include <platform_def.h>
|
|
|
|
|
2016-01-15 09:17:32 +00:00
|
|
|
#include <arch.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
#include <lib/psci/psci.h>
|
|
|
|
|
2016-01-15 09:17:32 +00:00
|
|
|
#include <plat_private.h>
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* This function returns the RockChip default topology tree information.
|
|
|
|
******************************************************************************/
|
|
|
|
const unsigned char *plat_get_power_domain_tree_desc(void)
|
|
|
|
{
|
|
|
|
return rockchip_power_domain_tree_desc;
|
|
|
|
}
|
|
|
|
|
|
|
|
int plat_core_pos_by_mpidr(u_register_t mpidr)
|
|
|
|
{
|
|
|
|
unsigned int cluster_id, cpu_id;
|
|
|
|
|
2016-07-16 04:16:51 +01:00
|
|
|
cpu_id = mpidr & MPIDR_AFFLVL_MASK;
|
|
|
|
cluster_id = mpidr & MPIDR_CLUSTER_MASK;
|
2016-01-15 09:17:32 +00:00
|
|
|
|
2016-07-16 04:16:51 +01:00
|
|
|
cpu_id += (cluster_id >> PLAT_RK_CLST_TO_CPUID_SHIFT);
|
|
|
|
|
|
|
|
if (cpu_id >= PLATFORM_CORE_COUNT)
|
2016-01-15 09:17:32 +00:00
|
|
|
return -1;
|
|
|
|
|
2016-07-16 04:16:51 +01:00
|
|
|
return cpu_id;
|
2016-01-15 09:17:32 +00:00
|
|
|
}
|