plat_topology.c 849 Bytes
Newer Older
Tony Xie's avatar
Tony Xie committed
1
2
3
/*
 * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
Tony Xie's avatar
Tony Xie committed
5
6
7
8
 */

#include <arch.h>
#include <plat_private.h>
9
#include <platform_def.h>
Tony Xie's avatar
Tony Xie committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <psci.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;

24
25
	cpu_id = mpidr & MPIDR_AFFLVL_MASK;
	cluster_id = mpidr & MPIDR_CLUSTER_MASK;
Tony Xie's avatar
Tony Xie committed
26

27
28
29
	cpu_id += (cluster_id >> PLAT_RK_CLST_TO_CPUID_SHIFT);

	if (cpu_id >= PLATFORM_CORE_COUNT)
Tony Xie's avatar
Tony Xie committed
30
31
		return -1;

32
	return cpu_id;
Tony Xie's avatar
Tony Xie committed
33
}