diff options
author | Soby Mathew <soby.mathew@arm.com> | 2019-07-25 09:04:21 +0000 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2019-07-25 09:04:21 +0000 |
commit | d38613df9aa7d81505ff1da6e2905b3216d51ce5 (patch) | |
tree | 238e8fd549c74ca8d15f9cb8e01b62c2d21a4513 /common | |
parent | 8b6394c95d820bd40e7b49fa1d3ea11c36f9e8d7 (diff) | |
parent | cbdc72b559ab8230e17b7ef0f928097207a61060 (diff) |
Merge changes I0d17ba6c,I540741d2,I9e6475ad,Ifd769320,I12c04a85, ... into integration
* changes:
plat/mediatek/mt81*: Use new bl31_params_parse() helper
plat/rockchip: Use new bl31_params_parse_helper()
Add helper to parse BL31 parameters (both versions)
Factor out cross-BL API into export headers suitable for 3rd party code
Use explicit-width data types in AAPCS parameter structs
plat/rockchip: Switch to use new common BL aux parameter library
Introduce lightweight BL platform parameter library
Diffstat (limited to 'common')
-rw-r--r-- | common/desc_image_load.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/common/desc_image_load.c b/common/desc_image_load.c index 405bb834..f2e8f605 100644 --- a/common/desc_image_load.c +++ b/common/desc_image_load.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -9,6 +9,7 @@ #include <arch_helpers.h> #include <common/bl_common.h> #include <common/desc_image_load.h> +#include <common/tbbr/tbbr_img_def.h> static bl_load_info_t bl_load_info; static bl_params_t next_bl_params; @@ -275,3 +276,47 @@ void populate_next_bl_params_config(bl_params_t *bl2_to_next_bl_params) } } } + +/******************************************************************************* + * Helper to extract BL32/BL33 entry point info from arg0 passed to BL31, for + * platforms that are only interested in those. Platforms that need to extract + * more information can parse the structures themselves. + ******************************************************************************/ + +void bl31_params_parse_helper(u_register_t param, + entry_point_info_t *bl32_ep_info_out, + entry_point_info_t *bl33_ep_info_out) +{ + bl_params_node_t *node; + bl_params_t *v2 = (void *)(uintptr_t)param; + +#if !ERROR_DEPRECATED + if (v2->h.version == PARAM_VERSION_1) { + struct { /* Deprecated version 1 parameter structure. */ + param_header_t h; + image_info_t *bl31_image_info; + entry_point_info_t *bl32_ep_info; + image_info_t *bl32_image_info; + entry_point_info_t *bl33_ep_info; + image_info_t *bl33_image_info; + } *v1 = (void *)(uintptr_t)param; + assert(v1->h.type == PARAM_BL31); + if (bl32_ep_info_out) + *bl32_ep_info_out = *v1->bl32_ep_info; + if (bl33_ep_info_out) + *bl33_ep_info_out = *v1->bl33_ep_info; + return; + } +#endif /* !ERROR_DEPRECATED */ + + assert(v2->h.version == PARAM_VERSION_2); + assert(v2->h.type == PARAM_BL_PARAMS); + for (node = v2->head; node; node = node->next_params_info) { + if (node->image_id == BL32_IMAGE_ID) + if (bl32_ep_info_out) + *bl32_ep_info_out = *node->ep_info; + if (node->image_id == BL33_IMAGE_ID) + if (bl33_ep_info_out) + *bl33_ep_info_out = *node->ep_info; + } +} |