blob: bb53c6b1fa59d0c71227920f7a367f149130a047 [file] [log] [blame]
Jorge Ramirez-Ortiza29d9a62017-06-28 10:11:31 +02001/*
Antonio Nino Diaz6766bb12018-10-26 11:12:31 +01002 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
Jorge Ramirez-Ortiza29d9a62017-06-28 10:11:31 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
Jorge Ramirez-Ortiza29d9a62017-06-28 10:11:31 +02008#include <psci.h>
9#include "platform_def.h"
Antonio Nino Diaz6766bb12018-10-26 11:12:31 +010010#include "plat_private.h"
Jorge Ramirez-Ortiza29d9a62017-06-28 10:11:31 +020011
12const unsigned char hisi_power_domain_tree_desc[] = {
13 PLATFORM_CLUSTER_COUNT,
14 PLATFORM_CORE_COUNT,
15};
16
17const unsigned char *plat_get_power_domain_tree_desc(void)
18{
19 return hisi_power_domain_tree_desc;
20}
21
22int plat_core_pos_by_mpidr(u_register_t mpidr)
23{
24 if (mpidr & MPIDR_CLUSTER_MASK)
25 return -1;
26
27 if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT)
28 return -1;
29
Antonio Nino Diaz6766bb12018-10-26 11:12:31 +010030 return poplar_calc_core_pos(mpidr);
Jorge Ramirez-Ortiza29d9a62017-06-28 10:11:31 +020031}