blob: 69e112f27cf4b01456199b8b42bf13b1c224de07 [file] [log] [blame]
Yatharth Kocharf528faf2016-06-28 16:58:26 +01001/*
dp-arm230011c2017-03-07 11:02:47 +00002 * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
Yatharth Kocharf528faf2016-06-28 16:58:26 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Yatharth Kocharf528faf2016-06-28 16:58:26 +01005 */
6
7#include <arch.h>
8#include <asm_macros.S>
9#include <platform_def.h>
10
dp-arm230011c2017-03-07 11:02:47 +000011 .weak plat_get_my_stack
12 .weak plat_set_my_stack
Yatharth Kocharf528faf2016-06-28 16:58:26 +010013
14 /* -----------------------------------------------------
15 * unsigned long plat_get_my_stack ()
16 *
17 * For cold-boot BL images, only the primary CPU needs
18 * a stack. This function returns the stack pointer for
19 * a stack allocated in normal memory.
20 * -----------------------------------------------------
21 */
22func plat_get_my_stack
23 get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE
24 bx lr
25endfunc plat_get_my_stack
26
27 /* -----------------------------------------------------
28 * void plat_set_my_stack ()
29 *
30 * For cold-boot BL images, only the primary CPU needs
31 * a stack. This function sets the stack pointer to a
32 * stack allocated in normal memory.
33 * -----------------------------------------------------
34 */
35func plat_set_my_stack
36 get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE
37 mov sp, r0
38 bx lr
39endfunc plat_set_my_stack
40
41 /* -----------------------------------------------------
42 * Per-cpu stacks in normal memory. Each cpu gets a
43 * stack of PLATFORM_STACK_SIZE bytes.
44 * -----------------------------------------------------
45 */
Chris Kay33bfc5e2023-02-14 11:30:04 +000046declare_stack platform_normal_stacks, .tzfw_normal_stacks, \
Yatharth Kocharf528faf2016-06-28 16:58:26 +010047 PLATFORM_STACK_SIZE, 1, CACHE_WRITEBACK_GRANULE