blob: f7e00440e9354f67d4ed47b66811c86099e7a89d [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <assert.h>
9#include <plat_topology.h>
10#include <platform_def.h>
11#include <stddef.h>
12#include <tftf_lib.h>
13
14static const struct {
15 unsigned cluster_id;
16 unsigned cpu_id;
17} juno_cores[] = {
18 /* Cortex-A53 Cluster: 4 cores*/
19 { 1, 0 },
20 { 1, 1 },
21 { 1, 2 },
22 { 1, 3 },
23 /* Cortex-A57 Cluster: 2 cores */
24 { 0, 0 },
25 { 0, 1 },
26};
27
28/*
29 * The Juno power domain tree descriptor. Juno implements a system
30 * power domain at the level 2. The first entry in the power domain descriptor
31 * specifies the number of power domains at the highest power level. For Juno
32 * this is 1 i.e. the number of system power domain.
33 */
34static const unsigned char juno_power_domain_tree_desc[] = {
35 /* Number of root nodes */
36 PLATFORM_SYSTEM_COUNT,
37 /* Number of children of root node */
38 PLATFORM_CLUSTER_COUNT,
39 /* Number of children for the first cluster */
40 PLATFORM_CLUSTER1_CORE_COUNT,
41 /* Number of children for the second cluster */
42 PLATFORM_CLUSTER0_CORE_COUNT
43};
44
45const unsigned char *tftf_plat_get_pwr_domain_tree_desc(void)
46{
47 return juno_power_domain_tree_desc;
48}
49
50uint64_t tftf_plat_get_mpidr(unsigned int core_pos)
51{
52 assert(core_pos < PLATFORM_CORE_COUNT);
53
54 return make_mpid(juno_cores[core_pos].cluster_id,
55 juno_cores[core_pos].cpu_id);
56}