blob: 58a52a3bf16cac6efc93754cd9a104585a9ea175 [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{
Venkatesh Yadav Abbarapu5f115db2021-01-10 20:40:16 -070012 if (mpidr & MPIDR_CLUSTER_MASK) {
Soren Brinkmann76fcae32016-03-06 20:16:27 -080013 return -1;
Venkatesh Yadav Abbarapu5f115db2021-01-10 20:40:16 -070014 }
Soren Brinkmann76fcae32016-03-06 20:16:27 -080015
Venkatesh Yadav Abbarapu5f115db2021-01-10 20:40:16 -070016 if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) {
Soren Brinkmann76fcae32016-03-06 20:16:27 -080017 return -1;
Venkatesh Yadav Abbarapu5f115db2021-01-10 20:40:16 -070018 }
Soren Brinkmann76fcae32016-03-06 20:16:27 -080019
Antonio Nino Diazea3c4de2018-10-17 16:46:41 +010020 return zynqmp_calc_core_pos(mpidr);
Soren Brinkmann76fcae32016-03-06 20:16:27 -080021}