plat_topology.c 640 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <platform_def.h>
  7. #include <arch.h>
  8. #include <lib/psci/psci.h>
  9. #include "plat_private.h"
  10. const unsigned char hisi_power_domain_tree_desc[] = {
  11. PLATFORM_CLUSTER_COUNT,
  12. PLATFORM_CORE_COUNT,
  13. };
  14. const unsigned char *plat_get_power_domain_tree_desc(void)
  15. {
  16. return hisi_power_domain_tree_desc;
  17. }
  18. int plat_core_pos_by_mpidr(u_register_t mpidr)
  19. {
  20. if (mpidr & MPIDR_CLUSTER_MASK)
  21. return -1;
  22. if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT)
  23. return -1;
  24. return poplar_calc_core_pos(mpidr);
  25. }