[PATCH 08/30] leon, apbuart: RX delayed interrupt
Chris Johns
chrisj at rtems.org
Fri Apr 14 03:21:44 UTC 2017
On 14/4/17 5:31 am, Daniel Hellstrom wrote:
> From: Martin Aberg <maberg at gaisler.com>
>
> Utilize the APBUART RX delayed interrupt if available. It also
> enables RX FIFO interrupt when used.
>
> The APBUART RX delayed interrupt is supported by the GR740.
> ---
> c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c | 44 +++++++++++++++++++++--
> 1 file changed, 42 insertions(+), 2 deletions(-)
>
> diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
> index b070db5..e6cbd82 100644
> --- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
> +++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
> @@ -50,6 +50,11 @@ extern void apbuart_outbyte_polled(
> extern int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
> extern struct apbuart_regs *dbg_uart; /* The debug UART */
A minor nit, this name pollutes the application namespace.
>
> +/* Probed hardware capabilities */
> +enum {
> + CAP_FIFO = 0x01, /* FIFO available */
> + CAP_DI = 0x02, /* RX delayed interrupt available */
> +};
> struct apbuart_priv {
> struct console_dev condev;
> struct drvmgr_dev *dev;
> @@ -58,6 +63,7 @@ struct apbuart_priv {
> char devName[32];
> volatile int sending;
> int mode;
> + int cap;
> };
>
> /* Getters for different interfaces. It happens to be just casting which we do
> @@ -186,6 +192,30 @@ static const rtems_termios_device_handler handler_polled = {
> .mode = TERMIOS_POLLED
> };
>
> +/*
> + * APBUART hardware instantiation is flexible. Probe features here and driver
> + * can select appropriate routines for the hardware. probecap() return value
> + * is a CAP_ bitmask.
> + */
> +static int probecap(volatile struct apbuart_regs *regs)
Why is there a volatile in this decl?
I do not see volatile used like this else where in the patches.
Chris
More information about the devel
mailing list