aboutsummaryrefslogtreecommitdiff
path: root/bl31
diff options
context:
space:
mode:
authorAndrew Thoelke <andrew.thoelke@arm.com>2014-05-22 12:30:37 +0100
committerAndrew Thoelke <andrew.thoelke@arm.com>2014-05-22 12:30:37 +0100
commitba9dbd10399c57e6bd4f19f2f5904b06f26d3ee4 (patch)
treebd066f88c09ca2369031a5adb2fc631def7502ef /bl31
parent39f6a68bd1c4d6c44fc0608289259c87b8ecbb6c (diff)
parentbb5ffdba18198cffa7480c7dd66c3e0d60a7af30 (diff)
downloadarm-trusted-firmware-ba9dbd10399c57e6bd4f19f2f5904b06f26d3ee4.tar.gz
Merge pull request #83 from athoelke/at/tf-issues-126
Set SCR_EL3.RW correctly before exiting bl31_main
Diffstat (limited to 'bl31')
-rw-r--r--bl31/bl31_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c
index 5a09829..561dbab 100644
--- a/bl31/bl31_main.c
+++ b/bl31/bl31_main.c
@@ -169,9 +169,15 @@ void bl31_prepare_next_image_entry()
assert(next_image_info);
scr = read_scr();
+ scr &= ~SCR_NS_BIT;
if (image_type == NON_SECURE)
scr |= SCR_NS_BIT;
+ scr &= ~SCR_RW_BIT;
+ if ((next_image_info->spsr & (1 << MODE_RW_SHIFT)) ==
+ (MODE_RW_64 << MODE_RW_SHIFT))
+ scr |= SCR_RW_BIT;
+
/*
* Tell the context mgmt. library to ensure that SP_EL3 points to
* the right context to exit from EL3 correctly.