lx2160a_helpers.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright 2018-2020 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #include <arch.h>
  8. #include <asm_macros.S>
  9. #include <platform_def.h>
  10. .globl plat_secondary_cold_boot_setup
  11. .globl plat_is_my_cpu_primary
  12. .globl plat_reset_handler
  13. .globl platform_mem_init
  14. func platform_mem1_init
  15. ret
  16. endfunc platform_mem1_init
  17. func platform_mem_init
  18. ret
  19. endfunc platform_mem_init
  20. func apply_platform_errata
  21. ret
  22. endfunc apply_platform_errata
  23. func plat_reset_handler
  24. mov x29, x30
  25. bl apply_platform_errata
  26. #if defined(IMAGE_BL31)
  27. ldr x0, =POLICY_SMMU_PAGESZ_64K
  28. cbz x0, 1f
  29. /* Set the SMMU page size in the sACR register */
  30. bl _set_smmu_pagesz_64
  31. #endif
  32. 1:
  33. mov x30, x29
  34. ret
  35. endfunc plat_reset_handler
  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. /* lx2160a does not do cold boot for secondary CPU */
  45. cb_panic:
  46. b cb_panic
  47. endfunc plat_secondary_cold_boot_setup
  48. /* unsigned int plat_is_my_cpu_primary (void);
  49. *
  50. * Find out whether the current cpu is the primary
  51. * cpu.
  52. */
  53. func plat_is_my_cpu_primary
  54. mrs x0, mpidr_el1
  55. and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
  56. cmp x0, 0x0
  57. cset w0, eq
  58. ret
  59. endfunc plat_is_my_cpu_primary