blob: 5521de455c7d6066dd54cd07709300c19cfc89a2 [file] [log] [blame]
Chandni Cherukuri33f17742019-01-07 14:17:52 +05301/*
2 * Copyright (c) 2019, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <assert.h>
8#include <plat_topology.h>
9#include <tftf_lib.h>
10
11static const struct {
12 unsigned int cluster_id;
13 unsigned int cpu_id;
14} plat_cores[] = {
15 /* Cluster0: 4 cores*/
16 { 0, 0 },
17 { 0, 1 },
18 { 0, 2 },
19 { 0, 3 },
20 /* Cluster1: 4 cores */
21 { 1, 0 },
22 { 1, 1 },
23 { 1, 2 },
24 { 1, 3 },
25};
26
27/*
28 * The power domain tree descriptor. The cluster power domains are
29 * arranged so that when the PSCI generic code creates the power domain tree,
30 * the indices of the CPU power domain nodes it allocates match the linear
31 * indices returned by plat_core_pos_by_mpidr().
32 */
33const unsigned char plat_pd_tree_desc[] = {
34 /* Number of root nodes */
35 SGI_CLUSTER_COUNT,
36 /* Number of children for the 1st node */
37 SGI_MAX_CPUS_PER_CLUSTER,
38 /* Number of children for the 2nd node */
39 SGI_MAX_CPUS_PER_CLUSTER
40};
41
42const unsigned char *tftf_plat_get_pwr_domain_tree_desc(void)
43{
44 return plat_pd_tree_desc;
45}
46
47uint64_t tftf_plat_get_mpidr(unsigned int core_pos)
48{
49 unsigned int mpid;
50
51 assert(core_pos < PLATFORM_CORE_COUNT);
52
53 mpid = make_mpid(
54 plat_cores[core_pos].cluster_id,
55 plat_cores[core_pos].cpu_id);
56
57 return mpid;
58}