blob: 3f6357bd1a96e5e55eb3588f0e071ef3cc171334 [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}
Chandni Cherukurid61a7052018-08-01 15:58:48 +053045
46/*******************************************************************************
47 * The array mapping platform core position (implemented by plat_my_core_pos())
48 * to the SCMI power domain ID implemented by SCP.
49 ******************************************************************************/
50const uint32_t plat_css_core_pos_to_scmi_dmn_id_map[32] = {
51 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \
52 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
53};