platform_up_stack.S 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2014-2019, ARM Limited and Contributors. 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. .local platform_normal_stacks
  10. .weak plat_set_my_stack
  11. .weak plat_get_my_stack
  12. /* -----------------------------------------------------
  13. * uintptr_t plat_get_my_stack ()
  14. *
  15. * For cold-boot BL images, only the primary CPU needs a
  16. * stack. This function returns the stack pointer for a
  17. * stack allocated in device memory.
  18. * -----------------------------------------------------
  19. */
  20. func plat_get_my_stack
  21. get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE
  22. ret
  23. endfunc plat_get_my_stack
  24. /* -----------------------------------------------------
  25. * void plat_set_my_stack ()
  26. *
  27. * For cold-boot BL images, only the primary CPU needs a
  28. * stack. This function sets the stack pointer to a stack
  29. * allocated in normal memory.
  30. * -----------------------------------------------------
  31. */
  32. func plat_set_my_stack
  33. get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE
  34. mov sp, x0
  35. ret
  36. endfunc plat_set_my_stack
  37. /* -----------------------------------------------------
  38. * Single cpu stack in normal memory.
  39. * Used for C code during boot, PLATFORM_STACK_SIZE bytes
  40. * are allocated
  41. * -----------------------------------------------------
  42. */
  43. declare_stack platform_normal_stacks, .tzfw_normal_stacks, \
  44. PLATFORM_STACK_SIZE, 1, CACHE_WRITEBACK_GRANULE