]> git.ipfire.org Git - people/ms/u-boot.git/blob - include/grlib/apbuart.h
sparc: leon3: Moved GRLIB core header files to common include/grlib directory
[people/ms/u-boot.git] / include / grlib / apbuart.h
1 /* GRLIB APBUART definitions
2 *
3 * (C) Copyright 2010, 2015
4 * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9 #ifndef __GRLIB_APBUART_H__
10 #define __GRLIB_APBUART_H__
11
12 /* APBUART Register map */
13 typedef struct {
14 volatile unsigned int data;
15 volatile unsigned int status;
16 volatile unsigned int ctrl;
17 volatile unsigned int scaler;
18 } ambapp_dev_apbuart;
19
20 /*
21 * The following defines the bits in the LEON UART Status Registers.
22 */
23
24 #define APBUART_STATUS_DR 0x00000001 /* Data Ready */
25 #define APBUART_STATUS_TSE 0x00000002 /* TX Send Register Empty */
26 #define APBUART_STATUS_THE 0x00000004 /* TX Hold Register Empty */
27 #define APBUART_STATUS_BR 0x00000008 /* Break Error */
28 #define APBUART_STATUS_OE 0x00000010 /* RX Overrun Error */
29 #define APBUART_STATUS_PE 0x00000020 /* RX Parity Error */
30 #define APBUART_STATUS_FE 0x00000040 /* RX Framing Error */
31 #define APBUART_STATUS_ERR 0x00000078 /* Error Mask */
32
33 /*
34 * The following defines the bits in the LEON UART Ctrl Registers.
35 */
36
37 #define APBUART_CTRL_RE 0x00000001 /* Receiver enable */
38 #define APBUART_CTRL_TE 0x00000002 /* Transmitter enable */
39 #define APBUART_CTRL_RI 0x00000004 /* Receiver interrupt enable */
40 #define APBUART_CTRL_TI 0x00000008 /* Transmitter interrupt enable */
41 #define APBUART_CTRL_PS 0x00000010 /* Parity select */
42 #define APBUART_CTRL_PE 0x00000020 /* Parity enable */
43 #define APBUART_CTRL_FL 0x00000040 /* Flow control enable */
44 #define APBUART_CTRL_LB 0x00000080 /* Loop Back enable */
45 #define APBUART_CTRL_DBG (1<<11) /* Debug Bit used by GRMON */
46
47 #endif