2 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
7 #include <platform_def.h>
9 #include <lib/psci/psci.h>
10 #include <plat/common/platform.h>
12 /* 1 cluster, all cores into */
13 static const unsigned char stm32mp1_power_domain_tree_desc
[] = {
14 PLATFORM_CLUSTER_COUNT
,
18 /* This function returns the platform topology */
19 const unsigned char *plat_get_power_domain_tree_desc(void)
21 return stm32mp1_power_domain_tree_desc
;
24 /*******************************************************************************
25 * This function implements a part of the critical interface between the psci
26 * generic layer and the platform that allows the former to query the platform
27 * to convert an MPIDR to a unique linear index. An error code (-1) is returned
28 * in case the MPIDR is invalid.
29 ******************************************************************************/
30 int plat_core_pos_by_mpidr(u_register_t mpidr
)
32 unsigned int cluster_id
, cpu_id
;
33 u_register_t mpidr_copy
= mpidr
;
35 mpidr_copy
&= MPIDR_AFFINITY_MASK
;
37 if ((mpidr_copy
& ~(MPIDR_CLUSTER_MASK
| MPIDR_CPU_MASK
)) != 0U) {
41 cluster_id
= (mpidr_copy
>> MPIDR_AFF1_SHIFT
) & MPIDR_AFFLVL_MASK
;
42 cpu_id
= (mpidr_copy
>> MPIDR_AFF0_SHIFT
) & MPIDR_AFFLVL_MASK
;
44 if (cluster_id
>= PLATFORM_CLUSTER_COUNT
) {
49 * Validate cpu_id by checking whether it represents a CPU in one
50 * of the two clusters present on the platform.
52 if (cpu_id
>= PLATFORM_CORE_COUNT
) {