blob: 906ce1b7feb3a73ad8c5f3b316fab9b18027bfd7 [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
Jolly Shah0bfd7002019-01-08 11:10:47 -08007#include <plat_private.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008#include <plat/common/platform.h>
9
Soren Brinkmann76fcae32016-03-06 20:16:27 -080010int plat_core_pos_by_mpidr(u_register_t mpidr)
11{
12 if (mpidr & MPIDR_CLUSTER_MASK)
13 return -1;
14
15 if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT)
16 return -1;
17
Antonio Nino Diazea3c4de2018-10-17 16:46:41 +010018 return zynqmp_calc_core_pos(mpidr);
Soren Brinkmann76fcae32016-03-06 20:16:27 -080019}