blob: 764008e9e133c6dd8aebf3c73ad267c62c8a4e81 [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
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00007#include <platform_def.h>
8
Jorge Ramirez-Ortiza29d9a62017-06-28 10:11:31 +02009#include <arch.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <lib/psci/psci.h>
11
Antonio Nino Diaz6766bb12018-10-26 11:12:31 +010012#include "plat_private.h"
Jorge Ramirez-Ortiza29d9a62017-06-28 10:11:31 +020013
14const unsigned char hisi_power_domain_tree_desc[] = {
15 PLATFORM_CLUSTER_COUNT,
16 PLATFORM_CORE_COUNT,
17};
18
19const unsigned char *plat_get_power_domain_tree_desc(void)
20{
21 return hisi_power_domain_tree_desc;
22}
23
24int plat_core_pos_by_mpidr(u_register_t mpidr)
25{
26 if (mpidr & MPIDR_CLUSTER_MASK)
27 return -1;
28
29 if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT)
30 return -1;
31
Antonio Nino Diaz6766bb12018-10-26 11:12:31 +010032 return poplar_calc_core_pos(mpidr);
Jorge Ramirez-Ortiza29d9a62017-06-28 10:11:31 +020033}