diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-01-11 08:27:40 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-01-12 08:15:58 +0100 |
commit | d46366a2e755865884551166c9fec0533673ec87 (patch) | |
tree | 6b5d3b2d75662de0dc3e315ae1d688dd897cdb27 /bsps/riscv/riscv/irq/irq.c | |
parent | bsps/xil: Use the LP64 header for ILP32 (diff) | |
download | rtems-d46366a2e755865884551166c9fec0533673ec87.tar.bz2 |
riscv: Resurrect RISCV_ENABLE_HTIF_SUPPORT
Low-end configurations may want to have the HTIF support removed.
Enable the option by default. Fix formatting. Fix node validity
checks.
Updates #4779.
Diffstat (limited to '')
-rw-r--r-- | bsps/riscv/riscv/irq/irq.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bsps/riscv/riscv/irq/irq.c b/bsps/riscv/riscv/irq/irq.c index f0ccc6f5f0..e8d297052b 100644 --- a/bsps/riscv/riscv/irq/irq.c +++ b/bsps/riscv/riscv/irq/irq.c @@ -249,14 +249,18 @@ static void riscv_plic_init(const void *fdt) plic = riscv_fdt_get_address(fdt, node); if (plic == NULL) { - node = fdt_node_offset_by_compatible(fdt, -1, "ucb,htif0"); +#ifdef RISCV_ENABLE_HTIF_SUPPORT + node = fdt_node_offset_by_compatible(fdt, -1, "ucb,htif0"); - /* Spike platform has HTIF and does not have a PLIC */ - if (node != -1) { - return; - } else { - bsp_fatal(RISCV_FATAL_NO_PLIC_REG_IN_DEVICE_TREE); - } + /* Spike platform has HTIF and does not have a PLIC */ + if (node >= 0) { + return; + } else { + bsp_fatal(RISCV_FATAL_NO_PLIC_REG_IN_DEVICE_TREE); + } +#else + bsp_fatal(RISCV_FATAL_NO_PLIC_REG_IN_DEVICE_TREE); +#endif } riscv_plic = plic; |