plat_topology.c 720 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright 2022-2023 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <arch_helpers.h>
  8. #include <plat/common/platform.h>
  9. const unsigned char imx_power_domain_tree_desc[] = {
  10. PWR_DOMAIN_AT_MAX_LVL,
  11. PLATFORM_CLUSTER_COUNT,
  12. PLATFORM_CLUSTER0_CORE_COUNT,
  13. };
  14. const unsigned char *plat_get_power_domain_tree_desc(void)
  15. {
  16. return imx_power_domain_tree_desc;
  17. }
  18. /*
  19. * Only one cluster is planned for i.MX9 family, no need
  20. * to consider the cluster id
  21. */
  22. int plat_core_pos_by_mpidr(u_register_t mpidr)
  23. {
  24. unsigned int cpu_id;
  25. mpidr &= MPIDR_AFFINITY_MASK;
  26. if (mpidr & ~(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)) {
  27. return -1;
  28. }
  29. cpu_id = MPIDR_AFFLVL1_VAL(mpidr);
  30. return cpu_id;
  31. }