summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/include
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2011-12-16 11:39:23 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2015-04-17 01:10:16 +0200
commitc176410021c40e2596a08fadf21f53c5d0343924 (patch)
treec4191fbf8e9c5c16b545355b309c32e8b674121f /c/src/lib/libbsp/sparc/shared/include
parentMERGE: new system clock implementation (diff)
downloadrtems-c176410021c40e2596a08fadf21f53c5d0343924.tar.bz2
LEON3: new Console driver, APBUART driver using Driver Manager
This patch reimplements the console driver of the LEON3 BSP, it has split up the console driver in two parts: Console driver and UART driver. Before the only UART supported was APBUART and only on-chip APBUARTs found during startup. However splitting the driver in two allows any UART interface to reuse the termios attach code of the console driver, pratically this has always been a problem when discovering APBUARTs after startup for example the PCI board GR-RASTA-IO has APBUARTs and must wait until after PCI has been setup. Since the only current driver that supports the new console driver uses the Driver Manager, the new console driver is only enabled when Driver Manager is initialized during startup. The new APBUART driver supports: * polling mode * interrupt mode * task-driven mode * set UART attributes * read UART attributes (system console inherit settings from boot loader) * Driver manager for finding/initialization of the hardware
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/include')
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/cons.h42
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/drvmgr/ambapp_bus.h1
2 files changed, 43 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/include/cons.h b/c/src/lib/libbsp/sparc/shared/include/cons.h
new file mode 100644
index 0000000000..2f1e51704f
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/include/cons.h
@@ -0,0 +1,42 @@
+/* Console driver interface to UART drivers
+ *
+ * - First console device that has System Console flag set will be
+ * system console.
+ * - If none of the registered console devices has system console set,
+ * the first is registered device is used, unless it has
+ *
+ * COPYRIGHT (c) 2010.
+ * Cobham Gaisler AB.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef __CONS_H__
+#define __CONS_H__
+
+struct console_dev;
+
+#define CONSOLE_FLAG_SYSCON 0x01
+
+struct console_cons_ops {
+ void (*get_uart_attrs)(struct console_dev *, struct termios *t);
+};
+
+struct console_dev {
+ /* Set to non-zero if this UART should be system console and/or
+ * debug console.
+ */
+ int flags;
+ char *fsname; /* File system prefix */
+ const struct rtems_termios_callbacks *callbacks; /* TERMIOS Callbacks */
+ struct console_cons_ops ops;
+};
+
+extern void console_dev_register(struct console_dev *dev);
+#if 0
+extern void console_dev_unregister(struct console_dev *dev);
+#endif
+
+#endif
diff --git a/c/src/lib/libbsp/sparc/shared/include/drvmgr/ambapp_bus.h b/c/src/lib/libbsp/sparc/shared/include/drvmgr/ambapp_bus.h
index 23e8cbd3a9..c8fca2422f 100644
--- a/c/src/lib/libbsp/sparc/shared/include/drvmgr/ambapp_bus.h
+++ b/c/src/lib/libbsp/sparc/shared/include/drvmgr/ambapp_bus.h
@@ -28,6 +28,7 @@ extern "C" {
DRIVER_ID(DRVMGR_BUS_TYPE_AMBAPP, ((((vendor) & 0xff) << 16) | ((device) & 0xfff)))
/*** Gaisler Hardware Device Driver IDs ***/
+#define DRIVER_AMBAPP_GAISLER_APBUART_ID DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_APBUART)
#define DRIVER_AMBAPP_GAISLER_GPTIMER_ID DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GPTIMER)
struct amba_dev_id {