Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 1 | /* |
Abhyuday Godhasara | 096f5cc | 2021-08-13 06:45:32 -0700 | [diff] [blame] | 2 | * Copyright (c) 2018-2021, ARM Limited and Contributors. All rights reserved. |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 6 | |
Tejas Patel | 6940996 | 2018-12-14 00:55:29 -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 | |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 10 | int32_t plat_core_pos_by_mpidr(u_register_t mpidr) |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 11 | { |
Abhyuday Godhasara | bacbdee | 2021-08-20 00:27:03 -0700 | [diff] [blame] | 12 | if ((mpidr & MPIDR_CLUSTER_MASK) != 0U) { |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 13 | return -1; |
Venkatesh Yadav Abbarapu | 5f115db | 2021-01-10 20:40:16 -0700 | [diff] [blame] | 14 | } |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 15 | |
Venkatesh Yadav Abbarapu | 5f115db | 2021-01-10 20:40:16 -0700 | [diff] [blame] | 16 | if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) { |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 17 | return -1; |
Venkatesh Yadav Abbarapu | 5f115db | 2021-01-10 20:40:16 -0700 | [diff] [blame] | 18 | } |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 19 | |
Venkatesh Yadav Abbarapu | bde8759 | 2022-05-24 11:11:12 +0530 | [diff] [blame] | 20 | return (int32_t)versal_calc_core_pos(mpidr); |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 21 | } |