diff --git a/litex/soc/cores/cpu/naxriscv/core.py b/litex/soc/cores/cpu/naxriscv/core.py index e7991495f..e97c79622 100644 --- a/litex/soc/cores/cpu/naxriscv/core.py +++ b/litex/soc/cores/cpu/naxriscv/core.py @@ -254,6 +254,7 @@ class NaxRiscv(CPU): platform.add_source(os.path.join(vdir, self.netlist_name + ".v"), "verilog") def add_soc_components(self, soc, soc_region_cls): + # Set UART/Timer0 CSRs to the ones used by OpenSBI. soc.csr.add("uart", n=2) soc.csr.add("timer0", n=3) diff --git a/litex/soc/cores/cpu/vexriscv_smp/core.py b/litex/soc/cores/cpu/vexriscv_smp/core.py index 4a8b9d105..c198e0f25 100755 --- a/litex/soc/cores/cpu/vexriscv_smp/core.py +++ b/litex/soc/cores/cpu/vexriscv_smp/core.py @@ -375,6 +375,10 @@ class VexRiscvSMP(CPU): platform.add_source(os.path.join(vdir, self.cluster_name + ".v"), "verilog") def add_soc_components(self, soc, soc_region_cls): + # Set UART/Timer0 CSRs to the ones used by OpenSBI. + soc.csr.add("uart", n=2) + soc.csr.add("timer0", n=3) + # Define number of CPUs soc.add_config("CPU_COUNT", VexRiscvSMP.cpu_count) soc.add_constant("CPU_ISA", VexRiscvSMP.get_arch())