1 #ifndef CYGONCE_DEVS_SERIAL_POWERPC_EC555_SERIAL_H
2 #define CYGONCE_DEVS_SERIAL_POWERPC_EC555_SERIAL_H
3 //==========================================================================
7 // PowerPC 5xx EC555 Serial I/O definitions.
9 //==========================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
38 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 // at http://sources.redhat.com/ecos/ecos-license/
40 // -------------------------------------------
41 //####ECOSGPLCOPYRIGHTEND####
42 //==========================================================================
43 //#####DESCRIPTIONBEGIN####
45 // Author(s): Bob Koninckx
48 // Purpose: EC555 Serial I/O definitions.
52 //####DESCRIPTIONEND####
53 //==========================================================================
55 //----------------------------------
56 // Includes and forward declarations
57 //----------------------------------
59 //----------------------
60 // Constants definitions
61 //----------------------
62 // Base addresses for the two serial ports
63 #define MPC555_SERIAL_BASE_A 0x305008
64 #define MPC555_SERIAL_BASE_B 0x305020
66 // The offset from the base for all serial registers
67 #define MPC555_SERIAL_SCCxR0 0
68 #define MPC555_SERIAL_SCCxR1 2
69 #define MPC555_SERIAL_SCxSR 4
70 #define MPC555_SERIAL_SCxDR 6
72 // The bits in the serial registers
73 #define MPC555_SERIAL_SCCxR0_OTHR 0x8000
74 #define MPC555_SERIAL_SCCxR0_LINKBD 0x4000
75 #define MPC555_SERIAL_SCCxR0_SCxBR 0x1fff
77 #define MPC555_SERIAL_SCCxR1_LOOPS 0x4000
78 #define MPC555_SERIAL_SCCxR1_WOMS 0x2000
79 #define MPC555_SERIAL_SCCxR1_ILT 0x1000
80 #define MPC555_SERIAL_SCCxR1_PT 0x0800
81 #define MPC555_SERIAL_SCCxR1_PE 0x0400
82 #define MPC555_SERIAL_SCCxR1_M 0x0200
83 #define MPC555_SERIAL_SCCxR1_WAKE 0x0100
84 #define MPC555_SERIAL_SCCxR1_TIE 0x0080
85 #define MPC555_SERIAL_SCCxR1_TCIE 0x0040
86 #define MPC555_SERIAL_SCCxR1_RIE 0x0020
87 #define MPC555_SERIAL_SCCxR1_ILIE 0x0010
88 #define MPC555_SERIAL_SCCxR1_TE 0x0008
89 #define MPC555_SERIAL_SCCxR1_RE 0x0004
90 #define MPC555_SERIAL_SCCxR1_RWU 0x0002
91 #define MPC555_SERIAL_SCCxR1_SBK 0x0001
93 #define MPC555_SERIAL_SCxSR_TDRE 0x0100
94 #define MPC555_SERIAL_SCxSR_TC 0x0080
95 #define MPC555_SERIAL_SCxSR_RDRF 0x0040
96 #define MPC555_SERIAL_SCxSR_RAF 0x0020
97 #define MPC555_SERIAL_SCxSR_IDLE 0x0010
98 #define MPC555_SERIAL_SCxSR_OR 0x0008
99 #define MPC555_SERIAL_SCxSR_NF 0x0004
100 #define MPC555_SERIAL_SCxSR_FE 0x0002
101 #define MPC555_SERIAL_SCxSR_PF 0x0001
103 // The available baud rates
104 // These are calculated for a busclock of 40 MHz
105 // It is not necessary to let the compiler calculate these
106 // values, we did not provide clockfrequency as a configuarion
108 static unsigned short select_baud[] = {
110 0, // 50 bps unsupported
111 0, // 75 bps unsupported
112 0, // 110 bps unsupported
113 0, // 134_5 bps unsupported
114 0, // 150 bps unsupported
115 0, // 200 bps unsupported
119 0, // 1800 bps unsupported
121 0, // 3600 bps unsupported
123 0, // 7200 bps unsupported
130 0 // 230400 bps unsupported
133 static unsigned char select_word_length[] = {
134 0, // 5 bits / word (char) not supported
135 0, // 6 bits / word (char) not supported
136 7, // 7 bits / word (char) ->> 7 bits per frame
137 8 // 8 bits / word (char) ->> 8 bits per frame
140 static unsigned char select_stop_bits[] = {
142 1, // 1 stop bit ->> 1 bit per frame
143 0, // 1.5 stop bit not supported
144 2 // 2 stop bits ->> 2 bits per frame
147 static unsigned char select_parity[] = {
148 0, // No parity ->> 0 bits per frame
149 1, // Even parity ->> 1 bit per frame
150 1, // Odd parityv ->> 1 bit per frame
151 0, // Mark parity not supported
152 0, // Space parity not supported
155 #endif // CYGONCE_DEVS_SERIAL_POWERPC_EC555_SERIAL_H
157 // EOF ec555_serial.h