mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-02 08:49:28 +00:00

Handoff structures are populated by executable entry point information tag based bl32/bl33 entries present in transfer list. The upstream code is having problem with the last TL entry particularly when the tags for two entries are same. While tlc tool dumps all entries correctly, transfer_list_dump() in upstream code does not provide information about the last entry in TL. Enabling TRANSFER_LIST also enables BL1_SOURCES and BL2_SOURCES in transfer_list.mk thereby enabling bl1/bl2 builds. bl1/bl2 builds are disabled by turning off NEED_BL1/NEED_BL2 build flags. Change-Id: I55ddccc1ab266cc5a609423d304a5e5c282e17f6 Signed-off-by: Amit Nagal <amit.nagal@amd.com>
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
/*
|
|
* Copyright (c) 2023-2024, Advanced Micro Devices, Inc. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
#include <stddef.h>
|
|
#include <arch_helpers.h>
|
|
#include <common/debug.h>
|
|
#include <lib/transfer_list.h>
|
|
|
|
/*
|
|
* FIXME: This address should come from firmware before TF-A runs
|
|
* Having this to make sure the transfer list functionality works
|
|
*/
|
|
#define FW_HANDOFF_BASE U(0x1200000)
|
|
#define FW_HANDOFF_SIZE U(0x600000)
|
|
|
|
static struct transfer_list_header *tl_hdr;
|
|
|
|
int32_t transfer_list_populate_ep_info(entry_point_info_t *bl32,
|
|
entry_point_info_t *bl33)
|
|
{
|
|
struct transfer_list_entry *te = NULL;
|
|
struct entry_point_info *ep;
|
|
int32_t ret;
|
|
|
|
tl_hdr = (struct transfer_list_header *)FW_HANDOFF_BASE;
|
|
ret = transfer_list_check_header(tl_hdr);
|
|
if ((ret == TL_OPS_ALL) || (ret == TL_OPS_RO)) {
|
|
transfer_list_dump(tl_hdr);
|
|
while ((te = transfer_list_next(tl_hdr, te)) != NULL) {
|
|
ep = transfer_list_entry_data(te);
|
|
if (te->tag_id == TL_TAG_EXEC_EP_INFO64) {
|
|
switch (GET_SECURITY_STATE(ep->h.attr)) {
|
|
case NON_SECURE:
|
|
*bl33 = *ep;
|
|
continue;
|
|
case SECURE:
|
|
*bl32 = *ep;
|
|
continue;
|
|
default:
|
|
ERROR("Unrecognized Image Security State %lu\n",
|
|
GET_SECURITY_STATE(ep->h.attr));
|
|
ret = TL_OPS_NON;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ret;
|
|
}
|