Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | ea3c4de | 2018-10-17 16:46:41 +0100 | [diff] [blame] | 2 | * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 5 | */ |
| 6 | |
Jolly Shah | 0bfd700 | 2019-01-08 11:10:47 -0800 | [diff] [blame] | 7 | #include <plat_private.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 8 | #include <plat/common/platform.h> |
| 9 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 10 | int 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 Diaz | ea3c4de | 2018-10-17 16:46:41 +0100 | [diff] [blame] | 18 | return zynqmp_calc_core_pos(mpidr); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 19 | } |