blob: 904f5ab3a5f4f292e0a3ef0165edfaea15a14fa9 [file] [log] [blame]
Manish Pandey52990ae2018-11-28 11:20:37 +00001/*
Avinash Mehtad46b58c2019-07-11 16:23:43 +01002 * Copyright (c) 2019-2020, ARM Limited and Contributors. All rights reserved.
Manish Pandey52990ae2018-11-28 11:20:37 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <plat/arm/common/plat_arm.h>
8#include <plat/common/platform.h>
9
10/* The Corstone700 power domain tree descriptor */
Avinash Mehtad46b58c2019-07-11 16:23:43 +010011static unsigned char corstone700_power_domain_tree_desc[PLAT_ARM_CLUSTER_COUNT
12 + 2];
Manish Pandey52990ae2018-11-28 11:20:37 +000013/*******************************************************************************
14 * This function dynamically constructs the topology according to
15 * CLUSTER_COUNT and returns it.
16 ******************************************************************************/
17const unsigned char *plat_get_power_domain_tree_desc(void)
18{
19 int i;
20
21 /*
22 * The highest level is the system level. The next level is constituted
23 * by clusters and then cores in clusters.
24 */
25 corstone700_power_domain_tree_desc[0] = 1;
26 corstone700_power_domain_tree_desc[1] = PLAT_ARM_CLUSTER_COUNT;
27
28 for (i = 0; i < PLAT_ARM_CLUSTER_COUNT; i++)
29 corstone700_power_domain_tree_desc[i + 2] = PLATFORM_CORE_COUNT;
30
31 return corstone700_power_domain_tree_desc;
32}
33
34/******************************************************************************
35 * This function implements a part of the critical interface between the PSCI
36 * generic layer and the platform that allows the former to query the platform
37 * to convert an MPIDR to a unique linear index. An error code (-1) is
38 * returned in case the MPIDR is invalid.
39 *****************************************************************************/
40int plat_core_pos_by_mpidr(u_register_t mpidr)
41{
42 return plat_arm_calc_core_pos(mpidr);
43}