blob: ad18aafc305988298701c3ce2d91df873dda4068 [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
Antonio Nino Diazea3c4de2018-10-17 16:46:41 +01002 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
Soren Brinkmann76fcae32016-03-06 20:16:27 -08003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soren Brinkmann76fcae32016-03-06 20:16:27 -08005 */
6
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00007#include <plat/common/platform.h>
8
Antonio Nino Diazea3c4de2018-10-17 16:46:41 +01009#include "zynqmp_private.h"
Soren Brinkmann76fcae32016-03-06 20:16:27 -080010
11int plat_core_pos_by_mpidr(u_register_t mpidr)
12{
13 if (mpidr & MPIDR_CLUSTER_MASK)
14 return -1;
15
16 if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT)
17 return -1;
18
Antonio Nino Diazea3c4de2018-10-17 16:46:41 +010019 return zynqmp_calc_core_pos(mpidr);
Soren Brinkmann76fcae32016-03-06 20:16:27 -080020}