blob: 213659115390d460ded1ef7da677551f0f44bd22 [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,
19 CSS_SGI_MAX_CORES_PER_CLUSTER,
20 CSS_SGI_MAX_CORES_PER_CLUSTER
21};
22
23/* Topology configuration for sgi platform */
24const css_topology_t sgi_topology = {
25 .power_tree = sgi_pd_tree_desc,
26 .plat_cluster_core_count = CSS_SGI_MAX_CORES_PER_CLUSTER
27};
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}