Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
Michal Simek | 2a47faa | 2023-04-14 08:43:51 +0200 | [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 | |||||
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 7 | #include <plat/common/platform.h> |
8 | |||||
Prasad Kummari | 536e110 | 2023-06-22 10:50:02 +0530 | [diff] [blame] | 9 | #include <plat_private.h> |
10 | |||||
Venkatesh Yadav Abbarapu | e7c4538 | 2022-05-19 14:49:49 +0530 | [diff] [blame] | 11 | int32_t plat_core_pos_by_mpidr(u_register_t mpidr) |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 12 | { |
Venkatesh Yadav Abbarapu | 5f115db | 2021-01-10 20:40:16 -0700 | [diff] [blame] | 13 | if (mpidr & MPIDR_CLUSTER_MASK) { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 14 | return -1; |
Venkatesh Yadav Abbarapu | 5f115db | 2021-01-10 20:40:16 -0700 | [diff] [blame] | 15 | } |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 16 | |
Venkatesh Yadav Abbarapu | 5f115db | 2021-01-10 20:40:16 -0700 | [diff] [blame] | 17 | if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 18 | return -1; |
Venkatesh Yadav Abbarapu | 5f115db | 2021-01-10 20:40:16 -0700 | [diff] [blame] | 19 | } |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 20 | |
Antonio Nino Diaz | ea3c4de | 2018-10-17 16:46:41 +0100 | [diff] [blame] | 21 | return zynqmp_calc_core_pos(mpidr); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 22 | } |