summaryrefslogtreecommitdiffstats
path: root/bsps/riscv/riscv/irq/irq.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-01-11 08:27:40 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-01-12 08:15:58 +0100
commitd46366a2e755865884551166c9fec0533673ec87 (patch)
tree6b5d3b2d75662de0dc3e315ae1d688dd897cdb27 /bsps/riscv/riscv/irq/irq.c
parentbsps/xil: Use the LP64 header for ILP32 (diff)
downloadrtems-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.c18
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;