aboutsummaryrefslogtreecommitdiffstats
path: root/lib/psci/psci_setup.c
diff options
context:
space:
mode:
authorPankaj Gupta <pankaj.gupta@nxp.com>2019-10-15 15:44:45 +0530
committerPankaj Gupta <pankaj.gupta@nxp.com>2019-11-26 16:45:41 +0530
commitab4df50c23b92cd344fe1e36cdd0e6e9c3d9aff6 (patch)
tree1b3d0e27b1427c81df4d25e4e159b9df88545082 /lib/psci/psci_setup.c
parentd537ee795c1390601428d6b5b3499d05b62ad271 (diff)
downloadplatform_external_arm-trusted-firmware-ab4df50c23b92cd344fe1e36cdd0e6e9c3d9aff6.tar.gz
platform_external_arm-trusted-firmware-ab4df50c23b92cd344fe1e36cdd0e6e9c3d9aff6.tar.bz2
platform_external_arm-trusted-firmware-ab4df50c23b92cd344fe1e36cdd0e6e9c3d9aff6.zip
adding support to enable different personality of the same soc.
Same SoC has different personality by creating different number of: - cores - clusters. As a result, the platform specific power domain tree will be created after identify the personality of the SoC. Hence, platform specific power domain tree may not be same for all the personality of the soc. Thus, psci library code will deduce the 'plat_core_count', while populating the power domain tree topology and return the number of cores. PLATFORM_CORE_COUNT will still be valid for a SoC, such that psci_plat_core_count <= PLATFORM_CORE_COUNT. PLATFORM_CORE_COUNT will continued to be defined by platform to create the data structures. Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com> Change-Id: I1f5c47647631cae2dcdad540d64cf09757db7185
Diffstat (limited to 'lib/psci/psci_setup.c')
-rw-r--r--lib/psci/psci_setup.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/psci/psci_setup.c b/lib/psci/psci_setup.c
index 853f9157c..becb54709 100644
--- a/lib/psci/psci_setup.c
+++ b/lib/psci/psci_setup.c
@@ -84,11 +84,12 @@ static void __init psci_init_pwr_domain_node(unsigned char node_idx,
*******************************************************************************/
static void __init psci_update_pwrlvl_limits(void)
{
- int j, cpu_idx;
+ unsigned int cpu_idx;
+ int j;
unsigned int nodes_idx[PLAT_MAX_PWR_LVL] = {0};
unsigned int temp_index[PLAT_MAX_PWR_LVL];
- for (cpu_idx = 0; cpu_idx < PLATFORM_CORE_COUNT; cpu_idx++) {
+ for (cpu_idx = 0; cpu_idx < psci_plat_core_count; cpu_idx++) {
psci_get_parent_pwr_domain_nodes(cpu_idx,
(unsigned int)PLAT_MAX_PWR_LVL,
temp_index);
@@ -109,7 +110,8 @@ static void __init psci_update_pwrlvl_limits(void)
* informs the number of root power domains. The parent nodes of the root nodes
* will point to an invalid entry(-1).
******************************************************************************/
-static void __init populate_power_domain_tree(const unsigned char *topology)
+static unsigned int __init populate_power_domain_tree(const unsigned char
+ *topology)
{
unsigned int i, j = 0U, num_nodes_at_lvl = 1U, num_nodes_at_next_lvl;
unsigned int node_index = 0U, num_children;
@@ -160,7 +162,8 @@ static void __init populate_power_domain_tree(const unsigned char *topology)
}
/* Validate the sanity of array exported by the platform */
- assert((int) j == PLATFORM_CORE_COUNT);
+ assert(j <= (unsigned int)PLATFORM_CORE_COUNT);
+ return j;
}
/*******************************************************************************
@@ -199,7 +202,7 @@ int __init psci_setup(const psci_lib_args_t *lib_args)
topology_tree = plat_get_power_domain_tree_desc();
/* Populate the power domain arrays using the platform topology map */
- populate_power_domain_tree(topology_tree);
+ psci_plat_core_count = populate_power_domain_tree(topology_tree);
/* Update the CPU limits for each node in psci_non_cpu_pd_nodes */
psci_update_pwrlvl_limits();