firmware: Ensure the mtvec is updated.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Atish Patra
2019-02-27 11:08:26 -08:00
committed by Anup Patel
parent 754ff34108
commit d4dd2b37f3

View File

@@ -184,6 +184,11 @@ _start_warm:
/* Setup trap handler */ /* Setup trap handler */
la a4, _trap_handler la a4, _trap_handler
csrw CSR_MTVEC, a4 csrw CSR_MTVEC, a4
/* Make sure that mtvec is updated */
1:
csrr a5, CSR_MTVEC
bne a4, a5, 1b
/* Initialize SBI runtime */ /* Initialize SBI runtime */
csrr a0, CSR_MSCRATCH csrr a0, CSR_MSCRATCH