Changeset c1764100 in rtems


Ignore:
Timestamp:
Dec 16, 2011, 10:39:23 AM (8 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
46e41c98
Parents:
045de35
git-author:
Daniel Hellstrom <daniel@…> (12/16/11 10:39:23)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:16)
Message:

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
Location:
c/src/lib/libbsp/sparc
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/Makefile.am

    r045de35 rc1764100  
    5050EXTRA_DIST += shared/include/grspw_rasta.h
    5151
    52 # UART  (APBUART)
     52# UART
     53EXTRA_DIST += shared/uart/cons.c
     54EXTRA_DIST += shared/uart/apbuart_cons.c
     55EXTRA_DIST += shared/include/cons.h
    5356EXTRA_DIST += shared/uart/apbuart.c
    5457EXTRA_DIST += shared/uart/apbuart_pci.c
  • c/src/lib/libbsp/sparc/leon3/Makefile.am

    r045de35 rc1764100  
    8080libbsp_a_SOURCES += ../../shared/console-termios.c
    8181libbsp_a_SOURCES += console/console.c
     82libbsp_a_SOURCES += ../../sparc/shared/uart/cons.c
     83libbsp_a_SOURCES += ../../sparc/shared/uart/apbuart_cons.c
     84include_HEADERS += ../../sparc/shared/include/cons.h
    8285# debugio
    8386libbsp_a_SOURCES += console/printk_support.c
  • c/src/lib/libbsp/sparc/leon3/include/bsp.h

    r045de35 rc1764100  
    256256 */
    257257#define AMBAPPBUS_INFO_AVAIL          /* AMBAPP Bus driver */
     258#define APBUART_INFO_AVAIL            /* APBUART Console driver */
    258259#define GPTIMER_INFO_AVAIL            /* GPTIMER Timer driver */
    259260
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    r045de35 rc1764100  
    8686#define LEON_REG_TIMER_CONTROL_LD    0x00000004  /* 1 = load counter */
    8787                                              /* 0 = no function */
     88
     89/*
     90 *  The following defines the bits in the UART Control Registers.
     91 */
     92
     93#define LEON_REG_UART_CONTROL_RTD  0x000000FF /* RX/TX data */
     94
     95/*
     96 *  The following defines the bits in the LEON UART Status Register.
     97 */
     98
     99#define LEON_REG_UART_STATUS_DR   0x00000001 /* Data Ready */
     100#define LEON_REG_UART_STATUS_TSE  0x00000002 /* TX Send Register Empty */
     101#define LEON_REG_UART_STATUS_THE  0x00000004 /* TX Hold Register Empty */
     102#define LEON_REG_UART_STATUS_BR   0x00000008 /* Break Error */
     103#define LEON_REG_UART_STATUS_OE   0x00000010 /* RX Overrun Error */
     104#define LEON_REG_UART_STATUS_PE   0x00000020 /* RX Parity Error */
     105#define LEON_REG_UART_STATUS_FE   0x00000040 /* RX Framing Error */
     106#define LEON_REG_UART_STATUS_TF   0x00000200 /* FIFO Full */
     107#define LEON_REG_UART_STATUS_ERR  0x00000078 /* Error Mask */
     108
     109/*
     110 *  The following defines the bits in the LEON UART Control Register.
     111 */
     112
     113#define LEON_REG_UART_CTRL_RE     0x00000001 /* Receiver enable */
     114#define LEON_REG_UART_CTRL_TE     0x00000002 /* Transmitter enable */
     115#define LEON_REG_UART_CTRL_RI     0x00000004 /* Receiver interrupt enable */
     116#define LEON_REG_UART_CTRL_TI     0x00000008 /* Transmitter interrupt enable */
     117#define LEON_REG_UART_CTRL_PS     0x00000010 /* Parity select */
     118#define LEON_REG_UART_CTRL_PE     0x00000020 /* Parity enable */
     119#define LEON_REG_UART_CTRL_FL     0x00000040 /* Flow control enable */
     120#define LEON_REG_UART_CTRL_LB     0x00000080 /* Loop Back enable */
     121#define LEON_REG_UART_CTRL_DB     0x00000800 /* Debug FIFO enable */
     122#define LEON_REG_UART_CTRL_SI     0x00004000 /* TX shift register empty IRQ enable */
     123#define LEON_REG_UART_CTRL_FA     0x80000000 /* FIFO Available */
     124#define LEON_REG_UART_CTRL_FA_BIT 31
    88125
    89126/*
  • c/src/lib/libbsp/sparc/leon3/preinstall.am

    r045de35 rc1764100  
    110110PREINSTALL_FILES += $(PROJECT_INCLUDE)/tlib.h
    111111
     112$(PROJECT_INCLUDE)/cons.h: ../../sparc/shared/include/cons.h $(PROJECT_INCLUDE)/$(dirstamp)
     113        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/cons.h
     114PREINSTALL_FILES += $(PROJECT_INCLUDE)/cons.h
     115
    112116$(PROJECT_INCLUDE)/bsp/irq-generic.h: ../../shared/include/irq-generic.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    113117        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h
  • c/src/lib/libbsp/sparc/shared/include/drvmgr/ambapp_bus.h

    r045de35 rc1764100  
    2929
    3030/*** Gaisler Hardware Device Driver IDs ***/
     31#define DRIVER_AMBAPP_GAISLER_APBUART_ID       DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_APBUART)
    3132#define DRIVER_AMBAPP_GAISLER_GPTIMER_ID       DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GPTIMER)
    3233
Note: See TracChangeset for help on using the changeset viewer.