summaryrefslogtreecommitdiffstats
path: root/bsps/riscv
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-24 14:47:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-25 10:07:44 +0200
commit581a0f8866401ab057f1b827c7b02c93e8f43fad (patch)
tree9cf295dbdfc35eec3242d64af650394a6a13c911 /bsps/riscv
parentbsp/riscv: Add PLIC support (diff)
downloadrtems-581a0f8866401ab057f1b827c7b02c93e8f43fad.tar.bz2
bsp/riscv: Use interrupt driven NS16550 driver
Update #3433.
Diffstat (limited to 'bsps/riscv')
-rw-r--r--bsps/riscv/riscv/console/console-config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/bsps/riscv/riscv/console/console-config.c b/bsps/riscv/riscv/console/console-config.c
index 270646ffe1..ceb6b785fb 100644
--- a/bsps/riscv/riscv/console/console-config.c
+++ b/bsps/riscv/riscv/console/console-config.c
@@ -133,6 +133,14 @@ static void riscv_console_probe(void)
ctx->clock = fdt32_to_cpu(val[0]);
+ val = (fdt32_t *) fdt_getprop(fdt, node, "interrupts", &len);
+
+ if (val == NULL || len != 4) {
+ bsp_fatal(RISCV_FATAL_NO_NS16550_INTERRUPTS_IN_DEVICE_TREE);
+ }
+
+ ctx->irq = RISCV_INTERRUPT_VECTOR_EXTERNAL(fdt32_to_cpu(val[0]));
+
if (node == console_node) {
riscv_console.context = &ctx->base;
riscv_console.putchar = ns16550_polled_putchar;
@@ -198,7 +206,7 @@ rtems_status_code console_initialize(
rtems_termios_device_install(
path,
- &ns16550_handler_polled,
+ &ns16550_handler_interrupt,
NULL,
&ctx->base
);