blob: c01ad83afed79f5affff00c9935966b061753d29 [file] [log] [blame]
Chandni Cherukuric6f0a5c2018-11-13 16:17:49 +05301/*
2 * Copyright (c) 2018, 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} sgi575_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 sgi575_pd_tree_desc[] = {
34 /* Number of root nodes */
Shriram Ke10a5082021-08-12 20:09:22 +053035 PLAT_ARM_CLUSTER_COUNT,
Chandni Cherukuric6f0a5c2018-11-13 16:17:49 +053036 /* Number of children for the 1st node */
Shriram Ke10a5082021-08-12 20:09:22 +053037 CSS_SGI_MAX_CPUS_PER_CLUSTER,
Chandni Cherukuric6f0a5c2018-11-13 16:17:49 +053038 /* Number of children for the 2nd node */
Shriram Ke10a5082021-08-12 20:09:22 +053039 CSS_SGI_MAX_CPUS_PER_CLUSTER
Chandni Cherukuric6f0a5c2018-11-13 16:17:49 +053040};
41
42const unsigned char *tftf_plat_get_pwr_domain_tree_desc(void)
43{
44 return sgi575_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 sgi575_cores[core_pos].cluster_id,
55 sgi575_cores[core_pos].cpu_id);
56
57 return mpid;
58}