blob: 2441630bd5f49e2e62556fa6e2f8d8278f3b5426 [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 Diazea3c4de2018-10-17 16:46:41 +01007#include <platform.h>
8#include "zynqmp_private.h"
Soren Brinkmann76fcae32016-03-06 20:16:27 -08009
10int 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}