1 #ifndef CYGONCE_DEVS_SERIAL_FREESCALE_ESCI_H
2 #define CYGONCE_DEVS_SERIAL_FREESCALE_ESCI_H
3 //==========================================================================
7 // Freescale eSCI 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.
14 // Copyright (C) eCosCentric Ltd
16 // eCos is free software; you can redistribute it and/or modify it under
17 // the terms of the GNU General Public License as published by the Free
18 // Software Foundation; either version 2 or (at your option) any later version.
20 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
21 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 // You should have received a copy of the GNU General Public License along
26 // with eCos; if not, write to the Free Software Foundation, Inc.,
27 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
29 // As a special exception, if other files instantiate templates or use macros
30 // or inline functions from this file, or you compile this file and link it
31 // with other works to produce a work based on this file, this file does not
32 // by itself cause the resulting work to be covered by the GNU General Public
33 // License. However the source code for this file must still be made available
34 // in accordance with section (3) of the GNU General Public License.
36 // This exception does not invalidate any other reasons why a work based on
37 // this file might be covered by the GNU General Public License.
38 // -------------------------------------------
39 //####ECOSGPLCOPYRIGHTEND####
40 //==========================================================================
41 //#####DESCRIPTIONBEGIN####
43 // Author(s): Ilija Koco <ilijak@siva.com.mk>
46 // Purpose: eSCI Serial I/O definitions.
50 //####DESCRIPTIONEND####
51 //==========================================================================
53 // Note: Following macros are platform dependent
54 // and have to be defined in var_io.h or plf_io.h
55 // Macros referenced by serial driver:
56 // CYGADDR_IO_SERIAL_FREESCALE_ESCI_A_BASE
57 // CYGADDR_IO_SERIAL_FREESCALE_ESCI_B_BASE
58 // CYGADDR_IO_SERIAL_FREESCALE_ESCI_C_BASE
59 // CYGADDR_IO_SERIAL_FREESCALE_ESCI_D_BASE
60 // CYGNUM_DEV_SER_FREESCALE_ESCI_SYSTEM_CLOCK
61 // FREESCALE_ESCI_BAUD(baud_rate)
63 // Macros not referenced by serial driver
64 // but by interrupt controller
65 // CYGNUM_IO_SERIAL_FREESCALE_ESCI_A_INT_VECTOR
66 // CYGNUM_IO_SERIAL_FREESCALE_ESCI_B_INT_VECTOR
67 // CYGNUM_IO_SERIAL_FREESCALE_ESCI_C_INT_VECTOR
68 // CYGNUM_IO_SERIAL_FREESCALE_ESCI_D_INT_VECTOR
75 #define FREESCALE_ESCI_A_BASE (CYGADDR_IO_SERIAL_FREESCALE_ESCI_A_BASE)
76 #define FREESCALE_ESCI_B_BASE (CYGADDR_IO_SERIAL_FREESCALE_ESCI_B_BASE)
77 #define FREESCALE_ESCI_C_BASE (CYGADDR_IO_SERIAL_FREESCALE_ESCI_C_BASE)
78 #define FREESCALE_ESCI_D_BASE (CYGADDR_IO_SERIAL_FREESCALE_ESCI_D_BASE)
80 #define FREESCALE_ESCI_A_I 0
81 #define FREESCALE_ESCI_B_I 1
82 #define FREESCALE_ESCI_C_I 2
83 #define FREESCALE_ESCI_D_I 3
85 #define FREESCALE_ESCI_BD(esci_base) \
86 (esci_base + FREESCALE_ESCI_BD_OFFSET) //short
87 #define FREESCALE_ESCI_CR12(esci_base) \
88 (esci_base + FREESCALE_ESCI_CR12_OFFSET) //short
89 #define FREESCALE_ESCI_CR34(esci_base) \
90 (esci_base + FREESCALE_ESCI_CR34_OFFSET) //short
91 #define FREESCALE_ESCI_CR1(esci_base) \
92 (esci_base + FREESCALE_ESCI_CR1_OFFSET) //char
93 #define FREESCALE_ESCI_CR2(esci_base) \
94 (esci_base + FREESCALE_ESCI_CR2_OFFSET) //char
95 #define FREESCALE_ESCI_CR3(esci_base) \
96 (esci_base + FREESCALE_ESCI_CR3_OFFSET) //char
97 #define FREESCALE_ESCI_CR4(esci_base) \
98 (esci_base + FREESCALE_ESCI_CR4_OFFSET) //short
99 #define FREESCALE_ESCI_LINCTRL(esci_base) \
100 (esci_base + FREESCALE_ESCI_LINCTRL_OFFSET) //short
101 #define FREESCALE_ESCI_LINCRCP(esci_base) \
102 (esci_base + FREESCALE_ESCI_LINCRCP_OFFSET) //short
103 #define FREESCALE_ESCI_SR(esci_base) \
104 (esci_base + FREESCALE_ESCI_SR_OFFSET) //short
105 #define FREESCALE_ESCI_DRL(esci_base) \
106 (esci_base + FREESCALE_ESCI_DRL_OFFSET) //char
108 #define FREESCALE_ESCI_BD_OFFSET (0x0000)
109 #define FREESCALE_ESCI_CR12_OFFSET (0x0002)
110 #define FREESCALE_ESCI_CR34_OFFSET (0x0002)
111 #define FREESCALE_ESCI_CR1_OFFSET (0x0002)
112 #define FREESCALE_ESCI_CR2_OFFSET (0x0003)
113 #define FREESCALE_ESCI_CR3_OFFSET (0x0004)
114 #define FREESCALE_ESCI_CR4_OFFSET (0x0005)
115 #define FREESCALE_ESCI_DRL_OFFSET (0x0007)
116 #define FREESCALE_ESCI_SR_OFFSET (0x0008)
117 #define FREESCALE_ESCI_LINSTAT_OFFSET (0x000A)
118 #define FREESCALE_ESCI_LINCTRL_OFFSET (0x000C)
119 #define FREESCALE_ESCI_LINRX_OFFSET (0x0010)
120 #define FREESCALE_ESCI_LINTX_OFFSET (0x0014)
121 #define FREESCALE_ESCI_LINCRCP_OFFSET (0x0018)
123 #define FREESCALE_ESCI_CR12_LOOPS (0x8000)
124 #define FREESCALE_ESCI_CR12_SCISDOZ (0x4000)
125 #define FREESCALE_ESCI_CR12_RSRC (0x2000)
126 #define FREESCALE_ESCI_CR12_M (0x1000)
127 #define FREESCALE_ESCI_CR12_WAKE (0x0800)
128 #define FREESCALE_ESCI_CR12_ILT (0x0400)
129 #define FREESCALE_ESCI_CR12_PE (0x0200)
130 #define FREESCALE_ESCI_CR12_PT (0x0100)
131 #define FREESCALE_ESCI_CR12_TIE (0x0080)
132 #define FREESCALE_ESCI_CR12_TCIE (0x0040)
133 #define FREESCALE_ESCI_CR12_RIE (0x0020)
134 #define FREESCALE_ESCI_CR12_ILIE (0x0010)
135 #define FREESCALE_ESCI_CR12_TE (0x0008)
136 #define FREESCALE_ESCI_CR12_RE (0x0004)
137 #define FREESCALE_ESCI_CR12_RWU (0x0002)
138 #define FREESCALE_ESCI_CR12_SBK (0x0001)
140 #define FREESCALE_ESCI_CR3_MDIS (0x80)
141 #define FREESCALE_ESCI_CR3_FBR (0x40)
142 #define FREESCALE_ESCI_CR3_BSTP (0x20)
143 #define FREESCALE_ESCI_CR3_IEBERR (0x10)
144 #define FREESCALE_ESCI_CR3_RXDMA (0x08)
145 #define FREESCALE_ESCI_CR3_TXDMA (0x04)
146 #define FREESCALE_ESCI_CR3_BRK13 (0x02)
147 #define FREESCALE_ESCI_CR3_TXDIR (0x01)
149 #define FREESCALE_ESCI_SR_TDRE (0x8000)
150 #define FREESCALE_ESCI_SR_TC (0x4000)
151 #define FREESCALE_ESCI_SR_RDRF (0x2000)
152 #define FREESCALE_ESCI_SR_IDLE (0x1000)
153 #define FREESCALE_ESCI_SR_OR (0x0800)
154 #define FREESCALE_ESCI_SR_NF (0x0400)
155 #define FREESCALE_ESCI_SR_FE (0x0200)
156 #define FREESCALE_ESCI_SR_PF (0x0100)
157 #define FREESCALE_ESCI_SR_BERR (0x0010)
158 #define FREESCALE_ESCI_SR_RAF (0x0001)
160 #endif // CYGONCE_DEVS_SERIAL_FREESCALE_ESCI_H