fvp_ve_helpers.S 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2019, Arm Limited. All rights reserved.
  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_get_my_entrypoint
  11. .globl plat_is_my_cpu_primary
  12. /* --------------------------------------------------------------------
  13. * void plat_secondary_cold_boot_setup (void);
  14. *
  15. * For AArch32, cold-booting secondary CPUs is not yet
  16. * implemented and they panic.
  17. * --------------------------------------------------------------------
  18. */
  19. func plat_secondary_cold_boot_setup
  20. cb_panic:
  21. b cb_panic
  22. endfunc plat_secondary_cold_boot_setup
  23. /* ---------------------------------------------------------------------
  24. * unsigned long plat_get_my_entrypoint (void);
  25. *
  26. * Main job of this routine is to distinguish between a cold and warm
  27. * boot. On FVP, this information can be queried from the power
  28. * controller. The Power Control SYS Status Register (PSYSR) indicates
  29. * the wake-up reason for the CPU.
  30. *
  31. * For a cold boot, return 0.
  32. * For a warm boot, read the mailbox and return the address it contains.
  33. *
  34. * TODO: PSYSR is a common register and should be
  35. * accessed using locks. Since it is not possible
  36. * to use locks immediately after a cold reset
  37. * we are relying on the fact that after a cold
  38. * reset all cpus will read the same WK field
  39. * ---------------------------------------------------------------------
  40. */
  41. func plat_get_my_entrypoint
  42. /* TODO support warm boot */
  43. /* Cold reset */
  44. mov r0, #0
  45. bx lr
  46. endfunc plat_get_my_entrypoint
  47. /* -----------------------------------------------------
  48. * unsigned int plat_is_my_cpu_primary (void);
  49. *
  50. * Currently configured for a sigle CPU
  51. * -----------------------------------------------------
  52. */
  53. func plat_is_my_cpu_primary
  54. mov r0, #1
  55. bx lr
  56. endfunc plat_is_my_cpu_primary