diff options
author | Christoph Hellwig <hch@lst.de> | 2019-04-15 11:14:36 +0200 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2019-04-25 14:51:10 -0700 |
commit | df16c40cbfb43fbd6d5d879585b268b131fa95eb (patch) | |
tree | c1c45c1738eddba7c15f06e22bec302a30f47884 /arch/riscv | |
parent | 09afac77b6e83b66e95ab0a32ba878beb4f6ee28 (diff) |
riscv: clear all pending interrupts when booting
Just in case an old interrupt is pending make sure we clear everything
asserted before this kernel started. Based on similar M-mode code in
opensbi.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nick Kossifidis <mick@ics.forth.gr>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv')
-rw-r--r-- | arch/riscv/kernel/head.S | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S index fe884cd69abd..9e3840d84d3e 100644 --- a/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S @@ -22,8 +22,9 @@ __INIT ENTRY(_start) - /* Mask all interrupts */ + /* Mask and clear all interrupts */ csrw sie, zero + csrw sip, zero /* Load the global pointer */ .option push |