plat_topology.c 957 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2013-2016, 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. /*******************************************************************************
  11. * This function returns the RockChip default topology tree information.
  12. ******************************************************************************/
  13. const unsigned char *plat_get_power_domain_tree_desc(void)
  14. {
  15. return rockchip_power_domain_tree_desc;
  16. }
  17. int plat_core_pos_by_mpidr(u_register_t mpidr)
  18. {
  19. unsigned int cluster_id, cpu_id;
  20. cpu_id = mpidr & MPIDR_AFFLVL_MASK;
  21. #ifdef PLAT_RK_MPIDR_CLUSTER_MASK
  22. cluster_id = mpidr & PLAT_RK_MPIDR_CLUSTER_MASK;
  23. #else
  24. cluster_id = mpidr & MPIDR_CLUSTER_MASK;
  25. #endif
  26. cpu_id += (cluster_id >> PLAT_RK_CLST_TO_CPUID_SHIFT);
  27. if (cpu_id >= PLATFORM_CORE_COUNT)
  28. return -1;
  29. return cpu_id;
  30. }