diff options
author | Alistair Delva <adelva@google.com> | 2021-02-16 21:01:22 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-16 21:01:22 +0000 |
commit | efb2826bb8160e2d8e0fcec85133a7468484f9fd (patch) | |
tree | 37a21c69306801ee7cdda5167a30896c8740155b /lib/psci/psci_setup.c | |
parent | b00a71fc312c9781fa6f404dccfb55b062b2ccac (diff) | |
parent | faa476c0caaa598afa5a6109d17102db5fe35ec6 (diff) | |
download | platform_external_arm-trusted-firmware-master.tar.gz platform_external_arm-trusted-firmware-master.tar.bz2 platform_external_arm-trusted-firmware-master.zip |
Merge branch 'aosp/upstream-master' into HEAD am: faa476c0caHEADandroid-s-beta-5android-s-beta-4android-s-beta-3android-s-beta-2android-s-beta-1mastermain-cg-testing-releaseandroid-s-beta-5android-s-beta-4
Original change: https://android-review.googlesource.com/c/platform/external/arm-trusted-firmware/+/1589611
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I3a25534ceed4f8e188510641080d8b8ed49b8f62
Diffstat (limited to 'lib/psci/psci_setup.c')
-rw-r--r-- | lib/psci/psci_setup.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/psci/psci_setup.c b/lib/psci/psci_setup.c index d1ec99808..9c37d63f2 100644 --- a/lib/psci/psci_setup.c +++ b/lib/psci/psci_setup.c @@ -17,6 +17,12 @@ #include "psci_private.h" +/* + * Check that PLATFORM_CORE_COUNT fits into the number of cores + * that can be represented by PSCI_MAX_CPUS_INDEX. + */ +CASSERT(PLATFORM_CORE_COUNT <= (PSCI_MAX_CPUS_INDEX + 1U), assert_psci_cores_overflow); + /******************************************************************************* * Per cpu non-secure contexts used to program the architectural state prior * return to the normal world. @@ -34,11 +40,13 @@ unsigned int psci_caps; * Function which initializes the 'psci_non_cpu_pd_nodes' or the * 'psci_cpu_pd_nodes' corresponding to the power level. ******************************************************************************/ -static void __init psci_init_pwr_domain_node(unsigned char node_idx, +static void __init psci_init_pwr_domain_node(uint16_t node_idx, unsigned int parent_idx, unsigned char level) { if (level > PSCI_CPU_PWR_LVL) { + assert(node_idx < PSCI_NUM_NON_CPU_PWR_DOMAINS); + psci_non_cpu_pd_nodes[node_idx].level = level; psci_lock_init(psci_non_cpu_pd_nodes, node_idx); psci_non_cpu_pd_nodes[node_idx].parent_node = parent_idx; @@ -47,6 +55,8 @@ static void __init psci_init_pwr_domain_node(unsigned char node_idx, } else { psci_cpu_data_t *svc_cpu_data; + assert(node_idx < PLATFORM_CORE_COUNT); + psci_cpu_pd_nodes[node_idx].parent_node = parent_idx; /* Initialize with an invalid mpidr */ @@ -144,7 +154,7 @@ static unsigned int __init populate_power_domain_tree(const unsigned char for (j = node_index; j < (node_index + num_children); j++) - psci_init_pwr_domain_node((unsigned char)j, + psci_init_pwr_domain_node((uint16_t)j, parent_node_index - 1U, (unsigned char)level); |