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

Leon Chen's avatar
Leon Chen committed
7
#include <platform_def.h>
8
9
10

#include <arch.h>
#include <lib/psci/psci.h>
11

Leon Chen's avatar
Leon Chen committed
12
13
14
15
16
unsigned int plat_get_aff_count(unsigned int aff_lvl, unsigned long mpidr)
{
	/* Report 1 (absent) instance at levels higher that the cluster level */
	if (aff_lvl > MPIDR_AFFLVL1)
		return PLATFORM_SYSTEM_COUNT;
17

Leon Chen's avatar
Leon Chen committed
18
19
	if (aff_lvl == MPIDR_AFFLVL1)
		return PLATFORM_CLUSTER_COUNT;
20

Leon Chen's avatar
Leon Chen committed
21
22
23
	return mpidr & 0x100 ? PLATFORM_CLUSTER1_CORE_COUNT :
			       PLATFORM_CLUSTER0_CORE_COUNT;
}
24

Leon Chen's avatar
Leon Chen committed
25
26
27
28
unsigned int plat_get_aff_state(unsigned int aff_lvl, unsigned long mpidr)
{
	return aff_lvl <= MPIDR_AFFLVL2 ? PSCI_AFF_PRESENT : PSCI_AFF_ABSENT;
}
29

Leon Chen's avatar
Leon Chen committed
30
31
32
33
34
int mt_setup_topology(void)
{
	/* [TODO] Make topology configurable via SCC */
	return 0;
}