plat_versal.c 427 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <plat/common/platform.h>
  7. #include <plat_private.h>
  8. int32_t plat_core_pos_by_mpidr(u_register_t mpidr)
  9. {
  10. if ((mpidr & MPIDR_CLUSTER_MASK) != 0U) {
  11. return -1;
  12. }
  13. if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) {
  14. return -1;
  15. }
  16. return (int32_t)versal_calc_core_pos(mpidr);
  17. }