blob: d9445e0c5629fa351d2888ffc1660fa77ef714e0 [file] [log] [blame]
Manish Pandey52990ae2018-11-28 11:20:37 +00001/*
2 * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
3 *
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 */
11static unsigned char corstone700_power_domain_tree_desc
12 [PLAT_ARM_CLUSTER_COUNT + 2];
13/*******************************************************************************
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}