mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-23 21:44:15 +00:00
fix(qemu): fix register convention in BL31 for qemu
The commit with Change-Id:Ie417e054a7a4c192024a2679419e99efeded1705 updated the register convention r1/x1 values but missing necessary changes in BL31. As a result, a system panic observed during setup for BL32 when TRANSFER_LIST is enabled due to unexpected arguments. This patch is to fix this issue for qemu. Change-Id: I42e581c5026f0f66d3b114204b4dff167a9bc6ae Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
This commit is contained in:
parent
c0688c55bb
commit
7ad6775bde
1 changed files with 21 additions and 5 deletions
|
@ -68,6 +68,9 @@ static struct transfer_list_header *bl31_tl;
|
|||
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||
u_register_t arg2, u_register_t arg3)
|
||||
{
|
||||
bool is64 = false;
|
||||
uint64_t hval;
|
||||
|
||||
/* Initialize the console to provide early debug support */
|
||||
qemu_console_init();
|
||||
|
||||
|
@ -92,6 +95,11 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
|||
* They are stored in Secure RAM, in BL2's address space.
|
||||
*/
|
||||
while (bl_params) {
|
||||
#ifdef __aarch64__
|
||||
if (bl_params->image_id == BL31_IMAGE_ID &&
|
||||
GET_RW(bl_params->ep_info->spsr) == MODE_RW_64)
|
||||
is64 = true;
|
||||
#endif
|
||||
if (bl_params->image_id == BL32_IMAGE_ID)
|
||||
bl32_image_ep_info = *bl_params->ep_info;
|
||||
|
||||
|
@ -113,12 +121,20 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
|||
panic();
|
||||
#endif
|
||||
|
||||
if (TRANSFER_LIST && arg1 == (TRANSFER_LIST_SIGNATURE |
|
||||
REGISTER_CONVENTION_VERSION_MASK) &&
|
||||
transfer_list_check_header((void *)arg3) != TL_OPS_NON) {
|
||||
if (!TRANSFER_LIST ||
|
||||
!transfer_list_check_header((void *)arg3))
|
||||
return;
|
||||
|
||||
if (is64)
|
||||
hval = TRANSFER_LIST_HANDOFF_X1_VALUE(REGISTER_CONVENTION_VERSION);
|
||||
else
|
||||
hval = TRANSFER_LIST_HANDOFF_R1_VALUE(REGISTER_CONVENTION_VERSION);
|
||||
|
||||
if (arg1 != hval)
|
||||
return;
|
||||
|
||||
bl31_tl = (void *)arg3; /* saved TL address from BL2 */
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLE_RME
|
||||
#if PLAT_qemu
|
||||
|
|
Loading…
Add table
Reference in a new issue