riscv: Add option to support RISC-V privileged spec 1.9
authorSean Anderson <seanga2@gmail.com>
Wed, 24 Jun 2020 10:41:19 +0000 (06:41 -0400)
committerAndes <uboot@andestech.com>
Wed, 1 Jul 2020 07:01:22 +0000 (15:01 +0800)
commitb8bc120927a75ccbdd3a242555933dc644391bc8
treec45afd3e5baf6fe2c64ce1a35125eee0b240d313
parent40686c394e533fec765fe237936e353c84e73fff
riscv: Add option to support RISC-V privileged spec 1.9

Some older processors (notably the Kendryte K210) use an older version of
the RISC-V privileged specification. The primary changes between the old
and new are in virtual memory, and in the merging of three separate counter
enable CSRs.  Using the new CSR on an old processor causes an illegal
instruction exception.  This patch adds an option to use the old CSRs
instead of the new one.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/riscv/Kconfig
arch/riscv/cpu/cpu.c
arch/riscv/include/asm/csr.h