source: rtems/c/src/lib/libbsp/sparc/shared/include/cons.h @ e53daed

4.115
Last change on this file since e53daed was c1764100, checked in by Daniel Hellstrom <daniel@…>, on 12/16/11 at 10:39:23

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
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*  Console driver interface to UART drivers
2 *
3 *  - First console device that has System Console flag set will be
4 *    system console.
5 *  - If none of the registered console devices has system console set,
6 *    the first is registered device is used, unless it has
7 *
8 *  COPYRIGHT (c) 2010.
9 *  Cobham Gaisler AB.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 */
15
16#ifndef __CONS_H__
17#define __CONS_H__
18
19struct console_dev;
20
21#define CONSOLE_FLAG_SYSCON      0x01
22
23struct console_cons_ops {
24        void (*get_uart_attrs)(struct console_dev *, struct termios *t);
25};
26
27struct console_dev {
28        /* Set to non-zero if this UART should be system console and/or
29         * debug console.
30         */
31        int flags;
32        char *fsname; /* File system prefix */
33        const struct rtems_termios_callbacks *callbacks; /* TERMIOS Callbacks */
34        struct console_cons_ops ops;
35};
36
37extern void console_dev_register(struct console_dev *dev);
38#if 0
39extern void console_dev_unregister(struct console_dev *dev);
40#endif
41
42#endif
Note: See TracBrowser for help on using the repository browser.