ixp12x0_comreg.h revision 1.7 1 1.5 ichiro /* $NetBSD: ixp12x0_comreg.h,v 1.7 2003/03/06 06:14:16 igy Exp $ */
2 1.1 ichiro
3 1.1 ichiro /*
4 1.1 ichiro * Copyright (c) 2002
5 1.1 ichiro * Ichiro FUKUHARA <ichiro (at) ichiro.org>. All rights reserved.
6 1.1 ichiro *
7 1.1 ichiro * Redistribution and use in source and binary forms, with or without
8 1.1 ichiro * modification, are permitted provided that the following conditions
9 1.1 ichiro * are met:
10 1.1 ichiro * 1. Redistributions of source code must retain the above copyright
11 1.1 ichiro * notice, this list of conditions and the following disclaimer.
12 1.1 ichiro * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 ichiro * notice, this list of conditions and the following disclaimer in the
14 1.1 ichiro * documentation and/or other materials provided with the distribution.
15 1.1 ichiro * 3. All advertising materials mentioning features or use of this software
16 1.1 ichiro * must display the following acknowledgement:
17 1.1 ichiro * This product includes software developed by Ichiro FUKUHARA.
18 1.1 ichiro * 4. Neither the name of the author nor the names of any co-contributors
19 1.1 ichiro * may be used to endorse or promote products derived from this software
20 1.1 ichiro * without specific prior written permission.
21 1.1 ichiro *
22 1.1 ichiro * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA AND CONTRIBUTORS ``AS IS''
23 1.1 ichiro * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1 ichiro * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 ichiro * ARE DISCLAIMED. IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS
26 1.1 ichiro * HEAD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27 1.1 ichiro * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 1.1 ichiro * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 1.1 ichiro * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 1.1 ichiro * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 1.1 ichiro * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 1.1 ichiro * THE POSSIBILITY OF SUCH DAMAGE.
33 1.1 ichiro */
34 1.1 ichiro
35 1.1 ichiro /*
36 1.1 ichiro * IXP12X0 UART register
37 1.1 ichiro * UART_SR 0x90003400
38 1.1 ichiro * UART_CR 0x90003800
39 1.1 ichiro * UART_DR 0x90003C00
40 1.1 ichiro */
41 1.1 ichiro
42 1.7 igy #ifndef _IXP12X0_COMREG_H_
43 1.7 igy #define _IXP12X0_COMREG_H_
44 1.7 igy
45 1.1 ichiro #define IXPCOM_FREQ (3686400 / 16)
46 1.1 ichiro #define IXPCOMSPEED(b) (IXPCOM_FREQ / (b) - 1)
47 1.1 ichiro #define IXPCOMSPEED2BRD(b) (IXPCOMSPEED(b) << 16)
48 1.1 ichiro
49 1.6 igy /* I/O space */
50 1.4 ichiro #define IXPCOM_UART_SIZE 0x00004000UL
51 1.6 igy #define IXPCOM_UART_OFFSET 0x00000000UL
52 1.6 igy #define IXPCOM_UART_HWBASE (IXP12X0_SYS_HWBASE + IXPCOM_UART_OFFSET)
53 1.6 igy /* IXPCOM_UART_VBASE should be used only for console's ioh. */
54 1.6 igy #define IXPCOM_UART_VBASE (IXP12X0_SYS_VBASE + IXPCOM_UART_OFFSET)
55 1.1 ichiro
56 1.1 ichiro /* UART control register */
57 1.1 ichiro #define IXPCOM_CR 0x00003800UL
58 1.1 ichiro #define CR_BRK 0x01 /* Break */
59 1.1 ichiro #define CR_PE 0x02 /* Parity enable */
60 1.1 ichiro #define CR_OES 0x04 /* Odd/even parity select */
61 1.1 ichiro #define CR_SBS 0x08 /* Stop bit select */
62 1.1 ichiro #define SBS_1STOP (0 << 3) /* 1 Stop Bit */
63 1.1 ichiro #define SBS_2STOP (1 << 3) /* 2 Stop Bit */
64 1.1 ichiro #define CR_RIE 0x10 /* Receive FIFO interrupt enable */
65 1.1 ichiro #define CR_DSS 0x60 /* Data size select */
66 1.1 ichiro #define DSS_5BIT (0 << 5) /* 5Bits */
67 1.1 ichiro #define DSS_6BIT (1 << 5) /* 6Bits */
68 1.1 ichiro #define DSS_7BIT (2 << 5) /* 7Bits */
69 1.1 ichiro #define DSS_8BIT (3 << 5) /* 8Bits */
70 1.1 ichiro #define CR_UE 0x80 /* UART Enable */
71 1.1 ichiro #define UE_DISABLE (0 << 7) /* UART Disabled */
72 1.1 ichiro #define UE_ENABLE (1 << 7) /* UART Enabled */
73 1.1 ichiro #define CR_XIE 0x100 /* Transmit FIFO interrupt enable */
74 1.1 ichiro #define CR_UIS 0x200 /* UART Interrupt Select */
75 1.1 ichiro #define CR_BRD 0x03ff0000 /* Baud rate divisor */
76 1.1 ichiro
77 1.1 ichiro
78 1.1 ichiro /* UART Status register */
79 1.4 ichiro #define IXPCOM_SR 0x00003400UL
80 1.1 ichiro #define SR_PRE 0x01 /* Parity error */
81 1.1 ichiro #define SR_FRE 0x02 /* Framing error */
82 1.1 ichiro #define SR_TXR 0x04 /* Transmit FIFO Ready */
83 1.1 ichiro #define SR_ROR 0x08 /* Receiver overrun */
84 1.1 ichiro #define SR_RXR 0x10 /* Receiver FIFO Ready */
85 1.2 ichiro #define SR_TXE 0x20 /* Transmit FIFO Empty */
86 1.1 ichiro #define SR_RXF 0x40 /* Receiver FIFO Full */
87 1.1 ichiro #define SR_TXF 0x80 /* Transmit FIFO Full */
88 1.1 ichiro
89 1.1 ichiro
90 1.1 ichiro /* UART data register */
91 1.4 ichiro #define IXPCOM_DR 0x00003C00UL
92 1.1 ichiro #define DR_PRE 0x100 /* Parity error */
93 1.1 ichiro #define DR_FRE 0x200 /* Framing error */
94 1.1 ichiro #define DR_ROR 0x400 /* Receiver overrun */
95 1.1 ichiro
96 1.1 ichiro #define IXPCOMSPLRAISED (~(CR_RIE | CR_XIE))
97 1.1 ichiro #define IXPCOMSPLLOWERD (~0UL);
98 1.7 igy
99 1.7 igy #endif /* _IXP12X0_COMREG_H_ */
100