summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/ppcn_60x/console/ns16550_p.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-02-18 16:48:14 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-02-18 16:48:14 +0000
commit0c04c377bc8ac177d28bd0e0096d7c6940d33cd4 (patch)
treeba3062eb819e89de2eee14397ffe61b202ad10de /c/src/lib/libbsp/powerpc/ppcn_60x/console/ns16550_p.h
parent./clock/Makefile.in,v (diff)
downloadrtems-0c04c377bc8ac177d28bd0e0096d7c6940d33cd4.tar.bz2
./clock/Makefile.in,v
./clock/clock.c,v ./console/Makefile.in,v ./console/config.c,v ./console/console.c,v ./console/console.h,v ./console/debugio.c,v ./console/i8042.c,v ./console/i8042_p.h,v ./console/i8042vga.c,v ./console/i8042vga.h,v ./console/ns16550.c,v ./console/ns16550.h,v ./console/ns16550_p.h,v ./console/ns16550cfg.c,v ./console/ns16550cfg.h,v ./console/vga.c,v ./console/vga_p.h,v ./console/z85c30.c,v ./console/z85c30.h,v ./console/z85c30_p.h,v ./console/z85c30cfg.c,v ./console/z85c30cfg.h,v ./include/Makefile.in,v ./include/bsp.h,v ./include/chain.h,v ./include/coverhd.h,v ./include/extisrdrv.h,v ./include/nvram.h,v ./include/pci.h,v ./include/tod.h,v ./network/Makefile.in,v ./network/amd79c970.c,v ./network/amd79c970.h,v ./nvram/Makefile.in,v ./nvram/ds1385.h,v ./nvram/mk48t18.h,v ./nvram/nvram.c,v ./nvram/prepnvr.h,v ./nvram/stk11c68.h,v ./pci/Makefile.in,v ./pci/pci.c,v ./start/Makefile.in,v ./start/start.s,v ./startup/Makefile.in,v ./startup/bspclean.c,v ./startup/bspstart.c,v ./startup/bsptrap.s,v ./startup/device-tree,v ./startup/genpvec.c,v ./startup/linkcmds,v ./startup/rtems-ctor.cc,v ./startup/sbrk.c,v ./startup/setvec.c,v ./startup/spurious.c,v ./startup/swap.c,v ./timer/Makefile.in,v ./timer/timer.c,v ./tod/Makefile.in,v ./tod/cmos.h,v ./tod/tod.c,v ./universe/Makefile.in,v ./universe/universe.c,v ./vectors/Makefile.in,v ./vectors/README,v ./vectors/align_h.s,v ./vectors/vectors.s,v ./wrapup/Makefile.in,v ./Makefile.in,v ./README,v ./STATUS,v ./bsp_specs,v
Diffstat (limited to 'c/src/lib/libbsp/powerpc/ppcn_60x/console/ns16550_p.h')
-rw-r--r--c/src/lib/libbsp/powerpc/ppcn_60x/console/ns16550_p.h196
1 files changed, 196 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/ppcn_60x/console/ns16550_p.h b/c/src/lib/libbsp/powerpc/ppcn_60x/console/ns16550_p.h
new file mode 100644
index 0000000000..7f7f51afa9
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/ppcn_60x/console/ns16550_p.h
@@ -0,0 +1,196 @@
+/*
+ * COPYRIGHT (c) 1998 by Radstone Technology
+ *
+ *
+ * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
+ * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
+ *
+ * You are hereby granted permission to use, copy, modify, and distribute
+ * this file, provided that this notice, plus the above copyright notice
+ * and disclaimer, appears in all copies. Radstone Technology will provide
+ * no support for this code.
+ *
+ */
+
+#ifndef _NS16550_P_H_
+#define _NS16550_P_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Define serial port read registers structure.
+ */
+
+typedef volatile struct _SP_READ_REGISTERS {
+ unsigned char ReceiveBuffer;
+ unsigned char InterruptEnable;
+ unsigned char InterruptId;
+ unsigned char LineControl;
+ unsigned char ModemControl;
+ unsigned char LineStatus;
+ unsigned char ModemStatus;
+ unsigned char ScratchPad;
+} SP_READ_REGISTERS, *PSP_READ_REGISTERS;
+
+/*
+ * Define serial port write registers structure.
+ */
+
+typedef volatile struct _SP_WRITE_REGISTERS {
+ unsigned char TransmitBuffer;
+ unsigned char InterruptEnable;
+ unsigned char FifoControl;
+ unsigned char LineControl;
+ unsigned char ModemControl;
+ unsigned char Reserved1;
+ unsigned char ModemStatus;
+ unsigned char ScratchPad;
+} SP_WRITE_REGISTERS, *PSP_WRITE_REGISTERS;
+
+/*
+ * Define serial port interrupt enable register structure.
+ */
+
+#define SP_INT_RX_ENABLE 0x01
+#define SP_INT_TX_ENABLE 0x02
+#define SP_INT_LS_ENABLE 0x04
+#define SP_INT_MS_ENABLE 0x08
+
+/*
+ * Define serial port interrupt id register structure.
+ */
+
+typedef struct _SP_INTERRUPT_ID {
+ unsigned char InterruptPending : 1;
+ unsigned char Identification : 3;
+ unsigned char Reserved1 : 2;
+ unsigned char FifoEnabled : 2;
+} SP_INTERRUPT_ID, *PSP_INTERRUPT_ID;
+
+/*
+ * Define serial port fifo control register structure.
+ */
+#define SP_FIFO_ENABLE 0x01
+#define SP_FIFO_RXRST 0x02
+#define SP_FIFO_TXRST 0x04
+#define SP_FIFO_DMA 0x08
+#define SP_FIFO_RXLEVEL 0xc0
+
+/*
+ * Define serial port line control register structure.
+ */
+#define SP_LINE_SIZE 0x03
+#define SP_LINE_STOP 0x04
+#define SP_LINE_PAR 0x08
+#define SP_LINE_ODD 0x10
+#define SP_LINE_STICK 0x20
+#define SP_LINE_BREAK 0x40
+#define SP_LINE_DLAB 0x80
+
+/*
+ * Line status register character size definitions.
+ */
+#define FIVE_BITS 0x0 /* five bits per character */
+#define SIX_BITS 0x1 /* six bits per character */
+#define SEVEN_BITS 0x2 /* seven bits per character */
+#define EIGHT_BITS 0x3 /* eight bits per character */
+
+/*
+ * Line speed divisor definition.
+ */
+#define NS16550_Baud(baud_rate) (115200/baud_rate)
+
+/*
+ * Define serial port modem control register structure.
+ */
+#define SP_MODEM_DTR 0x01
+#define SP_MODEM_RTS 0x02
+#define SP_MODEM_IRQ 0x08
+#define SP_MODEM_LOOP 0x10
+#define SP_MODEM_DIV4 0x80
+
+/*
+ * Define serial port line status register structure.
+ */
+#define SP_LSR_RDY 0x01
+#define SP_LSR_EOVRUN 0x02
+#define SP_LSR_EPAR 0x04
+#define SP_LSR_EFRAME 0x08
+#define SP_LSR_BREAK 0x10
+#define SP_LSR_THOLD 0x20
+#define SP_LSR_TX 0x40
+#define SP_LSR_EFIFO 0x80
+
+typedef struct _ns16550_context
+{
+ unsigned8 ucModemCtrl;
+} ns16550_context;
+
+/*
+ * Driver functions
+ */
+static boolean ns16550_probe(int minor);
+
+static void ns16550_init(int minor);
+
+static int ns16550_open(
+ int major,
+ int minor,
+ void * arg
+);
+
+static int ns16550_close(
+ int major,
+ int minor,
+ void * arg
+);
+
+static void ns16550_write_polled(
+ int minor,
+ char cChar
+);
+
+static void ns16550_assert_RTS(
+ int minor
+);
+
+static void ns16550_negate_RTS(
+ int minor
+);
+
+static void ns16550_assert_DTR(
+ int minor
+);
+
+static void ns16550_negate_DTR(
+ int minor
+);
+
+static void ns16550_initialize_interrupts(int minor);
+
+static int ns16550_flush(int major, int minor, void *arg);
+
+static int ns16550_write_support_int(
+ int minor,
+ const char *buf,
+ int len
+);
+
+static int ns16550_write_support_polled(
+ int minor,
+ const char *buf,
+ int len
+ );
+
+static int ns16550_inbyte_nonblocking_polled(
+ int minor
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _NS16550_P_H_ */