scifreg.h revision 1.7 1 /* $NetBSD: scifreg.h,v 1.7 2006/02/13 23:26:31 uwe Exp $ */
2
3 /*-
4 * Copyright (C) 1999 SAITOH Masanobu. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #ifndef _SH3_SCIFREG_H_
30 #define _SH3_SCIFREG_H_
31
32 /*
33 * Serial Communication Interface (SCIF)
34 */
35
36 #ifdef SH3
37
38 /* SH3 definitions */
39
40 #define SHREG_SCSMR2 (*(volatile unsigned char *) 0xa4000150)
41 #define SHREG_SCBRR2 (*(volatile unsigned char *) 0xa4000152)
42 #define SHREG_SCSCR2 (*(volatile unsigned char *) 0xa4000154)
43 #define SHREG_SCFTDR2 (*(volatile unsigned char *) 0xa4000156)
44 #define SHREG_SCSSR2 (*(volatile unsigned short *) 0xa4000158)
45 #define SHREG_SCFRDR2 (*(volatile unsigned char *) 0xa400015A)
46 #define SHREG_SCFCR2 (*(volatile unsigned char *) 0xa400015C)
47 #define SHREG_SCFDR2 (*(volatile unsigned short *) 0xa400015E)
48
49 #else /* !SH3 */
50
51 /* SH4 definitions */
52
53 #define SHREG_SCSMR2 (*(volatile unsigned short *) 0xffe80000)
54 #define SHREG_SCBRR2 (*(volatile unsigned char *) 0xffe80004)
55 #define SHREG_SCSCR2 (*(volatile unsigned short *) 0xffe80008)
56 #define SHREG_SCFTDR2 (*(volatile unsigned char *) 0xffe8000c)
57 #define SHREG_SCFSR2 (*(volatile unsigned short *) 0xffe80010)
58 #define SHREG_SCFRDR2 (*(volatile unsigned char *) 0xffe80014)
59 #define SHREG_SCFCR2 (*(volatile unsigned short *) 0xffe80018)
60 #define SHREG_SCFDR2 (*(volatile unsigned short *) 0xffe8001c)
61
62 #define SHREG_SCSPTR2 (*(volatile unsigned short *) 0xffe80020)
63 #define SHREG_SCLSR2 (*(volatile unsigned short *) 0xffe80024)
64
65 /* alias */
66 #define SHREG_SCSFDR2 SHREG_SCFTDR2
67 #define SHREG_SCSSR2 SHREG_SCFSR2
68
69 #define SCSPTR2_RTSIO 0x0080
70 #define SCSPTR2_RTSDT 0x0040
71 #define SCSPTR2_CTSIO 0x0020
72 #define SCSPTR2_CTSDT 0x0010
73 #define SCSPTR2_SCKIO 0x0008
74 #define SCSPTR2_SCKDT 0x0004
75 #define SCSPTR2_SPB2IO 0x0002
76 #define SCSPTR2_SPB2DT 0x0001
77
78 #define SCLSR2_ORER 0x0001 /* overrun error */
79
80 #endif /* !SH3 */
81
82
83 /* common definitions */
84
85 #define SCSCR2_TIE 0x80 /* Transmit Interrupt Enable */
86 #define SCSCR2_RIE 0x40 /* Recieve Interrupt Enable */
87 #define SCSCR2_TE 0x20 /* Transmit Enable */
88 #define SCSCR2_RE 0x10 /* Receive Enable */
89 #define SCSCR2_CKE1 0x02 /* ClocK Enable 1 */
90 #define SCSCR2_CKE0 0x01 /* ClocK Enable 0 */
91
92 #define SCSSR2_ER 0x0080 /* ERror */
93 #define SCSSR2_TEND 0x0040 /* Transmit END */
94 #define SCSSR2_TDFE 0x0020 /* Transmit Data Fifo Empty */
95 #define SCSSR2_BRK 0x0010 /* BReaK detection */
96 #define SCSSR2_FER 0x0008 /* Framing ERror */
97 #define SCSSR2_PER 0x0004 /* Parity ERror */
98 #define SCSSR2_RDF 0x0002 /* Recieve fifo Data Full */
99 #define SCSSR2_DR 0x0001 /* Data Ready */
100
101 #define SCFCR2_RTRG1 0x80 /* Receive TRiGger 1 */
102 #define SCFCR2_RTRG0 0x40 /* Receive TRiGger 0 */
103 #define SCFCR2_TTRG1 0x20 /* Transmit TRiGger 1 */
104 #define SCFCR2_TTRG0 0x10 /* Transmit TRiGger 0 */
105 #define SCFCR2_MCE 0x08 /* Modem Control Enable */
106 #define SCFCR2_TFRST 0x04 /* Transmit Fifo register ReSeT */
107 #define SCFCR2_RFRST 0x02 /* Receive Fifo register ReSeT */
108 #define SCFCR2_LOOP 0x01 /* LOOP back test */
109
110 #define FIFO_RCV_TRIGGER_1 0x00
111 #define FIFO_RCV_TRIGGER_4 0x40
112 #define FIFO_RCV_TRIGGER_8 0x80
113 #define FIFO_RCV_TRIGGER_14 0xc0
114 #define FIFO_XMT_TRIGGER_8 0x00
115 #define FIFO_XMT_TRIGGER_4 0x10
116 #define FIFO_XMT_TRIGGER_2 0x20
117 #define FIFO_XMT_TRIGGER_1 0x30
118
119 #define SCFDR2_TXCNT 0xff00 /* Tx CouNT */
120 #define SCFDR2_RECVCNT 0x00ff /* Rx CouNT */
121 #define SCFDR2_TXF_FULL 0x1000 /* Tx FULL */
122 #define SCFDR2_RXF_EPTY 0x0000 /* Rx EMPTY */
123
124 #endif /* !_SH3_SCIFREG_ */
125