plcomreg.h revision 1.1.4.2 1 1.1.4.2 thorpej /* $NetBSD: plcomreg.h,v 1.1.4.2 2002/01/10 19:42:02 thorpej Exp $ */
2 1.1.4.2 thorpej
3 1.1.4.2 thorpej /*-
4 1.1.4.2 thorpej * Copyright (c) 2001 ARM Ltd
5 1.1.4.2 thorpej * All rights reserved.
6 1.1.4.2 thorpej *
7 1.1.4.2 thorpej * Redistribution and use in source and binary forms, with or without
8 1.1.4.2 thorpej * modification, are permitted provided that the following conditions
9 1.1.4.2 thorpej * are met:
10 1.1.4.2 thorpej * 1. Redistributions of source code must retain the above copyright
11 1.1.4.2 thorpej * notice, this list of conditions and the following disclaimer.
12 1.1.4.2 thorpej * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.4.2 thorpej * notice, this list of conditions and the following disclaimer in the
14 1.1.4.2 thorpej * documentation and/or other materials provided with the distribution.
15 1.1.4.2 thorpej * 3. The name of the company may not be used to endorse or promote
16 1.1.4.2 thorpej * products derived from this software without specific prior written
17 1.1.4.2 thorpej * permission.
18 1.1.4.2 thorpej *
19 1.1.4.2 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
20 1.1.4.2 thorpej * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 1.1.4.2 thorpej * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 1.1.4.2 thorpej * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 1.1.4.2 thorpej * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 1.1.4.2 thorpej * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 1.1.4.2 thorpej * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.1.4.2 thorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1.4.2 thorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.1.4.2 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.1.4.2 thorpej * SUCH DAMAGE.
30 1.1.4.2 thorpej */
31 1.1.4.2 thorpej
32 1.1.4.2 thorpej
33 1.1.4.2 thorpej #define PLCOM_FREQ 1843200 /* 16-bit baud rate divisor */
34 1.1.4.2 thorpej #define PLCOM_TOLERANCE 30 /* baud rate tolerance, in 0.1% units */
35 1.1.4.2 thorpej
36 1.1.4.2 thorpej /* control register */
37 1.1.4.2 thorpej #define CR_LBE 0x80 /* Loopback enable */
38 1.1.4.2 thorpej #define CR_RTIE 0x40 /* Receive timeout interrupt enable */
39 1.1.4.2 thorpej #define CR_TIE 0x20 /* Transmit interrupt enable */
40 1.1.4.2 thorpej #define CR_RIE 0x10 /* Receive interrrupt enable */
41 1.1.4.2 thorpej #define CR_MSIE 0x08 /* Modem status interrupt enable */
42 1.1.4.2 thorpej #define CR_SIRLP 0x04 /* IrDA SIR Low power mode */
43 1.1.4.2 thorpej #define CR_SIREN 0x02 /* SIR Enable */
44 1.1.4.2 thorpej #define CR_UARTEN 0x01 /* Uart enable */
45 1.1.4.2 thorpej
46 1.1.4.2 thorpej /* interrupt identification register */
47 1.1.4.2 thorpej #define IIR_IMASK 0x0f
48 1.1.4.2 thorpej #define IIR_RTIS 0x08
49 1.1.4.2 thorpej #define IIR_TIS 0x04
50 1.1.4.2 thorpej #define IIR_RIS 0x02
51 1.1.4.2 thorpej #define IIR_MIS 0x01
52 1.1.4.2 thorpej
53 1.1.4.2 thorpej /* line control register */
54 1.1.4.2 thorpej #define LCR_WLEN 0x60 /* Mask of size bits */
55 1.1.4.2 thorpej #define LCR_8BITS 0x60 /* 8 bits per serial word */
56 1.1.4.2 thorpej #define LCR_7BITS 0x40 /* 7 bits */
57 1.1.4.2 thorpej #define LCR_6BITS 0x20 /* 6 bits */
58 1.1.4.2 thorpej #define LCR_5BITS 0x00 /* 5 bits */
59 1.1.4.2 thorpej #define LCR_FEN 0x10 /* FIFO enable */
60 1.1.4.2 thorpej #define LCR_STP2 0x08 /* 2 stop bits per serial word */
61 1.1.4.2 thorpej #define LCR_EPS 0x04 /* Even parity select */
62 1.1.4.2 thorpej #define LCR_PEN 0x02 /* Parity enable */
63 1.1.4.2 thorpej #define LCR_PEVEN (LCR_PEN | LCR_EPS)
64 1.1.4.2 thorpej #define LCR_PODD LCR_PEN
65 1.1.4.2 thorpej #define LCR_PNONE 0x00 /* No parity */
66 1.1.4.2 thorpej #define LCR_BRK 0x01 /* Break Control */
67 1.1.4.2 thorpej
68 1.1.4.2 thorpej /* modem control register */
69 1.1.4.2 thorpej #define MCR_RTS 0x02 /* Request To Send */
70 1.1.4.2 thorpej #define MCR_DTR 0x01 /* Data Terminal Ready */
71 1.1.4.2 thorpej
72 1.1.4.2 thorpej /* receive status register */
73 1.1.4.2 thorpej
74 1.1.4.2 thorpej #define RSR_OE 0x08 /* Overrun Error */
75 1.1.4.2 thorpej #define RSR_BE 0x04 /* Break */
76 1.1.4.2 thorpej #define RSR_PE 0x02 /* Parity Error */
77 1.1.4.2 thorpej #define RSR_FE 0x01 /* Framing Error */
78 1.1.4.2 thorpej
79 1.1.4.2 thorpej /* flag register */
80 1.1.4.2 thorpej #define FR_TXFE 0x80 /* Transmit fifo empty */
81 1.1.4.2 thorpej #define FR_RXFF 0x40 /* Recive fifo full */
82 1.1.4.2 thorpej #define FR_TXFF 0x20 /* Transmit fifo full */
83 1.1.4.2 thorpej #define FR_RXFE 0x10 /* Receive fifo empty */
84 1.1.4.2 thorpej #define FR_BUSY 0x08 /* Uart Busy */
85 1.1.4.2 thorpej #define FR_DCD 0x04 /* Data carrier detect */
86 1.1.4.2 thorpej #define FR_DSR 0x02 /* Data set ready */
87 1.1.4.2 thorpej #define FR_CTS 0x01 /* Clear to send */
88 1.1.4.2 thorpej
89 1.1.4.2 thorpej /* modem status register */
90 1.1.4.2 thorpej /* All deltas are from the last read of the MSR. */
91 1.1.4.2 thorpej #define MSR_DCD FR_DCD
92 1.1.4.2 thorpej #define MSR_DSR FR_DSR
93 1.1.4.2 thorpej #define MSR_CTS FR_CTS
94 1.1.4.2 thorpej
95 1.1.4.2 thorpej /* Register offsets */
96 1.1.4.2 thorpej #define plcom_dr 0x00
97 1.1.4.2 thorpej #define plcom_rsr 0x04
98 1.1.4.2 thorpej #define plcom_ecr 0x04
99 1.1.4.2 thorpej #define plcom_lcr 0x08
100 1.1.4.2 thorpej #define plcom_dlbh 0x0c
101 1.1.4.2 thorpej #define plcom_dlbl 0x10
102 1.1.4.2 thorpej #define plcom_cr 0x14
103 1.1.4.2 thorpej #define plcom_fr 0x18
104 1.1.4.2 thorpej #define plcom_iir 0x1c
105 1.1.4.2 thorpej #define plcom_icr 0x1c
106 1.1.4.2 thorpej #define plcom_ilpr 0x20
107 1.1.4.2 thorpej
108 1.1.4.2 thorpej /* IFPGA specific */
109 1.1.4.2 thorpej #define PLCOM_UART_SIZE 0x24
110