Yatharth Kochar | f528faf | 2016-06-28 16:58:26 +0100 | [diff] [blame] | 1 | /* |
dp-arm | 230011c | 2017-03-07 11:02:47 +0000 | [diff] [blame] | 2 | * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. |
Yatharth Kochar | f528faf | 2016-06-28 16:58:26 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Yatharth Kochar | f528faf | 2016-06-28 16:58:26 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <asm_macros.S> |
| 9 | #include <platform_def.h> |
| 10 | |
dp-arm | 230011c | 2017-03-07 11:02:47 +0000 | [diff] [blame] | 11 | .weak plat_get_my_stack |
| 12 | .weak plat_set_my_stack |
Yatharth Kochar | f528faf | 2016-06-28 16:58:26 +0100 | [diff] [blame] | 13 | |
| 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 | */ |
| 22 | func plat_get_my_stack |
| 23 | get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE |
| 24 | bx lr |
| 25 | endfunc 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 | */ |
| 35 | func plat_set_my_stack |
| 36 | get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE |
| 37 | mov sp, r0 |
| 38 | bx lr |
| 39 | endfunc 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 | */ |
| 46 | declare_stack platform_normal_stacks, tzfw_normal_stacks, \ |
| 47 | PLATFORM_STACK_SIZE, 1, CACHE_WRITEBACK_GRANULE |