summaryrefslogtreecommitdiff
path: root/include/grlib/apbuart.h
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2010-01-21 16:09:37 +0100
committerFrancois Retief <fgretief@spaceteq.co.za>2015-11-13 10:23:33 +0200
commitf2879f5952b35009c76de92ca57d67ab628bac0c (patch)
treecd79e349a44c8ed6dfc3cead9cf69b7e37fafb52 /include/grlib/apbuart.h
parentcff009ed6ff7da2e87f8213d34ed869be4373604 (diff)
sparc: leon3: Moved GRLIB core header files to common include/grlib directory
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Diffstat (limited to 'include/grlib/apbuart.h')
-rw-r--r--include/grlib/apbuart.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/grlib/apbuart.h b/include/grlib/apbuart.h
new file mode 100644
index 0000000000..1e1eb9a77c
--- /dev/null
+++ b/include/grlib/apbuart.h
@@ -0,0 +1,47 @@
+/* GRLIB APBUART definitions
+ *
+ * (C) Copyright 2010, 2015
+ * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __GRLIB_APBUART_H__
+#define __GRLIB_APBUART_H__
+
+/* APBUART Register map */
+typedef struct {
+ volatile unsigned int data;
+ volatile unsigned int status;
+ volatile unsigned int ctrl;
+ volatile unsigned int scaler;
+} ambapp_dev_apbuart;
+
+/*
+ * The following defines the bits in the LEON UART Status Registers.
+ */
+
+#define APBUART_STATUS_DR 0x00000001 /* Data Ready */
+#define APBUART_STATUS_TSE 0x00000002 /* TX Send Register Empty */
+#define APBUART_STATUS_THE 0x00000004 /* TX Hold Register Empty */
+#define APBUART_STATUS_BR 0x00000008 /* Break Error */
+#define APBUART_STATUS_OE 0x00000010 /* RX Overrun Error */
+#define APBUART_STATUS_PE 0x00000020 /* RX Parity Error */
+#define APBUART_STATUS_FE 0x00000040 /* RX Framing Error */
+#define APBUART_STATUS_ERR 0x00000078 /* Error Mask */
+
+/*
+ * The following defines the bits in the LEON UART Ctrl Registers.
+ */
+
+#define APBUART_CTRL_RE 0x00000001 /* Receiver enable */
+#define APBUART_CTRL_TE 0x00000002 /* Transmitter enable */
+#define APBUART_CTRL_RI 0x00000004 /* Receiver interrupt enable */
+#define APBUART_CTRL_TI 0x00000008 /* Transmitter interrupt enable */
+#define APBUART_CTRL_PS 0x00000010 /* Parity select */
+#define APBUART_CTRL_PE 0x00000020 /* Parity enable */
+#define APBUART_CTRL_FL 0x00000040 /* Flow control enable */
+#define APBUART_CTRL_LB 0x00000080 /* Loop Back enable */
+#define APBUART_CTRL_DBG (1<<11) /* Debug Bit used by GRMON */
+
+#endif