1 |
27 |
unneback |
#ifndef CYGONCE_HAL_PLF_IO_H
|
2 |
|
|
#define CYGONCE_HAL_PLF_IO_H
|
3 |
|
|
//=============================================================================
|
4 |
|
|
//
|
5 |
|
|
// plf_io.h
|
6 |
|
|
//
|
7 |
|
|
// Platform specific registers
|
8 |
|
|
//
|
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 |
|
|
//
|
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.
|
18 |
|
|
//
|
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
|
22 |
|
|
// for more details.
|
23 |
|
|
//
|
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.
|
27 |
|
|
//
|
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.
|
34 |
|
|
//
|
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 |
|
|
// 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####
|
44 |
|
|
//
|
45 |
|
|
// Author(s): jskov
|
46 |
|
|
// Contributors:jskov
|
47 |
|
|
// Date: 2001-03-16
|
48 |
|
|
// Purpose: ARM/E7T platform specific registers
|
49 |
|
|
// Description:
|
50 |
|
|
// Usage: #include <cyg/hal/plf_io.h>
|
51 |
|
|
//
|
52 |
|
|
//####DESCRIPTIONEND####
|
53 |
|
|
//
|
54 |
|
|
//=============================================================================
|
55 |
|
|
|
56 |
|
|
// non-caching by accessing addr|0x04000000
|
57 |
|
|
|
58 |
|
|
#define E7T_REG_BASE 0x07ff0000
|
59 |
|
|
|
60 |
|
|
// -----------------------------------------------------------------------------
|
61 |
|
|
// System config (register bases and caching)
|
62 |
|
|
#define E7T_SYSCFG (E7T_REG_BASE + 0x0000)
|
63 |
|
|
|
64 |
|
|
#define E7T_SYSCFG_SDM 0x80000000
|
65 |
|
|
#define E7T_SYSCFG_PD_ID_MASK 0x3c000000
|
66 |
|
|
#define E7T_SYSCFG_SRBBP_MASK 0x03ff0000 // address/64k
|
67 |
|
|
#define E7T_SYSCFG_ISBBP_MASK 0x0000ffc0 // a25-a16
|
68 |
|
|
#define E7T_SYSCFG_CM_MASK 0x00000030
|
69 |
|
|
#define E7T_SYSCFG_CM_4R_4C 0x00000000
|
70 |
|
|
#define E7T_SYSCFG_CM_0R_8C 0x00000010
|
71 |
|
|
#define E7T_SYSCFG_CM_8R_0C 0x00000020
|
72 |
|
|
#define E7T_SYSCFG_WE 0x00000004 // only KS32C50100?
|
73 |
|
|
#define E7T_SYSCFG_CE 0x00000002
|
74 |
|
|
#define E7T_SYSCFG_SE 0x00000001
|
75 |
|
|
|
76 |
|
|
#define E7T_CLKCON (E7T_REG_BASE + 0x3000)
|
77 |
|
|
|
78 |
|
|
#define E7T_EXTACON0 (E7T_REG_BASE + 0x3008)
|
79 |
|
|
#define E7T_EXTACON1 (E7T_REG_BASE + 0x300c)
|
80 |
|
|
|
81 |
|
|
//-----------------------------------------------------------------------------
|
82 |
|
|
// Memory banks data width
|
83 |
|
|
#define E7T_EXTDBWTH (E7T_REG_BASE + 0x3010)
|
84 |
|
|
|
85 |
|
|
#define E7T_EXTDBWTH_MASK 3
|
86 |
|
|
#define E7T_EXTDBWTH_8BIT 1
|
87 |
|
|
#define E7T_EXTDBWTH_16BIT 2
|
88 |
|
|
#define E7T_EXTDBWTH_32BIT 3
|
89 |
|
|
|
90 |
|
|
#define E7T_EXTDBWTH_DSR0_shift 0
|
91 |
|
|
#define E7T_EXTDBWTH_DSR1_shift 2
|
92 |
|
|
#define E7T_EXTDBWTH_DSR2_shift 4
|
93 |
|
|
#define E7T_EXTDBWTH_DSR3_shift 6
|
94 |
|
|
#define E7T_EXTDBWTH_DSR4_shift 8
|
95 |
|
|
#define E7T_EXTDBWTH_DSR5_shift 10
|
96 |
|
|
#define E7T_EXTDBWTH_DSD0_shift 12
|
97 |
|
|
#define E7T_EXTDBWTH_DSD1_shift 14
|
98 |
|
|
#define E7T_EXTDBWTH_DSD2_shift 16
|
99 |
|
|
#define E7T_EXTDBWTH_DSD3_shift 18
|
100 |
|
|
#define E7T_EXTDBWTH_DSX0_shift 20
|
101 |
|
|
#define E7T_EXTDBWTH_DSX1_shift 22
|
102 |
|
|
#define E7T_EXTDBWTH_DSX2_shift 24
|
103 |
|
|
#define E7T_EXTDBWTH_DSX3_shift 26
|
104 |
|
|
|
105 |
|
|
// -----------------------------------------------------------------------------
|
106 |
|
|
// Bank locations and timing
|
107 |
|
|
#define E7T_ROMCON0 (E7T_REG_BASE + 0x3014)
|
108 |
|
|
#define E7T_ROMCON1 (E7T_REG_BASE + 0x3018)
|
109 |
|
|
#define E7T_ROMCON2 (E7T_REG_BASE + 0x301c)
|
110 |
|
|
#define E7T_ROMCON3 (E7T_REG_BASE + 0x3020)
|
111 |
|
|
#define E7T_ROMCON4 (E7T_REG_BASE + 0x3024)
|
112 |
|
|
#define E7T_ROMCON5 (E7T_REG_BASE + 0x3028)
|
113 |
|
|
|
114 |
|
|
#define E7T_ROMCON_PMC_MASK 0x00000003
|
115 |
|
|
#define E7T_ROMCON_PMC_ROM 0x00000000
|
116 |
|
|
#define E7T_ROMCON_PMC_4W_PAGE 0x00000001
|
117 |
|
|
#define E7T_ROMCON_PMC_8W_PAGE 0x00000002
|
118 |
|
|
#define E7T_ROMCON_PMC_16W_PAGE 0x00000003
|
119 |
|
|
|
120 |
|
|
#define E7T_ROMCON_TPA_MASK 0x0000000c
|
121 |
|
|
#define E7T_ROMCON_TPA_5C 0x00000000
|
122 |
|
|
#define E7T_ROMCON_TPA_2C 0x00000004
|
123 |
|
|
#define E7T_ROMCON_TPA_3C 0x00000008
|
124 |
|
|
#define E7T_ROMCON_TPA_4C 0x0000000c
|
125 |
|
|
|
126 |
|
|
#define E7T_ROMCON_TACC_MASK 0x00000070
|
127 |
|
|
#define E7T_ROMCON_TACC_DISABLE 0x00000000
|
128 |
|
|
#define E7T_ROMCON_TACC_2C 0x00000010
|
129 |
|
|
#define E7T_ROMCON_TACC_3C 0x00000020
|
130 |
|
|
#define E7T_ROMCON_TACC_4C 0x00000030
|
131 |
|
|
#define E7T_ROMCON_TACC_5C 0x00000040
|
132 |
|
|
#define E7T_ROMCON_TACC_6C 0x00000050
|
133 |
|
|
#define E7T_ROMCON_TACC_7C 0x00000060
|
134 |
|
|
|
135 |
|
|
#define E7T_ROMCON_BASE_MASK 0x000ff700
|
136 |
|
|
#define E7T_ROMCON_BASE_shift 10
|
137 |
|
|
|
138 |
|
|
#define E7T_ROMCON_NEXT_MASK 0x7ff00000
|
139 |
|
|
#define E7T_ROMCON_NEXT_shift 20
|
140 |
|
|
|
141 |
|
|
|
142 |
|
|
|
143 |
|
|
#define E7T_DRAMCON0 (E7T_REG_BASE + 0x302c)
|
144 |
|
|
#define E7T_DRAMCON1 (E7T_REG_BASE + 0x3030)
|
145 |
|
|
#define E7T_DRAMCON2 (E7T_REG_BASE + 0x3034)
|
146 |
|
|
#define E7T_DRAMCON3 (E7T_REG_BASE + 0x3038)
|
147 |
|
|
#define E7T_REFEXTCON (E7T_REG_BASE + 0x303c)
|
148 |
|
|
|
149 |
|
|
//-----------------------------------------------------------------------------
|
150 |
|
|
// INTC
|
151 |
|
|
|
152 |
|
|
#define E7T_INTMOD (E7T_REG_BASE + 0x4000)
|
153 |
|
|
#define E7T_INTPND (E7T_REG_BASE + 0x4004)
|
154 |
|
|
#define E7T_INTMSK (E7T_REG_BASE + 0x4008)
|
155 |
|
|
#define E7T_INTPRI0 (E7T_REG_BASE + 0x400c)
|
156 |
|
|
#define E7T_INTPRI1 (E7T_REG_BASE + 0x4010)
|
157 |
|
|
#define E7T_INTPRI2 (E7T_REG_BASE + 0x4014)
|
158 |
|
|
#define E7T_INTPRI3 (E7T_REG_BASE + 0x4018)
|
159 |
|
|
#define E7T_INTPRI4 (E7T_REG_BASE + 0x401c)
|
160 |
|
|
#define E7T_INTPRI5 (E7T_REG_BASE + 0x4020)
|
161 |
|
|
#define E7T_INTOFFSET (E7T_REG_BASE + 0x4024)
|
162 |
|
|
#define E7T_PNDPRI (E7T_REG_BASE + 0x4028)
|
163 |
|
|
#define E7T_PNDTEST (E7T_REG_BASE + 0x402c)
|
164 |
|
|
#define E7T_INTOFFSET_FIQ (E7T_REG_BASE + 0x4030)
|
165 |
|
|
#define E7T_INTOFFSET_IRQ (E7T_REG_BASE + 0x4034)
|
166 |
|
|
|
167 |
|
|
#define E7T_INTMSK_GLOBAL (1<<21)
|
168 |
|
|
|
169 |
|
|
//-----------------------------------------------------------------------------
|
170 |
|
|
// PIO
|
171 |
|
|
|
172 |
|
|
#define E7T_IOPMOD (E7T_REG_BASE + 0x5000)
|
173 |
|
|
#define E7T_IOPCON (E7T_REG_BASE + 0x5004)
|
174 |
|
|
#define E7T_IOPDATA (E7T_REG_BASE + 0x5008)
|
175 |
|
|
|
176 |
|
|
//-----------------------------------------------------------------------------
|
177 |
|
|
// Timers
|
178 |
|
|
|
179 |
|
|
#define E7T_TMOD (E7T_REG_BASE + 0x6000)
|
180 |
|
|
#define E7T_TDATA0 (E7T_REG_BASE + 0x6004)
|
181 |
|
|
#define E7T_TDATA1 (E7T_REG_BASE + 0x6008)
|
182 |
|
|
#define E7T_TCNT0 (E7T_REG_BASE + 0x600c)
|
183 |
|
|
#define E7T_TCNT1 (E7T_REG_BASE + 0x6010)
|
184 |
|
|
|
185 |
|
|
#define E7T_TMOD_TE0 0x00000001
|
186 |
|
|
#define E7T_TMOD_TMD0 0x00000002
|
187 |
|
|
#define E7T_TMOD_TCLR0 0x00000004
|
188 |
|
|
#define E7T_TMOD_TE1 0x00000008
|
189 |
|
|
#define E7T_TMOD_TMD1 0x00000010
|
190 |
|
|
#define E7T_TMOD_TCLR1 0x00000020
|
191 |
|
|
|
192 |
|
|
|
193 |
|
|
//-----------------------------------------------------------------------------
|
194 |
|
|
// UART
|
195 |
|
|
|
196 |
|
|
#define E7T_UART0_BASE (E7T_REG_BASE + 0xd000)
|
197 |
|
|
#define E7T_UART1_BASE (E7T_REG_BASE + 0xe000)
|
198 |
|
|
|
199 |
|
|
#define E7T_UART_LCON 0x0000
|
200 |
|
|
#define E7T_UART_CON 0x0004
|
201 |
|
|
#define E7T_UART_STAT 0x0008
|
202 |
|
|
#define E7T_UART_TXBUF 0x000c
|
203 |
|
|
#define E7T_UART_RXBUF 0x0010
|
204 |
|
|
#define E7T_UART_BRDIV 0x0014
|
205 |
|
|
#define E7T_UART_BRDCNT 0x0018
|
206 |
|
|
#define E7T_UART_BRDCLK 0x001c
|
207 |
|
|
|
208 |
|
|
#define E7T_UART_LCON_5_DBITS 0x00
|
209 |
|
|
#define E7T_UART_LCON_6_DBITS 0x01
|
210 |
|
|
#define E7T_UART_LCON_7_DBITS 0x02
|
211 |
|
|
#define E7T_UART_LCON_8_DBITS 0x03
|
212 |
|
|
#define E7T_UART_LCON_1_SBITS 0x00
|
213 |
|
|
#define E7T_UART_LCON_2_SBITS 0x04
|
214 |
|
|
#define E7T_UART_LCON_NO_PARITY 0x00
|
215 |
|
|
#define E7T_UART_LCON_EVEN_PARITY 0x00
|
216 |
|
|
#define E7T_UART_LCON_ODD_PARITY 0x28
|
217 |
|
|
#define E7T_UART_LCON_1_PARITY 0x30
|
218 |
|
|
#define E7T_UART_LCON_0_PARITY 0x38
|
219 |
|
|
#define E7T_UART_LCON_SCS 0x40
|
220 |
|
|
#define E7T_UART_LCON_IR 0x80
|
221 |
|
|
|
222 |
|
|
#define E7T_UART_CON_RXM_MASK 0x03
|
223 |
|
|
#define E7T_UART_CON_RXM_INT 0x01
|
224 |
|
|
#define E7T_UART_CON_TXM_MASK 0x0c
|
225 |
|
|
#define E7T_UART_CON_TXM_INT 0x08
|
226 |
|
|
#define E7T_UART_CON_RX_ERR_INT 0x04
|
227 |
|
|
|
228 |
|
|
|
229 |
|
|
#define E7T_UART_STAT_DTR 0x10
|
230 |
|
|
#define E7T_UART_STAT_RDR 0x20
|
231 |
|
|
#define E7T_UART_STAT_TXE 0x40 // tx empty
|
232 |
|
|
#define E7T_UART_STAT_TC 0x80 // tx complete
|
233 |
|
|
|
234 |
|
|
//-----------------------------------------------------------------------------
|
235 |
|
|
// Cache
|
236 |
|
|
#define E7T_CACHE_SET0_ADDR 0x14000000
|
237 |
|
|
#define E7T_CACHE_SET1_ADDR 0x14800000
|
238 |
|
|
#define E7T_CACHE_TAG_ADDR 0x15000000
|
239 |
|
|
|
240 |
|
|
//-----------------------------------------------------------------------------
|
241 |
|
|
// Memory map is 1-1
|
242 |
|
|
|
243 |
|
|
#define CYGARC_PHYSICAL_ADDRESS(_x_) (_x_)
|
244 |
|
|
|
245 |
|
|
//-----------------------------------------------------------------------------
|
246 |
|
|
// end of plf_io.h
|
247 |
|
|
#endif // CYGONCE_HAL_PLF_IO_H
|