platform_up_stack.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2016-2017, 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. .weak plat_get_my_stack
  10. .weak plat_set_my_stack
  11. /* -----------------------------------------------------
  12. * unsigned long plat_get_my_stack ()
  13. *
  14. * For cold-boot BL images, only the primary CPU needs
  15. * a stack. This function returns the stack pointer for
  16. * a stack allocated in normal memory.
  17. * -----------------------------------------------------
  18. */
  19. func plat_get_my_stack
  20. get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE
  21. bx lr
  22. endfunc plat_get_my_stack
  23. /* -----------------------------------------------------
  24. * void plat_set_my_stack ()
  25. *
  26. * For cold-boot BL images, only the primary CPU needs
  27. * a stack. This function sets the stack pointer to a
  28. * stack allocated in normal memory.
  29. * -----------------------------------------------------
  30. */
  31. func plat_set_my_stack
  32. get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE
  33. mov sp, r0
  34. bx lr
  35. endfunc plat_set_my_stack
  36. /* -----------------------------------------------------
  37. * Per-cpu stacks in normal memory. Each cpu gets a
  38. * stack of PLATFORM_STACK_SIZE bytes.
  39. * -----------------------------------------------------
  40. */
  41. declare_stack platform_normal_stacks, .tzfw_normal_stacks, \
  42. PLATFORM_STACK_SIZE, 1, CACHE_WRITEBACK_GRANULE