]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
uniphier: add a helper to get image_info
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 1 Feb 2018 12:37:40 +0000 (21:37 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 1 Feb 2018 15:19:19 +0000 (00:19 +0900)
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>
plat/socionext/uniphier/uniphier.h
plat/socionext/uniphier/uniphier_bl2_setup.c
plat/socionext/uniphier/uniphier_image_desc.c

index 2af30dff8064cdc281427c8785e1476bc0b0644e..b1a05726ebfbe7ecfbcaae857189cf4007c0d24a 100644 (file)
@@ -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);
index daf0c45d38cbdde30f37ed3bd0d06ccd586f4e80..e72b6001d20501b64631fb67758f4af04d7aa717 100644 (file)
@@ -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)
index 1e474c53f1c0cbef62a7b933b1b47cc72cc0bc31..f4651db05de28786803bf4259aa0c646675e21d3 100644 (file)
@@ -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;
 }