lib: Add csr detect support
authorAtish Patra <atish.patra@wdc.com>
Sat, 9 May 2020 23:47:24 +0000 (16:47 -0700)
committerAnup Patel <anup@brainfault.org>
Sun, 10 May 2020 04:29:20 +0000 (09:59 +0530)
commitaef9a60d521a7810557d1caf826311bc349691ac
treeeb81d072b85951e695c8e8f74658fb76b44c7185
parent63a513edeccee1758bbfe5111ccc4fbec8f18a12
lib: Add csr detect support

As RISC-V ISA allows many CSRs such as pmp, s/mcounteren to be optional
in hardware, OpenSBI should provide an option to dynamically detect
these csr access capability at run time.

Implement a csr read/write access check helper macros.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Tested-by: Jonathan Balkind <jbalkind@cs.princeton.edu>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
include/sbi/sbi_csr_detect.h [new file with mode: 0644]