1 /*
2  * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
3  * Copyright (c) 2018,2020 The Linux Foundation. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include <arch.h>
9 
10 #include <platform_def.h>
11 #include <qti_plat.h>
12 
13 /* The QTI power domain tree descriptor */
14 const unsigned char qti_power_domain_tree_desc[] = {
15 	/* One domain to represent PDC */
16 	PLAT_PDC_COUNT,
17 	/* One domain to represent RSC */
18 	PLAT_RSC_COUNT,
19 	/* There is one top-level FCM cluster */
20 	PLAT_CLUSTER_COUNT,
21 	/* No. of cores in the FCM cluster */
22 	PLAT_CLUSTER0_CORE_COUNT
23 };
24 
25 /*******************************************************************************
26  * This function returns the ARM default topology tree information.
27  ******************************************************************************/
plat_get_power_domain_tree_desc(void)28 const unsigned char *plat_get_power_domain_tree_desc(void)
29 {
30 	return qti_power_domain_tree_desc;
31 }
32 
33 /** Function: plat_core_pos_by_mpidr
34  * This function implements a part of the critical interface between the psci
35  * generic layer and the platform that allows the former to query the platform
36  * to convert an MPIDR to a unique linear index. An error code (-1) is returned
37  * in case the MPIDR is invalid.
38  */
plat_core_pos_by_mpidr(u_register_t mpidr)39 int plat_core_pos_by_mpidr(u_register_t mpidr)
40 {
41 	int core_linear_index = plat_qti_core_pos_by_mpidr(mpidr);
42 
43 	if (core_linear_index < PLATFORM_CORE_COUNT) {
44 		return core_linear_index;
45 	} else {
46 		return -1;
47 	}
48 }
49