2014-03-20 10:48:23 +00:00
|
|
|
/*
|
2017-03-07 11:02:47 +00:00
|
|
|
* Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved.
|
2014-03-20 10:48:23 +00:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2014-03-20 10:48:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <arch.h>
|
|
|
|
#include <asm_macros.S>
|
2014-05-14 17:44:19 +01:00
|
|
|
#include <platform_def.h>
|
2014-03-20 10:48:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
.local platform_normal_stacks
|
2017-03-07 11:02:47 +00:00
|
|
|
.weak plat_set_my_stack
|
|
|
|
.weak plat_get_my_stack
|
|
|
|
.weak platform_set_stack
|
|
|
|
.weak platform_get_stack
|
2014-03-20 10:48:23 +00:00
|
|
|
|
|
|
|
/* -----------------------------------------------------
|
2016-06-16 14:52:04 +01:00
|
|
|
* uintptr_t plat_get_my_stack ()
|
2014-03-20 10:48:23 +00:00
|
|
|
*
|
|
|
|
* For cold-boot BL images, only the primary CPU needs a
|
|
|
|
* stack. This function returns the stack pointer for a
|
|
|
|
* stack allocated in device memory.
|
|
|
|
* -----------------------------------------------------
|
|
|
|
*/
|
2015-04-09 13:40:55 +01:00
|
|
|
func plat_get_my_stack
|
2014-03-20 10:48:23 +00:00
|
|
|
get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE
|
|
|
|
ret
|
2015-04-09 13:40:55 +01:00
|
|
|
endfunc plat_get_my_stack
|
2014-03-20 10:48:23 +00:00
|
|
|
|
|
|
|
/* -----------------------------------------------------
|
2015-04-09 13:40:55 +01:00
|
|
|
* void plat_set_my_stack ()
|
2014-03-20 10:48:23 +00:00
|
|
|
*
|
|
|
|
* For cold-boot BL images, only the primary CPU needs a
|
|
|
|
* stack. This function sets the stack pointer to a stack
|
|
|
|
* allocated in normal memory.
|
|
|
|
* -----------------------------------------------------
|
|
|
|
*/
|
2015-04-09 13:40:55 +01:00
|
|
|
func plat_set_my_stack
|
2014-03-20 10:48:23 +00:00
|
|
|
get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE
|
|
|
|
mov sp, x0
|
|
|
|
ret
|
2015-04-09 13:40:55 +01:00
|
|
|
endfunc plat_set_my_stack
|
2014-03-20 10:48:23 +00:00
|
|
|
|
2015-07-13 16:26:11 +01:00
|
|
|
/* -----------------------------------------------------
|
|
|
|
* unsigned long platform_get_stack ()
|
|
|
|
*
|
|
|
|
* For cold-boot BL images, only the primary CPU needs a
|
|
|
|
* stack. This function returns the stack pointer for a
|
|
|
|
* stack allocated in device memory. This function
|
|
|
|
* is deprecated.
|
|
|
|
* -----------------------------------------------------
|
|
|
|
*/
|
|
|
|
func_deprecated platform_get_stack
|
|
|
|
b plat_get_my_stack
|
|
|
|
endfunc_deprecated platform_get_stack
|
|
|
|
|
|
|
|
/* -----------------------------------------------------
|
|
|
|
* void platform_set_stack ()
|
|
|
|
*
|
|
|
|
* For cold-boot BL images, only the primary CPU needs a
|
|
|
|
* stack. This function sets the stack pointer to a stack
|
|
|
|
* allocated in normal memory.This function is
|
|
|
|
* deprecated.
|
|
|
|
* -----------------------------------------------------
|
|
|
|
*/
|
|
|
|
func_deprecated platform_set_stack
|
|
|
|
b plat_set_my_stack
|
|
|
|
endfunc_deprecated platform_set_stack
|
|
|
|
|
2014-03-20 10:48:23 +00:00
|
|
|
/* -----------------------------------------------------
|
|
|
|
* Single cpu stack in normal memory.
|
|
|
|
* Used for C code during boot, PLATFORM_STACK_SIZE bytes
|
|
|
|
* are allocated
|
|
|
|
* -----------------------------------------------------
|
|
|
|
*/
|
|
|
|
declare_stack platform_normal_stacks, tzfw_normal_stacks, \
|
2016-06-09 17:16:35 +01:00
|
|
|
PLATFORM_STACK_SIZE, 1, CACHE_WRITEBACK_GRANULE
|