Skip to content

Commit

Permalink
tmp: load bl32 at certain physical offset
Browse files Browse the repository at this point in the history
Signed-off-by: Seonghyun Park <seonghp@amazon.com>
  • Loading branch information
seonghp committed Feb 26, 2024
1 parent a1be69e commit f846124
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/optee/optee_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ bool optee_header_is_valid(uintptr_t header_base)
return tee_validate_header((optee_header_t *)header_base);
}

#define BL32_PHYS_OFFSET 0x10000

/*******************************************************************************
* Parse the OPTEE image
* Return 0 on success or a negative error code otherwise.
Expand All @@ -45,6 +47,7 @@ static int parse_optee_image(image_info_t *image_info,

init_load_addr = ((uint64_t)image->load_addr_hi << 32) |
image->load_addr_lo;
init_load_addr += BL32_PHYS_OFFSET;
init_size = image->size;

/*
Expand Down
9 changes: 6 additions & 3 deletions plat/qemu/common/qemu_bl2_mem_params_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#define BL32_PHYS_OFFSET 0x10000

#include <platform_def.h>

#include <common/desc_image_load.h>
Expand Down Expand Up @@ -87,13 +89,14 @@ static bl_mem_params_node_t bl2_mem_params_descs[] = {

SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
entry_point_info_t, BL32_EP_ATTRIBS),
.ep_info.pc = BL32_BASE,
.ep_info.pc = BL32_BASE + BL32_PHYS_OFFSET,

SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
image_info_t, BL32_IMG_ATTRIBS),

.image_info.image_base = BL32_BASE,
.image_info.image_max_size = BL32_LIMIT - BL32_BASE,
/* FIXME(seonghp) */
.image_info.image_base = BL32_BASE + BL32_PHYS_OFFSET,
.image_info.image_max_size = BL32_LIMIT - BL32_BASE - BL32_PHYS_OFFSET,

.next_handoff_image_id = BL33_IMAGE_ID,
},
Expand Down

0 comments on commit f846124

Please sign in to comment.