Nariman Poushin | 0ece80f | 2018-02-26 06:52:04 +0000 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 17 | const unsigned char sgi_pd_tree_desc[] = { |
| 18 | PLAT_ARM_CLUSTER_COUNT, |
Vishwanatha HG | 64f0b6f | 2018-05-08 17:15:37 +0530 | [diff] [blame] | 19 | CSS_SGI_MAX_CPUS_PER_CLUSTER, |
| 20 | CSS_SGI_MAX_CPUS_PER_CLUSTER |
Nariman Poushin | 0ece80f | 2018-02-26 06:52:04 +0000 | [diff] [blame] | 21 | }; |
| 22 | |
| 23 | /* Topology configuration for sgi platform */ |
| 24 | const css_topology_t sgi_topology = { |
| 25 | .power_tree = sgi_pd_tree_desc, |
Vishwanatha HG | 64f0b6f | 2018-05-08 17:15:37 +0530 | [diff] [blame] | 26 | .plat_cluster_core_count = CSS_SGI_MAX_CPUS_PER_CLUSTER |
Nariman Poushin | 0ece80f | 2018-02-26 06:52:04 +0000 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | /******************************************************************************* |
| 30 | * This function returns the topology tree information. |
| 31 | ******************************************************************************/ |
| 32 | const 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 | ******************************************************************************/ |
| 41 | unsigned int plat_arm_get_cluster_core_count(u_register_t mpidr) |
| 42 | { |
| 43 | return sgi_topology.plat_cluster_core_count; |
| 44 | } |