2018-09-25 14:14:58 +01:00
|
|
|
/*
|
2021-08-13 14:45:32 +01:00
|
|
|
* Copyright (c) 2018-2021, ARM Limited and Contributors. All rights reserved.
|
2018-09-25 14:14:58 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
2018-12-14 00:18:21 +00:00
|
|
|
|
2018-12-14 08:55:29 +00:00
|
|
|
#include <plat_private.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
#include <plat/common/platform.h>
|
|
|
|
|
2018-09-25 14:14:58 +01:00
|
|
|
int plat_core_pos_by_mpidr(u_register_t mpidr)
|
|
|
|
{
|
2021-08-20 08:27:03 +01:00
|
|
|
if ((mpidr & MPIDR_CLUSTER_MASK) != 0U) {
|
2018-09-25 14:14:58 +01:00
|
|
|
return -1;
|
2021-01-11 03:40:16 +00:00
|
|
|
}
|
2018-09-25 14:14:58 +01:00
|
|
|
|
2021-01-11 03:40:16 +00:00
|
|
|
if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) {
|
2018-09-25 14:14:58 +01:00
|
|
|
return -1;
|
2021-01-11 03:40:16 +00:00
|
|
|
}
|
2018-09-25 14:14:58 +01:00
|
|
|
|
2021-08-13 14:45:32 +01:00
|
|
|
return (int)versal_calc_core_pos(mpidr);
|
2018-09-25 14:14:58 +01:00
|
|
|
}
|