summaryrefslogtreecommitdiff
path: root/src/arch/armv7
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2013-06-19 20:15:57 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-07-10 22:43:16 +0200
commitb919809afeaf3c571961ead626c04b8f9e258e11 (patch)
tree3e6157d55e4a370e7ae756ef4d58f77694616cb9 /src/arch/armv7
parent63bb610abb9ffa244a6571132813388a485141c9 (diff)
downloadcoreboot-b919809afeaf3c571961ead626c04b8f9e258e11.tar.xz
ARM: Don't leave alignment checking on after the exception test.
Currently, the exception handling code on ARM turns on alignment checks as an easy way to generate an exception for testing purposes. It was leaving it on which disabled unaligned accesses for other, unlreated code running later. This change adjusts the code so the original value of the alignment bit is restored after the test exception. Change-Id: Id8d035a05175f9fb13de547ab4aa5496d681d30c Signed-off-by: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/3690 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/armv7')
-rw-r--r--src/arch/armv7/exception.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/arch/armv7/exception.c b/src/arch/armv7/exception.c
index 14f82163c6..1055cb5663 100644
--- a/src/arch/armv7/exception.c
+++ b/src/arch/armv7/exception.c
@@ -143,9 +143,8 @@ void exception_init(void)
sctlr &= ~sctlr_te;
/* Set V=0 in SCTLR so VBAR points to the exception vector table. */
sctlr &= ~sctlr_v;
- /* Enforce alignment. */
- sctlr |= sctlr_a;
- set_sctlr(sctlr);
+ /* Enforce alignment temporarily. */
+ set_sctlr(sctlr | sctlr_a);
extern uint32_t exception_table[];
set_vbar((uintptr_t)exception_table);
@@ -155,4 +154,7 @@ void exception_init(void)
exception_test();
test_abort = 0;
printk(BIOS_ERR, "Testing exceptions: DONE\n");
+
+ /* Restore original alignment settings. */
+ set_sctlr(sctlr);
}