[PATCH] riscv: Allow platforms with no PLIC to proceed

Hesham Almatary Hesham.Almatary at cl.cam.ac.uk
Mon Sep 17 12:12:07 UTC 2018


Spike simulator and QEMU's spike_v1.10 don't have a PLIC
---
 bsps/riscv/riscv/irq/irq.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bsps/riscv/riscv/irq/irq.c b/bsps/riscv/riscv/irq/irq.c
index 1a76846..3c35a37 100644
--- a/bsps/riscv/riscv/irq/irq.c
+++ b/bsps/riscv/riscv/irq/irq.c
@@ -161,7 +161,12 @@ static void riscv_plic_init(const void *fdt)
 
   plic = riscv_fdt_get_address(fdt, node);
   if (plic == NULL) {
+#if RISCV_ENABLE_HTIF_SUPPORT != 0
+    /* Spike platform has HTIF and does not have a PLIC */
+    return;
+#else
     bsp_fatal(RISCV_FATAL_NO_PLIC_REG_IN_DEVICE_TREE);
+#endif
   }
 
   val = fdt_getprop(fdt, node, "riscv,ndev", &len);
-- 
2.7.4



More information about the devel mailing list