uniphier_helpers.S 757 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <asm_macros.S>
  7. #include <platform_def.h>
  8. .global uniphier_calc_core_pos
  9. .global plat_my_core_pos
  10. .globl platform_mem_init
  11. /*
  12. * unsigned int uniphier_calc_core_pos(u_register_t mpidr)
  13. * core_pos = (cluster_id * max_cpus_per_cluster) + core_id
  14. */
  15. func uniphier_calc_core_pos
  16. and x1, x0, #MPIDR_CPU_MASK
  17. and x0, x0, #MPIDR_CLUSTER_MASK
  18. lsr x0, x0, #MPIDR_AFFINITY_BITS
  19. mov x2, #UNIPHIER_MAX_CPUS_PER_CLUSTER
  20. madd x0, x0, x2, x1
  21. ret
  22. endfunc uniphier_calc_core_pos
  23. func plat_my_core_pos
  24. mrs x0, mpidr_el1
  25. b uniphier_calc_core_pos
  26. endfunc plat_my_core_pos
  27. func platform_mem_init
  28. ret
  29. endfunc platform_mem_init