Commit 0ac60c08 authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 2e379d2f
...@@ -42,7 +42,9 @@ int uniphier_usb_init(unsigned int soc, uintptr_t *block_dev_spec); ...@@ -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_io_setup(unsigned int soc);
int uniphier_check_image(unsigned int image_id); 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); int uniphier_scp_is_running(void);
void uniphier_scp_start(void); void uniphier_scp_start(void);
......
...@@ -88,8 +88,12 @@ void bl2_el3_plat_arch_setup(void) ...@@ -88,8 +88,12 @@ void bl2_el3_plat_arch_setup(void)
} }
} }
if (skip_scp) if (skip_scp) {
uniphier_image_descs_fixup(); 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) void bl2_platform_setup(void)
......
/* /*
* 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 * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -86,12 +86,11 @@ static struct bl_mem_params_node uniphier_image_descs[] = { ...@@ -86,12 +86,11 @@ static struct bl_mem_params_node uniphier_image_descs[] = {
}; };
REGISTER_BL_IMAGE_DESCS(uniphier_image_descs) REGISTER_BL_IMAGE_DESCS(uniphier_image_descs)
/* SCP is optional. Allow run-time fixup of the descriptor array. */ struct image_info *uniphier_get_image_info(unsigned int image_id)
void uniphier_image_descs_fixup(void)
{ {
struct bl_mem_params_node *desc; struct bl_mem_params_node *desc;
desc = get_bl_mem_params_node(SCP_BL2_IMAGE_ID); desc = get_bl_mem_params_node(image_id);
assert(desc != NULL); assert(desc);
desc->image_info.h.attr |= IMAGE_ATTRIB_SKIP_LOADING; return &desc->image_info;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment