From 51c79b7351ba99f8d6ad6c3045cc8fb10b413b4a Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Tue, 30 Aug 2016 13:07:31 +0100 Subject: AArch32: resolve build error when LOG_LEVEL=50 This patch resolves a build error in Trusted Firmware when `ARCH=aarch32` and LOG_LEVEL >= 50. Change-Id: I62a23ded4a25304533cdcc5ff11442aee041709b --- common/bl_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/bl_common.c b/common/bl_common.c index 6dcd4c18..bae02d4b 100644 --- a/common/bl_common.c +++ b/common/bl_common.c @@ -419,9 +419,11 @@ void print_entry_point_info(const entry_point_info_t *ep_info) PRINT_IMAGE_ARG(1); PRINT_IMAGE_ARG(2); PRINT_IMAGE_ARG(3); +#ifndef AARCH32 PRINT_IMAGE_ARG(4); PRINT_IMAGE_ARG(5); PRINT_IMAGE_ARG(6); PRINT_IMAGE_ARG(7); +#endif #undef PRINT_IMAGE_ARG } -- cgit From 9e3b4cbbade36bb38a4a96381f0aca1b48ccaa0c Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Wed, 31 Aug 2016 12:34:33 +0100 Subject: AArch32: Fix SCTLR context initialization This patch fixes a bug in context management library when writing SCTLR register during context initialization. The write happened prior to initialization of the register context pointer. This resulted in the compiler optimizing the write sequence from the final binary and hence SCTLR remains uninitialized when entering normal world. The bug is fixed by doing the initialization of the register context pointer earlier in the sequence. Change-Id: Ic7465593a74534046b79f40446ffa1165c52ed76 --- lib/el3_runtime/aarch32/context_mgmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/el3_runtime/aarch32/context_mgmt.c b/lib/el3_runtime/aarch32/context_mgmt.c index 6915ded7..bc5f9c42 100644 --- a/lib/el3_runtime/aarch32/context_mgmt.c +++ b/lib/el3_runtime/aarch32/context_mgmt.c @@ -86,6 +86,8 @@ static void cm_init_context_common(cpu_context_t *ctx, const entry_point_info_t /* Clear any residual register values from the context */ memset(ctx, 0, sizeof(*ctx)); + reg_ctx = get_regs_ctx(ctx); + /* * Base the context SCR on the current value, adjust for entry point * specific requirements @@ -121,8 +123,6 @@ static void cm_init_context_common(cpu_context_t *ctx, const entry_point_info_t if (GET_M32(ep->spsr) == MODE32_hyp) scr |= SCR_HCE_BIT; - reg_ctx = get_regs_ctx(ctx); - write_ctx_reg(reg_ctx, CTX_SCR, scr); write_ctx_reg(reg_ctx, CTX_LR, ep->pc); write_ctx_reg(reg_ctx, CTX_SPSR, ep->spsr); -- cgit