aboutsummaryrefslogtreecommitdiff
path: root/bl1/aarch64/bl1_entrypoint.S
diff options
context:
space:
mode:
authorAndrew Thoelke <andrew.thoelke@arm.com>2014-04-24 15:33:24 +0100
committerAndrew Thoelke <andrew.thoelke@arm.com>2014-05-07 09:27:36 +0100
commit40fd072548ab47ce21bc48dc8059513048693f4e (patch)
tree732fbe956cc63f9ba9ede13439c37c91c27df8a9 /bl1/aarch64/bl1_entrypoint.S
parente404d7f44a190b82332bb96daffa0c6239732218 (diff)
downloadtrusted-firmware-a-40fd072548ab47ce21bc48dc8059513048693f4e.tar.gz
Set processor endianness immediately after RESET
SCTLR_EL3.EE is being configured too late in bl1_arch_setup() and bl31_arch_setup() after data accesses have already occured on the cold and warm boot paths. This control bit must be configured immediately on CPU reset to match the endian state of the firmware (little endian). Fixes ARM-software/tf-issues#145 Change-Id: Ie12e46fbbed6baf024c30beb50751591bb8c8655
Diffstat (limited to 'bl1/aarch64/bl1_entrypoint.S')
-rw-r--r--bl1/aarch64/bl1_entrypoint.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/bl1/aarch64/bl1_entrypoint.S b/bl1/aarch64/bl1_entrypoint.S
index 012b779c77..62e12181da 100644
--- a/bl1/aarch64/bl1_entrypoint.S
+++ b/bl1/aarch64/bl1_entrypoint.S
@@ -43,6 +43,16 @@
func bl1_entrypoint
/* ---------------------------------------------
+ * Set the CPU endianness before doing anything
+ * that might involve memory reads or writes
+ * ---------------------------------------------
+ */
+ mrs x0, sctlr_el3
+ bic x0, x0, #SCTLR_EE_BIT
+ msr sctlr_el3, x0
+ isb
+
+ /* ---------------------------------------------
* Perform any processor specific actions upon
* reset e.g. cache, tlb invalidations etc.
* ---------------------------------------------