From d4dd2b37f3a80fc99345930879721499cf9e0c8a Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Wed, 27 Feb 2019 11:08:26 -0800 Subject: [PATCH] firmware: Ensure the mtvec is updated. Signed-off-by: Atish Patra --- firmware/fw_base.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index 3c509cf..83fe2aa 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -184,6 +184,11 @@ _start_warm: /* Setup trap handler */ la a4, _trap_handler csrw CSR_MTVEC, a4 + /* Make sure that mtvec is updated */ + 1: + csrr a5, CSR_MTVEC + bne a4, a5, 1b + /* Initialize SBI runtime */ csrr a0, CSR_MSCRATCH -- 2.7.4