Debian Codegraph @

plat/socionext/synquacer/sq_topology.c

raw symbols SCIP
1 /*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #include <platform_def.h>
8
9 #include <arch.h>
10
11 #include <sq_common.h>
12
13 unsigned char sq_pd_tree_desc[PLAT_CLUSTER_COUNT + 1];
14
15 int plat_core_pos_by_mpidr(u_register_t mpidr)
16 {
17 unsigned int cluster_id, cpu_id;
18
19 cluster_id = (mpidr >> MPIDR_AFF1_SHIFT) & MPIDR_AFFLVL_MASK;
20 if (cluster_id >= PLAT_CLUSTER_COUNT)
21 return -1;
22
23 cpu_id = (mpidr >> MPIDR_AFF0_SHIFT) & MPIDR_AFFLVL_MASK;
24 if (cpu_id >= PLAT_MAX_CORES_PER_CLUSTER)
25 return -1;
26
27 return sq_calc_core_pos(mpidr);
28 }
29
30 const unsigned char *plat_get_power_domain_tree_desc(void)
31 {
32 int i;
33
34 sq_pd_tree_desc[0] = PLAT_CLUSTER_COUNT;
35
36 for (i = 0; i < PLAT_CLUSTER_COUNT; i++)
37 sq_pd_tree_desc[i + 1] = PLAT_MAX_CORES_PER_CLUSTER;
38
39 return sq_pd_tree_desc;
40 }