On 2017-04-14 05:21, Chris Johns wrote:
On 14/4/17 5:31 am, Daniel Hellstrom wrote:
From: Martin Aberg <mab...@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.
Since the dbg_uart isn't modified by this patch, we will post a separate patch prefixing with leon3_ instead.

+/* 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.
Good comment. We will post a second version of the patch.

Thanks!


Chris
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to