diff options
author | HC Yen <hc.yen@mediatek.com> | 2015-01-12 18:53:01 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-21 13:43:12 +0100 |
commit | 9dd2cf695de3e787471046c0e848b59aecc8f809 (patch) | |
tree | c46bfbd6ba0222c876cea77b9aed9491bea82320 /payloads/libpayload | |
parent | 11e743ce2626449e7faef13d898c89dc95f30002 (diff) |
libpayload arm64: fix mmu_disable() cache problem
The raw_write_sctlr_current() cannot be used in mmu_disable() because
it pushes some registers to cached stack, and then just after cache
disabled, the value was gone.
BRANCH=none
BUG=none
TEST=build and boot on mt8173-evb
Change-Id: I512405b7917f27d16bdd3c51d9459827ad714e67
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: aafe64922cc4cd01ecb099db106d04538e3e57ff
Original-Change-Id: I0dda8518d14c46fae1fe76e3629bd4ee81c1e0ee
Original-Signed-off-by: HC Yen <hc.yen@mediatek.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/240323
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/8799
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r-- | payloads/libpayload/arch/arm64/mmu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c index 86d9fc5ee5..da2127d0da 100644 --- a/payloads/libpayload/arch/arm64/mmu.c +++ b/payloads/libpayload/arch/arm64/mmu.c @@ -332,9 +332,10 @@ static uint32_t is_mmu_enabled(void) */ void mmu_disable(void) { + uint32_t el = get_current_el(); uint32_t sctlr; - sctlr = raw_read_sctlr_current(); + sctlr = raw_read_sctlr(el); sctlr &= ~(SCTLR_C | SCTLR_M | SCTLR_I); tlbiall_current(); @@ -343,7 +344,7 @@ void mmu_disable(void) dsb(); isb(); - raw_write_sctlr_current(sctlr); + raw_write_sctlr(sctlr, el); dcache_clean_invalidate_all(); dsb(); |