Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame^] | 6 | |
| 7 | #include <plat/common/platform.h> |
| 8 | |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 9 | #include "versal_private.h" |
| 10 | |
| 11 | int plat_core_pos_by_mpidr(u_register_t mpidr) |
| 12 | { |
| 13 | if (mpidr & MPIDR_CLUSTER_MASK) |
| 14 | return -1; |
| 15 | |
| 16 | if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) |
| 17 | return -1; |
| 18 | |
| 19 | return versal_calc_core_pos(mpidr); |
| 20 | } |