1 #ifndef CYGONCE_DEVS_SERIAL_POWERPC_MPC555_SERIAL_H
2 #define CYGONCE_DEVS_SERIAL_POWERPC_MPC555_SERIAL_H
3 //==========================================================================
7 // PowerPC 5xx MPC555 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.
37 // -------------------------------------------
38 //####ECOSGPLCOPYRIGHTEND####
39 //==========================================================================
40 //#####DESCRIPTIONBEGIN####
42 // Author(s): Bob Koninckx
45 // Purpose: MPC555 Serial I/O definitions.
49 //####DESCRIPTIONEND####
50 //==========================================================================
52 //----------------------------------
53 // Includes and forward declarations
54 //----------------------------------
56 //----------------------
57 // Constants definitions
58 //----------------------
59 // Base addresses for the two serial ports
60 #define MPC555_SERIAL_BASE_A 0x305008
61 #define MPC555_SERIAL_BASE_B 0x305020
63 // The offset from the base for all serial registers
64 #define MPC555_SERIAL_SCCxR0 0
65 #define MPC555_SERIAL_SCCxR1 2
66 #define MPC555_SERIAL_SCxSR 4
67 #define MPC555_SERIAL_SCxDR 6
69 // The bits in the serial registers
70 #define MPC555_SERIAL_SCCxR0_OTHR 0x8000
71 #define MPC555_SERIAL_SCCxR0_LINKBD 0x4000
72 #define MPC555_SERIAL_SCCxR0_SCxBR 0x1fff
74 #define MPC555_SERIAL_SCCxR1_LOOPS 0x4000
75 #define MPC555_SERIAL_SCCxR1_WOMS 0x2000
76 #define MPC555_SERIAL_SCCxR1_ILT 0x1000
77 #define MPC555_SERIAL_SCCxR1_PT 0x0800
78 #define MPC555_SERIAL_SCCxR1_PE 0x0400
79 #define MPC555_SERIAL_SCCxR1_M 0x0200
80 #define MPC555_SERIAL_SCCxR1_WAKE 0x0100
81 #define MPC555_SERIAL_SCCxR1_TIE 0x0080
82 #define MPC555_SERIAL_SCCxR1_TCIE 0x0040
83 #define MPC555_SERIAL_SCCxR1_RIE 0x0020
84 #define MPC555_SERIAL_SCCxR1_ILIE 0x0010
85 #define MPC555_SERIAL_SCCxR1_TE 0x0008
86 #define MPC555_SERIAL_SCCxR1_RE 0x0004
87 #define MPC555_SERIAL_SCCxR1_RWU 0x0002
88 #define MPC555_SERIAL_SCCxR1_SBK 0x0001
90 #define MPC555_SERIAL_SCxSR_TDRE 0x0100
91 #define MPC555_SERIAL_SCxSR_TC 0x0080
92 #define MPC555_SERIAL_SCxSR_RDRF 0x0040
93 #define MPC555_SERIAL_SCxSR_RAF 0x0020
94 #define MPC555_SERIAL_SCxSR_IDLE 0x0010
95 #define MPC555_SERIAL_SCxSR_OR 0x0008
96 #define MPC555_SERIAL_SCxSR_NF 0x0004
97 #define MPC555_SERIAL_SCxSR_FE 0x0002
98 #define MPC555_SERIAL_SCxSR_PF 0x0001
100 // The available baud rates
101 // These are calculated for a busclock of 40 MHz
102 // It is not necessary to let the compiler calculate these
103 // values, we did not provide clockfrequency as a configuarion
105 static unsigned short select_baud[] = {
107 0, // 50 bps unsupported
108 0, // 75 bps unsupported
109 0, // 110 bps unsupported
110 0, // 134_5 bps unsupported
111 0, // 150 bps unsupported
112 0, // 200 bps unsupported
116 0, // 1800 bps unsupported
118 0, // 3600 bps unsupported
120 0, // 7200 bps unsupported
127 0 // 230400 bps unsupported
130 static unsigned char select_word_length[] = {
131 0, // 5 bits / word (char) not supported
132 0, // 6 bits / word (char) not supported
133 7, // 7 bits / word (char) ->> 7 bits per frame
134 8 // 8 bits / word (char) ->> 8 bits per frame
137 static unsigned char select_stop_bits[] = {
139 1, // 1 stop bit ->> 1 bit per frame
140 0, // 1.5 stop bit not supported
141 2 // 2 stop bits ->> 2 bits per frame
144 static unsigned char select_parity[] = {
145 0, // No parity ->> 0 bits per frame
146 1, // Even parity ->> 1 bit per frame
147 1, // Odd parityv ->> 1 bit per frame
148 0, // Mark parity not supported
149 0, // Space parity not supported
152 #endif // CYGONCE_DEVS_SERIAL_POWERPC_MPC555_SERIAL_H
154 // EOF mpc555_serial.h