blob: a080a76a954312d2a5c8768c6635702c0ac8530b [file] [log] [blame]
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +05301/*
Tejas Patel69409962018-12-14 00:55:29 -08002 * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +05303 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00006
Tejas Patel69409962018-12-14 00:55:29 -08007#include <plat_private.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008#include <plat/common/platform.h>
9
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +053010int 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
18 return versal_calc_core_pos(mpidr);
19}