blob: 1d2e027dfd76af571285526f5d3920032d9d102b [file] [log] [blame]
Nariman Poushin0ece80f2018-02-26 06:52:04 +00001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <plat_arm.h>
8#include <sgi_plat_config.h>
9
10/* Topology */
11/*
12 * The power domain tree descriptor. The cluster power domains are
13 * arranged so that when the PSCI generic code creates the power domain tree,
14 * the indices of the CPU power domain nodes it allocates match the linear
15 * indices returned by plat_core_pos_by_mpidr().
16 */
17const unsigned char sgi_pd_tree_desc[] = {
18 PLAT_ARM_CLUSTER_COUNT,
Vishwanatha HG64f0b6f2018-05-08 17:15:37 +053019 CSS_SGI_MAX_CPUS_PER_CLUSTER,
20 CSS_SGI_MAX_CPUS_PER_CLUSTER
Nariman Poushin0ece80f2018-02-26 06:52:04 +000021};
22
23/* Topology configuration for sgi platform */
24const css_topology_t sgi_topology = {
25 .power_tree = sgi_pd_tree_desc,
Vishwanatha HG64f0b6f2018-05-08 17:15:37 +053026 .plat_cluster_core_count = CSS_SGI_MAX_CPUS_PER_CLUSTER
Nariman Poushin0ece80f2018-02-26 06:52:04 +000027};
28
29/*******************************************************************************
30 * This function returns the topology tree information.
31 ******************************************************************************/
32const unsigned char *plat_get_power_domain_tree_desc(void)
33{
34 return sgi_topology.power_tree;
35}
36
37/*******************************************************************************
38 * This function returns the core count within the cluster corresponding to
39 * `mpidr`.
40 ******************************************************************************/
41unsigned int plat_arm_get_cluster_core_count(u_register_t mpidr)
42{
43 return sgi_topology.plat_cluster_core_count;
44}