]> git.baikalelectronics.ru Git - uboot.git/commit
riscv: do not blindly modify the mstatus CSR
authorLukas Auer <lukas.auer@aisec.fraunhofer.de>
Thu, 22 Nov 2018 10:26:28 +0000 (11:26 +0100)
committerAndes <uboot@andestech.com>
Mon, 26 Nov 2018 05:57:32 +0000 (13:57 +0800)
commit77760df38d3c2fc4cfb3defb40c8c425609c8c63
tree1c1e7f54e906684be5ffb570bedea526ae94afa9
parentce21c86853b482da80ccc200dd97e1d6c5ffff45
riscv: do not blindly modify the mstatus CSR

The mstatus CSR includes WPRI (writes preserve values, reads ignore
values) fields and must therefore not be set to zero without preserving
these fields. It is not apparent why mstatus is set to zero here since
it is not required for U-Boot to run. Remove it.

This instruction and others encode zero as an immediate.  RISC-V has the
zero register for this purpose. Replace the immediates with the zero
register.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
arch/riscv/cpu/start.S