ls1043a_helpers.S 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright 2018-2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <asm_macros.S>
  8. #include <platform_def.h>
  9. .globl plat_secondary_cold_boot_setup
  10. .globl plat_is_my_cpu_primary
  11. .globl plat_reset_handler
  12. .globl platform_mem_init
  13. func platform_mem1_init
  14. ret
  15. endfunc platform_mem1_init
  16. func platform_mem_init
  17. ret
  18. endfunc platform_mem_init
  19. func apply_platform_errata
  20. ret
  21. endfunc apply_platform_errata
  22. func plat_reset_handler
  23. mov x29, x30
  24. bl apply_platform_errata
  25. #if defined(IMAGE_BL31)
  26. ldr x0, =POLICY_SMMU_PAGESZ_64K
  27. cbz x0, 1f
  28. /* Set the SMMU page size in the sACR register */
  29. bl _set_smmu_pagesz_64
  30. #endif
  31. 1:
  32. mov x30, x29
  33. ret
  34. endfunc plat_reset_handler
  35. /*
  36. * void plat_secondary_cold_boot_setup (void);
  37. *
  38. * This function performs any platform specific actions
  39. * needed for a secondary cpu after a cold reset e.g
  40. * mark the cpu's presence, mechanism to place it in a
  41. * holding pen etc.
  42. */
  43. func plat_secondary_cold_boot_setup
  44. /* ls1043a does not do cold boot for secondary CPU */
  45. cb_panic:
  46. b cb_panic
  47. endfunc plat_secondary_cold_boot_setup
  48. /*
  49. * unsigned int plat_is_my_cpu_primary (void);
  50. *
  51. * Find out whether the current cpu is the primary
  52. * cpu.
  53. */
  54. func plat_is_my_cpu_primary
  55. mrs x0, mpidr_el1
  56. and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
  57. cmp x0, 0x0
  58. cset w0, eq
  59. ret
  60. endfunc plat_is_my_cpu_primary