uniphier: add a helper to get image_info
In the next commit, I will have more usecases to get struct image_info from image ID. It is better to make a helper function at a different layer. I do not need the current uniphier_image_descs_fixup() since the code is small enough to be squashed into the caller side. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
2e379d2f1b
commit
0ac60c0801
|
@ -42,7 +42,9 @@ int uniphier_usb_init(unsigned int soc, uintptr_t *block_dev_spec);
|
|||
|
||||
int uniphier_io_setup(unsigned int soc);
|
||||
int uniphier_check_image(unsigned int image_id);
|
||||
void uniphier_image_descs_fixup(void);
|
||||
|
||||
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);
|
||||
|
|
|
@ -88,8 +88,12 @@ void bl2_el3_plat_arch_setup(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (skip_scp)
|
||||
uniphier_image_descs_fixup();
|
||||
if (skip_scp) {
|
||||
struct image_info *image_info;
|
||||
|
||||
image_info = uniphier_get_image_info(SCP_BL2_IMAGE_ID);
|
||||
image_info->h.attr |= IMAGE_ATTRIB_SKIP_LOADING;
|
||||
}
|
||||
}
|
||||
|
||||
void bl2_platform_setup(void)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -86,12 +86,11 @@ static struct bl_mem_params_node uniphier_image_descs[] = {
|
|||
};
|
||||
REGISTER_BL_IMAGE_DESCS(uniphier_image_descs)
|
||||
|
||||
/* SCP is optional. Allow run-time fixup of the descriptor array. */
|
||||
void uniphier_image_descs_fixup(void)
|
||||
struct image_info *uniphier_get_image_info(unsigned int image_id)
|
||||
{
|
||||
struct bl_mem_params_node *desc;
|
||||
|
||||
desc = get_bl_mem_params_node(SCP_BL2_IMAGE_ID);
|
||||
assert(desc != NULL);
|
||||
desc->image_info.h.attr |= IMAGE_ATTRIB_SKIP_LOADING;
|
||||
desc = get_bl_mem_params_node(image_id);
|
||||
assert(desc);
|
||||
return &desc->image_info;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue