[PATCH 3/4] bsps/riscv: UART - Comment code that queries UART interrupts
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Apr 2 05:03:21 UTC 2019
On 31/03/2019 16:33, Hesham Almatary wrote:
> * Different RISC-V DTBs use different names for UART interrupts such as
> "interrupts" and "interrupts-extended", so it is not portable.
> * polling functions are currently used, so there is no need to query interrupts.
> ---
> bsps/riscv/riscv/console/console-config.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/bsps/riscv/riscv/console/console-config.c b/bsps/riscv/riscv/console/console-config.c
> index 04d0b28361..81e46f304f 100644
> --- a/bsps/riscv/riscv/console/console-config.c
> +++ b/bsps/riscv/riscv/console/console-config.c
> @@ -183,13 +183,20 @@ static void riscv_console_probe(void)
>
> ctx->clock = fdt32_to_cpu(val[0]);
>
> - val = (fdt32_t *) fdt_getprop(fdt, node, "interrupts", &len);
> + /* XXX Different RISC-V DTBs use different property names for interrupt
> + sources. If an interrupt-driven driver is needed, uncomment, replace the
> + "interrupts-extended" string below with your target's DTB name for UART
> + interrupts, and use interrupt-driven UART functions instead of
> + ns16550_polled_* functions */
> +
> + /* val = (fdt32_t *) fdt_getprop(fdt, node, "interrupts-extended", &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;
The driver uses interrupts:
rtems_status_code console_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg
)
...
rtems_termios_device_install(
path,
&ns16550_handler_interrupt,
NULL,
&ctx->base
);
In the long run we need some standard support for device trees similar
to what Linux or FreeBSD has. Unfortunately, this is a multiple man-week
work package.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel
mailing list