Commit 53677b93 authored by Jon Medhurst's avatar Jon Medhurst Committed by Sandrine Bailleux
Browse files

Workaround: Setup register context for BL3-3


This is a temporary solution for issue #20
Signed-off-by: default avatarJon Medhurst <tixy@linaro.org>
Showing with 12 additions and 1 deletion
+12 -1
...@@ -182,6 +182,14 @@ void bl31_prepare_next_image_entry() ...@@ -182,6 +182,14 @@ void bl31_prepare_next_image_entry()
(MODE_RW_64 << MODE_RW_SHIFT)) (MODE_RW_64 << MODE_RW_SHIFT))
scr |= SCR_RW_BIT; scr |= SCR_RW_BIT;
/*
* Setup general purpose registers context for next image.
*/
cpu_context *context = cm_get_context(read_mpidr(),
next_image_info->security_state);
memcpy(&context->gpregs_ctx, &next_image_info->args,
sizeof(next_image_info->args));
/* /*
* Tell the context mgmt. library to ensure that SP_EL3 points to * Tell the context mgmt. library to ensure that SP_EL3 points to
* the right context to exit from EL3 correctly. * the right context to exit from EL3 correctly.
......
...@@ -108,6 +108,9 @@ void bl31_early_platform_setup(bl31_args *from_bl2, ...@@ -108,6 +108,9 @@ void bl31_early_platform_setup(bl31_args *from_bl2,
void *data) void *data)
{ {
bl2_to_bl31_args = *from_bl2; bl2_to_bl31_args = *from_bl2;
/* UEFI expects x0 to be primary CPU MPID */
bl2_to_bl31_args.bl33_image_info.args.arg0 = PRIMARY_CPU;
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
/* Non-Trusted Firmware BL3-3 and its load address */ /* Non-Trusted Firmware BL3-3 and its load address */
#define BL33_IMAGE_NAME "bl33.bin" /* e.g. UEFI */ #define BL33_IMAGE_NAME "bl33.bin" /* e.g. UEFI */
#define NS_IMAGE_OFFSET (DRAM_BASE + 0x8000000) /* DRAM + 128MB */ #define NS_IMAGE_OFFSET 0xE0000000
/* Firmware Image Package */ /* Firmware Image Package */
#define FIP_IMAGE_NAME "fip.bin" #define FIP_IMAGE_NAME "fip.bin"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment