blob: cbfa935c2727dda55a89c6cc109786fcfd6c8133 [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
2 * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soren Brinkmann76fcae32016-03-06 20:16:27 -08005 */
6
7#include <plat_arm.h>
8
9int plat_core_pos_by_mpidr(u_register_t mpidr)
10{
11 if (mpidr & MPIDR_CLUSTER_MASK)
12 return -1;
13
14 if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT)
15 return -1;
16
17 return plat_arm_calc_core_pos(mpidr);
18}