diff --git a/sys/drv/Makefile b/sys/drv/Makefile index d46826082c..957b450225 100644 --- a/sys/drv/Makefile +++ b/sys/drv/Makefile @@ -39,8 +39,8 @@ SOURCES-AARCH64 = \ SOURCES-RISCV = \ clint.c \ liteuart.c \ - litex_riscv_rootdev.c \ plic.c \ + riscv_rootdev.c \ sbi_console.c \ sifive_uart.c diff --git a/sys/drv/litex_riscv_rootdev.c b/sys/drv/riscv_rootdev.c similarity index 98% rename from sys/drv/litex_riscv_rootdev.c rename to sys/drv/riscv_rootdev.c index fc15ff5f28..2f1229c6f6 100644 --- a/sys/drv/litex_riscv_rootdev.c +++ b/sys/drv/riscv_rootdev.c @@ -192,7 +192,11 @@ static int rootdev_attach(device_t *bus) { return ENXIO; rman_init(&rd->mem_rm, "RISC-V I/O space"); +#if __riscv_xlen == 64 + rman_manage_region(&rd->mem_rm, 0x00000000, 0x30000000); +#else rman_manage_region(&rd->mem_rm, 0xf0000000, 0x10000000); +#endif /* * NOTE: supervisor can only control supervisor and user interrupts, however, diff --git a/sys/drv/simplebus.c b/sys/drv/simplebus.c index c1bd9b6e70..1bafab9a05 100644 --- a/sys/drv/simplebus.c +++ b/sys/drv/simplebus.c @@ -231,7 +231,7 @@ static int sb_intr_to_rl(device_t *dev) { end: kfree(M_DEV, intrs); - return 0; + return err; } int simplebus_add_child(device_t *bus, const char *path, int unit,