firmware: Ensure the mtvec is updated.
authorAtish Patra <atish.patra@wdc.com>
Wed, 27 Feb 2019 19:08:26 +0000 (11:08 -0800)
committerAnup Patel <anup@brainfault.org>
Wed, 6 Mar 2019 03:29:54 +0000 (08:59 +0530)
Signed-off-by: Atish Patra <atish.patra@wdc.com>
firmware/fw_base.S

index 3c509cf..83fe2aa 100644 (file)
@@ -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