mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-13 16:14:20 +00:00
uniphier: pass SCP base address as a function parameter
Currently, UNIPHIER_SCP_BASE is hard-coded in uniphier_scp_start(), which is not handy for PIE. Towards the goal of making this really position-independent, pass in image_info->image_base. Change-Id: I88e020a1919c607b1d5ce70b116201d95773bb63 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
b79b3177d3
commit
577b24411a
3 changed files with 6 additions and 8 deletions
|
@ -48,7 +48,7 @@ struct image_info;
|
|||
struct image_info *uniphier_get_image_info(unsigned int image_id);
|
||||
|
||||
int uniphier_scp_is_running(void);
|
||||
void uniphier_scp_start(void);
|
||||
void uniphier_scp_start(uint32_t scp_base);
|
||||
void uniphier_scp_open_com(void);
|
||||
void uniphier_scp_system_off(void);
|
||||
void uniphier_scp_system_reset(void);
|
||||
|
|
|
@ -149,12 +149,10 @@ int bl2_plat_handle_pre_image_load(unsigned int image_id)
|
|||
|
||||
int bl2_plat_handle_post_image_load(unsigned int image_id)
|
||||
{
|
||||
struct image_info *image_info = uniphier_get_image_info(image_id);
|
||||
#ifdef UNIPHIER_DECOMPRESS_GZIP
|
||||
struct image_info *image_info;
|
||||
int ret;
|
||||
|
||||
image_info = uniphier_get_image_info(image_id);
|
||||
|
||||
if (!(image_info->h.attr & IMAGE_ATTRIB_SKIP_LOADING)) {
|
||||
ret = image_decompress(uniphier_get_image_info(image_id));
|
||||
if (ret)
|
||||
|
@ -163,7 +161,7 @@ int bl2_plat_handle_post_image_load(unsigned int image_id)
|
|||
#endif
|
||||
|
||||
if (image_id == SCP_BL2_IMAGE_ID && uniphier_bl2_kick_scp)
|
||||
uniphier_scp_start();
|
||||
uniphier_scp_start(image_info->image_base);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -28,11 +28,11 @@ int uniphier_scp_is_running(void)
|
|||
return mmio_read_32(UNIPHIER_STMBE2COM) == UNIPHIER_SCP_READY_MAGIC;
|
||||
}
|
||||
|
||||
void uniphier_scp_start(void)
|
||||
void uniphier_scp_start(uint32_t scp_base)
|
||||
{
|
||||
uint32_t tmp;
|
||||
|
||||
mmio_write_32(UNIPHIER_STMBE2COM + 4, UNIPHIER_SCP_BASE);
|
||||
mmio_write_32(UNIPHIER_STMBE2COM + 4, scp_base);
|
||||
mmio_write_32(UNIPHIER_STMBE2COM, UNIPHIER_SCP_READY_MAGIC);
|
||||
|
||||
do {
|
||||
|
|
Loading…
Add table
Reference in a new issue